org.gstreamer.event
Class SeekEvent

java.lang.Object
  extended by org.gstreamer.lowlevel.NativeValue
      extended by org.gstreamer.lowlevel.Handle
          extended by org.gstreamer.lowlevel.NativeObject
              extended by org.gstreamer.lowlevel.RefCountedObject
                  extended by org.gstreamer.MiniObject
                      extended by org.gstreamer.Event
                          extended by org.gstreamer.event.SeekEvent

public class SeekEvent
extends Event

A request for a new playback position and rate.

The seek event configures playback of the pipeline between start to stop at the speed given in rate, also called a playback segment.

The start and stop values are expressed in format.

A rate of 1.0 means normal playback rate, 2.0 means double speed. Negative values means backwards playback. A value of 0.0 for the rate is not allowed and should be accomplished instead by PAUSING the pipeline.

A pipeline has a default playback segment configured with a start position of 0, a stop position of -1 and a rate of 1.0. The currently configured playback segment can be queried with #GST_QUERY_SEGMENT.

and stopType specify how to adjust the currently configured start and stop fields in segment. Adjustments can be made relative or absolute to the last configured values. A type of SeekType.NONE means that the position should not be updated.

When the rate is positive and start has been updated, playback will start from the newly configured start position.

For negative rates, playback will start from the newly configured stop position (if any). If the stop position if updated, it must be different from -1 for negative rates.

It is not possible to seek relative to the current playback position, to do this, PAUSE the pipeline, query the current playback position with getPosition and update the playback segment current position with a SeekType.SET to the desired position.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject
NativeObject.Initializer
 
Field Summary
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, LIFECYCLE, ownsHandle
 
Constructor Summary
SeekEvent(double rate, Format format, int flags, SeekType startType, long start, SeekType stopType, long stop)
          Creates a new seek event.
SeekEvent(NativeObject.Initializer init)
          This constructor is for internal use only.
 
Method Summary
 int getFlags()
          Gets the SeekFlags of this seek event.
 Format getFormat()
          Gets the Format of the start and stop seek values.
 double getRate()
          Gets the playback rate.
 long getStart()
          Gets the start of the seek segment.
 SeekType getStartType()
          Gets the SeekType of the start value.
 long getStop()
          Gets the stop position of the seek.
 SeekType getStopType()
          Gets the SeekType of the start value.
 
Methods inherited from class org.gstreamer.Event
getStructure
 
Methods inherited from class org.gstreamer.MiniObject
disposeNativeHandle, isWritable, makeWritable, objectFor, ref, unref
 
Methods inherited from class org.gstreamer.lowlevel.NativeObject
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, initializer, instanceFor, invalidate, isDisposed, nativeValue, objectFor, objectFor, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SeekEvent

public SeekEvent(NativeObject.Initializer init)
This constructor is for internal use only.

Parameters:
init - initialization data.

SeekEvent

public SeekEvent(double rate,
                 Format format,
                 int flags,
                 SeekType startType,
                 long start,
                 SeekType stopType,
                 long stop)
Creates a new seek event.

Parameters:
rate - the new playback rate
format - the format of the seek values
flags - the optional seek flags
startType - the type and flags for the new start position
start - the value of the new start position
stopType - the type and flags for the new stop position
stop - the value of the new stop position
Method Detail

getRate

public double getRate()
Gets the playback rate. A rate of 1.0 means normal playback rate, 2.0 means double speed. Negative values means backwards playback. A value of 0.0 for the rate is not allowed and should be accomplished instead by PAUSING the pipeline.

Returns:
the playback rate.

getFormat

public Format getFormat()
Gets the Format of the start and stop seek values.

Returns:
the format.

getFlags

public int getFlags()
Gets the SeekFlags of this seek event.

Returns:
the seek flags.

getStartType

public SeekType getStartType()
Gets the SeekType of the start value.

Returns:
the SeekType.

getStart

public long getStart()
Gets the start of the seek segment.

Returns:
the start of the seek.

getStopType

public SeekType getStopType()
Gets the SeekType of the start value.

Returns:
the SeekType.

getStop

public long getStop()
Gets the stop position of the seek.

Returns:
the stop position.