Interface MediaObject

All Superinterfaces:
KurentoObject
All Known Subinterfaces:
AlphaBlending, BaseRtpEndpoint, Composite, Dispatcher, DispatcherOneToMany, Endpoint, FaceOverlayFilter, Filter, GenericMediaElement, GStreamerFilter, HttpEndpoint, HttpPostEndpoint, Hub, HubPort, ImageOverlayFilter, MediaElement, MediaPipeline, Mixer, OpenCVFilter, PassThrough, PlayerEndpoint, RecorderEndpoint, RtpEndpoint, SdpEndpoint, ServerManager, SessionEndpoint, UriEndpoint, WebRtcEndpoint, ZBarFilter

public interface MediaObject extends KurentoObject
Base interface used to manage capabilities common to all Kurento elements.

Properties

  • id: unique identifier assigned to this MediaObject at instantiation time. MediaPipeline IDs are generated with a GUID followed by suffix _kurento.MediaPipeline. MediaElement IDs are also a GUID with suffix _kurento.{ElementType} and prefixed by parent's ID.
    MediaPipeline ID example
    907cac3a-809a-4bbe-a93e-ae7e944c5cae_kurento.MediaPipeline
    MediaElement ID example
    907cac3a-809a-4bbe-a93e-ae7e944c5cae_kurento.MediaPipeline/403da25a-805b-4cf1-8c55-f190588e6c9b_kurento.WebRtcEndpoint
  • name: free text intended to provide a friendly name for this MediaObject. Its default value is the same as the ID.
  • tags: key-value pairs intended for applications to associate metadata to this MediaObject instance.


Events

  • ErrorEvent: reports asynchronous error events. It is recommended to always subscribe a listener to this event, as regular error from the pipeline will be notified through it, instead of through an exception when invoking a method.
  • Method Details

    • getMediaPipeline

      MediaPipeline getMediaPipeline()
      Get MediaPipeline to which this MediaObject belongs. It returns itself when invoked for a pipeline object.
    • getMediaPipeline

      void getMediaPipeline(Continuation<MediaPipeline> cont)
      Get MediaPipeline to which this MediaObject belongs. It returns itself when invoked for a pipeline object.
    • getMediaPipeline

      TFuture<MediaPipeline> getMediaPipeline(Transaction tx)
      Get MediaPipeline to which this MediaObject belongs. It returns itself when invoked for a pipeline object.
    • getParent

      MediaObject getParent()
      Get Parent of this MediaObject.

      The parent of a Hub or a MediaElement is its MediaPipeline. A MediaPipeline has no parent, so this property will be null.

    • getParent

      void getParent(Continuation<MediaObject> cont)
      Get Parent of this MediaObject.

      The parent of a Hub or a MediaElement is its MediaPipeline. A MediaPipeline has no parent, so this property will be null.

    • getParent

      Get Parent of this MediaObject.

      The parent of a Hub or a MediaElement is its MediaPipeline. A MediaPipeline has no parent, so this property will be null.

    • getId

      String getId()
      Get Unique identifier of this MediaObject.

      It's a synthetic identifier composed by a GUID and MediaObject type. The ID is prefixed with the parent ID when the object has parent: ID_parent/ID_media-object.

      Specified by:
      getId in interface KurentoObject
    • getId

      void getId(Continuation<String> cont)
      Get Unique identifier of this MediaObject.

      It's a synthetic identifier composed by a GUID and MediaObject type. The ID is prefixed with the parent ID when the object has parent: ID_parent/ID_media-object.

    • getId

      Get Unique identifier of this MediaObject.

      It's a synthetic identifier composed by a GUID and MediaObject type. The ID is prefixed with the parent ID when the object has parent: ID_parent/ID_media-object.

    • getChildren

      List<MediaObject> getChildren()
      Get Children of this MediaObject.
    • getChildren

      void getChildren(Continuation<List<MediaObject>> cont)
      Get Children of this MediaObject.
    • getChildren

      TFuture<List<MediaObject>> getChildren(Transaction tx)
      Get Children of this MediaObject.
    • getName

      String getName()
      Get This MediaObject's name.

      This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

    • getName

      void getName(Continuation<String> cont)
      Get This MediaObject's name.

      This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

    • getName

      TFuture<String> getName(Transaction tx)
      Get This MediaObject's name.

      This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

    • setName

      void setName(String name)
      Set This MediaObject's name.

      This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

    • setName

      void setName(String name, Continuation<Void> cont)
      Set This MediaObject's name.

      This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

    • setName

      void setName(String name, Transaction tx)
      Set This MediaObject's name.

      This is just sugar to simplify developers' life debugging, it is not used internally for indexing nor identifying the objects. By default, it's the object's ID.

    • getSendTagsInEvents

      boolean getSendTagsInEvents()
      Get Flag activating or deactivating sending the element's tags in fired events.
    • getSendTagsInEvents

      void getSendTagsInEvents(Continuation<Boolean> cont)
      Get Flag activating or deactivating sending the element's tags in fired events.
    • getSendTagsInEvents

      TFuture<Boolean> getSendTagsInEvents(Transaction tx)
      Get Flag activating or deactivating sending the element's tags in fired events.
    • setSendTagsInEvents

      void setSendTagsInEvents(boolean sendTagsInEvents)
      Set Flag activating or deactivating sending the element's tags in fired events.
    • setSendTagsInEvents

      void setSendTagsInEvents(boolean sendTagsInEvents, Continuation<Void> cont)
      Set Flag activating or deactivating sending the element's tags in fired events.
    • setSendTagsInEvents

      void setSendTagsInEvents(boolean sendTagsInEvents, Transaction tx)
      Set Flag activating or deactivating sending the element's tags in fired events.
    • getCreationTime

      int getCreationTime()
      Get MediaObject creation time in seconds since Epoch.
    • getCreationTime

      void getCreationTime(Continuation<Integer> cont)
      Get MediaObject creation time in seconds since Epoch.
    • getCreationTime

      TFuture<Integer> getCreationTime(Transaction tx)
      Get MediaObject creation time in seconds since Epoch.
    • addTag

      void addTag(String key, String value)
      Adds a new tag to this MediaObject. If the tag is already present, it changes the value.
      Parameters:
      key - Tag name.
      value - Value associated to this tag.
    • addTag

      void addTag(String key, String value, Continuation<Void> cont)
      Asynchronous version of addTag: Continuation.onSuccess(F) is called when the action is done. If an error occurs, Continuation.onError(java.lang.Throwable) is called.
      Parameters:
      key - Tag name.
      value - Value associated to this tag.
      See Also:
    • addTag

      void addTag(Transaction tx, String key, String value)
      Adds a new tag to this MediaObject. If the tag is already present, it changes the value.
      Parameters:
      key - Tag name.
      value - Value associated to this tag.
    • removeTag

      void removeTag(String key)
      Removes an existing tag. Exists silently with no error if tag is not defined.
      Parameters:
      key - Tag name to be removed
    • removeTag

      void removeTag(String key, Continuation<Void> cont)
      Asynchronous version of removeTag: Continuation.onSuccess(F) is called when the action is done. If an error occurs, Continuation.onError(java.lang.Throwable) is called.
      Parameters:
      key - Tag name to be removed
      See Also:
    • removeTag

      void removeTag(Transaction tx, String key)
      Removes an existing tag. Exists silently with no error if tag is not defined.
      Parameters:
      key - Tag name to be removed
    • getTag

      String getTag(String key)
      Returns the value of given tag, or MEDIA_OBJECT_TAG_KEY_NOT_FOUND if tag is not defined.
      Parameters:
      key - Tag key.
      Returns:
      The value associated to the given key. *
    • getTag

      void getTag(String key, Continuation<String> cont)
      Asynchronous version of getTag: Continuation.onSuccess(F) is called when the action is done. If an error occurs, Continuation.onError(java.lang.Throwable) is called.
      Parameters:
      key - Tag key.
      See Also:
    • getTag

      TFuture<String> getTag(Transaction tx, String key)
      Returns the value of given tag, or MEDIA_OBJECT_TAG_KEY_NOT_FOUND if tag is not defined.
      Parameters:
      key - Tag key.
      Returns:
      The value associated to the given key. *
    • getTags

      List<Tag> getTags()
      Returns all tags attached to this MediaObject.
      Returns:
      An array containing all key-value pairs associated with this MediaObject. *
    • getTags

      void getTags(Continuation<List<Tag>> cont)
      Asynchronous version of getTags: Continuation.onSuccess(F) is called when the action is done. If an error occurs, Continuation.onError(java.lang.Throwable) is called.
      See Also:
    • getTags

      TFuture<List<Tag>> getTags(Transaction tx)
      Returns all tags attached to this MediaObject.
      Returns:
      An array containing all key-value pairs associated with this MediaObject. *
    • addErrorListener

      ListenerSubscription addErrorListener(EventListener<ErrorEvent> listener)
      Add a EventListener for event ErrorEvent. Synchronous call.
      Parameters:
      listener - Listener to be called on ErrorEvent
      Returns:
      ListenerSubscription for the given Listener
    • addErrorListener

      void addErrorListener(EventListener<ErrorEvent> listener, Continuation<ListenerSubscription> cont)
      Add a EventListener for event ErrorEvent. Asynchronous call. Calls Continuation<ListenerSubscription> when it has been added.
      Parameters:
      listener - Listener to be called on ErrorEvent
      cont - Continuation to be called when the listener is registered
    • removeErrorListener

      void removeErrorListener(ListenerSubscription listenerSubscription)
      Remove a ListenerSubscription for event ErrorEvent. Synchronous call.
      Parameters:
      listenerSubscription - Listener subscription to be removed
    • removeErrorListener

      void removeErrorListener(ListenerSubscription listenerSubscription, Continuation<Void> cont)
      Remove a ListenerSubscription for event ErrorEvent. Asynchronous call. Calls Continuation<Void> when it has been removed.
      Parameters:
      listenerSubscription - Listener subscription to be removed
      cont - Continuation to be called when the listener is removed