org.gstreamer.elements
Class PlayBin2

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.GObject
                      extended by org.gstreamer.GstObject
                          extended by org.gstreamer.Element
                              extended by org.gstreamer.Bin
                                  extended by org.gstreamer.Pipeline
                                      extended by org.gstreamer.elements.PlayBin2

public class PlayBin2
extends Pipeline


Nested Class Summary
static interface PlayBin2.ABOUT_TO_FINISH
          Signal emitted when the current uri is about to finish.
static interface PlayBin2.AUDIO_CHANGED
          Signal is emitted whenever the number or order of the audio streams has changed.
static interface PlayBin2.AUDIO_TAGS_CHANGED
          Signal is emitted whenever the tags of an audio stream have changed.
static interface PlayBin2.TEXT_CHANGED
          Signal is emitted whenever the number or order of the audio streams has changed.
static interface PlayBin2.TEXT_TAGS_CHANGED
          Signal is emitted whenever the tags of a text stream have changed.
static interface PlayBin2.VIDEO_CHANGED
          Signal is emitted whenever the number or order of the video streams has changed.
static interface PlayBin2.VIDEO_TAGS_CHANGED
          Signal is emitted whenever the tags of a video stream have changed.
 
Nested classes/interfaces inherited from class org.gstreamer.Bin
Bin.DO_LATENCY, Bin.ELEMENT_ADDED, Bin.ELEMENT_REMOVED
 
Nested classes/interfaces inherited from class org.gstreamer.Element
Element.NO_MORE_PADS, Element.PAD_ADDED, Element.PAD_REMOVED
 
Nested classes/interfaces inherited from class org.gstreamer.GObject
GObject.GCallback
 
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject
NativeObject.Initializer
 
Field Summary
static java.lang.String GST_NAME
           
 
Fields inherited from class org.gstreamer.Bin
DEBUG_GRAPH_SHOW_ALL, DEBUG_GRAPH_SHOW_CAPS_DETAILS, DEBUG_GRAPH_SHOW_MEDIA_TYPE, DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS, DEBUG_GRAPH_SHOW_STATES
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, ownsHandle
 
Constructor Summary
PlayBin2(NativeObject.Initializer init)
          Creates a new PlayBin2 proxy.
PlayBin2(java.lang.String name)
          Creates a new PlayBin2.
PlayBin2(java.lang.String name, java.net.URI uri)
          Creates a new PlayBin2.
 
Method Summary
 void connect(PlayBin2.ABOUT_TO_FINISH listener)
          Adds a listener for the about-to-finish signal
 void connect(PlayBin2.AUDIO_CHANGED listener)
          Adds a listener for the audio-changed signal
 void connect(PlayBin2.AUDIO_TAGS_CHANGED listener)
          Adds a listener for the audio-tags-changed signal
 void connect(PlayBin2.TEXT_CHANGED listener)
          Adds a listener for the audio-changed signal
 void connect(PlayBin2.TEXT_TAGS_CHANGED listener)
          Adds a listener for the audio-tags-changed signal
 void connect(PlayBin2.VIDEO_CHANGED listener)
          Adds a listener for the video-changed signal
 void connect(PlayBin2.VIDEO_TAGS_CHANGED listener)
          Adds a listener for the video-tags-changed signal
 void disconnect(PlayBin2.ABOUT_TO_FINISH listener)
          Removes a listener for the about-to-finish signal
 void disconnect(PlayBin2.AUDIO_CHANGED listener)
          Removes a listener for the audio-changed signal
 void disconnect(PlayBin2.AUDIO_TAGS_CHANGED listener)
          Removes a listener for the audio-tags-changed signal
 void disconnect(PlayBin2.TEXT_CHANGED listener)
          Removes a listener for the text-changed signal
 void disconnect(PlayBin2.TEXT_TAGS_CHANGED listener)
          Removes a listener for the text-tags-changed signal
 void disconnect(PlayBin2.VIDEO_CHANGED listener)
          Removes a listener for the video-changed signal
 void disconnect(PlayBin2.VIDEO_TAGS_CHANGED listener)
          Removes a listener for the video-tags-changed signal
 double getVideoSinkFrameRate()
          Retrieves the framerate from the caps of the video sink's pad.
 java.awt.Dimension getVideoSize()
          Retrieves the width and height of the video frames configured in the caps of the video sink's pad.
 double getVolume()
          Gets the current volume.
 int getVolumePercent()
          Get the current volume.
 void setAudioSink(Element element)
          Sets the audio output Element.
 void setInputFile(java.io.File file)
          Sets the media file to play.
 void setURI(java.net.URI uri)
          Sets the media URI to play.
 void setVideoSink(Element element)
          Sets the video output Element.
 void setVisualization(Element element)
          Sets the visualization output Element.
 void setVolume(double volume)
          Sets the audio playback volume.
 void setVolumePercent(int percent)
          Set the volume for the PlayBin.
 
Methods inherited from class org.gstreamer.Pipeline
getAutoFlushBus, getBus, getClock, launch, launch, queryDuration, queryDuration, queryDuration, queryPosition, queryPosition, queryPosition, querySegment, querySegment, seek, seek, seek, setAutoFlushBus, setClock, useClock
 
Methods inherited from class org.gstreamer.Bin
add, addMany, connect, connect, connect, debugToDotFile, debugToDotFile, disconnect, disconnect, disconnect, getElementByInterface, getElementByName, getElementByNameRecurseUp, getElements, getElementsRecursive, getElementsSorted, getSinks, getSources, launch, remove, removeMany
 
