All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kurento.client.PlayerEndpoint Maven / Gradle / Ivy

Go to download

Kurento Client The Kurento Client project allows server applications to control media server resources.

There is a newer version: 7.1.0
Show newest version
/**
 * This file is generated with Kurento-maven-plugin.
 * Please don't edit.
 */
package org.kurento.client;


/**
 *
 *       

* Retrieves content from seekable or non-seekable sources, and injects them into KMS, so they can be delivered to any Filter or Endpoint in the same MediaPipeline. Following URI schemas are supported: *

    *
  • * Files: Mounted in the local file system. *
    • file:///path/to/file
    *
  • *
  • * RTSP: Those of IP cameras would be a good example. *
      *
    • rtsp://
    • *
    • rtsp://username:password@
    • *
    *
  • *
  • * HTTP: Any file available in an HTTP server *
      *
    • http(s):///path/to/file
    • *
    • http(s)://username:password@/path/to/file
    • *
    *
  • *
*

*

* For the player to stream the contents of the file, the server must have access to the resource. In case of local files, the user running the process must have read permissions over the file. For network resources, the path to the resource must be accessible: IP and port access not blocked, correct credentials, etc.The resource location can’t be changed after the player is created, and a new player should be created for streaming a different resource. *

*

* The list of valid operations is *

    *
  • *play*: starts streaming media. If invoked after pause, it will resume playback.
  • *
  • *stop*: stops streaming media. If play is invoked afterwards, the file will be streamed from the beginning.
  • *
  • *pause*: pauses media streaming. Play must be invoked in order to resume playback.
  • *
  • *seek*: If the source supports “jumps” in the timeline, then the PlayerEndpoint can *
      *
    • *setPosition*: allows to set the position in the file.
    • *
    • *getPosition*: returns the current position being streamed.
    • *
    *
  • *
*

*

*

Events fired:

*
  • EndOfStreamEvent: If the file is streamed completely.
*

* * **/ @org.kurento.client.internal.RemoteClass public interface PlayerEndpoint extends UriEndpoint { /** * * Get Returns info about the source being played * **/ org.kurento.client.VideoInfo getVideoInfo(); /** * * Get Returns info about the source being played * **/ void getVideoInfo(Continuation cont); /** * * Get Returns info about the source being played * **/ TFuture getVideoInfo(Transaction tx); /** * * Get Returns the GStreamer DOT string for this element's private pipeline * **/ String getElementGstreamerDot(); /** * * Get Returns the GStreamer DOT string for this element's private pipeline * **/ void getElementGstreamerDot(Continuation cont); /** * * Get Returns the GStreamer DOT string for this element's private pipeline * **/ TFuture getElementGstreamerDot(Transaction tx); /** * * Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos * **/ long getPosition(); /** * * Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos * **/ void getPosition(Continuation cont); /** * * Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos * **/ TFuture getPosition(Transaction tx); /** * * Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos * **/ void setPosition(@org.kurento.client.internal.server.Param("position") long position); /** * * Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos * **/ void setPosition(@org.kurento.client.internal.server.Param("position") long position, Continuation cont); /** * * Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos * **/ void setPosition(@org.kurento.client.internal.server.Param("position") long position, Transaction tx); /** * * Starts reproducing the media, sending it to the :rom:cls:`MediaSource`. If the endpoint * has been connected to other endpoints, those will start receiving media. * **/ void play(); /** * * Asynchronous version of play: * {@link Continuation#onSuccess} is called when the action is * done. If an error occurs, {@link Continuation#onError} is called. * @see PlayerEndpoint#play * **/ void play(Continuation cont); /** * * Starts reproducing the media, sending it to the :rom:cls:`MediaSource`. If the endpoint * has been connected to other endpoints, those will start receiving media. * **/ void play(Transaction tx); /** * Add a {@link EventListener} for event {@link EndOfStreamEvent}. Synchronous call. * * @param listener Listener to be called on EndOfStreamEvent * @return ListenerSubscription for the given Listener * **/ @org.kurento.client.internal.server.EventSubscription(EndOfStreamEvent.class) ListenerSubscription addEndOfStreamListener(EventListener listener); /** * Add a {@link EventListener} for event {@link EndOfStreamEvent}. Asynchronous call. * Calls Continuation<ListenerSubscription> when it has been added. * * @param listener Listener to be called on EndOfStreamEvent * @param cont Continuation to be called when the listener is registered * **/ @org.kurento.client.internal.server.EventSubscription(EndOfStreamEvent.class) void addEndOfStreamListener(EventListener listener, Continuation cont); /** * Remove a {@link ListenerSubscription} for event {@link EndOfStreamEvent}. Synchronous call. * * @param listenerSubscription Listener subscription to be removed * **/ @org.kurento.client.internal.server.EventSubscription(EndOfStreamEvent.class) void removeEndOfStreamListener(ListenerSubscription listenerSubscription); /** * Remove a {@link ListenerSubscription} for event {@link EndOfStreamEvent}. Asynchronous call. * Calls Continuation<Void> when it has been removed. * * @param listenerSubscription Listener subscription to be removed * @param cont Continuation to be called when the listener is removed * **/ @org.kurento.client.internal.server.EventSubscription(EndOfStreamEvent.class) void removeEndOfStreamListener(ListenerSubscription listenerSubscription, Continuation cont); public class Builder extends AbstractBuilder { /** * * Creates a Builder for PlayerEndpoint * **/ public Builder(org.kurento.client.MediaPipeline mediaPipeline, String uri){ super(PlayerEndpoint.class,mediaPipeline); props.add("mediaPipeline",mediaPipeline); props.add("uri",uri); } public Builder withProperties(Properties properties) { return (Builder)super.withProperties(properties); } public Builder with(String name, Object value) { return (Builder)super.with(name, value); } /** * * Feed the input media as-is to the Media Pipeline, instead of first decoding it. *

* When this property is not enabled, the input media gets always decoded into a raw format before being processed by the rest of the Media Pipeline; this is done to ensure that Kurento is able to keep track of lost keyframes among other quality-control measurements. Of course, having to decode the media has a cost in terms of CPU usage, but ensures that the output streaming will be robust and reliable. *

*

* When this property is enabled, the explained behavior gets disabled. Instead, The endpoint will provide any input media directly to the Media Pipeline, without prior decoding. Enabling this mode of operation could have a severe effect on stability, because lost video keyframes will not be regenerated; however, avoiding a full cycle of decoding and encoding can be very useful for certain applications, because it improves performance by greatly reducing the CPU processing load. *

*

* Keep in mind that if this property is enabled, the original source media MUST already have an encoding format which is compatible with the destination target. For example: given a pipeline which uses this endpoint to read a file and then streams it to a WebRTC browser such as Chrome, then the file must already be encoded with a VP8 or H.264 codec profile which Chrome is able to decode. Note that for this example, most browsers don't support ANY combination of H.264 encoding options; instead, they tend to support only a very specific subset of the codec features (also known as 'profiles'). *

*

* We strongly recommend to avoid using this option, because correct behavior cannot be guaranteed. *

* * **/ public Builder useEncodedMedia(){ props.add("useEncodedMedia",Boolean.TRUE); return this; } /** * * Sets a value for networkCache in Builder for PlayerEndpoint. * * @param networkCache * When using RTSP sources: Amount of milliseconds to buffer * **/ public Builder withNetworkCache(int networkCache){ props.add("networkCache",networkCache); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy