From cd809c19718faeebb8e8d6411523ee0a3bd9c949 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 26 Mar 2019 17:49:42 +0900 Subject: [PATCH 01/16] fix that mpegaudioparse node is not create with parse node type and mp3 media_format Change-Id: I401ba603608e753337ad203be67797ad4571e9d2 Signed-off-by: Hyunil --- src/media_streamer_gst.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/media_streamer_gst.c b/src/media_streamer_gst.c index f6ad624..3c98be4 100644 --- a/src/media_streamer_gst.c +++ b/src/media_streamer_gst.c @@ -2289,10 +2289,10 @@ GstCaps *__ms_create_caps_from_fmt(media_format_h fmt) caps = gst_caps_new_simple("audio/x-raw", "channels", G_TYPE_INT, channel, "format", G_TYPE_STRING, __ms_convert_mime_to_string_format(mime), "rate", G_TYPE_INT, samplerate, NULL); else if (MEDIA_FORMAT_ENCODED == (mime & MEDIA_FORMAT_ENCODED)) { - if (mime & MEDIA_FORMAT_AAC) + if (mime == MEDIA_FORMAT_AAC) caps = gst_caps_new_simple(__ms_convert_mime_to_string_format(mime), "mpegversion", G_TYPE_INT, 4, NULL); - else if (mime & MEDIA_FORMAT_MP3) - caps = gst_caps_new_simple(__ms_convert_mime_to_string_format(mime), "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL); + else if (mime == MEDIA_FORMAT_MP3) + caps = gst_caps_new_simple(__ms_convert_mime_to_string_format(mime), "mpegversion", G_TYPE_INT, 1, NULL); else caps = gst_caps_new_simple(__ms_convert_mime_to_string_format(mime), "channels", G_TYPE_INT, channel, "rate", G_TYPE_INT, samplerate, NULL); } -- 2.7.4 From 569393c4bb3307a573dbb75255fa2860bfee2960 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Fri, 29 Mar 2019 13:23:31 +0900 Subject: [PATCH 02/16] Remove channel and rate from creating caps to generate correct caps for RAW format Change-Id: I3180f026c1e44626694b849ba1d63c04830cec33 Signed-off-by: Hyunil --- src/media_streamer_gst.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/media_streamer_gst.c b/src/media_streamer_gst.c index 3c98be4..63e5999 100644 --- a/src/media_streamer_gst.c +++ b/src/media_streamer_gst.c @@ -2285,10 +2285,9 @@ GstCaps *__ms_create_caps_from_fmt(media_format_h fmt) ms_debug_fenter(); if (!media_format_get_audio_info(fmt, &mime, &channel, &samplerate, &bit, &avg_bps)) { - if (MEDIA_FORMAT_RAW == (mime & MEDIA_FORMAT_RAW)) - caps = gst_caps_new_simple("audio/x-raw", "channels", G_TYPE_INT, channel, "format", - G_TYPE_STRING, __ms_convert_mime_to_string_format(mime), "rate", G_TYPE_INT, samplerate, NULL); - else if (MEDIA_FORMAT_ENCODED == (mime & MEDIA_FORMAT_ENCODED)) { + if (MEDIA_FORMAT_RAW == (mime & MEDIA_FORMAT_RAW)) { + caps = gst_caps_new_simple("audio/x-raw", "format", G_TYPE_STRING, __ms_convert_mime_to_string_format(mime), NULL); + } else if (MEDIA_FORMAT_ENCODED == (mime & MEDIA_FORMAT_ENCODED)) { if (mime == MEDIA_FORMAT_AAC) caps = gst_caps_new_simple(__ms_convert_mime_to_string_format(mime), "mpegversion", G_TYPE_INT, 4, NULL); else if (mime == MEDIA_FORMAT_MP3) -- 2.7.4 From cac463d3807ffe47022dac06b7fb2d5369392899 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Mon, 3 Jun 2019 13:38:07 +0900 Subject: [PATCH 03/16] Add setting caps to MEDIA_STREAMER_NODE_TYPE_FILTER for static use case Change-Id: Ifcd755ba8681db6700d6f9679d5273b350b679ba Signed-off-by: Hyunil --- src/media_streamer_gst.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/media_streamer_gst.c b/src/media_streamer_gst.c index 63e5999..0e7e7bb 100644 --- a/src/media_streamer_gst.c +++ b/src/media_streamer_gst.c @@ -1334,6 +1334,11 @@ GstElement *__ms_node_element_create(node_plug_s *plug_info, media_streamer_node gst_element = __ms_element_create_by_registry(plug_info, type); } + if (type == MEDIA_STREAMER_NODE_TYPE_FILTER) { + if (plug_info->src_caps) + g_object_set(G_OBJECT(gst_element), "caps", plug_info->src_caps, NULL); + } + ms_debug_fleave(); return gst_element; -- 2.7.4 From 18f5469edc45f71a1bc5326e97194e5784fcf4de Mon Sep 17 00:00:00 2001 From: Hyunil Date: Mon, 10 Jun 2019 16:40:40 +0900 Subject: [PATCH 04/16] fix Native API Reference error Change-Id: I5bbf79ba38ff6eeca8da3a3fa1b5e26bea31f25c Signed-off-by: Hyunil --- include/media_streamer.h | 104 ++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 56 deletions(-) diff --git a/include/media_streamer.h b/include/media_streamer.h index fa3d24b..6bd7c6a 100644 --- a/include/media_streamer.h +++ b/include/media_streamer.h @@ -180,7 +180,7 @@ typedef enum { * @details Index number of camera to activate. * Data type is integer and default value is 0. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_CAMERA_ID "camera-id" @@ -189,7 +189,7 @@ typedef enum { * @details Width for camera size to capture. * Data type is integer and default value is 1600. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_CAPTURE_WIDTH "capture-width" @@ -198,7 +198,7 @@ typedef enum { * @details Height for camera size to capture. * Data type is integer and default value is 1200. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_CAPTURE_HEIGHT "capture-height" @@ -207,7 +207,7 @@ typedef enum { * @details Whether to act as a live source. * Data type is boolean and default value is false. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_IS_LIVE_STREAM "is-live" @@ -216,7 +216,7 @@ typedef enum { * @details URI to read from * Data type is string. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_URI "uri" @@ -225,7 +225,7 @@ typedef enum { * @details Value of the User-Agent HTTP request header field. * Data type is string. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_USER_AGENT "user-agent" @@ -234,7 +234,7 @@ typedef enum { * @details The type of the push data stream. * 0:stream, 1:seekable, 2:random-access (default:0) * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_STREAM_TYPE "stream-type" @@ -243,7 +243,7 @@ typedef enum { * @details The port to receive the packets from. * Data type is integer and default value is 5004. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_PORT "port" @@ -252,7 +252,7 @@ typedef enum { * @details The port to receive the video packets from. * Data type is integer. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_VIDEO_IN_PORT "video_in_port" @@ -261,7 +261,7 @@ typedef enum { * @details The port to receive the audio packets from. * Data type is integer. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_AUDIO_IN_PORT "audio_in_port" @@ -270,7 +270,7 @@ typedef enum { * @details The port to send the video packets to. * Data type is integer. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_VIDEO_OUT_PORT "video_out_port" @@ -279,7 +279,7 @@ typedef enum { * @details The port to send the audio packets to. * Data type is integer. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_AUDIO_OUT_PORT "audio_out_port" @@ -288,7 +288,7 @@ typedef enum { * @details IP address to send/receive packets for. * Data type is string and default value is "0.0.0.0". * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_IP_ADDRESS "address" @@ -298,7 +298,7 @@ typedef enum { * ex) "hw:0,0", "hw:0,1" * Data type is string and default value is "default". * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_AUDIO_DEVICE "audio_device" @@ -307,7 +307,7 @@ typedef enum { * @details Synchronize on the clock * Data type is boolean and default value is true. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_CLOCK_SYNCHRONIZED "sync" @@ -317,7 +317,7 @@ typedef enum { * 0:none/1:rotate 90 degree/2:rotate 180 degree/3:rotate 270 degree * Default value is 3(rotate 270 degree). * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_ROTATE "rotate" @@ -327,7 +327,7 @@ typedef enum { * 0:none, 1:horizontal, 2:vertical, 3:both * Default value is 0. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_FLIP "flip" @@ -343,7 +343,7 @@ typedef enum { * 5:Custom ROI * Default value is 0(Letter box). * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_DISPLAY_GEOMETRY_METHOD "display-geometry-method" @@ -352,7 +352,7 @@ typedef enum { * @details It is a object to draw video frame on. * Data type is Pointer. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_DISPLAY "display" @@ -361,7 +361,7 @@ typedef enum { * @details Draws screen or blacks out. * Data type is boolean and default value is true(visible). * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_VISIBLE "visible" @@ -370,7 +370,7 @@ typedef enum { * @details The host/IP/Multicast group to send the packets to. * Data type is string and default value is "localhost". * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_HOST "host" @@ -379,7 +379,7 @@ typedef enum { * @details Path for writing playlist from * Data type is string. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_SEGMENT_LOCATION "location" @@ -387,7 +387,7 @@ typedef enum { * @brief Definition for playlist location parameter of adaptive sink node. * @details Path for writing playlist from. Data type is string. * @since_tizen 3.0 - * @see media_streamer_node_get_params + * @see media_streamer_node_get_params() */ #define MEDIA_STREAMER_PARAM_PLAYLIST_LOCATION "playlist-location" @@ -404,7 +404,7 @@ typedef enum { * @param[in] error The error that occurred in media steamer * @param[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 + * This data will be accessible from media_streamer_error_cb() * @pre Create media streamer handle by calling media_streamer_create() function * @see media_streamer_set_error_cb() * @see media_streamer_unset_error_cb() @@ -420,7 +420,7 @@ typedef void (*media_streamer_error_cb)(media_streamer_h streamer, * @param[in] current_state The current state of media streamer * @param[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 + * This data will be accessible from media_streamer_state_changed_cb() * @pre Create media streamer handle by calling media_streamer_create() function * @see media_streamer_set_state_change_cb() * @see media_streamer_unset_state_change_cb() @@ -433,7 +433,7 @@ typedef void (*media_streamer_state_changed_cb)(media_streamer_h streamer, * @details This callback will be invoked when the buffer level drops below the threshold of max size * or no free space in custom source buffer. * @since_tizen 3.0 - * @remarks Callback can be applied only for MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM source type + * @remarks Callback can be applied only for #MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM source type * @param[in] node Media streamer source node handle * @param[in] status Media streamer custom buffer status * @param[in] user_data The user data passed from the callback registration function @@ -446,12 +446,12 @@ typedef void (*media_streamer_custom_buffer_status_cb)(media_streamer_node_h nod /** * @brief Called when new data is available from custom sink. - * @details This callback can be applied only to MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type + * @details This callback can be applied only to #MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type * @since_tizen 3.0 * @param[in] node Media streamer sink node handle * @param[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 + * This data will be accessible from media_streamer_sink_data_ready_cb() * @pre media_streamer_sink_set_data_ready_cb() * @see MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM * @see media_streamer_sink_set_data_ready_cb() @@ -461,12 +461,12 @@ typedef void (*media_streamer_sink_data_ready_cb)(media_streamer_node_h node, vo /** * @brief Called when the end-of-stream has been reached. - * @details This callback can be applied only to MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type + * @details This callback can be applied only to #MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type * @since_tizen 3.0 * @param[in] node Media streamer sink node handle * @param[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 + * This data will be accessible from media_streamer_sink_eos_cb() * @pre media_streamer_sink_set_eos_cb() * @see MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM * @see media_streamer_sink_set_eos_cb() @@ -505,7 +505,7 @@ typedef void (*media_streamer_interrupted_cb)(media_streamer_interrupted_code_e * @param[in] callback Callback function pointer * @param[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 + * This data will be accessible from media_streamer_error_cb() * @return @c 0 on success, * otherwise a negative error value * @retval #MEDIA_STREAMER_ERROR_NONE Successful @@ -538,7 +538,7 @@ int media_streamer_unset_error_cb(media_streamer_h streamer); * @param[in] callback Callback function pointer * @param[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 + * This data will be accessible from media_streamer_state_changed_cb() * @return @c 0 on success, * otherwise a negative error value * @retval #MEDIA_STREAMER_ERROR_NONE Successful @@ -596,7 +596,7 @@ int media_streamer_unset_interrupted_cb(media_streamer_h streamer); /** * @brief Sets a callback function to be invoked when buffer underrun or overflow is occurred. - * @details This function can be called only for MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM source type + * @details This function can be called only for #MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM source type * @since_tizen 3.0 * @remarks This function is used for media stream playback only. * @param[in] source Media streamer source node handle @@ -632,13 +632,13 @@ int media_streamer_src_unset_buffer_status_cb(media_streamer_node_h source); /** * @brief Sets a callback function to be called when the custom sink is ready for data processing. - * @details This function can be called only for MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type + * @details This function can be called only for #MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM sink type * @since_tizen 3.0 * @param[in] sink Media streamer sink node handle * @param[in] callback Callback function pointer * @param[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 + * This data will be accessible from media_streamer_sink_data_ready_cb() * @return @c 0 on success, * otherwise a negative error value * @retval #MEDIA_STREAMER_ERROR_NONE Successful @@ -672,7 +672,7 @@ int media_streamer_sink_unset_data_ready_cb(media_streamer_node_h sink); * @param[in] callback Callback function pointer * @param[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 + * This data will be accessible from media_streamer_sink_eos_cb() * @return @c 0 on success, * otherwise a negative error value * @retval #MEDIA_STREAMER_ERROR_NONE Successful @@ -716,7 +716,7 @@ int media_streamer_sink_unset_eos_cb(media_streamer_node_h sink); int media_streamer_create(media_streamer_h *streamer); /** - * @brief Sets media streamer state to MEDIA_STREAMER_STATE_READY. + * @brief Sets media streamer state to #MEDIA_STREAMER_STATE_READY. * @since_tizen 3.0 * @param[in] streamer Media streamer handle * @return @c 0 on success, @@ -725,7 +725,7 @@ int media_streamer_create(media_streamer_h *streamer); * @retval #MEDIA_STREAMER_ERROR_INVALID_STATE Invalid state * @retval #MEDIA_STREAMER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_STREAMER_ERROR_INVALID_OPERATION Invalid operation - * @pre The media streamer state must be set to MEDIA_STREAMER_STATE_IDLE + * @pre The media streamer state must be set to #MEDIA_STREAMER_STATE_IDLE * by calling media_streamer_create() or media_streamer_unprepare(). * @pre At least one src and one sink should be added and linked in the streamer * by calling media_streamer_node_create_src(), media_streamer_node_create_sink() and media_streamer_node_link(). @@ -736,7 +736,7 @@ int media_streamer_create(media_streamer_h *streamer); int media_streamer_prepare(media_streamer_h streamer); /** - * @brief Sets media streamer state to MEDIA_STREAMER_STATE_IDLE. + * @brief Sets media streamer state to #MEDIA_STREAMER_STATE_IDLE. * @details The most recently used media is reset and no longer associated with the media streamer. * @since_tizen 3.0 * @param[in] streamer Media streamer handle @@ -753,7 +753,7 @@ int media_streamer_prepare(media_streamer_h streamer); int media_streamer_unprepare(media_streamer_h streamer); /** - * @brief Sets media streamer state to MEDIA_STREAMER_STATE_PLAYING. + * @brief Sets media streamer state to #MEDIA_STREAMER_STATE_PLAYING. * @details Start running the current streamer, or resumes it if paused. * @since_tizen 3.0 * @param[in] streamer Media streamer handle @@ -815,7 +815,7 @@ int media_streamer_stop(media_streamer_h streamer); * Don't need to remove nodes by calling media_streamer_node_remove(). * If you want to change the node without destroying streamer handle, * you can call the media_streamer_node_remove() function - * after setting the streamer state to MEDIA_STREAMER_STATE_IDLE state. + * after setting the streamer state to #MEDIA_STREAMER_STATE_IDLE state. * @param[in] streamer Media streamer handle * @return @c 0 on success, * otherwise a negative error value @@ -871,8 +871,8 @@ int media_streamer_get_play_position(media_streamer_h streamer, int *time); /** * @brief Gets the total running time of the associated media. * @since_tizen 3.0 - * @remarks The streamer's src node type should be MEDIA_STREAMER_NODE_SRC_TYPE_FILE or MEDIA_STREAMER_NODE_SRC_TYPE_HTTP. - * If not, return value will be MEDIA_STREAMER_ERROR_NONE and duration will be -1. + * @remarks The streamer's src node type should be #MEDIA_STREAMER_NODE_SRC_TYPE_FILE or #MEDIA_STREAMER_NODE_SRC_TYPE_HTTP. + * If not, return value will be #MEDIA_STREAMER_ERROR_NONE and duration will be -1. * @param[in] streamer Media streamer handle * @param[out] duration The duration in milliseconds * @return @c 0 on success, @@ -903,9 +903,6 @@ int media_streamer_get_state(media_streamer_h streamer, media_streamer_state_e * /** * @brief Creates media streamer source node. * @since_tizen 3.0 - * @privilege http://tizen.org/privilege/internet - * http://tizen.org/privilege/camera - * http://tizen.org/privilege/recorder * @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. @@ -926,7 +923,7 @@ int media_streamer_node_create_src(media_streamer_node_src_type_e type, media_st /** * @brief Pushes packet into custom source node. - * @details This function can be called only for MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM. + * @details This function can be called only for #MEDIA_STREAMER_NODE_SRC_TYPE_CUSTOM. * @since_tizen 3.0 * @param[in] src Media streamer source node handle * @param[in] packet Media packet handle @@ -944,7 +941,6 @@ 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 - * @privilege http://tizen.org/privilege/internet * @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. @@ -965,7 +961,7 @@ int media_streamer_node_create_sink(media_streamer_node_sink_type_e type, media_ /** * @brief Pulls packet from custom sink node. - * @details This function can be called only for MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM + * @details This function can be called only for #MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM * @since_tizen 3.0 * @param[in] sink Media streamer sink node handle * @param[out] packet Media packet handle @@ -983,11 +979,11 @@ int media_streamer_node_create_sink(media_streamer_node_sink_type_e type, media_ int media_streamer_node_pull_packet(media_streamer_node_h sink, media_packet_h *packet); /** - * @brief Creates media streamer node except MEDIA_STREAMER_NODE_TYPE_SRC and MEDIA_STREAMER_NODE_TYPE_SINK. + * @brief Creates media streamer node except #MEDIA_STREAMER_NODE_TYPE_SRC and #MEDIA_STREAMER_NODE_TYPE_SINK. * @details Creates node specific @a type with specific format of input * 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. + * @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. * You can release @a node using media_streamer_node_destroy() function * @param[in] type Created node type @@ -1048,7 +1044,7 @@ int media_streamer_node_destroy(media_streamer_node_h node); /** * @brief Removes media streamer node from streamer. * @since_tizen 3.0 - * @remarks To remove node without error posting, the state of streamer should be MEDIA_STREAMER_STATE_IDLE. + * @remarks To remove node without error posting, the state of streamer should be #MEDIA_STREAMER_STATE_IDLE. * If the node is linked, it will be unlinked before removing. * @param[in] streamer Media streamer handle * @param[in] node Media streamer node handle @@ -1158,8 +1154,6 @@ 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 - * @privilege http://tizen.org/privilege/mediastorage - * http://tizen.org/privilege/externalstorage * @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 @@ -1206,8 +1200,6 @@ 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 - * @privilege http://tizen.org/privilege/mediastorage - * http://tizen.org/privilege/externalstorage * @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 -- 2.7.4 From 15805119a1ce150b940d1deef3a6a61cd0f221b7 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Fri, 21 Jun 2019 14:11:32 +0900 Subject: [PATCH 05/16] Clarify autoplug test case Change-Id: I28da784be128c561bf899513227a6f92c3f3aee1 Signed-off-by: Hyunil --- test/media_streamer_test.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 11eafcc..9497984 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -35,7 +35,7 @@ typedef enum { MENU_STATE_MAIN_MENU, MENU_STATE_BROADCAST_MENU, MENU_STATE_VOIP_MENU, - MENU_STATE_PLAYING_MENU, + MENU_STATE_AUTOPLUG_PLAYING_MENU, MENU_STATE_PRESET_MENU, MENU_STATE_ADAPTIVE_MENU, } menu_state_e; @@ -48,7 +48,7 @@ typedef enum { SUBMENU_STATE_GETTING_SUBFILE_URI, SUBMENU_STATE_AUTOPLUG, SUBMENU_STATE_SCENARIO, - SUBMENU_STATE_PLAYING_SCENARIO, + SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO, SUBMENU_STATE_FORMAT, SUBMENU_STATE_ADAPTIVE_SCENARIO, } submenu_state_e; @@ -1048,7 +1048,7 @@ static void display_scenario_select_menu(void) } -static void display_playing_scenario_select_menu(void) +static void display_autoplug_playing_scenario_select_menu(void) { g_print("\n"); g_print("====================================================\n"); @@ -1142,7 +1142,7 @@ static void display_main_menu(void) g_print("----------------------------------------------------\n"); g_print("1. Broadcast \n"); g_print("2. VOIP \n"); - g_print("3. Local Playing \n"); + g_print("3. Local Playing (link: Autoplug) \n"); g_print("4. Adaptive \n"); g_print("q. quit \n"); g_print("----------------------------------------------------\n"); @@ -1162,7 +1162,7 @@ static void display_menu(void) case MENU_STATE_VOIP_MENU: display_voip_menu(); break; - case MENU_STATE_PLAYING_MENU: + case MENU_STATE_AUTOPLUG_PLAYING_MENU: display_preset_menu(); break; case MENU_STATE_PRESET_MENU: @@ -1195,8 +1195,8 @@ static void display_menu(void) case SUBMENU_STATE_SCENARIO: display_scenario_select_menu(); break; - case SUBMENU_STATE_PLAYING_SCENARIO: - display_playing_scenario_select_menu(); + case SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO: + display_autoplug_playing_scenario_select_menu(); break; case SUBMENU_STATE_ADAPTIVE_SCENARIO: display_adaptive_scenario_select_menu(); @@ -1314,7 +1314,7 @@ void _interpret_main_menu(char *cmd) else if (!strncmp(cmd, "2", len)) g_menu_state = MENU_STATE_VOIP_MENU; else if (!strncmp(cmd, "3", len)) - g_menu_state = MENU_STATE_PLAYING_MENU; + g_menu_state = MENU_STATE_AUTOPLUG_PLAYING_MENU; else if (!strncmp(cmd, "4", len)) g_menu_state = MENU_STATE_ADAPTIVE_MENU; else if (!strncmp(cmd, "q", len)) @@ -1407,7 +1407,7 @@ void _interpret_adaptive_scenario_menu(char *cmd) g_sub_menu_state = SUBMENU_STATE_UNKNOWN; } -void _interpret_playing_scenario_menu(char *cmd) +void _interpret_autoplug_playing_scenario_menu(char *cmd) { int len = strlen(cmd); @@ -1536,7 +1536,7 @@ void _interpret_getting_sub_uri_menu(char *cmd) return; } - if (g_menu_state == MENU_STATE_PLAYING_MENU) { + if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU) { run_playing_preset(); g_sub_menu_state = SUBMENU_STATE_UNKNOWN; } else { @@ -1558,7 +1558,7 @@ void _interpret_getting_uri_menu(char *cmd) } g_print("_interpret_getting_uri_menu %d %d %d", g_menu_state, g_sub_menu_state, g_scenario_mode); - if (g_menu_state == MENU_STATE_PLAYING_MENU) { + if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU) { if (g_scenario_mode == SCENARIO_MODE_FILE_SUBTITLE_VIDEO_AUDIO) { g_sub_menu_state = SUBMENU_STATE_GETTING_SUBFILE_URI; } else { @@ -1619,8 +1619,8 @@ void _interpret_preset_menu(char *cmd) } else if (!strncmp(cmd, "2", len)) { /* call the run_preset function after autoplug mode was selected; */ - if (g_menu_state == MENU_STATE_PLAYING_MENU) - g_sub_menu_state = SUBMENU_STATE_PLAYING_SCENARIO; + if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU) + g_sub_menu_state = SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO; else if (g_menu_state == MENU_STATE_ADAPTIVE_MENU) g_sub_menu_state = SUBMENU_STATE_ADAPTIVE_SCENARIO; else @@ -1669,7 +1669,7 @@ static void interpret_cmd(char *cmd) case MENU_STATE_VOIP_MENU: _interpret_voip_menu(cmd); break; - case MENU_STATE_PLAYING_MENU: + case MENU_STATE_AUTOPLUG_PLAYING_MENU: _interpret_preset_menu(cmd); break; case MENU_STATE_PRESET_MENU: @@ -1703,8 +1703,8 @@ static void interpret_cmd(char *cmd) case SUBMENU_STATE_SCENARIO: _interpret_scenario_menu(cmd); break; - case SUBMENU_STATE_PLAYING_SCENARIO: - _interpret_playing_scenario_menu(cmd); + case SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO: + _interpret_autoplug_playing_scenario_menu(cmd); break; case SUBMENU_STATE_ADAPTIVE_SCENARIO: _interpret_adaptive_scenario_menu(cmd); -- 2.7.4 From c098c78aa43ec16e547428ddb34cb9f8da77e183 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Fri, 28 Jun 2019 16:12:20 +0900 Subject: [PATCH 06/16] Add static link test menu for local playing Change-Id: If4be71dc76affa99dfa64af55e6fdf9a00f1e71c Signed-off-by: Hyunil --- test/media_streamer_test.c | 57 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 9497984..033bb1a 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -36,6 +36,7 @@ typedef enum { MENU_STATE_BROADCAST_MENU, MENU_STATE_VOIP_MENU, MENU_STATE_AUTOPLUG_PLAYING_MENU, + MENU_STATE_STATIC_LINK_PLAYING_MENU, MENU_STATE_PRESET_MENU, MENU_STATE_ADAPTIVE_MENU, } menu_state_e; @@ -49,6 +50,7 @@ typedef enum { SUBMENU_STATE_AUTOPLUG, SUBMENU_STATE_SCENARIO, SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO, + SUBMENU_STATE_STATIC_LINK_PLAYING_SCENARIO, SUBMENU_STATE_FORMAT, SUBMENU_STATE_ADAPTIVE_SCENARIO, } submenu_state_e; @@ -1052,7 +1054,7 @@ static void display_autoplug_playing_scenario_select_menu(void) { g_print("\n"); g_print("====================================================\n"); - g_print(" media streamer test: Playing menu v0.3\n"); + g_print(" media streamer test: Playing(Autoplug) menu v0.3\n"); g_print("----------------------------------------------------\n"); g_print("\n"); g_print("Please select Playing Scenario mode\n"); @@ -1066,6 +1068,21 @@ static void display_autoplug_playing_scenario_select_menu(void) g_print("====================================================\n"); } +static void display_static_link_playing_scenario_select_menu(void) +{ + g_print("\n"); + g_print("====================================================\n"); + g_print(" media streamer test: Playing(static link) menu v0.3\n"); + g_print("----------------------------------------------------\n"); + g_print("\n"); + g_print("Please select Playing Scenario mode\n"); + g_print("By default will be used [%d] mode\n", g_scenario_mode); + g_print("1. Appsrc -> Appsink \n"); + g_print("b. back \n"); + g_print("----------------------------------------------------\n"); + g_print("====================================================\n"); +} + static void display_adaptive_scenario_select_menu(void) { g_print("\n"); @@ -1143,7 +1160,8 @@ static void display_main_menu(void) g_print("1. Broadcast \n"); g_print("2. VOIP \n"); g_print("3. Local Playing (link: Autoplug) \n"); - g_print("4. Adaptive \n"); + g_print("4. Local Playing (link: static) \n"); + g_print("5. Adaptive \n"); g_print("q. quit \n"); g_print("----------------------------------------------------\n"); g_print("====================================================\n"); @@ -1163,11 +1181,8 @@ static void display_menu(void) display_voip_menu(); break; case MENU_STATE_AUTOPLUG_PLAYING_MENU: - display_preset_menu(); - break; + case MENU_STATE_STATIC_LINK_PLAYING_MENU: case MENU_STATE_PRESET_MENU: - display_preset_menu(); - break; case MENU_STATE_ADAPTIVE_MENU: display_preset_menu(); break; @@ -1198,6 +1213,9 @@ static void display_menu(void) case SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO: display_autoplug_playing_scenario_select_menu(); break; + case SUBMENU_STATE_STATIC_LINK_PLAYING_SCENARIO: + display_static_link_playing_scenario_select_menu(); + break; case SUBMENU_STATE_ADAPTIVE_SCENARIO: display_adaptive_scenario_select_menu(); break; @@ -1316,6 +1334,8 @@ void _interpret_main_menu(char *cmd) else if (!strncmp(cmd, "3", len)) g_menu_state = MENU_STATE_AUTOPLUG_PLAYING_MENU; else if (!strncmp(cmd, "4", len)) + g_menu_state = MENU_STATE_STATIC_LINK_PLAYING_MENU; + else if (!strncmp(cmd, "5", len)) g_menu_state = MENU_STATE_ADAPTIVE_MENU; else if (!strncmp(cmd, "q", len)) quit(); @@ -1424,8 +1444,19 @@ void _interpret_autoplug_playing_scenario_menu(char *cmd) g_scenario_mode = SCENARIO_MODE_HTTP_VIDEO_AUDIO; g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; return; - } else if (!strncmp(cmd, "4", len)) { + } + } + g_sub_menu_state = SUBMENU_STATE_UNKNOWN; +} + +void _interpret_static_link_playing_scenario_menu(char *cmd) +{ + int len = strlen(cmd); + + if (len == 1) { + if (!strncmp(cmd, "1", len)) { g_scenario_mode = SCENARIO_MODE_APPSRC_APPSINK; + return; } } g_sub_menu_state = SUBMENU_STATE_UNKNOWN; @@ -1558,7 +1589,7 @@ void _interpret_getting_uri_menu(char *cmd) } g_print("_interpret_getting_uri_menu %d %d %d", g_menu_state, g_sub_menu_state, g_scenario_mode); - if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU) { + if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU || g_menu_state == MENU_STATE_STATIC_LINK_PLAYING_MENU) { if (g_scenario_mode == SCENARIO_MODE_FILE_SUBTITLE_VIDEO_AUDIO) { g_sub_menu_state = SUBMENU_STATE_GETTING_SUBFILE_URI; } else { @@ -1621,6 +1652,8 @@ void _interpret_preset_menu(char *cmd) /* call the run_preset function after autoplug mode was selected; */ if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU) g_sub_menu_state = SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO; + if (g_menu_state == MENU_STATE_STATIC_LINK_PLAYING_MENU) + g_sub_menu_state = SUBMENU_STATE_STATIC_LINK_PLAYING_SCENARIO; else if (g_menu_state == MENU_STATE_ADAPTIVE_MENU) g_sub_menu_state = SUBMENU_STATE_ADAPTIVE_SCENARIO; else @@ -1670,11 +1703,8 @@ static void interpret_cmd(char *cmd) _interpret_voip_menu(cmd); break; case MENU_STATE_AUTOPLUG_PLAYING_MENU: - _interpret_preset_menu(cmd); - break; + case MENU_STATE_STATIC_LINK_PLAYING_MENU: case MENU_STATE_PRESET_MENU: - _interpret_preset_menu(cmd); - break; case MENU_STATE_ADAPTIVE_MENU: _interpret_preset_menu(cmd); break; @@ -1706,6 +1736,9 @@ static void interpret_cmd(char *cmd) case SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO: _interpret_autoplug_playing_scenario_menu(cmd); break; + case SUBMENU_STATE_STATIC_LINK_PLAYING_SCENARIO: + _interpret_static_link_playing_scenario_menu(cmd); + break; case SUBMENU_STATE_ADAPTIVE_SCENARIO: _interpret_adaptive_scenario_menu(cmd); break; -- 2.7.4 From a3e7d23141cc33116cf5ef9d208348829ec07c05 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 2 Jul 2019 14:19:51 +0900 Subject: [PATCH 07/16] Add gcov package for measuring line coverage Change-Id: I42758506055fe93fbaf771ae728636102ce4d882 Signed-off-by: Hyunil --- packaging/capi-media-streamer.spec | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packaging/capi-media-streamer.spec b/packaging/capi-media-streamer.spec index 589049b..7419ef7 100644 --- a/packaging/capi-media-streamer.spec +++ b/packaging/capi-media-streamer.spec @@ -45,6 +45,15 @@ Requires: %{name} = %{version}-%{release} %description devel MediaStreamer Library in Tizen Native API (DEV). +%if 0%{?gcov:1} +%package gcov +Summary: Line Coverage of MediaStreamer library in Tizen C API +Group: Development/Multimedia + +%description gcov +Collection of files related to Line Coverage. It is teseted as gcov for a MediaStreamer library in Tizen native API +%endif + %prep %setup -q cp %{SOURCE1001} . @@ -67,6 +76,11 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` make %{?jobs:-j%jobs} +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_bindir} @@ -75,6 +89,10 @@ cp test/media_streamer_test %{buildroot}%{_bindir} mkdir -p %{buildroot}/usr/etc %make_install +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif %post /sbin/ldconfig @@ -93,3 +111,8 @@ mkdir -p %{buildroot}/usr/etc %{_includedir}/media/*.h %{_libdir}/pkgconfig/*.pc %{_libdir}/lib%{name}.so + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif -- 2.7.4 From 135d12cbeb753c3bf0092c4bb56754657e95f036 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Wed, 3 Jul 2019 15:24:48 +0900 Subject: [PATCH 08/16] Add display_menu to Appsink/src test Change-Id: Ib9b18b337ef5ba4d399d347ecc643ac071c90ca7 Signed-off-by: Hyunil --- test/media_streamer_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 033bb1a..8c480c3 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -1456,10 +1456,10 @@ void _interpret_static_link_playing_scenario_menu(char *cmd) if (len == 1) { if (!strncmp(cmd, "1", len)) { g_scenario_mode = SCENARIO_MODE_APPSRC_APPSINK; + g_sub_menu_state = SUBMENU_STATE_UNKNOWN; return; } } - g_sub_menu_state = SUBMENU_STATE_UNKNOWN; } void _interpret_scenario_menu(char *cmd) @@ -1652,7 +1652,7 @@ void _interpret_preset_menu(char *cmd) /* call the run_preset function after autoplug mode was selected; */ if (g_menu_state == MENU_STATE_AUTOPLUG_PLAYING_MENU) g_sub_menu_state = SUBMENU_STATE_AUTOPLUG_PLAYING_SCENARIO; - if (g_menu_state == MENU_STATE_STATIC_LINK_PLAYING_MENU) + else if (g_menu_state == MENU_STATE_STATIC_LINK_PLAYING_MENU) g_sub_menu_state = SUBMENU_STATE_STATIC_LINK_PLAYING_SCENARIO; else if (g_menu_state == MENU_STATE_ADAPTIVE_MENU) g_sub_menu_state = SUBMENU_STATE_ADAPTIVE_SCENARIO; -- 2.7.4 From d87f8d45af10de3c42288178d1d5f94db137580a Mon Sep 17 00:00:00 2001 From: Hyunil Date: Wed, 3 Jul 2019 15:39:17 +0900 Subject: [PATCH 09/16] Rename enum string for sharing with audio file Change-Id: Ic36bfcfaf3061014d905891d97dae55386274ca0 Signed-off-by: Hyunil --- test/media_streamer_test.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 8c480c3..2194337 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -45,7 +45,7 @@ typedef enum { SUBMENU_STATE_UNKNOWN, SUBMENU_STATE_GETTING_IP, SUBMENU_STATE_GETTING_SEEK_POS, - SUBMENU_STATE_GETTING_VIDEOFILE_URI, + SUBMENU_STATE_GETTING_FILE_URI, SUBMENU_STATE_GETTING_SUBFILE_URI, SUBMENU_STATE_AUTOPLUG, SUBMENU_STATE_SCENARIO, @@ -1198,7 +1198,7 @@ static void display_menu(void) case SUBMENU_STATE_GETTING_SEEK_POS: display_getting_seek_position_menu(); break; - case SUBMENU_STATE_GETTING_VIDEOFILE_URI: + case SUBMENU_STATE_GETTING_FILE_URI: display_getting_uri_menu(); break; case SUBMENU_STATE_GETTING_SUBFILE_URI: @@ -1408,19 +1408,19 @@ void _interpret_adaptive_scenario_menu(char *cmd) if (len == 1) { if (!strncmp(cmd, "1", len)) { g_scenario_mode = SCENARIO_MODE_ADAPTIVE_SERVER; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } else if (!strncmp(cmd, "2", len)) { g_scenario_mode = SCENARIO_MODE_ADAPTIVE_SERVER_MANUAL; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } else if (!strncmp(cmd, "3", len)) { g_scenario_mode = SCENARIO_MODE_ADAPTIVE_CLIENT_AUTO; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } else if (!strncmp(cmd, "4", len)) { g_scenario_mode = SCENARIO_MODE_ADAPTIVE_CLIENT_MANUAL; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } } @@ -1434,15 +1434,15 @@ void _interpret_autoplug_playing_scenario_menu(char *cmd) if (len == 1) { if (!strncmp(cmd, "1", len)) { g_scenario_mode = SCENARIO_MODE_FILE_PLAY_VIDEO_AUDIO; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } else if (!strncmp(cmd, "2", len)) { g_scenario_mode = SCENARIO_MODE_FILE_SUBTITLE_VIDEO_AUDIO; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } else if (!strncmp(cmd, "3", len)) { g_scenario_mode = SCENARIO_MODE_HTTP_VIDEO_AUDIO; - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; return; } } @@ -1508,7 +1508,7 @@ void _interpret_scenario_menu(char *cmd) g_video_is_on = TRUE; g_audio_is_on = TRUE; if (g_menu_preset == PRESET_RTP_STREAMER) { - g_sub_menu_state = SUBMENU_STATE_GETTING_VIDEOFILE_URI; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; } else if (g_menu_preset == PRESET_RTP_CLIENT) { create_formats(); media_streamer_node_h rtp_bin = _create_rtp(VIDEO_PORT, AUDIO_PORT, TRUE); @@ -1721,7 +1721,7 @@ static void interpret_cmd(char *cmd) case SUBMENU_STATE_GETTING_SEEK_POS: _interpret_getting_seek_position_menu(cmd); break; - case SUBMENU_STATE_GETTING_VIDEOFILE_URI: + case SUBMENU_STATE_GETTING_FILE_URI: _interpret_getting_uri_menu(cmd); break; case SUBMENU_STATE_GETTING_SUBFILE_URI: -- 2.7.4 From 9f5cdc5f28ea86a1b3f87d891c5d61f5beb91a9f Mon Sep 17 00:00:00 2001 From: Hyunil Date: Thu, 4 Jul 2019 14:14:11 +0900 Subject: [PATCH 10/16] Specify the audio, video and container format in detail. Change-Id: Ia40c7d9da016345c0ebe536615a8f5a23eb529b9 Signed-off-by: Hyunil --- test/media_streamer_test.c | 100 ++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 2194337..fa23dc3 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -138,15 +138,15 @@ gboolean g_autoplug_mode = FALSE; gboolean g_video_is_on = FALSE; gboolean g_audio_is_on = FALSE; -media_format_h vfmt_raw = NULL; +media_format_h vfmt_i420 = NULL; media_format_h vfmt_encoded = NULL; -media_format_h vfmt_aenc = NULL; -media_format_h afmt_raw = NULL; -media_format_h afmt_araw = NULL; +media_format_h vfmt_h264 = NULL; +media_format_h afmt_pcm = NULL; +media_format_h afmt_f32le = NULL; media_format_h afmt_encoded = NULL; -media_format_h afmt_aenc = NULL; -media_format_h tsfmt = NULL; -media_format_h qtfmt = NULL; +media_format_h afmt_aac = NULL; +media_format_h cfmt_mpeg2ts = NULL; +media_format_h cfmt_mp4 = NULL; static int app_create(void *data); static int app_terminate(void *data); @@ -320,18 +320,18 @@ static void _destroy(media_streamer_h streamer) static void create_formats(void) { - if (!vfmt_raw || !vfmt_encoded || !afmt_raw) + if (!vfmt_i420 || !vfmt_encoded || !afmt_pcm) g_print("Formats already created!\n"); /* Define video raw format */ - media_format_create(&vfmt_raw); - if (media_format_set_video_mime(vfmt_raw, MEDIA_FORMAT_I420) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&vfmt_i420); + if (media_format_set_video_mime(vfmt_i420, MEDIA_FORMAT_I420) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_video_mime failed!"); - media_format_set_video_width(vfmt_raw, VIDEO_WIDTH); - media_format_set_video_height(vfmt_raw, VIDEO_HIGHT); - media_format_set_video_avg_bps(vfmt_raw, VIDEO_AVG_BPS); - media_format_set_video_max_bps(vfmt_raw, VIDEO_MAX_BPS); + media_format_set_video_width(vfmt_i420, VIDEO_WIDTH); + media_format_set_video_height(vfmt_i420, VIDEO_HIGHT); + media_format_set_video_avg_bps(vfmt_i420, VIDEO_AVG_BPS); + media_format_set_video_max_bps(vfmt_i420, VIDEO_MAX_BPS); /* Define encoded video format */ media_format_create(&vfmt_encoded); @@ -344,30 +344,30 @@ static void create_formats(void) media_format_set_video_max_bps(vfmt_encoded, VIDEO_MAX_BPS); /* Define encoded video format for adaptive stream */ - media_format_create(&vfmt_aenc); - if (media_format_set_video_mime(vfmt_aenc, MEDIA_FORMAT_H264_SP) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&vfmt_h264); + if (media_format_set_video_mime(vfmt_h264, MEDIA_FORMAT_H264_SP) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_video_mime failed!"); - media_format_set_video_width(vfmt_aenc, VIDEO_WIDTH); - media_format_set_video_height(vfmt_aenc, VIDEO_HIGHT); - media_format_set_video_avg_bps(vfmt_aenc, VIDEO_AVG_BPS); - media_format_set_video_max_bps(vfmt_aenc, VIDEO_MAX_BPS); + media_format_set_video_width(vfmt_h264, VIDEO_WIDTH); + media_format_set_video_height(vfmt_h264, VIDEO_HIGHT); + media_format_set_video_avg_bps(vfmt_h264, VIDEO_AVG_BPS); + media_format_set_video_max_bps(vfmt_h264, VIDEO_MAX_BPS); /* Define audio raw format */ - media_format_create(&afmt_raw); - if (media_format_set_audio_mime(afmt_raw, MEDIA_FORMAT_PCM) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&afmt_pcm); + if (media_format_set_audio_mime(afmt_pcm, MEDIA_FORMAT_PCM) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_audio_mime failed!"); - media_format_set_audio_channel(afmt_raw, AUDIO_CHANNEL); - media_format_set_audio_samplerate(afmt_raw, AUDIO_SAMPLERATE); + media_format_set_audio_channel(afmt_pcm, AUDIO_CHANNEL); + media_format_set_audio_samplerate(afmt_pcm, AUDIO_SAMPLERATE); /* Define audio raw format for adaptive streaming */ - media_format_create(&afmt_araw); - if (media_format_set_audio_mime(afmt_araw, MEDIA_FORMAT_PCM_F32LE) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&afmt_f32le); + if (media_format_set_audio_mime(afmt_f32le, MEDIA_FORMAT_PCM_F32LE) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_audio_mime failed!"); - media_format_set_audio_channel(afmt_araw, AUDIO_CHANNEL); - media_format_set_audio_samplerate(afmt_araw, AUDIO_SAMPLERATE); + media_format_set_audio_channel(afmt_f32le, AUDIO_CHANNEL); + media_format_set_audio_samplerate(afmt_f32le, AUDIO_SAMPLERATE); /* Define audio encoded format */ media_format_create(&afmt_encoded); @@ -378,21 +378,21 @@ static void create_formats(void) media_format_set_audio_samplerate(afmt_encoded, AUDIO_SAMPLERATE); /* Define audio encoded format for adaptive stream */ - media_format_create(&afmt_aenc); - if (media_format_set_audio_mime(afmt_aenc, MEDIA_FORMAT_AAC) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&afmt_aac); + if (media_format_set_audio_mime(afmt_aac, MEDIA_FORMAT_AAC) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_audio_mime failed!"); - media_format_set_audio_channel(afmt_aenc, AUDIO_CHANNEL); - media_format_set_audio_samplerate(afmt_aenc, AUDIO_SAMPLERATE); - media_format_set_audio_aac_type(afmt_aenc, TRUE); + media_format_set_audio_channel(afmt_aac, AUDIO_CHANNEL); + media_format_set_audio_samplerate(afmt_aac, AUDIO_SAMPLERATE); + media_format_set_audio_aac_type(afmt_aac, TRUE); /* Define mpegts stream format */ - media_format_create(&tsfmt); - if (media_format_set_container_mime(tsfmt, MEDIA_FORMAT_CONTAINER_MPEG2TS) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&cfmt_mpeg2ts); + if (media_format_set_container_mime(cfmt_mpeg2ts, MEDIA_FORMAT_CONTAINER_MPEG2TS) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_container_mime failed!"); /* Define MP4 stream format */ - media_format_create(&qtfmt); - if (media_format_set_container_mime(qtfmt, MEDIA_FORMAT_CONTAINER_MP4) != MEDIA_FORMAT_ERROR_NONE) + media_format_create(&cfmt_mp4); + if (media_format_set_container_mime(cfmt_mp4, MEDIA_FORMAT_CONTAINER_MP4) != MEDIA_FORMAT_ERROR_NONE) g_print("media_format_set_container_mime failed!"); } @@ -537,7 +537,7 @@ static void _create_rtp_streamer(media_streamer_node_h rtp_bin) /*********************** encoder **************************************** */ media_streamer_node_h video_enc = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER, vfmt_raw, vfmt_encoded, &video_enc); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER, vfmt_i420, vfmt_encoded, &video_enc); media_streamer_node_add(current_media_streamer, video_enc); APPEND_NODE(video_enc); @@ -570,7 +570,7 @@ static void _create_rtp_streamer(media_streamer_node_h rtp_bin) /*********************** audioencoder *********************************** */ media_streamer_node_h audio_enc = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER, afmt_raw, afmt_encoded, &audio_enc); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER, afmt_pcm, afmt_encoded, &audio_enc); media_streamer_node_add(current_media_streamer, audio_enc); APPEND_NODE(audio_enc); @@ -639,7 +639,7 @@ static void _create_rtp_client(media_streamer_node_h rtp_bin) /* ********************** videodec ************************************ */ media_streamer_node_h video_dec = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_encoded, vfmt_raw, &video_dec); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_encoded, vfmt_i420, &video_dec); media_streamer_node_add(current_media_streamer, video_dec); APPEND_NODE(video_dec); @@ -755,32 +755,32 @@ static void _create_adaptive_server_manual() APPEND_NODE(file_src); media_streamer_node_h qt_demux = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_DEMUXER, qtfmt, NULL, &qt_demux); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_DEMUXER, cfmt_mp4, NULL, &qt_demux); media_streamer_node_add(current_media_streamer, qt_demux); APPEND_NODE(qt_demux); media_streamer_node_h video_dec = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_aenc, vfmt_raw, &video_dec); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_h264, vfmt_i420, &video_dec); media_streamer_node_add(current_media_streamer, video_dec); APPEND_NODE(video_dec); media_streamer_node_h audio_dec = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_aenc, afmt_araw, &audio_dec); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_aac, afmt_f32le, &audio_dec); media_streamer_node_add(current_media_streamer, audio_dec); APPEND_NODE(audio_dec); media_streamer_node_h video_enc = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER, vfmt_raw, vfmt_aenc, &video_enc); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER, vfmt_i420, vfmt_h264, &video_enc); media_streamer_node_add(current_media_streamer, video_enc); APPEND_NODE(video_enc); media_streamer_node_h audio_enc = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER, afmt_araw, afmt_aenc, &audio_enc); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER, afmt_f32le, afmt_aac, &audio_enc); media_streamer_node_add(current_media_streamer, audio_enc); APPEND_NODE(audio_enc); media_streamer_node_h ts_mux = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_MUXER, NULL, tsfmt, &ts_mux); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_MUXER, NULL, cfmt_mpeg2ts, &ts_mux); media_streamer_node_add(current_media_streamer, ts_mux); APPEND_NODE(ts_mux); @@ -832,17 +832,17 @@ static void _create_adaptive_playing_manual() APPEND_NODE(adaptive_src); media_streamer_node_h ts_demux = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_DEMUXER, tsfmt, NULL, &ts_demux); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_DEMUXER, cfmt_mpeg2ts, NULL, &ts_demux); media_streamer_node_add(current_media_streamer, ts_demux); APPEND_NODE(ts_demux); media_streamer_node_h video_dec = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_aenc, vfmt_raw, &video_dec); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_h264, vfmt_i420, &video_dec); media_streamer_node_add(current_media_streamer, video_dec); APPEND_NODE(video_dec); media_streamer_node_h audio_dec = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_aenc, afmt_araw, &audio_dec); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_aac, afmt_f32le, &audio_dec); media_streamer_node_add(current_media_streamer, audio_dec); APPEND_NODE(audio_dec); @@ -923,7 +923,7 @@ static void _create_app_test() /* ********************** app_sink *********************************** */ media_streamer_node_h app_sink = NULL; media_streamer_node_create_sink(MEDIA_STREAMER_NODE_SINK_TYPE_CUSTOM, &app_sink); - media_streamer_node_set_pad_format(app_sink, "sink", vfmt_raw); + media_streamer_node_set_pad_format(app_sink, "sink", vfmt_i420); media_streamer_node_add(current_media_streamer, app_sink); APPEND_NODE(app_sink); -- 2.7.4 From 31dcf1aa8f005b12872f186a86f011204c9f0339 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Fri, 5 Jul 2019 11:38:46 +0900 Subject: [PATCH 11/16] Add static link test for aac file playing Change-Id: I10691e3ff5e68edb24e7b224231927461d35197e Signed-off-by: Hyunil --- test/media_streamer_test.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index fa23dc3..70c8f7f 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -87,6 +87,7 @@ typedef enum { SCENARIO_MODE_ADAPTIVE_SERVER_MANUAL, SCENARIO_MODE_ADAPTIVE_CLIENT_AUTO, SCENARIO_MODE_ADAPTIVE_CLIENT_MANUAL, + SCENARIO_MODE_FILE_PLAY_AAC_AUDIO } scenario_mode_e; #define PACKAGE "media_streamer_test" @@ -459,6 +460,28 @@ static void _create_file_playing() APPEND_NODE(audio_sink); } +static void _create_static_audio_aac_playing() +{ + media_streamer_node_h filesrc = NULL; + media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_FILE, &filesrc); + media_streamer_node_set_param(filesrc, MEDIA_STREAMER_PARAM_URI, g_uri); + media_streamer_node_add(current_media_streamer, filesrc); + APPEND_NODE(filesrc); + + media_streamer_node_h audio_decoder = NULL; + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_aac, afmt_pcm, &audio_decoder); + media_streamer_node_add(current_media_streamer, audio_decoder); + APPEND_NODE(audio_decoder); + + media_streamer_node_h audiosink = NULL; + media_streamer_node_create_sink(MEDIA_STREAMER_NODE_SINK_TYPE_AUDIO, &audiosink); + media_streamer_node_add(current_media_streamer, audiosink); + APPEND_NODE(audiosink); + + media_streamer_node_link(filesrc, "src", audio_decoder, "sink"); + media_streamer_node_link(audio_decoder, "src", audiosink, "sink"); +} + static void _create_file_sub_playing() { media_streamer_node_h file_sub_src = NULL; @@ -1077,7 +1100,8 @@ static void display_static_link_playing_scenario_select_menu(void) g_print("\n"); g_print("Please select Playing Scenario mode\n"); g_print("By default will be used [%d] mode\n", g_scenario_mode); - g_print("1. Appsrc -> Appsink \n"); + g_print("1. Appsrc -> Appsink\n"); + g_print("2. Audio File(aac) playing\n"); g_print("b. back \n"); g_print("----------------------------------------------------\n"); g_print("====================================================\n"); @@ -1294,6 +1318,8 @@ void run_playing_preset(void) if (g_scenario_mode == SCENARIO_MODE_FILE_PLAY_VIDEO_AUDIO) _create_file_playing(); + else if (g_scenario_mode == SCENARIO_MODE_FILE_PLAY_AAC_AUDIO) + _create_static_audio_aac_playing(); else if (g_scenario_mode == SCENARIO_MODE_FILE_SUBTITLE_VIDEO_AUDIO) _create_file_sub_playing(); else if (g_scenario_mode == SCENARIO_MODE_HTTP_VIDEO_AUDIO) @@ -1456,10 +1482,15 @@ void _interpret_static_link_playing_scenario_menu(char *cmd) if (len == 1) { if (!strncmp(cmd, "1", len)) { g_scenario_mode = SCENARIO_MODE_APPSRC_APPSINK; - g_sub_menu_state = SUBMENU_STATE_UNKNOWN; + } + else if (!strncmp(cmd, "2", len)) { + g_scenario_mode = SCENARIO_MODE_FILE_PLAY_AAC_AUDIO; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; + g_printf("g_sub_menu_state (%d)\n", g_sub_menu_state); return; } } + g_sub_menu_state = SUBMENU_STATE_UNKNOWN; } void _interpret_scenario_menu(char *cmd) -- 2.7.4 From 3cccc28920a72c03d4cb1d828a1b6d78a14fda25 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Mon, 8 Jul 2019 15:34:24 +0900 Subject: [PATCH 12/16] Add void to empty param function Change-Id: I2fda06f2f813f5cb7e8443c5e9bf6e7303a6a704 Signed-off-by: Hyunil --- test/media_streamer_test.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 70c8f7f..953e213 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -438,7 +438,7 @@ static void set_rtp_params(media_streamer_node_h rtp_node, const char *ip, int v bundle_free(params); } -static void _create_file_playing() +static void _create_file_playing(void) { media_streamer_node_h file_src = NULL; media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_FILE, &file_src); @@ -460,7 +460,7 @@ static void _create_file_playing() APPEND_NODE(audio_sink); } -static void _create_static_audio_aac_playing() +static void _create_static_audio_aac_playing(void) { media_streamer_node_h filesrc = NULL; media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_FILE, &filesrc); @@ -482,7 +482,7 @@ static void _create_static_audio_aac_playing() media_streamer_node_link(audio_decoder, "src", audiosink, "sink"); } -static void _create_file_sub_playing() +static void _create_file_sub_playing(void) { media_streamer_node_h file_sub_src = NULL; media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_FILE, &file_sub_src); @@ -510,7 +510,7 @@ static void _create_file_sub_playing() APPEND_NODE(audio_sink); } -static void _create_file_streaming() +static void _create_file_streaming(void) { g_print("\n _create_file_playing \n"); media_streamer_node_h file_src = NULL; @@ -520,7 +520,7 @@ static void _create_file_streaming() APPEND_NODE(file_src); } -static void _create_http_playing() +static void _create_http_playing(void) { media_streamer_node_h http_src = NULL; media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_HTTP, &http_src); @@ -750,7 +750,7 @@ static media_streamer_node_h _create_rtp(int video_port, int audio_port, gboolea return rtp_bin; } -static void _create_adaptive_server() +static void _create_adaptive_server(void) { g_print("\n _create_adaptive_server \n"); media_streamer_node_h file_src = NULL; @@ -768,7 +768,7 @@ static void _create_adaptive_server() APPEND_NODE(adaptive_sink); } -static void _create_adaptive_server_manual() +static void _create_adaptive_server_manual(void) { g_print("\n _create_adaptive_server manual \n"); media_streamer_node_h file_src = NULL; @@ -822,7 +822,7 @@ static void _create_adaptive_server_manual() media_streamer_node_link(ts_mux, "src", adaptive_sink, "sink"); } -static void _create_adaptive_playing() +static void _create_adaptive_playing(void) { g_print("\n _create_adaptive_playing \n"); media_streamer_node_h adaptive_src = NULL; @@ -845,7 +845,7 @@ static void _create_adaptive_playing() APPEND_NODE(audio_sink); } -static void _create_adaptive_playing_manual() +static void _create_adaptive_playing_manual(void) { g_print("\n _create_adaptive_playing_manual \n"); media_streamer_node_h adaptive_src = NULL; @@ -933,7 +933,7 @@ static void eos_cb(media_streamer_node_h node, void *user_data) g_print("Got EOS cb from appsink\n"); } -static void _create_app_test() +static void _create_app_test(void) { g_print("== _create_appsrc \n"); @@ -1009,7 +1009,7 @@ void reset_current_menu_state(void) g_node_counter = 0; } -void quit() +void quit(void) { reset_current_menu_state(); elm_exit(); -- 2.7.4 From 6c9a59073c0863bfab88cb37bbb67f9b3d03e035 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Mon, 15 Jul 2019 14:49:07 +0900 Subject: [PATCH 13/16] Add static link test for mp3 file playing Change-Id: Id9ede22ad11c9233d47ed63663c7d73698005cd1 Signed-off-by: Hyunil --- test/media_streamer_test.c | 53 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 953e213..bdd8b98 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -87,7 +87,8 @@ typedef enum { SCENARIO_MODE_ADAPTIVE_SERVER_MANUAL, SCENARIO_MODE_ADAPTIVE_CLIENT_AUTO, SCENARIO_MODE_ADAPTIVE_CLIENT_MANUAL, - SCENARIO_MODE_FILE_PLAY_AAC_AUDIO + SCENARIO_MODE_FILE_PLAY_AAC_AUDIO, + SCENARIO_MODE_FILE_PLAY_MP3_AUDIO } scenario_mode_e; #define PACKAGE "media_streamer_test" @@ -146,6 +147,7 @@ media_format_h afmt_pcm = NULL; media_format_h afmt_f32le = NULL; media_format_h afmt_encoded = NULL; media_format_h afmt_aac = NULL; +media_format_h afmt_mp3 = NULL; media_format_h cfmt_mpeg2ts = NULL; media_format_h cfmt_mp4 = NULL; @@ -357,7 +359,7 @@ static void create_formats(void) /* Define audio raw format */ media_format_create(&afmt_pcm); if (media_format_set_audio_mime(afmt_pcm, MEDIA_FORMAT_PCM) != MEDIA_FORMAT_ERROR_NONE) - g_print("media_format_set_audio_mime failed!"); + g_print("media_format_set_audio_mime failed!\n"); media_format_set_audio_channel(afmt_pcm, AUDIO_CHANNEL); media_format_set_audio_samplerate(afmt_pcm, AUDIO_SAMPLERATE); @@ -365,7 +367,7 @@ static void create_formats(void) /* Define audio raw format for adaptive streaming */ media_format_create(&afmt_f32le); if (media_format_set_audio_mime(afmt_f32le, MEDIA_FORMAT_PCM_F32LE) != MEDIA_FORMAT_ERROR_NONE) - g_print("media_format_set_audio_mime failed!"); + g_print("media_format_set_audio_mime failed!\n"); media_format_set_audio_channel(afmt_f32le, AUDIO_CHANNEL); media_format_set_audio_samplerate(afmt_f32le, AUDIO_SAMPLERATE); @@ -373,15 +375,20 @@ static void create_formats(void) /* Define audio encoded format */ media_format_create(&afmt_encoded); if (media_format_set_audio_mime(afmt_encoded, MEDIA_FORMAT_AMR_NB) != MEDIA_FORMAT_ERROR_NONE) - g_print("media_format_set_audio_mime failed!"); + g_print("media_format_set_audio_mime failed!\n"); media_format_set_audio_channel(afmt_encoded, AUDIO_CHANNEL); media_format_set_audio_samplerate(afmt_encoded, AUDIO_SAMPLERATE); + /* Define audio mp3 format */ + media_format_create(&afmt_mp3); + if (media_format_set_audio_mime(afmt_mp3, MEDIA_FORMAT_MP3) != MEDIA_FORMAT_ERROR_NONE) + g_print("media_format_set_audio_mime failed!\n"); + /* Define audio encoded format for adaptive stream */ media_format_create(&afmt_aac); if (media_format_set_audio_mime(afmt_aac, MEDIA_FORMAT_AAC) != MEDIA_FORMAT_ERROR_NONE) - g_print("media_format_set_audio_mime failed!"); + g_print("media_format_set_audio_mime failed!\n"); media_format_set_audio_channel(afmt_aac, AUDIO_CHANNEL); media_format_set_audio_samplerate(afmt_aac, AUDIO_SAMPLERATE); @@ -390,11 +397,12 @@ static void create_formats(void) /* Define mpegts stream format */ media_format_create(&cfmt_mpeg2ts); if (media_format_set_container_mime(cfmt_mpeg2ts, MEDIA_FORMAT_CONTAINER_MPEG2TS) != MEDIA_FORMAT_ERROR_NONE) - g_print("media_format_set_container_mime failed!"); + g_print("media_format_set_container_mime failed!\n"); + /* Define MP4 stream format */ media_format_create(&cfmt_mp4); if (media_format_set_container_mime(cfmt_mp4, MEDIA_FORMAT_CONTAINER_MP4) != MEDIA_FORMAT_ERROR_NONE) - g_print("media_format_set_container_mime failed!"); + g_print("media_format_set_container_mime failed!\n"); } static void set_rtp_params(media_streamer_node_h rtp_node, const char *ip, int video_port, int audio_port, gboolean port_reverse) @@ -482,6 +490,28 @@ static void _create_static_audio_aac_playing(void) media_streamer_node_link(audio_decoder, "src", audiosink, "sink"); } +static void _create_static_audio_mp3_playing(void) +{ + media_streamer_node_h filesrc = NULL; + media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_FILE, &filesrc); + media_streamer_node_set_param(filesrc, MEDIA_STREAMER_PARAM_URI, g_uri); + media_streamer_node_add(current_media_streamer, filesrc); + APPEND_NODE(filesrc); + + media_streamer_node_h audio_decoder = NULL; + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_mp3, afmt_pcm, &audio_decoder); + media_streamer_node_add(current_media_streamer, audio_decoder); + APPEND_NODE(audio_decoder); + + media_streamer_node_h audiosink = NULL; + media_streamer_node_create_sink(MEDIA_STREAMER_NODE_SINK_TYPE_AUDIO, &audiosink); + media_streamer_node_add(current_media_streamer, audiosink); + APPEND_NODE(audiosink); + + media_streamer_node_link(filesrc, "src", audio_decoder, "sink"); + media_streamer_node_link(audio_decoder, "src", audiosink, "sink"); +} + static void _create_file_sub_playing(void) { media_streamer_node_h file_sub_src = NULL; @@ -1102,6 +1132,7 @@ static void display_static_link_playing_scenario_select_menu(void) g_print("By default will be used [%d] mode\n", g_scenario_mode); g_print("1. Appsrc -> Appsink\n"); g_print("2. Audio File(aac) playing\n"); + g_print("3. Audio File(mp3) playing\n"); g_print("b. back \n"); g_print("----------------------------------------------------\n"); g_print("====================================================\n"); @@ -1320,6 +1351,8 @@ void run_playing_preset(void) _create_file_playing(); else if (g_scenario_mode == SCENARIO_MODE_FILE_PLAY_AAC_AUDIO) _create_static_audio_aac_playing(); + else if (g_scenario_mode == SCENARIO_MODE_FILE_PLAY_MP3_AUDIO) + _create_static_audio_mp3_playing(); else if (g_scenario_mode == SCENARIO_MODE_FILE_SUBTITLE_VIDEO_AUDIO) _create_file_sub_playing(); else if (g_scenario_mode == SCENARIO_MODE_HTTP_VIDEO_AUDIO) @@ -1489,6 +1522,12 @@ void _interpret_static_link_playing_scenario_menu(char *cmd) g_printf("g_sub_menu_state (%d)\n", g_sub_menu_state); return; } + else if (!strncmp(cmd, "3", len)) { + g_scenario_mode = SCENARIO_MODE_FILE_PLAY_MP3_AUDIO; + g_sub_menu_state = SUBMENU_STATE_GETTING_FILE_URI; + g_printf("g_sub_menu_state (%d)\n", g_sub_menu_state); + return; + } } g_sub_menu_state = SUBMENU_STATE_UNKNOWN; } -- 2.7.4 From 5e4a622ed6931b543e77e1abdf4bfc1a51168e68 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 23 Jul 2019 12:44:10 +0900 Subject: [PATCH 14/16] Change input value type for parent_id Change-Id: I2e3d6a3285d97a056c9495d935fc545e48848924 Signed-off-by: Hyunil --- include/media_streamer_priv.h | 2 +- src/media_streamer_node.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/media_streamer_priv.h b/include/media_streamer_priv.h index a2a49ce..8c3c2e4 100644 --- a/include/media_streamer_priv.h +++ b/include/media_streamer_priv.h @@ -147,7 +147,7 @@ typedef struct { } media_streamer_node_s; typedef struct _media_streamer_wl_info_s { - int parent_id; + gint parent_id; } media_streamer_wl_info_s; /* Private functions definition */ diff --git a/src/media_streamer_node.c b/src/media_streamer_node.c index beda130..9528930 100644 --- a/src/media_streamer_node.c +++ b/src/media_streamer_node.c @@ -1695,7 +1695,7 @@ int __ms_node_set_display(media_streamer_node_s *ms_node, const char *param_valu LOGD("wayland global surface id : %d", wl_info.parent_id); - gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(ms_node->gst_element), (guintptr)wl_info.parent_id); + gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(ms_node->gst_element), wl_info.parent_id); return ret; } -- 2.7.4 From 2f677ea22cbc24fef3e25981fdde27d776255250 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 30 Jul 2019 11:53:59 +0900 Subject: [PATCH 15/16] Add gcov environment Change-Id: I088bd23496518c01c4e82e23555119cba0834acd Signed-off-by: Hyunil --- packaging/capi-media-streamer.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packaging/capi-media-streamer.spec b/packaging/capi-media-streamer.spec index 7419ef7..0ba92b7 100644 --- a/packaging/capi-media-streamer.spec +++ b/packaging/capi-media-streamer.spec @@ -70,6 +70,12 @@ flags="$flags -DTIZEN_DEBUG_ENABLE" export CFLAGS="$CFLAGS $flags" export CXXFLAGS="$CXXFLAGS $flags" export FFLAGS="$FFLAGS $flags" +%if 0%{?gcov:1} +export CFLAGS+=" -fprofile-arcs -ftest-coverage" +export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" +export FFLAGS+=" -fprofile-arcs -ftest-coverage" +export LDFLAGS+=" -lgcov" +%endif MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -- 2.7.4 From 8c9abbc4bb25fa63b0951a19ba62fa0233dfd28c Mon Sep 17 00:00:00 2001 From: Hyunil Date: Fri, 23 Aug 2019 16:05:04 +0900 Subject: [PATCH 16/16] remove setting use-tbm because default value is false Change-Id: I469c83b8cf4ae2b5b76e3e309c271f7f1111f598 Signed-off-by: Hyunil --- src/media_streamer_node.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/media_streamer_node.c b/src/media_streamer_node.c index 9528930..449fd96 100644 --- a/src/media_streamer_node.c +++ b/src/media_streamer_node.c @@ -757,7 +757,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); -- 2.7.4