Uses of Class
org.gstreamer.GstObject

Packages that use GstObject
org.gstreamer   
org.gstreamer.elements   
org.gstreamer.elements.good   
org.gstreamer.io   
org.gstreamer.lowlevel   
org.gstreamer.message   
 

Uses of GstObject in org.gstreamer
 

Subclasses of GstObject in org.gstreamer
 class Bin
          Base class and element that can contain other elements.
 class Bus
          The Bus is an object responsible for delivering Messages in a first-in first-out way from the streaming threads to the application.
 class Clock
          Abstract class for global clocks.
 class Element
          Abstract base class for all pipeline elements.
 class ElementFactory
          ElementFactory is used to create instances of elements.
 class GhostPad
          Pseudo link pads.
 class Pad
          Object contained by elements that allows links to other elements.
 class PadTemplate
          Padtemplates describe the possible media types a Pad or an ElementFactory can handle.
 class Pipeline
          A Pipeline is a special Bin used as the toplevel container for the filter graph.
 class Plugin
          Container for features loaded from a shared object module
 class PluginFeature
          Base class for contents of a Plugin This is a base class for anything that can be added to a Plugin.
 class Registry
          Abstract base class for management of Plugin objects.
 

Methods in org.gstreamer that return GstObject
 GstObject StreamInfo.getObject()
          Source Pad or object of the stream
 GstObject GstObject.getParent()
           
 GstObject Message.getSource()
          Gets the Element that posted this message.
 

Methods in org.gstreamer with parameters of type GstObject
 void Bus.ASYNC_DONE.asyncDone(GstObject source)
          Called when a segment-done message has been posted.
 void Bus.BUFFERING.bufferingData(GstObject source, int percent)
          Called when a Pipeline element needs to buffer data before it can continue processing.
 void Bus.DURATION.durationChanged(GstObject source, Format format, long duration)
          Called when a new duration message is posted on the Bus.
 void Bus.EOS.endOfStream(GstObject source)
          Called when a Pipeline element posts a end-of-stream message.
 void Bus.ERROR.errorMessage(GstObject source, int code, java.lang.String message)
          Called when a Pipeline element posts an error message.
 void Bus.INFO.infoMessage(GstObject source, int code, java.lang.String message)
          Called when a Pipeline element posts an informational message.
 void Bus.SEGMENT_DONE.segmentDone(GstObject source, Format format, long position)
          Called when a segment-done message has been posted.
 void Bus.SEGMENT_START.segmentStart(GstObject source, Format format, long position)
           
 void Bus.STATE_CHANGED.stateChanged(GstObject source, State old, State current, State pending)
          Called when a Pipeline element executes a State change.
protected static NativeObject.Initializer GstObject.steal(GstObject victim)
          Steal the native peer from another GstObject.
 void Bus.TAG.tagsFound(GstObject source, TagList tagList)
          Called when a Pipeline element finds media meta-data.
 void Bus.WARNING.warningMessage(GstObject source, int code, java.lang.String message)
          Called when a Pipeline element posts an warning message.
 

Uses of GstObject in org.gstreamer.elements
 

Subclasses of GstObject in org.gstreamer.elements
 class AppSink
          A sink Element that enables an application to pull data from a pipeline.
 class AppSrc
          Enables an application to feed buffers into a pipeline.
 class BaseSink
           
 class BaseSrc
           
 class BaseTransform
           
 class BufferDataAppSink
          Class that allows to pull out native buffers from the GStreamer pipeline into the application.
 class BufferDataSink
          Class that allows to pull out native buffers from the GStreamer pipeline into the application.
 class ByteDataAppSink
          Class that allows to pull out buffers from the GStreamer pipeline into the application, using an appsink.
 class ByteDataSink
          Class that allows to pull out buffers from the GStreamer pipeline into the application, using an appsink.
 class CustomSink
           
 class CustomSrc
           
 class DecodeBin
          Deprecated. This element is deprecated and no longer supported. You should use the uridecodebin or decodebin2 element instead (or, even better: playbin2).
 class DecodeBin2
          Utility Element to automatically identify media stream types and hook up elements.
 class FakeSink
           
 class FakeSrc
           
 class FileSink
          A gstreamer element that write to a file.
 class FileSrc
          A gstreamer element that reads from a file.
 class Identity
           
 class InputSelector
           
 class MultiQueue
          A gstreamer element for Multiple data queue.
 class PlayBin
          Deprecated. This element is deprecated and no longer supported. You should use the PlayBin2 element instead. Playbin provides a stand-alone everything-in-one abstraction for an audio and/or video player.

