Tizen Native API
5.0
|
The Media Streamer APIs provides functions for building custom player.
#include <media_streamer.h>
The Media Streamer API allows application developers to construct the custom player. It includes provides a way to handle media content by user specific player.
MEDIASTREAMER allows :
The Media Streamer API also notifies you by callback mechanism when state is changed.
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | media_streamer_set_error_cb (media_streamer_h streamer, media_streamer_error_cb callback, void *user_data) |
Sets a error callback function to be invoked when an error occurs. | |
int | media_streamer_unset_error_cb (media_streamer_h streamer) |
Unsets the error callback function. | |
int | media_streamer_set_state_change_cb (media_streamer_h streamer, media_streamer_state_changed_cb callback, void *user_data) |
Sets a callback that will be triggered after media streamer state is changed. | |
int | media_streamer_unset_state_change_cb (media_streamer_h streamer) |
Unsets the state changed callback function. | |
int | media_streamer_set_interrupted_cb (media_streamer_h streamer, media_streamer_interrupted_cb callback, void *user_data) |
Sets a callback function to be invoked when the media streamer is interrupted. | |
int | media_streamer_unset_interrupted_cb (media_streamer_h streamer) |
Unsets the callback function. | |
int | media_streamer_src_set_buffer_status_cb (media_streamer_node_h source, media_streamer_custom_buffer_status_cb callback, void *user_data) |
Sets a callback function to be invoked when buffer underrun or overflow is occurred. | |
int | media_streamer_src_unset_buffer_status_cb (media_streamer_node_h source) |
Unsets the src buffer status callback function. | |
int | media_streamer_sink_set_data_ready_cb (media_streamer_node_h sink, media_streamer_sink_data_ready_cb callback, void *user_data) |
Sets a callback function to be called when the custom sink is ready for data processing. | |
int | media_streamer_sink_unset_data_ready_cb (media_streamer_node_h sink) |
Unsets the sink data ready callback function. | |
int | media_streamer_sink_set_eos_cb (media_streamer_node_h sink, media_streamer_sink_eos_cb callback, void *user_data) |
Sets a callback function to be called when custom sink detect the end-of-stream. | |
int | media_streamer_sink_unset_eos_cb (media_streamer_node_h sink) |
Unsets the sink end-of-stream callback function. | |
int | media_streamer_create (media_streamer_h *streamer) |
Creates an instance of media streamer and passes the handle to the caller. | |
int | media_streamer_prepare (media_streamer_h streamer) |
Sets media streamer state to MEDIA_STREAMER_STATE_READY. | |
int | media_streamer_unprepare (media_streamer_h streamer) |
Sets media streamer state to MEDIA_STREAMER_STATE_IDLE. | |
int | media_streamer_play (media_streamer_h streamer) |
Sets media streamer state to MEDIA_STREAMER_STATE_PLAYING. | |
int | media_streamer_pause (media_streamer_h streamer) |
Pauses the media streamer. | |
int | media_streamer_stop (media_streamer_h streamer) |
Stops the media streamer. | |
int | media_streamer_destroy (media_streamer_h streamer) |
Destroys media streamer. | |
int | media_streamer_set_play_position (media_streamer_h streamer, int time, bool accurate, media_streamer_position_changed_cb callback, void *user_data) |
Changes playback position to the defined time value, asynchronously. | |
int | media_streamer_get_play_position (media_streamer_h streamer, int *time) |
Gets the current position in milliseconds. | |
int | media_streamer_get_duration (media_streamer_h streamer, int *duration) |
Gets the total running time of the associated media. | |
int | media_streamer_get_state (media_streamer_h streamer, media_streamer_state_e *state) |
Gets media streamer state. | |
int | media_streamer_node_create_src (media_streamer_node_src_type_e type, media_streamer_node_h *src) |
Creates media streamer source node. | |
int | media_streamer_node_push_packet (media_streamer_node_h src, media_packet_h packet) |
Pushes packet into custom source node. | |
int | media_streamer_node_create_sink (media_streamer_node_sink_type_e type, media_streamer_node_h *sink) |
Creates media streamer sink node. | |
int | media_streamer_node_pull_packet (media_streamer_node_h sink, media_packet_h *packet) |
Pulls packet from custom sink node. | |
int | media_streamer_node_create (media_streamer_node_type_e type, media_format_h in_fmt, media_format_h out_fmt, media_streamer_node_h *node) |
Creates media streamer node except MEDIA_STREAMER_NODE_TYPE_SRC and MEDIA_STREAMER_NODE_TYPE_SINK. | |
int | media_streamer_node_add (media_streamer_h streamer, media_streamer_node_h node) |
Adds node to media streamer. | |
int | media_streamer_node_destroy (media_streamer_node_h node) |
Destroys media streamer node. | |
int | media_streamer_node_remove (media_streamer_h streamer, media_streamer_node_h node) |
Removes media streamer node from streamer. | |
int | media_streamer_node_link (media_streamer_node_h src_node, const char *src_pad_name, media_streamer_node_h dest_node, const char *sink_pad_name) |
Links two media streamer nodes. | |
int | media_streamer_node_set_pad_format (media_streamer_node_h node, const char *pad_name, media_format_h fmt) |
Sets media format for pad of media streamer node. | |
int | media_streamer_node_get_pad_format (media_streamer_node_h node, const char *pad_name, media_format_h *fmt) |
Gets media format for pad of media streamer node. | |
int | media_streamer_node_get_pad_name (media_streamer_node_h node, char ***src_pad_name, int *src_pad_num, char ***sink_pad_name, int *sink_pad_num) |
Gets name of node pads. | |
int | media_streamer_node_set_params (media_streamer_node_h node, bundle *param_list) |
Sets parameters of node. | |
int | media_streamer_node_get_params (media_streamer_node_h node, bundle **param_list) |
Gets node parameter list. | |
int | media_streamer_node_set_param (media_streamer_node_h node, const char *param_name, const char *param_value) |
Sets single parameter of node. | |
int | media_streamer_node_get_param (media_streamer_node_h node, const char *param_name, char **param_value) |
Gets value of parameter. | |
Typedefs | |
typedef void * | media_streamer_h |
Media Streamer handle type. | |
typedef void * | media_streamer_node_h |
Media Streamer node handle type. | |
typedef void(* | media_streamer_error_cb )(media_streamer_h streamer, media_streamer_error_e error, void *user_data) |
Called when error occurs in media streamer. | |
typedef void(* | media_streamer_state_changed_cb )(media_streamer_h streamer, media_streamer_state_e previous_state, media_streamer_state_e current_state, void *user_data) |
Called when media streamer state is changed. | |
typedef void(* | media_streamer_custom_buffer_status_cb )(media_streamer_node_h node, media_streamer_custom_buffer_status_e status, void *user_data) |
Called when the custom source needs more data or has enough data. | |
typedef void(* | media_streamer_sink_data_ready_cb )(media_streamer_node_h node, void *user_data) |
Called when new data is available from custom sink. | |
typedef void(* | media_streamer_sink_eos_cb )(media_streamer_node_h node, void *user_data) |
Called when the end-of-stream has been reached. | |
typedef void(* | media_streamer_position_changed_cb )(void *user_data) |
Called when the seek operation is completed. | |
typedef void(* | media_streamer_interrupted_cb )(media_streamer_interrupted_code_e code, void *user_data) |
Called when the media streamer is interrupted. | |
Defines | |
#define | MEDIA_STREAMER_PARAM_CAMERA_ID "camera-id" |
Definition for camera-id parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_CAPTURE_WIDTH "capture-width" |
Definition for capture-width parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_CAPTURE_HEIGHT "capture-height" |
Definition for capture-height parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_IS_LIVE_STREAM "is-live" |
Definition for is-live parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_URI "uri" |
Definition for uri parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_USER_AGENT "user-agent" |
Definition for user-agent parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_STREAM_TYPE "stream-type" |
Definition for stream type parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_PORT "port" |
Definition for port parameter of source or sink node. | |
#define | MEDIA_STREAMER_PARAM_VIDEO_IN_PORT "video_in_port" |
Definition for video port parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_AUDIO_IN_PORT "audio_in_port" |
Definition for audio port parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_VIDEO_OUT_PORT "video_out_port" |
Definition for video port parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_AUDIO_OUT_PORT "audio_out_port" |
Definition for audio port parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_IP_ADDRESS "address" |
Definition for IP address parameter of source node. | |
#define | MEDIA_STREAMER_PARAM_AUDIO_DEVICE "audio_device" |
Definition for audio device name parameter of source or sink node. | |
#define | MEDIA_STREAMER_PARAM_CLOCK_SYNCHRONIZED "sync" |
Definition for sync parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_ROTATE "rotate" |
Definition for rotate parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_FLIP "flip" |
Definition for flip parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_DISPLAY_GEOMETRY_METHOD "display-geometry-method" |
Definition for display geometry method parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_DISPLAY "display" |
Definition for display parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_VISIBLE "visible" |
Definition for visible parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_HOST "host" |
Definition for host parameter of sink node. | |
#define | MEDIA_STREAMER_PARAM_SEGMENT_LOCATION "location" |
Definition for segment location parameter of adaptive sink node. | |
#define | MEDIA_STREAMER_PARAM_PLAYLIST_LOCATION "playlist-location" |
Definition for playlist location parameter of adaptive sink node. |
#define MEDIA_STREAMER_PARAM_AUDIO_DEVICE "audio_device" |
Definition for audio device name parameter of source or sink node.
ALSA device, as defined in an asound configuration file. ex) "hw:0,0", "hw:0,1" Data type is string and default value is "default".
#define MEDIA_STREAMER_PARAM_AUDIO_IN_PORT "audio_in_port" |
Definition for audio port parameter of source node.
The port to receive the audio packets from. Data type is integer.
#define MEDIA_STREAMER_PARAM_AUDIO_OUT_PORT "audio_out_port" |
Definition for audio port parameter of sink node.
The port to send the audio packets to. Data type is integer.
#define MEDIA_STREAMER_PARAM_CAMERA_ID "camera-id" |
Definition for camera-id parameter of source node.
Index number of camera to activate. Data type is integer and default value is 0.
#define MEDIA_STREAMER_PARAM_CAPTURE_HEIGHT "capture-height" |
Definition for capture-height parameter of source node.
Height for camera size to capture. Data type is integer and default value is 1200.
#define MEDIA_STREAMER_PARAM_CAPTURE_WIDTH "capture-width" |
Definition for capture-width parameter of source node.
Width for camera size to capture. Data type is integer and default value is 1600.
#define MEDIA_STREAMER_PARAM_CLOCK_SYNCHRONIZED "sync" |
Definition for sync parameter of sink node.
Synchronize on the clock Data type is boolean and default value is true.
#define MEDIA_STREAMER_PARAM_DISPLAY "display" |
Definition for display parameter of sink node.
It is a object to draw video frame on. Data type is Pointer.
#define MEDIA_STREAMER_PARAM_DISPLAY_GEOMETRY_METHOD "display-geometry-method" |
Definition for display geometry method parameter of sink node.
Geometrical method for display. 0:Letter box 1:Original size 2:Full-screen 3:Cropped full screen 4:Original size if surface size is larger than video size(width/height), or Letter box if video size(width/height) is larger than surface size. 5:Custom ROI Default value is 0(Letter box).
#define MEDIA_STREAMER_PARAM_FLIP "flip" |
Definition for flip parameter of sink node.
Flip for display. 0:none, 1:horizontal, 2:vertical, 3:both Default value is 0.
#define MEDIA_STREAMER_PARAM_HOST "host" |
Definition for host parameter of sink node.
The host/IP/Multicast group to send the packets to. Data type is string and default value is "localhost".
#define MEDIA_STREAMER_PARAM_IP_ADDRESS "address" |
Definition for IP address parameter of source node.
IP address to send/receive packets for. Data type is string and default value is "0.0.0.0".
#define MEDIA_STREAMER_PARAM_IS_LIVE_STREAM "is-live" |
Definition for is-live parameter of source node.
Whether to act as a live source. Data type is boolean and default value is false.
#define MEDIA_STREAMER_PARAM_PLAYLIST_LOCATION "playlist-location" |
Definition for playlist location parameter of adaptive sink node.
Path for writing playlist from. Data type is string.
#define MEDIA_STREAMER_PARAM_PORT "port" |
Definition for port parameter of source or sink node.
The port to receive the packets from. Data type is integer and default value is 5004.
#define MEDIA_STREAMER_PARAM_ROTATE "rotate" |
Definition for rotate parameter of sink node.
Rotate angle of display output. 0:none/1:rotate 90 degree/2:rotate 180 degree/3:rotate 270 degree Default value is 3(rotate 270 degree).
#define MEDIA_STREAMER_PARAM_SEGMENT_LOCATION "location" |
Definition for segment location parameter of adaptive sink node.
Path for writing playlist from Data type is string.
#define MEDIA_STREAMER_PARAM_STREAM_TYPE "stream-type" |
Definition for stream type parameter of source node.
The type of the push data stream. 0:stream, 1:seekable, 2:random-access (default:0)
#define MEDIA_STREAMER_PARAM_URI "uri" |
Definition for uri parameter of source node.
URI to read from Data type is string.
#define MEDIA_STREAMER_PARAM_USER_AGENT "user-agent" |
Definition for user-agent parameter of source node.
Value of the User-Agent HTTP request header field. Data type is string.
#define MEDIA_STREAMER_PARAM_VIDEO_IN_PORT "video_in_port" |
Definition for video port parameter of source node.
The port to receive the video packets from. Data type is integer.
#define MEDIA_STREAMER_PARAM_VIDEO_OUT_PORT "video_out_port" |
Definition for video port parameter of sink node.
The port to send the video packets to. Data type is integer.
#define MEDIA_STREAMER_PARAM_VISIBLE "visible" |
Definition for visible parameter of sink node.
Draws screen or blacks out. Data type is boolean and default value is true(visible).
typedef void(* media_streamer_custom_buffer_status_cb)(media_streamer_node_h node, media_streamer_custom_buffer_status_e status, void *user_data) |
Called when the custom source needs more data or has enough data.
This callback will be invoked when the buffer level drops below the threshold of max size or no free space in custom source buffer.
[in] | node | Media streamer source node handle |
[in] | status | Media streamer custom buffer status |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* media_streamer_error_cb)(media_streamer_h streamer, media_streamer_error_e error, void *user_data) |
Called when error occurs in media streamer.
[in] | streamer | Media streamer handle |
[in] | error | The error that occurred in media steamer |
[in] | user_data | The user data passed from the code where media_streamer_set_error_cb() was invoked This data will be accessible from media_streamer_error_cb |
typedef void* media_streamer_h |
Media Streamer handle type.
typedef void(* media_streamer_interrupted_cb)(media_streamer_interrupted_code_e code, void *user_data) |
Called when the media streamer is interrupted.
[in] | code | The interrupted error code |
[in] | user_data | The user data passed from the callback registration function |
typedef void* media_streamer_node_h |
Media Streamer node handle type.
typedef void(* media_streamer_position_changed_cb)(void *user_data) |
Called when the seek operation is completed.
[in] | user_data | The user data passed from the callback registration function |
typedef void(* media_streamer_sink_data_ready_cb)(media_streamer_node_h node, void *user_data) |
Called when new data is available from custom sink.
This callback can be applied only to MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type
[in] | node | Media streamer sink node handle |
[in] | user_data | The user data passed from the code where media_streamer_sink_set_data_ready_cb() was invoked This data will be accessible from media_streamer_sink_data_ready_cb |
typedef void(* media_streamer_sink_eos_cb)(media_streamer_node_h node, void *user_data) |
Called when the end-of-stream has been reached.
This callback can be applied only to MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type
[in] | node | Media streamer sink node handle |
[in] | user_data | The user data passed from the code where media_streamer_sink_set_eos_cb() was invoked This data will be accessible from media_streamer_sink_eos_cb |
typedef void(* media_streamer_state_changed_cb)(media_streamer_h streamer, media_streamer_state_e previous_state, media_streamer_state_e current_state, void *user_data) |
Called when media streamer state is changed.
[in] | streamer | Media streamer handle |
[in] | previous_state | The previous state of the media streamer |
[in] | current_state | The current state of media streamer |
[in] | user_data | The user data passed from the code where media_streamer_set_state_changed_cb() was invoked This data will be accessible from media_streamer_state_changed_cb |
Enumeration for media streamer error.
Enumeration for media streamer sink node type.
Enumeration for media streamer source node type.
Enumeration for media streamer node type.
MEDIA_STREAMER_NODE_TYPE_NONE |
Not defined type |
MEDIA_STREAMER_NODE_TYPE_SRC |
Src node type. Not available for media_streamer_node_create(). Use media_streamer_node_create_src() |
MEDIA_STREAMER_NODE_TYPE_SINK |
Sink node type. Not available for media_streamer_node_create(). Use media_streamer_node_create_sink() |
MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER |
Video encoder node type |
MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER |
Video decoder node type |
MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER |
Audio encoder node type |
MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER |
Audio decoder node type |
MEDIA_STREAMER_NODE_TYPE_VIDEO_CONVERTER |
Video converter node type |
MEDIA_STREAMER_NODE_TYPE_AUDIO_CONVERTER |
Audio converter node type |
MEDIA_STREAMER_NODE_TYPE_AUDIO_RESAMPLE |
Audio resample node type |
MEDIA_STREAMER_NODE_TYPE_VIDEO_PAY |
Rtp video payloader |
MEDIA_STREAMER_NODE_TYPE_AUDIO_PAY |
Rtp audio payloader |
MEDIA_STREAMER_NODE_TYPE_VIDEO_DEPAY |
Rtp video depayloader |
MEDIA_STREAMER_NODE_TYPE_AUDIO_DEPAY |
Rtp audio depayloader |
MEDIA_STREAMER_NODE_TYPE_VIDEO_RATE |
Rate node type |
MEDIA_STREAMER_NODE_TYPE_VIDEO_SCALE |
Scale node type |
MEDIA_STREAMER_NODE_TYPE_TEXT_OVERLAY |
Overlay node type |
MEDIA_STREAMER_NODE_TYPE_PARSER |
Parser node type |
MEDIA_STREAMER_NODE_TYPE_FILTER |
Filter node type, to limit formats of data |
MEDIA_STREAMER_NODE_TYPE_TEE |
Tee node type, splits data to multiple path |
MEDIA_STREAMER_NODE_TYPE_QUEUE |
Queue node type |
MEDIA_STREAMER_NODE_TYPE_MQUEUE |
Multiple data queue node type |
MEDIA_STREAMER_NODE_TYPE_MUXER |
Muxer node type |
MEDIA_STREAMER_NODE_TYPE_DEMUXER |
Demuxer node type |
MEDIA_STREAMER_NODE_TYPE_RTP |
Rtp component to send and receive data |
MEDIA_STREAMER_NODE_TYPE_INPUT_SELECTOR |
N-to-1 input stream selector |
MEDIA_STREAMER_NODE_TYPE_OUTPUT_SELECTOR |
1-to-N output stream selector |
MEDIA_STREAMER_NODE_TYPE_INTERLEAVE |
Folds many mono channel into one interleaved audio stream |
MEDIA_STREAMER_NODE_TYPE_DEINTERLEAVE |
Splits multi channel audio into many mono audio |
Enumeration for media streamer state.
int media_streamer_create | ( | media_streamer_h * | streamer | ) |
Creates an instance of media streamer and passes the handle to the caller.
[out] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_destroy | ( | media_streamer_h | streamer | ) |
Destroys media streamer.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_get_duration | ( | media_streamer_h | streamer, |
int * | duration | ||
) |
Gets the total running time of the associated media.
[in] | streamer | Media streamer handle |
[out] | duration | The duration in milliseconds |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_get_play_position | ( | media_streamer_h | streamer, |
int * | time | ||
) |
Gets the current position in milliseconds.
[in] | streamer | Media streamer handle |
[out] | time | The current position in milliseconds |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_get_state | ( | media_streamer_h | streamer, |
media_streamer_state_e * | state | ||
) |
Gets media streamer state.
[in] | streamer | Media streamer handle |
[out] | state | Media streamer state |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_add | ( | media_streamer_h | streamer, |
media_streamer_node_h | node | ||
) |
Adds node to media streamer.
[in] | streamer | Media streamer handle |
[in] | node | Media streamer node handle to be added |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_create | ( | media_streamer_node_type_e | type, |
media_format_h | in_fmt, | ||
media_format_h | out_fmt, | ||
media_streamer_node_h * | node | ||
) |
Creates media streamer node except MEDIA_STREAMER_NODE_TYPE_SRC and MEDIA_STREAMER_NODE_TYPE_SINK.
Creates node specific type with specific format of input and output data.
[in] | type | Created node type |
[in] | in_fmt | Media format handle for input data |
[in] | out_fmt | Media format handle for output data |
[out] | node | Media streamer node handle to be created |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_create_sink | ( | media_streamer_node_sink_type_e | type, |
media_streamer_node_h * | sink | ||
) |
Creates media streamer sink node.
[in] | type | Type of sink node to be created |
[out] | sink | Media streamer sink node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_STREAMER_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_STREAMER_ERROR_NOT_SUPPORTED | Not supported |
int media_streamer_node_create_src | ( | media_streamer_node_src_type_e | type, |
media_streamer_node_h * | src | ||
) |
Creates media streamer source node.
[in] | type | Media streamer source node type |
[out] | src | Media streamer source node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_STREAMER_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_STREAMER_ERROR_NOT_SUPPORTED | Not supported |
int media_streamer_node_destroy | ( | media_streamer_node_h | node | ) |
Destroys media streamer node.
[in] | node | Media streamer node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_get_pad_format | ( | media_streamer_node_h | node, |
const char * | pad_name, | ||
media_format_h * | fmt | ||
) |
Gets media format for pad of media streamer node.
[in] | node | Media streamer node handle |
[in] | pad_name | Pad name |
[out] | fmt | Media format handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_get_pad_name | ( | media_streamer_node_h | node, |
char *** | src_pad_name, | ||
int * | src_pad_num, | ||
char *** | sink_pad_name, | ||
int * | sink_pad_num | ||
) |
Gets name of node pads.
[in] | node | Media streamer node handle |
[out] | src_pad_name | Array of source pad name |
[out] | src_pad_num | The number of source pads |
[out] | sink_pad_name | Array of sink pad name |
[out] | sink_pad_num | The number of sink pads |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_get_param | ( | media_streamer_node_h | node, |
const char * | param_name, | ||
char ** | param_value | ||
) |
Gets value of parameter.
Gets parameter one by one without creating param bundle.
[in] | node | Media streamer node handle |
[in] | param_name | Param name of node |
[out] | param_value | Param value of node |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_get_params | ( | media_streamer_node_h | node, |
bundle ** | param_list | ||
) |
Gets node parameter list.
[in] | node | Media streamer node handle |
[out] | param_list | Key value array of media streamer node parameters |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_link | ( | media_streamer_node_h | src_node, |
const char * | src_pad_name, | ||
media_streamer_node_h | dest_node, | ||
const char * | sink_pad_name | ||
) |
Links two media streamer nodes.
[in] | src_node | Media streamer node handle |
[in] | src_pad_name | The name of the source pad of the source node |
[in] | dest_node | The destination media streamer node handle |
[in] | sink_pad_name | The name of the sink pad of the destination node |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_pull_packet | ( | media_streamer_node_h | sink, |
media_packet_h * | packet | ||
) |
Pulls packet from custom sink node.
This function can be called only for MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM
[in] | sink | Media streamer sink node handle |
[out] | packet | Media packet handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_push_packet | ( | media_streamer_node_h | src, |
media_packet_h | packet | ||
) |
Pushes packet into custom source node.
This function can be called only for MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM.
[in] | src | Media streamer source node handle |
[in] | packet | Media packet handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_remove | ( | media_streamer_h | streamer, |
media_streamer_node_h | node | ||
) |
Removes media streamer node from streamer.
[in] | streamer | Media streamer handle |
[in] | node | Media streamer node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_set_pad_format | ( | media_streamer_node_h | node, |
const char * | pad_name, | ||
media_format_h | fmt | ||
) |
Sets media format for pad of media streamer node.
[in] | node | Media streamer node handle |
[in] | pad_name | Pad name |
[in] | fmt | Media format handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_node_set_param | ( | media_streamer_node_h | node, |
const char * | param_name, | ||
const char * | param_value | ||
) |
Sets single parameter of node.
Sets parameter one by one without creating param bundle.
[in] | node | Media streamer node handle |
[in] | param_name | Param name of node |
[in] | param_value | Param value of node |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_STREAMER_ERROR_PERMISSION_DENIED | Permission denied |
int media_streamer_node_set_params | ( | media_streamer_node_h | node, |
bundle * | param_list | ||
) |
Sets parameters of node.
Many parameters can be set at one time all together by using bundle.
[in] | node | Media streamer node handle |
[in] | param_list | Key value array of media streamer node parameters |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_STREAMER_ERROR_PERMISSION_DENIED | Permission denied |
int media_streamer_pause | ( | media_streamer_h | streamer | ) |
Pauses the media streamer.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_play | ( | media_streamer_h | streamer | ) |
Sets media streamer state to MEDIA_STREAMER_STATE_PLAYING.
Start running the current streamer, or resumes it if paused.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_prepare | ( | media_streamer_h | streamer | ) |
Sets media streamer state to MEDIA_STREAMER_STATE_READY.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_set_error_cb | ( | media_streamer_h | streamer, |
media_streamer_error_cb | callback, | ||
void * | user_data | ||
) |
Sets a error callback function to be invoked when an error occurs.
Following error codes can be delivered by error callback. MEDIA_STREAMER_ERROR_INVALID_OPERATION, MEDIA_STREAMER_ERROR_FILE_NO_SPACE_ON_DEVICE, MEDIA_STREAMER_ERROR_NOT_SUPPORTED, MEDIA_STREAMER_ERROR_CONNECTION_FAILED, MEDIA_STREAMER_ERROR_RESOURCE_CONFLICT
[in] | streamer | Media streamer handle |
[in] | callback | Callback function pointer |
[in] | user_data | The user data passed from the code where media_streamer_set_error_cb() was invoked This data will be accessible from media_streamer_error_cb |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_set_interrupted_cb | ( | media_streamer_h | streamer, |
media_streamer_interrupted_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to be invoked when the media streamer is interrupted.
[in] | streamer | Media streamer handle |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_set_play_position | ( | media_streamer_h | streamer, |
int | time, | ||
bool | accurate, | ||
media_streamer_position_changed_cb | callback, | ||
void * | user_data | ||
) |
Changes playback position to the defined time value, asynchronously.
[in] | streamer | Media streamer handle |
[in] | time | Time in millisecond |
[in] | accurate | If true , it will seek to the accurate position, but this might be considerably slower for some formats, otherwise false , it will seek to the nearest keyframe |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_STREAMER_ERROR_SEEK_FAILED | Seek operation failure |
int media_streamer_set_state_change_cb | ( | media_streamer_h | streamer, |
media_streamer_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback that will be triggered after media streamer state is changed.
[in] | streamer | Media streamer handle |
[in] | callback | Callback function pointer |
[in] | user_data | The user data passed from the code where media_streamer_set_state_change_cb() was invoked This data will be accessible from media_streamer_state_changed_cb |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_sink_set_data_ready_cb | ( | media_streamer_node_h | sink, |
media_streamer_sink_data_ready_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to be called when the custom sink is ready for data processing.
This function can be called only for MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type
[in] | sink | Media streamer sink node handle |
[in] | callback | Callback function pointer |
[in] | user_data | The user data passed from the code where media_streamer_sink_set_data_ready_cb() was invoked This data will be accessible from media_streamer_sink_data_ready_cb |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_sink_set_eos_cb | ( | media_streamer_node_h | sink, |
media_streamer_sink_eos_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to be called when custom sink detect the end-of-stream.
[in] | sink | Media streamer sink node handle |
[in] | callback | Callback function pointer |
[in] | user_data | The user data passed from the code where media_streamer_sink_set_eos_cb() was invoked. This data will be accessible from media_streamer_sink_eos_cb |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
Unsets the sink data ready callback function.
[in] | sink | Media streamer sink node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
Unsets the sink end-of-stream callback function.
[in] | sink | Media streamer sink node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_src_set_buffer_status_cb | ( | media_streamer_node_h | source, |
media_streamer_custom_buffer_status_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to be invoked when buffer underrun or overflow is occurred.
This function can be called only for MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM source type
[in] | source | Media streamer source node handle |
[in] | callback | The buffer status callback function to register |
[in] | user_data | The user data passed from the code where media_streamer_src_set_buffer_status_cb() was invoked This data will be accessible from media_streamer_custom_buffer_status_cb() |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
Unsets the src buffer status callback function.
[in] | source | Media streamer source node handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_stop | ( | media_streamer_h | streamer | ) |
Stops the media streamer.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_unprepare | ( | media_streamer_h | streamer | ) |
Sets media streamer state to MEDIA_STREAMER_STATE_IDLE.
The most recently used media is reset and no longer associated with the media streamer.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_STATE | Invalid state |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_unset_error_cb | ( | media_streamer_h | streamer | ) |
Unsets the error callback function.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_unset_interrupted_cb | ( | media_streamer_h | streamer | ) |
Unsets the callback function.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |
int media_streamer_unset_state_change_cb | ( | media_streamer_h | streamer | ) |
Unsets the state changed callback function.
[in] | streamer | Media streamer handle |
0
on success, otherwise a negative error value MEDIA_STREAMER_ERROR_NONE | Successful |
MEDIA_STREAMER_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_STREAMER_ERROR_INVALID_OPERATION | Invalid operation |