Patch to flush appsrc internal frames datas 17/118417/1 accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable accepted/tizen/3.0/common/20170320.130426 accepted/tizen/3.0/ivi/20170320.080458 accepted/tizen/3.0/mobile/20170320.074852 accepted/tizen/3.0/tv/20170320.075833 accepted/tizen/3.0/wearable/20170320.080124 submit/tizen_3.0/20170317.034449
authorjuan82.liu <juan82.liu@samsung.com>
Fri, 10 Mar 2017 00:38:38 +0000 (08:38 +0800)
committerjuan82.liu <juan82.liu@samsung.com>
Fri, 10 Mar 2017 00:41:00 +0000 (08:41 +0800)
Change-Id: I14aed19af4f0853c91713767f66219f6a0a224a0

src/media_codec_port_gst.c

index 387efcd9de90ad8d8bbd8023b513111bdeb970ee..fd8246c7d8828cfe4a78136bc7f1448be0e75f7f 100755 (executable)
@@ -2309,7 +2309,7 @@ gboolean __mc_gst_bus_callback(GstBus *bus, GstMessage *msg, gpointer data)
 {
        int ret  = MC_ERROR_NONE;
        mc_gst_core_t *core = (mc_gst_core_t *)data;
-       LOGD("@%p v(%d)e(%d)", core, core->video, core->encoder);
+       LOGD("@%p v(%d)e(%d)bus message : %s", core, core->video, core->encoder, gst_message_type_get_name(GST_MESSAGE_TYPE(msg)));
 
        switch (GST_MESSAGE_TYPE(msg)) {
 
@@ -2401,7 +2401,7 @@ static GstBusSyncReply __mc_gst_bus_sync_callback(GstBus *bus, GstMessage *msg,
        mc_gst_core_t *core = (mc_gst_core_t *)data;
        GstBusSyncReply reply = GST_BUS_DROP;
 
-       LOGD("__mc_gst_bus_sync_callback is called");
+       LOGD("__mc_gst_bus_sync_callback is called : %s", gst_message_type_get_name(GST_MESSAGE_TYPE(msg)));
 
        if (!core->pipeline) {
                LOGE("mediacodec pipeline handle is null");
@@ -2724,6 +2724,23 @@ static int _mc_gst_flush_buffers(mc_gst_core_t *core)
 
        _mc_gst_set_flush_input(core);
 
+       LOGW("Trying send flush_start .... ");
+       event = gst_event_new_flush_start();
+       ret = gst_element_send_event(core->appsrc, event);
+       if (ret != TRUE) {
+               LOGE("failed to send Flush_Start event");
+               return MC_ERROR;
+       }
+
+       LOGW("Trying send flush_stop .... ");
+       event = gst_event_new_flush_stop(TRUE);
+       ret = gst_element_send_event(core->appsrc, event);
+       if (ret != TRUE) {
+               LOGE("failed to send Flush_Stop event");
+               return MC_ERROR;
+       }
+
+       LOGW("Trying send seek .... ");
        event = gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH,
                        GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, -1);