It can handle both audio and video files and features

  • automatic file type recognition and based on that automatic selection and usage of the right audio/video/subtitle demuxers/decoders
  • visualisations for audio files
  • subtitle support for video files
  • stream selection between different audio/subtitles streams
  • meta info (tag) extraction
  • easy access to the last video frame
  • buffering when playing streams over a network
  • volume control

Usage

A playbin element can be created just like any other element using ElementFactory.make(java.lang.String, java.lang.String), although to call PlayBin specific methods, it is best to create one via a PlayBin.PlayBin(String) or PlayBin.PlayBin(String, URI) constructor.

The file/URI to play should be set via PlayBin.setInputFile(java.io.File) or PlayBin.setURI(java.net.URI)

Playbin is a Pipeline. It will notify the application of everything that's happening (errors, end of stream, tags found, state changes, etc.) by posting messages on its Bus. The application needs to watch the bus.

Playback can be initiated by setting the PlayBin to PLAYING state using setState or play. Note that the state change will take place in the background in a separate thread, when the function returns playback is probably not happening yet and any errors might not have occured yet. Applications using playbin should ideally be written to deal with things completely asynchroneous.

When playback has finished (an EOS message has been received on the bus) or an error has occured (an ERROR message has been received on the bus) or the user wants to play a different track, playbin should be set back to READY or NULL state, then the input file/URI should be set to the new location and then playbin be set to PLAYING state again.

Seeking can be done using seek on the playbin element. Again, the seek will not be executed instantaneously, but will be done in a background thread. When the seek call returns the seek will most likely still be in process. An application may wait for the seek to finish (or fail) using Element.getState(long) with -1 as the timeout, but this will block the user interface and is not recommended at all.

Applications may query the current position and duration of the stream via Pipeline.queryPosition() and Pipeline.queryDuration() and setting the format passed to Format.TIME. If the query was successful, the duration or position will have been returned in units of nanoseconds.

Advanced Usage: specifying the audio and video sink

By default, if no audio sink or video sink has been specified via PlayBin.setAudioSink(org.gstreamer.Element) and PlayBin.setVideoSink(org.gstreamer.Element), playbin will use the autoaudiosink and autovideosink elements to find the first-best available output method. This should work in most cases, but is not always desirable. Often either the user or application might want to specify more explicitly what to use for audio and video output.

If the application wants more control over how audio or video should be output, it may create the audio/video sink elements itself (for example using ElementFactory.make(java.lang.String, java.lang.String)) and provide them to playbin using PlayBin.setAudioSink(org.gstreamer.Element) and PlayBin.setVideoSink(org.gstreamer.Element)

GNOME-based applications, for example, will usually want to create gconfaudiosink and gconfvideosink elements and make playbin use those, so that output happens to whatever the user has configured in the GNOME Multimedia System Selector confinguration dialog.

The sink elements do not necessarily need to be ready-made sinks. It is possible to create container elements that look like a sink to playbin, but in reality contain a number of custom elements linked together. This can be achieved by creating a Bin and putting elements in there and linking them, and then creating a sink GhostPad for the bin and pointing it to the sink pad of the first element within the bin. This can be used for a number of purposes, for example to force output to a particular format or to modify or observe the data before it is output.

