From 6fa740f1deab4de11bd8cbee1a0fb7f931e14c54 Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Mon, 18 Oct 2021 15:54:24 +0900 Subject: [PATCH] [0.6.266] release video resource - set state to NULL to release resource before remove from bin - object unref is done in gst_bin_remove. Change-Id: Ib943eeb5e65c2dcf84087df92620a56df287f680 --- packaging/libmm-player.spec | 2 +- src/mm_player_priv.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 31abe7c..49575ac 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.265 +Version: 0.6.266 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index 73e60b4..b936df4 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -7585,6 +7585,7 @@ _mmplayer_gst_decode_pad_removed(GstElement *elem, GstPad *pad, mmplayer_t *player = (mmplayer_t *)data; mmplayer_gst_element_t *mainbin = player->pipeline->mainbin; mmplayer_gst_element_t *videobin = player->pipeline->videobin; + gint timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player); MMPLAYER_FENTER(); MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && mainbin); @@ -7601,11 +7602,27 @@ _mmplayer_gst_decode_pad_removed(GstElement *elem, GstPad *pad, __mmplayer_del_sink(player, videobin[MMPLAYER_V_SINK].gst); + LOGD("remove videobin"); + ret = _mmplayer_gst_set_state(player, videobin[MMPLAYER_V_BIN].gst, + GST_STATE_NULL, FALSE, timeout); + if (ret != MM_ERROR_NONE) { + LOGE("fail to change state of videobin to NULL"); + return; + } + if (!gst_bin_remove(GST_BIN_CAST(mainbin[MMPLAYER_M_PIPE].gst), videobin[MMPLAYER_V_BIN].gst)) { LOGE("failed to remove videobin"); gst_object_unref(GST_OBJECT(videobin[MMPLAYER_V_BIN].gst)); } + LOGD("remove concat"); + ret = _mmplayer_gst_set_state(player, mainbin[MMPLAYER_M_V_CONCAT].gst, + GST_STATE_NULL, FALSE, timeout); + if (ret != MM_ERROR_NONE) { + LOGE("fail to change state of concat to NULL"); + return; + } + if (!gst_bin_remove(GST_BIN_CAST(mainbin[MMPLAYER_M_PIPE].gst), mainbin[MMPLAYER_M_V_CONCAT].gst)) { LOGE("failed to remove video concat"); gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_V_CONCAT].gst)); -- 2.7.4