From e9fa811971ccd5fb1968d93f88a924685f3145c4 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Fri, 4 Oct 2019 14:59:50 +0900 Subject: [PATCH] [ACR-1469] Add definition for use-tbm Change-Id: Ib9f108c2197e25af144c5c1f5863d777d29cd0c1 Signed-off-by: Hyunil --- include/media_streamer.h | 45 ++++++++++++++++++++++++++++----------------- src/media_streamer_node.c | 4 +++- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/include/media_streamer.h b/include/media_streamer.h index 6bd7c6a..76a7e04 100644 --- a/include/media_streamer.h +++ b/include/media_streamer.h @@ -366,6 +366,17 @@ typedef enum { #define MEDIA_STREAMER_PARAM_VISIBLE "visible" /** + * @brief Definition for use-tbm parameter of sink node. + * @details Use Tizen Buffer Memory instead of Shared Memory. + * The sink node must receive the tbm-buffer created by the previous node. + * The value is changeable only in the #MEDIA_STREAMER_STATE_IDLE state. + * Data type is boolean and default value is false. + * @since_tizen 5.5 + * @see media_streamer_node_get_params() + */ +#define MEDIA_STREAMER_PARAM_USE_TBM "use-tbm" + +/** * @brief Definition for host parameter of sink node. * @details The host/IP/Multicast group to send the packets to. * Data type is string and default value is "localhost". @@ -547,7 +558,7 @@ int media_streamer_unset_error_cb(media_streamer_h streamer); * @pre Create a media streamer handle by calling media_streamer_create() function * @post media_streamer_state_changed_cb() will be invoked. * @see media_streamer_unset_state_change_cb() - * @see media_streamer_state_change_cb() + * @see media_streamer_state_changed_cb() */ int media_streamer_set_state_change_cb(media_streamer_h streamer, media_streamer_state_changed_cb callback, void *user_data); @@ -903,9 +914,9 @@ int media_streamer_get_state(media_streamer_h streamer, media_streamer_state_e * /** * @brief Creates media streamer source node. * @since_tizen 3.0 - * @remarks The internet privilege(http://tizen.org/privilege/internet) should be added if any URIs are used to play from network. - * The camera privilege(http://tizen.org/privilege/camera) should be added if the src node handle the camera device. - * The recorder privilege(http://tizen.org/privilege/recorder) should be added if the src node handle the recorder device. + * @remarks The internet privilege(%http://tizen.org/privilege/internet) should be added if any URIs are used to play from network. + * The camera privilege(%http://tizen.org/privilege/camera) should be added if the src node handle the camera device. + * The recorder privilege(%http://tizen.org/privilege/recorder) should be added if the src node handle the recorder device. * You can release source node using media_streamer_node_destroy() function. * @param[in] type Media streamer source node type * @param[out] src Media streamer source node handle @@ -941,7 +952,7 @@ int media_streamer_node_push_packet(media_streamer_node_h src, media_packet_h pa /** * @brief Creates media streamer sink node. * @since_tizen 3.0 - * @remarks The internet privilege(http://tizen.org/privilege/internet) should be added if any URIs are used to transmit the output data. + * @remarks The internet privilege(%http://tizen.org/privilege/internet) should be added if any URIs are used to transmit the output data. * You can release @a sink node using media_streamer_node_destroy() * @remarks If @a type is #MEDIA_STREAMER_NODE_SINK_TYPE_ADAPTIVE, the HTTP server will be started and the server will be able to transmit the output data to the other device. * The application must have an authentication responsibility between a server and client because the data transmission is not secure. @@ -972,7 +983,7 @@ int media_streamer_node_create_sink(media_streamer_node_sink_type_e type, media_ * @retval #MEDIA_STREAMER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_STREAMER_ERROR_INVALID_OPERATION Invalid operation * @pre Create a sink node handle by calling media_streamer_node_create_sink() function - * @pre Set media_streamer_data_ready_cb by calling media_streamer_set_data_ready_cb() function. + * @pre Set media_streamer_sink_data_ready_cb by calling media_streamer_sink_set_data_ready_cb() function. * @see #media_packet_h * @see media_streamer_node_create_sink() */ @@ -984,7 +995,7 @@ int media_streamer_node_pull_packet(media_streamer_node_h sink, media_packet_h * * and output data. * @since_tizen 3.0 * @remarks The node type should not be #MEDIA_STREAMER_NODE_TYPE_SRC and #MEDIA_STREAMER_NODE_TYPE_SINK. - * To create src/sink type node, media_streamer_node_create_src()/media_streamer_node_create_sink() should be called. + * To create src / sink type node, media_streamer_node_create_src() / media_streamer_node_create_sink() should be called. * You can release @a node using media_streamer_node_destroy() function * @param[in] type Created node type * @param[in] in_fmt Media format handle for input data @@ -1154,8 +1165,8 @@ int media_streamer_node_get_pad_name(media_streamer_node_h node, char ***src_pad * @brief Sets parameters of node. * @details Many parameters can be set at one time all together by using bundle. * @since_tizen 3.0 - * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) should be added if any video/audio files are written in the internal storage devices. - * The externalstorage privilege(http://tizen.org/privilege/externalstorage) should be added if any video/audio files are written in the external storage devices. + * @remarks The mediastorage privilege(%http://tizen.org/privilege/mediastorage) should be added if any video/audio files are written in the internal storage devices. + * The externalstorage privilege(%http://tizen.org/privilege/externalstorage) should be added if any video/audio files are written in the external storage devices. * @param[in] node Media streamer node handle * @param[in] param_list Key value array of media streamer node parameters * @return @c 0 on success, @@ -1189,8 +1200,8 @@ int media_streamer_node_set_params(media_streamer_node_h node, bundle *param_lis * @pre Create a node handle by calling media_streamer_node_createXXX() function * @post Set params which are needed to set by calling media_streamer_node_set_params() or media_streamer_node_set_param() function. * @see media_streamer_node_create() - * @see media_streamer_src_create() - * @see media_streamer_sink_create() + * @see media_streamer_node_create_src() + * @see media_streamer_node_create_sink() * @see media_streamer_node_set_params() * @see media_streamer_node_set_param() */ @@ -1200,8 +1211,8 @@ int media_streamer_node_get_params(media_streamer_node_h node, bundle **param_li * @brief Sets single parameter of node. * @details Sets parameter one by one without creating param bundle. * @since_tizen 3.0 - * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) should be added if any video/audio files are written in the internal storage devices. - * The externalstorage privilege(http://tizen.org/privilege/externalstorage) should be added if any video/audio files are written in the external storage devices. + * @remarks The mediastorage privilege(%http://tizen.org/privilege/mediastorage) should be added if any video/audio files are written in the internal storage devices. + * The externalstorage privilege(%http://tizen.org/privilege/externalstorage) should be added if any video/audio files are written in the external storage devices. * @param[in] node Media streamer node handle * @param[in] param_name Param name of node * @param[in] param_value Param value of node @@ -1215,8 +1226,8 @@ int media_streamer_node_get_params(media_streamer_node_h node, bundle **param_li * @pre Create a node handle by calling media_streamer_node_createXXX() function. * @pre Get param list to set by calling media_streamer_node_get_params() function. * @see media_streamer_node_create() - * @see media_streamer_src_create() - * @see media_streamer_sink_create() + * @see media_streamer_node_create_src() + * @see media_streamer_node_create_sink() * @see media_streamer_node_get_params() * @see media_streamer_node_get_param() */ @@ -1240,8 +1251,8 @@ int media_streamer_node_set_param(media_streamer_node_h node, * @pre Create a node handle by calling media_streamer_node_createXXX() function. * @pre Get param list to know the param name by calling media_streamer_node_get_params() function. * @see media_streamer_node_create() - * @see media_streamer_src_create() - * @see media_streamer_sink_create() + * @see media_streamer_node_create_src() + * @see media_streamer_node_create_sink() * @see media_streamer_node_get_params() * @see media_streamer_node_set_param() */ diff --git a/src/media_streamer_node.c b/src/media_streamer_node.c index a4975f8..917ef96 100644 --- a/src/media_streamer_node.c +++ b/src/media_streamer_node.c @@ -60,6 +60,7 @@ static param_s param_table[] = { {MEDIA_STREAMER_PARAM_DISPLAY_GEOMETRY_METHOD, "display-geometry-method"}, {MEDIA_STREAMER_PARAM_DISPLAY, "display"}, {MEDIA_STREAMER_PARAM_VISIBLE, "visible"}, + {MEDIA_STREAMER_PARAM_USE_TBM, "use-tbm"}, {MEDIA_STREAMER_PARAM_HOST, "host"}, {MEDIA_STREAMER_PARAM_SEGMENT_LOCATION, "location"}, {MEDIA_STREAMER_PARAM_PLAYLIST_LOCATION, "playlist-location"}, @@ -768,7 +769,6 @@ int __ms_sink_node_create(media_streamer_node_s *node) case MEDIA_STREAMER_NODE_SINK_TYPE_OVERLAY: plugin_name = __ms_ini_get_string("node type 2:overlay", DEFAULT_VIDEO_SINK); node->gst_element = __ms_element_create(plugin_name, NULL); - g_object_set(node->gst_element, "use-tbm", FALSE, NULL); break; case MEDIA_STREAMER_NODE_SINK_TYPE_FAKE: plugin_name = __ms_ini_get_string("node type 2:fake", DEFAULT_FAKE_SINK); @@ -1433,6 +1433,7 @@ int __ms_node_get_param_value(media_streamer_node_s *node, param_s *param, char string_val = g_strdup_printf("%u", g_value_get_uint(&value)); } else if (!g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_IS_LIVE_STREAM) || !g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_CLOCK_SYNCHRONIZED) || + !g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_USE_TBM) || !g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_VISIBLE)) { string_val = g_strdup(g_value_get_boolean(&value) ? "true" : "false"); } else if (!g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_URI) || @@ -1732,6 +1733,7 @@ int __ms_node_set_param_value(media_streamer_node_s *ms_node, param_s *param, co g_object_set(ms_node->gst_element, param->origin_name, (int)strtol(param_value, NULL, 10), NULL); } else if (!g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_IS_LIVE_STREAM) || !g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_CLOCK_SYNCHRONIZED) || + !g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_USE_TBM) || !g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_VISIBLE)) { g_object_set(ms_node->gst_element, param->origin_name, !g_ascii_strcasecmp(param_value, "true"), NULL); } else if (!g_strcmp0(param->param_name, MEDIA_STREAMER_PARAM_URI)) { -- 2.7.4