It is also possible to 'suppress' audio and/or video output by using 'fakesink' elements (or capture it from there using the fakesink element's "handoff" signal, which, nota bene, is fired from the streaming thread!).

Retrieving Tags and Other Meta Data

Most of the common meta data (artist, title, etc.) can be retrieved by watching for TAG messages on the pipeline's bus (see above).

Other more specific meta information like width/height/framerate of video streams or samplerate/number of channels of audio streams can be obtained using the "stream-info" property, which will return a GList of stream info objects, one for each stream. These are opaque objects that can only be accessed via the standard GObject property interface, ie. g_object_get(). Each stream info object has the following properties:

  • "object" (GstObject) (the decoder source pad usually)
  • "type" (enum) (if this is an audio/video/subtitle stream)
  • "decoder" (string) (name of decoder used to decode this stream)
  • "mute" (boolean) (to mute or unmute this stream)
  • "caps" (GstCaps) (caps of the decoded stream)
  • "language-code" (string) (ISO-639 language code for this stream, mostly used for audio/subtitle streams)
  • "codec" (string) (format this stream was encoded in)

Stream information from the stream-info properties is best queried once playbin has changed into PAUSED or PLAYING state (which can be detected via a state-changed message on the bus where old_state=READY and new_state=PAUSED), since before that the list might not be complete yet or not contain all available information (like language-codes).

Buffering

Playbin handles buffering automatically for the most part, but applications need to handle parts of the buffering process as well. Whenever playbin is buffering, it will post BUFFERING messages on the bus with a percentage value that shows the progress of the buffering process. Applications need to set playbin to PLAYING or PAUSED state in response to these messages. They may also want to convey the buffering progress to the user in some way. Here is how to extract the percentage information from the message (requires GStreamer >= 0.10.11):

 PlayBin playbin = new PlayBin("player");
 playbin.getBus().connect(new Bus.BUFFERING() {
     public void bufferingMessage(GstObject element, int percent) {
         System.out.printf("Buffering (%u percent done)\n", percent);
     }
 }
 
Note that applications should keep/set the pipeline in the PAUSED state when a BUFFERING message is received with a buffer percent value < 100 and set the pipeline back to PLAYING state when a BUFFERING message with a value of 100 percent is received (if PLAYING is the desired state, that is).

Embedding the video window in your application

By default, playbin (or rather the video sinks used) will create their own window. Applications will usually want to force output to a window of their own, however. This can be done using the GstXOverlay interface, which most video sinks implement. See the documentation there for more details.

Specifying which CD/DVD device to use

The device to use for CDs/DVDs needs to be set on the source element playbin creates before it is opened. The only way to do this at the moment is to connect to playbin's "notify::source" signal, which will be emitted by playbin when it has created the source element for a particular URI. In the signal callback you can check if the source element has a "device" property and set it appropriately. In future ways might be added to specify the device as part of the URI, but at the time of writing this is not possible yet.

Examples

Here is a simple pipeline to play back a video or audio file:

gst-launch -v playbin uri=file:///path/to/somefile.avi

This will play back the given AVI video file, given that the video and audio decoders required to decode the content are installed. Since no special audio sink or video sink is supplied (not possible via gst-launch), playbin will try to find a suitable audio and video sink automatically using the autoaudiosink and autovideosink elements.

Here is a another pipeline to play track 4 of an audio CD:

gst-launch -v playbin uri=cdda://4

This will play back track 4 on an audio CD in your disc drive (assuming the drive is detected automatically by the plugin).

Here is a another pipeline to play title 1 of a DVD: gst-launch -v playbin uri=dvd://1 This will play back title 1 of a DVD in your disc drive (assuming the drive is detected automatically by the plugin).

 class PlayBin2
           
 class Queue
          A gstreamer element for data queue.
 class Queue2
          A gstreamer element for data queue.
 class RGBDataAppSink
          Class that allows to pull out buffers from the GStreamer pipeline into the application.
 class RGBDataFileSink
          This bin encapsulates a pipeline that allows to encode RGB buffers into a video file.
 class RGBDataSink
          Class that allows to pull out buffers from the GStreamer pipeline into the application.
 class Tee
          A gstreamer element for data queue.
 class TypeFind
          Utility Element to identify media types in the stream.
 

Uses of GstObject in org.gstreamer.elements.good
 

Subclasses of GstObject in org.gstreamer.elements.good
 class RTPBin
          Java representation of gstreamer gstrtpbin
 class RTSPSrc
          Java representation of gstreamer rtspsrc
 

Uses of GstObject in org.gstreamer.io
 

Subclasses of GstObject in org.gstreamer.io
 class InputStreamSrc
           
 class OutputStreamSink
           
 class ReadableByteChannelSrc
           
 class WriteableByteChannelSink
           
 

Uses of GstObject in org.gstreamer.lowlevel
 

Fields in org.gstreamer.lowlevel declared as GstObject
 GstObject GstMessageAPI.MessageStruct.src
           
 

Methods in org.gstreamer.lowlevel that return GstObject
 GstObject GstObjectAPI.gst_object_get_parent(GstObject object)
           
 

Methods in org.gstreamer.lowlevel with parameters of type GstObject
 com.sun.jna.Pointer GstObjectAPI.gst_implements_interface_cast(GstObject obj, com.sun.jna.NativeLong gtype)
           
 boolean GstObjectAPI.gst_implements_interface_check(GstObject from, com.sun.jna.NativeLong type)
           
 Message GstMessageAPI.gst_message_new_application(GstObject src, Structure structure)
           
 Message GstMessageAPI.gst_message_new_async_done(GstObject src)
           
 Message GstMessageAPI.gst_message_new_async_start(GstObject src, boolean new_base_time)
           
 Message GstMessageAPI.gst_message_new_buffering(GstObject src, int percent)
           
 Message GstMessageAPI.gst_message_new_clock_lost(GstObject src, Clock clock)
           
 Message GstMessageAPI.gst_message_new_clock_provide(GstObject src, Clock clock, boolean ready)
           
 Message GstMessageAPI.gst_message_new_custom(MessageType type, GstObject src, Structure structure)
           
 Message GstMessageAPI.gst_message_new_duration(GstObject src, Format format, long duration)
           
 Message GstMessageAPI.gst_message_new_element(GstObject src, Structure structure)
           
 Message GstMessageAPI.gst_message_new_eos(GstObject src)
           
 Message GstMessageAPI.gst_message_new_error(GstObject src, GstAPI.GErrorStruct error, java.lang.String debug)
           
 Message GstMessageAPI.gst_message_new_info(GstObject src, GstAPI.GErrorStruct error, java.lang.String debug)
           
 Message GstMessageAPI.gst_message_new_latency(GstObject src)
           
 Message GstMessageAPI.gst_message_new_new_clock(GstObject src, Clock clock)
           
 Message GstMessageAPI.gst_message_new_segment_done(GstObject src, Format format, long position)
           
 Message GstMessageAPI.gst_message_new_segment_start(GstObject src, Format format, long position)
           
 Message GstMessageAPI.gst_message_new_state_changed(GstObject src, State oldstate, State newstate, State pending)
           
 Message GstMessageAPI.gst_message_new_state_dirty(GstObject src)
           
 Message GstMessageAPI.gst_message_new_tag(GstObject src, TagList tag_list)
           
 Message GstMessageAPI.gst_message_new_warning(GstObject src, GstAPI.GErrorStruct error, java.lang.String debug)
           
 java.lang.String GstObjectAPI.gst_object_get_name_prefix(GstObject object)
           
 java.lang.String GstObjectAPI.gst_object_get_name(GstObject obj)
           
 GstObject GstObjectAPI.gst_object_get_parent(GstObject object)
           
 boolean GstObjectAPI.gst_object_has_ancestor(GstObject object, GstObject ancestor)
           
 void GstObjectAPI.gst_object_ref(GstObject ptr)
           
 void GstObjectAPI.gst_object_set_name_prefix(GstObject object, java.lang.String name_prefix)
           
 boolean GstObjectAPI.gst_object_set_name(GstObject obj, java.lang.String name)
           
 boolean GstObjectAPI.gst_object_set_parent(GstObject object, GstObject parent)
           
 void GstObjectAPI.gst_object_sink(GstObject ptr)
           
 void GstObjectAPI.gst_object_unparent(GstObject object)
           
 void GstObjectAPI.gst_object_unref(GstObject ptr)
           
 

Uses of GstObject in org.gstreamer.message
 

Constructors in org.gstreamer.message with parameters of type GstObject
BufferingMessage(GstObject src, int percent)
          Creates a new Buffering message.
DurationMessage(GstObject src, Format format, long duration)
          Creates a new Buffering message.
EOSMessage(GstObject src)
          Creates a new eos message.
LatencyMessage(GstObject source)
          Creates a new Latency message.
SegmentDoneMessage(GstObject src, Format format, long position)
          Creates a new segment done message.
StateChangedMessage(GstObject src, State old, State current, State pending)
          Creates a new state-changed message.
TagMessage(GstObject src, TagList tagList)
          Creates a new Buffering message.