From: Eunhae Choi Date: Wed, 27 Sep 2017 13:23:19 +0000 (+0900) Subject: [0.3.77] sync with muse player modification X-Git-Tag: submit/tizen/20170929.104425^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F153011%2F3;p=platform%2Fcore%2Fapi%2Fplayer.git [0.3.77] sync with muse player modification muse player do not export media packet. it will send video data instead. Change-Id: Ib5e828a15cf3bcbda1a055d95153f5f37b44c2b1 --- diff --git a/include/player.h b/include/player.h index 6a12d05..a99ee0d 100644 --- a/include/player.h +++ b/include/player.h @@ -599,7 +599,7 @@ int player_set_memory_buffer(player_h player, const void * data, int size); * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see #player_state_e */ -int player_get_state(player_h player, player_state_e *state); +int player_get_state(player_h player, player_state_e *state); /** * @brief Sets the player's volume. diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index a94e86f..3d09da1 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,6 +1,6 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.76 +Version: 0.3.77 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index 59667e6..c15d1bd 100644 --- a/src/player.c +++ b/src/player.c @@ -94,7 +94,7 @@ typedef struct { } _player_cb_data; typedef struct { - intptr_t remote_pkt; + intptr_t remote_v_data; gint fd; gint fd_id; bool use_tsurf_pool; @@ -122,9 +122,9 @@ static void _player_release_internal_memory(player_cli_s * pc); int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data) { int ret = MEDIA_PACKET_FINALIZE; - muse_player_api_e api = MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB; + muse_player_api_e api = MUSE_PLAYER_API_RETURN_VIDEO_DATA; _media_pkt_fin_data *fin_data = (_media_pkt_fin_data *) user_data; - intptr_t packet = 0; + intptr_t v_data = 0; char *snd_msg = NULL; int snd_len = 0; @@ -168,8 +168,8 @@ int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user goto EXIT; } - packet = fin_data->remote_pkt; - snd_msg = muse_core_msg_new(api, MUSE_TYPE_POINTER, "packet", packet, 0); + v_data = fin_data->remote_v_data; + snd_msg = muse_core_msg_new(api, MUSE_TYPE_POINTER, "v_data", v_data, 0); snd_len = muse_core_msg_send(fin_data->fd, snd_msg); muse_core_msg_free(snd_msg); @@ -663,7 +663,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, bool make_pkt_fmt = false; int ret = MEDIA_FORMAT_ERROR_NONE; _media_pkt_fin_data *fin_data = NULL; - intptr_t packet = 0; + intptr_t v_data = 0; uint64_t pts = 0; int i = 0; muse_core_msg_parse_err_e err = MUSE_MSG_PARSE_ERROR_NONE; @@ -674,7 +674,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, !muse_core_msg_object_get_value("key[1]", jobj, MUSE_TYPE_ANY, &key[1]) || !muse_core_msg_object_get_value("key[2]", jobj, MUSE_TYPE_ANY, &key[2]) || !muse_core_msg_object_get_value("key[3]", jobj, MUSE_TYPE_ANY, &key[3]) || - !muse_core_msg_object_get_value("packet", jobj, MUSE_TYPE_POINTER, &packet) || + !muse_core_msg_object_get_value("v_data", jobj, MUSE_TYPE_POINTER, &v_data) || !muse_core_msg_object_get_value("mimetype", jobj, MUSE_TYPE_ANY, &mimetype) || !muse_core_msg_object_get_value("pts", jobj, MUSE_TYPE_INT64, &pts) || !muse_core_msg_object_get_value("surface_info", jobj, MUSE_TYPE_ARRAY, surface_info)) { @@ -694,7 +694,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, } if (!cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]) { - /* send msg to release packet. */ + /* send msg to release v_data. */ LOGE("_video_decoded_cb is not set"); goto ERROR; } @@ -781,7 +781,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, LOGE("failed to alloc fin_data"); goto ERROR; } - fin_data->remote_pkt = packet; + fin_data->remote_v_data = v_data; fin_data->fd = cb_info->fd; fin_data->use_tsurf_pool = cb_info->use_tsurf_pool; @@ -838,8 +838,8 @@ ERROR: } memset(recv_data->tfd, INVALID_DEFAULT_VALUE, sizeof(recv_data->tfd)); - if (cb_info && packet) - player_msg_send1_no_return(MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB, cb_info->fd, POINTER, packet); + if (cb_info && v_data) + player_msg_send1_no_return(MUSE_PLAYER_API_RETURN_VIDEO_DATA, cb_info->fd, POINTER, v_data); return; } @@ -3002,7 +3002,7 @@ int player_get_content_info(player_h player, player_content_info_e key, char **p int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_codec) { PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(paudio_codec && pvideo_codec); + PLAYER_NULL_ARG_CHECK(paudio_codec || pvideo_codec); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_INFO; player_cli_s *pc = (player_cli_s *) player; @@ -3017,8 +3017,10 @@ int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_co if (ret == PLAYER_ERROR_NONE) { player_msg_get_string2(ret_buf, video_codec, audio_codec, ret_val); if (ret_val) { - *pvideo_codec = strndup(video_codec, MUSE_MSG_MAX_LENGTH); - *paudio_codec = strndup(audio_codec, MUSE_MSG_MAX_LENGTH); + if (pvideo_codec) + *pvideo_codec = strndup(video_codec, MUSE_MSG_MAX_LENGTH); + if (paudio_codec) + *paudio_codec = strndup(audio_codec, MUSE_MSG_MAX_LENGTH); } else { ret = PLAYER_ERROR_INVALID_OPERATION; } @@ -3030,7 +3032,7 @@ int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_co int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchannel, int *pbit_rate) { PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(psample_rate && pchannel && pbit_rate); + PLAYER_NULL_ARG_CHECK(psample_rate || pchannel || pbit_rate); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO; player_cli_s *pc = (player_cli_s *) player; @@ -3046,9 +3048,12 @@ int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchann bool ret_val = TRUE; player_msg_get3(ret_buf, sample_rate, INT, channel, INT, bit_rate, INT, ret_val); if (ret_val) { - *psample_rate = sample_rate; - *pchannel = channel; - *pbit_rate = bit_rate; + if (psample_rate) + *psample_rate = sample_rate; + if (pchannel) + *pchannel = channel; + if (pbit_rate) + *pbit_rate = bit_rate; } else { ret = PLAYER_ERROR_INVALID_OPERATION; } @@ -3060,7 +3065,7 @@ int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchann int player_get_video_stream_info(player_h player, int *pfps, int *pbit_rate) { PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(pfps && pbit_rate); + PLAYER_NULL_ARG_CHECK(pfps || pbit_rate); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO; player_cli_s *pc = (player_cli_s *) player; @@ -3075,8 +3080,10 @@ int player_get_video_stream_info(player_h player, int *pfps, int *pbit_rate) bool ret_val = TRUE; player_msg_get2(ret_buf, fps, INT, bit_rate, INT, ret_val); if (ret_val) { - *pfps = fps; - *pbit_rate = bit_rate; + if (pfps) + *pfps = fps; + if (pbit_rate) + *pbit_rate = bit_rate; } else { ret = PLAYER_ERROR_INVALID_OPERATION; }