bug fix for using H/W codec 60/216460/3
authorHyunil <hyunil46.park@samsung.com>
Fri, 25 Oct 2019 07:04:22 +0000 (16:04 +0900)
committerHyunil <hyunil46.park@samsung.com>
Fri, 25 Oct 2019 07:35:55 +0000 (16:35 +0900)
Change-Id: I6e351c1b35d5ad954d9d7d2be3ab7306e14a6056
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
src/media_streamer_gst.c

index 214c180..c915d32 100644 (file)
@@ -1469,6 +1469,7 @@ GstElement *__ms_video_decoder_element_create(node_plug_s *plug_info, media_stre
        gboolean gst_ret = FALSE;
        const gchar *sink_type = NULL;
        GstCaps *dec_caps = NULL;
+       gchar *codec_name = NULL;
 
        ms_debug_fenter();
 
@@ -1506,9 +1507,6 @@ GstElement *__ms_video_decoder_element_create(node_plug_s *plug_info, media_stre
        if (decoder_type == MEDIA_FORMAT_H264_SP)
                g_object_set(G_OBJECT(decoder_parser), "config-interval", H264_PARSER_CONFIG_INTERVAL, NULL);
 
-       if (g_strrstr(plug_info->info->default_name, "omx") || g_strrstr(plug_info->info->default_name, "sprd"))
-               is_hw_codec = TRUE;
-
        /* Creating bin - Video Decoder */
        decoder_queue = __ms_element_create("queue", NULL);
        decoder_bin = gst_bin_new("video_decoder");
@@ -1518,6 +1516,10 @@ GstElement *__ms_video_decoder_element_create(node_plug_s *plug_info, media_stre
                goto ERROR;
        }
 
+       codec_name = GST_OBJECT_NAME(decoder_elem);
+       if (g_strrstr(codec_name, "omx") || g_strrstr(codec_name, "sprd"))
+               is_hw_codec = TRUE;
+
        /* Adding elements to bin Audio Encoder */
        gst_bin_add_many(GST_BIN(decoder_bin), decoder_queue, decoder_elem, decoder_parser, NULL);
        gst_ret = gst_element_link_many(decoder_queue, decoder_parser, decoder_elem, NULL);