[0.6.246] Set h264parse to send SPS/PPS with every IDR frame if omxdec_h264 is used.
[platform/core/multimedia/libmm-player.git] / src / mm_player_priv.c
index 1bde8bf..b3fadf0 100644 (file)
@@ -7680,6 +7680,9 @@ _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data)
 #endif
                player->pipeline->mainbin[MMPLAYER_M_DEMUX].id = MMPLAYER_M_DEMUX;
                player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst = element;
+       } else if (g_strrstr(klass, "Parser") && (g_strrstr(klass, "Video"))) {
+               player->pipeline->mainbin[MMPLAYER_M_V_PARSE].id = MMPLAYER_M_V_PARSE;
+               player->pipeline->mainbin[MMPLAYER_M_V_PARSE].gst = element;
        }
 
        if (g_strrstr(factory_name, "asfdemux") || g_strrstr(factory_name, "qtdemux") || g_strrstr(factory_name, "avidemux")) {
@@ -7703,6 +7706,12 @@ _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data)
                }
        } else if (g_strrstr(factory_name, player->ini.videocodec_element_hw)) {
                player->pipeline->mainbin[MMPLAYER_M_DEC1].gst = element;
+       } else if (g_strrstr(factory_name, "omxdec_h264")) {
+               GstElement *video_parse = player->pipeline->mainbin[MMPLAYER_M_V_PARSE].gst;
+               if (video_parse && (g_object_class_find_property(G_OBJECT_GET_CLASS(video_parse), "config-interval"))) {
+                       g_object_set(G_OBJECT(video_parse), "config-interval", -1, NULL);
+                       LOGD("Send SPS and PPS Insertion every IDR frame");
+               }
        }
 
        if ((player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst) &&