Methods inherited from class org.gstreamer.Element
addPad, connect, connect, connect, disconnect, disconnect, disconnect, getBaseTime, getFactory, getPad, getPads, getRequestPad, getSinkPads, getSrcPads, getStartTime, getState, getState, getState, getState, getStaticPad, isPlaying, link, link, linkMany, linkPads, linkPadsFiltered, makeRawElement, pause, play, postMessage, ready, releaseRequestPad, removePad, sendEvent, setBaseTime, setCaps, setLockedState, setStartTime, setState, stop, syncStateWithParent, unlink, unlinkMany, unlinkPads
 
Methods inherited from class org.gstreamer.GstObject
addListenerProxy, getName, getParent, initializer, initializer, ref, removeListenerProxy, setName, steal, toString, unref
 
Methods inherited from class org.gstreamer.GObject
addCallback, connect, connect, connect, disconnect, disconnect, disposeNativeHandle, emit, emit, g_signal_connect, get, getPointer, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, getType, invalidate, objectFor, removeCallback, set
 
Methods inherited from class org.gstreamer.lowlevel.NativeObject
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, instanceFor, isDisposed, nativeValue, objectFor, objectFor, objectFor
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GST_NAME

public static final java.lang.String GST_NAME
See Also:
Constant Field Values
Constructor Detail

PlayBin2

public PlayBin2(java.lang.String name)
Creates a new PlayBin2.

Parameters:
name - The name used to identify this pipeline.

PlayBin2

public PlayBin2(java.lang.String name,
                java.net.URI uri)
Creates a new PlayBin2.

Parameters:
name - The name used to identify this pipeline.
uri - The URI of the media file to load.

PlayBin2

public PlayBin2(NativeObject.Initializer init)
Creates a new PlayBin2 proxy.

Parameters:
init - proxy initialization args
Method Detail

setInputFile

public void setInputFile(java.io.File file)
Sets the media file to play.

Parameters:
file - The File to play.

setURI

public void setURI(java.net.URI uri)
Sets the media URI to play.

Parameters:
uri - The URI to play.

setAudioSink

public void setAudioSink(Element element)
Sets the audio output Element.

To disable audio output, call this method with a null argument.

Parameters:
element - The element to use for audio output.

setVideoSink

public void setVideoSink(Element element)
Sets the video output Element.

To disable video output, call this method with a null argument.

Parameters:
element - The element to use for video output.

setVisualization

public void setVisualization(Element element)
Sets the visualization output Element.

Parameters:
element - The element to use for visualization.

setVolumePercent

public void setVolumePercent(int percent)
Set the volume for the PlayBin.

Parameters:
percent - Percentage (between 0 and 100) to set the volume to.

getVolumePercent

public int getVolumePercent()
Get the current volume.

Returns:
The current volume as a percentage between 0 and 100 of the max volume.

setVolume

public void setVolume(double volume)
Sets the audio playback volume.

Parameters:
volume - value between 0.0 and 1.0 with 1.0 being full volume.

getVolume

public double getVolume()
Gets the current volume.

Returns:
The current volume as a percentage between 0 and 100 of the max volume.

getVideoSinkFrameRate

public double getVideoSinkFrameRate()
Retrieves the framerate from the caps of the video sink's pad.

Returns:
frame rate (frames per second), or 0 if the framerate is not available

getVideoSize

public java.awt.Dimension getVideoSize()
Retrieves the width and height of the video frames configured in the caps of the video sink's pad.

Returns:
dimensions of the video frames, or null if the video frame size is not available

connect

public void connect(PlayBin2.ABOUT_TO_FINISH listener)
Adds a listener for the about-to-finish signal


disconnect

public void disconnect(PlayBin2.ABOUT_TO_FINISH listener)
Removes a listener for the about-to-finish signal

Parameters:
listener - The listener that was previously added.

connect

public void connect(PlayBin2.VIDEO_CHANGED listener)
Adds a listener for the video-changed signal


disconnect

public void disconnect(PlayBin2.VIDEO_CHANGED listener)
Removes a listener for the video-changed signal

Parameters:
listener - The listener that was previously added.

connect

public void connect(PlayBin2.AUDIO_CHANGED listener)
Adds a listener for the audio-changed signal


disconnect

public void disconnect(PlayBin2.AUDIO_CHANGED listener)
Removes a listener for the audio-changed signal

Parameters:
listener - The listener that was previously added.

connect

public void connect(PlayBin2.TEXT_CHANGED listener)
Adds a listener for the audio-changed signal


disconnect

public void disconnect(PlayBin2.TEXT_CHANGED listener)
Removes a listener for the text-changed signal

Parameters:
listener - The listener that was previously added.

connect

public void connect(PlayBin2.VIDEO_TAGS_CHANGED listener)
Adds a listener for the video-tags-changed signal


disconnect

public void disconnect(PlayBin2.VIDEO_TAGS_CHANGED listener)
Removes a listener for the video-tags-changed signal

Parameters:
listener - The listener that was previously added.

connect

public void connect(PlayBin2.AUDIO_TAGS_CHANGED listener)
Adds a listener for the audio-tags-changed signal


disconnect

public void disconnect(PlayBin2.AUDIO_TAGS_CHANGED listener)
Removes a listener for the audio-tags-changed signal

Parameters:
listener - The listener that was previously added.

connect

public void connect(PlayBin2.TEXT_TAGS_CHANGED listener)
Adds a listener for the audio-tags-changed signal


disconnect

public void disconnect(PlayBin2.TEXT_TAGS_CHANGED listener)
Removes a listener for the text-tags-changed signal

Parameters:
listener - The listener that was previously added.