org.gstreamer
Class Message

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.Message
Direct Known Subclasses:
BufferingMessage, DurationMessage, EOSMessage, GErrorMessage, LatencyMessage, SegmentDoneMessage, StateChangedMessage, TagMessage

public class Message
extends MiniObject

Lightweight objects to signal the ocurrence of pipeline events.

Messages are implemented as a subclass of MiniObject with a generic Structure as the content. This allows for writing custom messages without requiring an API change while allowing a wide range of different types of messages.

Messages are posted by objects in the pipeline and are passed to the application using the Bus. The basic use pattern of posting a message on a Bus is as follows: Posting a Message bus.post(new EOSMessage(source)); An Element usually posts messages on the bus provided by the parent container using postMessage().


Nested Class Summary
 
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject
org.gstreamer.lowlevel.NativeObject.Initializer
 
Field Summary
protected  org.gstreamer.lowlevel.GstMessageAPI.MessageStruct messageStruct
           
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, LIFECYCLE, ownsHandle
 
Constructor Summary
Message(org.gstreamer.lowlevel.NativeObject.Initializer init)
          Creates a new instance of Message.
 
Method Summary
 Message copy()
          Creates a copy of the message.
 GstObject getSource()
          Gets the Element that posted this message.
 Structure getStructure()
          Gets the structure containing the data in this message.
 MessageType getType()
          Gets the type of this message.
 Message makeWritable()
          Gets a writable version of this Message.
 
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
 

Field Detail

messageStruct

protected org.gstreamer.lowlevel.GstMessageAPI.MessageStruct messageStruct
Constructor Detail

Message

public Message(org.gstreamer.lowlevel.NativeObject.Initializer init)
Creates a new instance of Message.

Parameters:
init - internal initialization data.
Method Detail

getSource

public GstObject getSource()
Gets the Element that posted this message.

Returns:
the element that posted the message.

getStructure

public Structure getStructure()
Gets the structure containing the data in this message.

Returns:
a structure.

getType

public MessageType getType()
Gets the type of this message.

Returns:
the message type.

makeWritable

public Message makeWritable()
Gets a writable version of this Message.

Returns:
a new Message (possibly a duplicate) that is writable.

copy

public Message copy()
Creates a copy of the message.

Returns:
a copy of this message.