From: Eunhae Choi Date: Tue, 17 Jan 2017 08:21:41 +0000 (+0900) Subject: [v0.6.24] remove deadcode X-Git-Tag: accepted/tizen/common/20170117.174947^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c655c6e0ec0b16802b09f7fd2829d52d8e4d1544;p=platform%2Fcore%2Fmultimedia%2Flibmm-player.git [v0.6.24] remove deadcode Change-Id: I34f05dd7ffd6062af1b2fc77b02ffca6a4ac180c --- diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 5e73f39..3c1a2f0 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.23 +Version: 0.6.24 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/include/mm_player_internal.h b/src/include/mm_player_internal.h index 60304e9..7a7e966 100644 --- a/src/include/mm_player_internal.h +++ b/src/include/mm_player_internal.h @@ -231,21 +231,6 @@ int mm_player_set_audio_stream_callback_ex(MMHandleType player, bool sync, mm_pl int mm_player_do_video_capture(MMHandleType player); /** - * This function set callback function for putting data into player. - * - * @param player [in] Handle of player. - * @param buf [in] data to push into player - * @param size [in] buffer size to push - * - * @return This function returns zero on success, or negative value with error - * code. - * @remark - * @see - * @since - */ -int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size); - -/** * This function changes the previous videosink plugin for a new one * * @param player [in] Handle of player. diff --git a/src/include/mm_player_priv.h b/src/include/mm_player_priv.h index 33b2fda..f9f5a24 100644 --- a/src/include/mm_player_priv.h +++ b/src/include/mm_player_priv.h @@ -127,7 +127,6 @@ enum MMPlayerUriType { MM_PLAYER_URI_TYPE_MEM, /**< Player URI type Mem */ MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */ MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */ - MM_PLAYER_URI_TYPE_BUFF, /**< Player URI type Buffer */ MM_PLAYER_URI_TYPE_MS_BUFF, /**< Player URI type Media Stream Buffer */ MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */ MM_PLAYER_URI_TYPE_SS, /**< Player URI type Smooth streaming */ @@ -801,7 +800,6 @@ int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int pos int _mmplayer_adjust_video_postion(MMHandleType hplayer, int offset); int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end); int _mmplayer_deactivate_section_repeat(MMHandleType hplayer); -int _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size); int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming); int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param); int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param); diff --git a/src/mm_player.c b/src/mm_player.c index 9a4f776..341c859 100644 --- a/src/mm_player.c +++ b/src/mm_player.c @@ -394,21 +394,6 @@ int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display return result; } -int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - //MMPLAYER_CMD_LOCK( player ); - - result = _mmplayer_push_buffer(player, buf, size); - - //MMPLAYER_CMD_UNLOCK( player ); - - return result; -} - int mm_player_start(MMHandleType player) { int result = MM_ERROR_NONE; diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index bec94d9..3d34208 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -6016,116 +6016,6 @@ __gst_appsrc_seek_data_mem(GstElement *element, guint64 size, gpointer user_data return TRUE; } -static void -__gst_appsrc_feed_data(GstElement *element, guint size, gpointer user_data) // @ -{ - mm_player_t *player = (mm_player_t*)user_data; - MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_DEFAULT; - guint64 current_level_bytes = 0; - MMPLAYER_RETURN_IF_FAIL(player); - - LOGI("app-src: feed data\n"); - - g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL); - MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player); - if (player->media_stream_buffer_status_cb[type]) - player->media_stream_buffer_status_cb[type](type, MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN, current_level_bytes, player->buffer_cb_user_param); - - MMPLAYER_MEDIA_STREAM_CALLBACK_UNLOCK(player); -} - -static gboolean -__gst_appsrc_seek_data(GstElement *element, guint64 offset, gpointer user_data) // @ -{ - mm_player_t *player = (mm_player_t*)user_data; - MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_DEFAULT; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); - - LOGI("app-src: seek data, offset: %llu\n", offset); - MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player); - - if (player->media_stream_seek_data_cb[type]) - player->media_stream_seek_data_cb[type](type, offset, player->buffer_cb_user_param); - MMPLAYER_MEDIA_STREAM_CALLBACK_UNLOCK(player); - - return TRUE; -} - - -static gboolean -__gst_appsrc_enough_data(GstElement *element, gpointer user_data) // @ -{ - mm_player_t *player = (mm_player_t*)user_data; - MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_DEFAULT; - guint64 current_level_bytes = 0; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); - - g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL); - - MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player); - - LOGI("app-src: enough data:%p %llu\n", player->media_stream_buffer_status_cb[type], current_level_bytes); - if (player->media_stream_buffer_status_cb[type]) - player->media_stream_buffer_status_cb[type](type, MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW, current_level_bytes, player->buffer_cb_user_param); - MMPLAYER_MEDIA_STREAM_CALLBACK_UNLOCK(player); - - return TRUE; -} - -int -_mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size) // @ -{ - mm_player_t* player = (mm_player_t*)hplayer; - GstBuffer *buffer = NULL; - GstFlowReturn gst_ret = GST_FLOW_OK; - int ret = MM_ERROR_NONE; -// gint len = size; - - MMPLAYER_FENTER(); - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - /* check current state */ -// MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_START); - - - /* NOTE : we should check and create pipeline again if not created as we destroy - * whole pipeline when stopping in streamming playback - */ - if (!player->pipeline) { - if (MM_ERROR_NONE != __gst_realize(player)) { - LOGE("failed to realize before starting. only in streamming\n"); - return MM_ERROR_PLAYER_INTERNAL; - } - } - - LOGI("app-src: pushing data\n"); - - if (buf == NULL) { - LOGE("buf is null\n"); - return MM_ERROR_NONE; - } - - buffer = gst_buffer_new(); - - if (size <= 0) { - LOGD("call eos appsrc\n"); - g_signal_emit_by_name(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "end-of-stream", &gst_ret); - return MM_ERROR_NONE; - } - - //gst_buffer_insert_memory(buffer, -1, gst_memory_new_wrapped(0, (guint8 *)(buf->buf + buf->offset), len, 0, len, (guint8*)(buf->buf + buf->offset), g_free)); - - LOGD("feed buffer %p, length %u\n", buf, size); - g_signal_emit_by_name(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "push-buffer", buffer, &gst_ret); - - MMPLAYER_FLEAVE(); - - return ret; -} - static GstBusSyncReply __mmplayer_bus_sync_callback(GstBus * bus, GstMessage * message, gpointer data) { @@ -6526,32 +6416,6 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @ g_object_set(G_OBJECT(element), "timeout", http_timeout, NULL); } break; - - /* appsrc */ - case MM_PLAYER_URI_TYPE_BUFF: - { - guint64 stream_type = GST_APP_STREAM_TYPE_STREAM; - - LOGD("mem src is selected\n"); - - element = gst_element_factory_make("appsrc", "buff-source"); - if (!element) { - LOGE("failed to create appsrc element\n"); - break; - } - - g_object_set(element, "stream-type", stream_type, NULL); - //g_object_set(element, "size", player->mem_buf.len, NULL); - //g_object_set(element, "blocksize", (guint64)20480, NULL); - - MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data", - G_CALLBACK(__gst_appsrc_seek_data), player); - MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data", - G_CALLBACK(__gst_appsrc_feed_data), player); - MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data", - G_CALLBACK(__gst_appsrc_enough_data), player); - } - break; case MM_PLAYER_URI_TYPE_MS_BUFF: { LOGD("MS buff src is selected\n"); @@ -7341,7 +7205,6 @@ static int __gst_stop(mm_player_t* player) // @ gboolean rewind = FALSE; gint timeout = 0; int ret = MM_ERROR_NONE; - GstState state; gboolean async = FALSE; MMPLAYER_FENTER(); @@ -7368,20 +7231,14 @@ static int __gst_stop(mm_player_t* player) // @ /* Just set state to PAUESED and the rewind. it's usual player behavior. */ timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player); - if (player->profile.uri_type == MM_PLAYER_URI_TYPE_BUFF) { - state = GST_STATE_READY; - } else { - state = GST_STATE_PAUSED; - - if (!MMPLAYER_IS_STREAMING(player) || - (player->streaming_type == STREAMING_SERVICE_VOD && player->videodec_linked)) - rewind = TRUE; - } + if ((!MMPLAYER_IS_STREAMING(player) && !MMPLAYER_IS_MS_BUFF_SRC(player)) || + (player->streaming_type == STREAMING_SERVICE_VOD && player->videodec_linked)) + rewind = TRUE; if (player->es_player_push_mode) async = TRUE; /* set gst state */ - ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, state, async, timeout); + ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED, async, timeout); /* disable fadeout */ if (fadedown || player->sound_focus.by_asm_cb) @@ -8010,9 +7867,6 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse data->uri_type = MM_PLAYER_URI_TYPE_MS_BUFF; ret = MM_ERROR_NONE; } - } else if ((path = strstr(uri, "buff://"))) { - data->uri_type = MM_PLAYER_URI_TYPE_BUFF; - ret = MM_ERROR_NONE; } else if ((path = strstr(uri, "rtsp://"))) { if (strlen(path)) { if ((path = strstr(uri, "/wfd1.0/"))) {