[0.6.150] get right audio channel info 03/193403/2
authorEunhae Choi <eunhae1.choi@samsung.com>
Tue, 20 Nov 2018 07:57:26 +0000 (16:57 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 20 Nov 2018 08:00:27 +0000 (17:00 +0900)
- do not overwrite the demuxer elem reference
  and do not keep the parser elem
- get audio channel info from attr
- remove unused elem reference

Change-Id: Id7e8600587f27b777bc91c7cf47df3db0c918b44

packaging/libmm-player.spec
src/include/mm_player_priv.h
src/include/mm_player_utils.h
src/mm_player_priv.c

index f24e520..8672c1d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.149
+Version:    0.6.150
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 68de886..535392d 100644 (file)
@@ -195,7 +195,6 @@ enum MainElementID {
        MMPLAYER_M_Q2,
        MMPLAYER_M_DEMUX,
        MMPLAYER_M_SUBPARSE,
-       MMPLAYER_M_DEMUX_EX,
        MMPLAYER_M_V_INPUT_SELECTOR,    // video input_select
        MMPLAYER_M_A_INPUT_SELECTOR,    // audio input_select
        MMPLAYER_M_T_INPUT_SELECTOR,    // text input_select
index 285b07d..f46880b 100644 (file)
@@ -139,9 +139,13 @@ do { \
 #define MMPLAYER_LOG_GST_CAPS_TYPE(x_caps) \
 do { \
        gchar *caps_type = NULL; \
-       caps_type = gst_caps_to_string(x_caps); \
-       LOGD("caps: %s", caps_type); \
-       MMPLAYER_FREEIF(caps_type); \
+       if (x_caps) { \
+               caps_type = gst_caps_to_string(x_caps); \
+               LOGD("caps: %s", caps_type); \
+               MMPLAYER_FREEIF(caps_type); \
+       } else {\
+               LOGW("caps is null"); \
+       } \
 } while (0)
 
 /* message posting */
index 4105dc7..78dc9a0 100755 (executable)
@@ -2685,22 +2685,7 @@ __mmplayer_gst_fill_audio_bucket(mm_player_t *player, GList **bucket)
                        g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "mute", player->sound.mute, NULL);
                }
 
-               /* check if multi-channels */
-               if (player->pipeline->mainbin && player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst) {
-                       GstPad *srcpad = NULL;
-                       GstCaps *caps = NULL;
-
-                       if ((srcpad = gst_element_get_static_pad(player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst, "src"))) {
-                               if ((caps = gst_pad_query_caps(srcpad, NULL))) {
-                                       /* MMPLAYER_LOG_GST_CAPS_TYPE(caps); */
-                                       GstStructure *str = gst_caps_get_structure(caps, 0);
-                                       if (str)
-                                               gst_structure_get_int(str, "channels", &channels);
-                                       gst_caps_unref(caps);
-                               }
-                               gst_object_unref(srcpad);
-                       }
-               }
+               mm_attrs_get_int_by_name(player->attrs, "content_audio_channels", &channels);
 
                /* audio effect element. if audio effect is enabled */
                if ((strcmp(player->ini.audioeffect_element, ""))
@@ -7318,20 +7303,10 @@ __mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data
                                                "max-video-width", player->adaptive_info.limit.width,
                                                "max-video-height", player->adaptive_info.limit.height, NULL);
 
-       } else if (g_strrstr(klass, "Demux") || g_strrstr(klass, "Parse")) {
-               /* FIXIT : first value will be overwritten if there's more
-                * than 1 demuxer/parser
-                */
-
-               //LOGD("plugged element is demuxer. take it\n");
+       } else if (g_strrstr(klass, "Demuxer")) {
+               //LOGD("plugged element is demuxer. take it");
                player->pipeline->mainbin[MMPLAYER_M_DEMUX].id = MMPLAYER_M_DEMUX;
                player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst = element;
-
-               /*Added for multi audio support */ // Q. del?
-               if (g_strrstr(klass, "Demux")) {
-                       player->pipeline->mainbin[MMPLAYER_M_DEMUX_EX].id = MMPLAYER_M_DEMUX_EX;
-                       player->pipeline->mainbin[MMPLAYER_M_DEMUX_EX].gst = element;
-               }
        }
 
        if (g_strrstr(factory_name, "asfdemux") || g_strrstr(factory_name, "qtdemux") || g_strrstr(factory_name, "avidemux")) {
@@ -9342,4 +9317,4 @@ __mmplayer_set_playing_state(mm_player_t *player)
        }
 
        return;
-}
\ No newline at end of file
+}