[0.6.147] bug fix: support audio playback when surface type is null with playing... 40/193040/7
authorHyunil <hyunil46.park@samsung.com>
Wed, 14 Nov 2018 05:57:38 +0000 (14:57 +0900)
committerHyunil <hyunil46.park@samsung.com>
Wed, 14 Nov 2018 12:11:53 +0000 (21:11 +0900)
Change-Id: If84ef1edbf8e4841049ac923648cc69c9870b72a
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
packaging/libmm-player.spec
src/include/mm_player_priv.h
src/mm_player_gst.c
src/mm_player_priv.c

index 2552b23..4f563ae 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.146
+Version:    0.6.147
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 8c2a39b..aa68967 100644 (file)
@@ -653,7 +653,6 @@ typedef struct {
 
        /* autoplugging */
        GList *factories;
-       gboolean have_dynamic_pad;
        GList *parsers; // list of linked parser name
        GList *audio_decoders; // list of linked audio name
        gboolean no_more_pad;
index 597b74e..da0a146 100644 (file)
@@ -2560,7 +2560,6 @@ __mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data)
        GstElement *new_element = NULL;
        GstStructure *str = NULL;
        const gchar *name = NULL;
-       gboolean caps_ret = TRUE;
 
        mm_player_t *player = (mm_player_t*) data;
 
@@ -2571,24 +2570,27 @@ __mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data)
                                        player->pipeline &&
                                        player->pipeline->mainbin);
 
-       MMPLAYER_GST_GET_CAPS_INFO(pad, caps, str, name, caps_ret);
-       if (!caps_ret)
-               goto ERROR;
-
        /* payload type is recognizable. increase num_dynamic and wait for sinkbin creation.
         * num_dynamic_pad will decreased after creating a sinkbin.
         */
        player->num_dynamic_pad++;
        LOGD("stream count inc : %d", player->num_dynamic_pad);
 
-       /* clear  previous result*/
-       player->have_dynamic_pad = FALSE;
+       caps = gst_pad_query_caps(pad, NULL);
+       MMPLAYER_CHECK_NULL(caps);
+
+       str = gst_caps_get_structure (caps, 0);
+       name = gst_structure_get_string(str, "media");
+       if (!name) {
+               LOGE("cannot get mimetype from structure.\n");
+               goto ERROR;
+       }
 
        if (strstr(name, "video")) {
                gint stype = 0;
                mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &stype);
 
-               if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE) {
+               if ((stype == MM_DISPLAY_SURFACE_NULL) && (player->set_mode.media_packet_video_stream == FALSE)) {
                        if (player->v_stream_caps) {
                                gst_caps_unref(player->v_stream_caps);
                                player->v_stream_caps = NULL;
@@ -2600,20 +2602,11 @@ __mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data)
                }
        }
 
-       /* clear  previous result*/
-       player->have_dynamic_pad = FALSE;
-
        if (!__mmplayer_gst_create_decoder(player, pad, caps)) {
                LOGE("failed to autoplug for caps");
                goto ERROR;
        }
 
-       /* check if there's dynamic pad*/
-       if (player->have_dynamic_pad) {
-               LOGE("using pad caps assums there's no dynamic pad !\n");
-               goto ERROR;
-       }
-
        gst_caps_unref(caps);
        caps = NULL;
 
index 6822aa7..ba35fc9 100644 (file)
@@ -4133,7 +4133,6 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player)
 
        /* cleanup stuffs */
        MMPLAYER_FREEIF(player->type);
-       player->have_dynamic_pad = FALSE;
        player->no_more_pad = FALSE;
        player->num_dynamic_pad = 0;
        player->demux_pad_index = 0;