[0.6.110] consider the feature when building pipeline 64/179164/1 accepted/tizen/unified/20180517.062318 submit/tizen/20180516.072931
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 16 May 2018 07:00:24 +0000 (16:00 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 16 May 2018 07:00:24 +0000 (16:00 +0900)
Change-Id: If8c85c22ebcf343a5685835ca5adbebf13b24c3b

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

index bd961ac..f35188c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.109
+Version:    0.6.110
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 692ff4c..e98fd76 100644 (file)
@@ -824,6 +824,7 @@ typedef struct {
 
        /* Video360 related stuff
         * */
+       gboolean is_360_feature_enabled;
        gboolean is_content_spherical;
        mm_player_spherical_metadata_t video360_metadata;
        gboolean is_openal_plugin_used;
index 09d4e86..78b1bbe 100755 (executable)
 #define PLAYER_BUS_MSG_DEFAULT_TIMEOUT 500 /* bus msg wait timeout */
 #define PLAYER_BUS_MSG_PREPARE_TIMEOUT 10
 
-#define SPATIAL_AUDIO_CAPS "audio/x-raw,format=S16LE,channels=4"
+#define SPATIAL_AUDIO_CAPS             "audio/x-raw,format=S16LE,channels=4"
+#define FEATURE_NAME_SPHERICAL_VIDEO   "http://tizen.org/feature/multimedia.player.spherical_video"
 
 /*---------------------------------------------------------------------------
 |    LOCAL CONSTANT DEFINITIONS:                                                                                       |
@@ -4629,11 +4630,12 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                                player->video360_metadata.ambisonic_format, player->video360_metadata.ambisonic_order);
 
                /* Note: qtdemux converts audio metadata defaults to openalsink defaults. */
-               if (player->is_content_spherical &&
-                               channels == 4 &&
-                               player->video360_metadata.ambisonic_type == MMFILE_AMBISONIC_TYPE_PERIPHONIC &&
-                               player->video360_metadata.ambisonic_format == MMFILE_AMBISONIC_FORMAT_AMB &&
-                               player->video360_metadata.ambisonic_order == MMFILE_AMBISONIC_ORDER_FOA) {
+               if (player->is_360_feature_enabled &&
+                       player->is_content_spherical &&
+                       channels == 4 &&
+                       player->video360_metadata.ambisonic_type == MMFILE_AMBISONIC_TYPE_PERIPHONIC &&
+                       player->video360_metadata.ambisonic_format == MMFILE_AMBISONIC_FORMAT_AMB &&
+                       player->video360_metadata.ambisonic_order == MMFILE_AMBISONIC_ORDER_FOA) {
 
                        strncpy(player->ini.audiosink_element, "openalsink", PLAYER_INI_MAX_STRLEN - 1);
 
@@ -4664,7 +4666,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                                                "source-orientation-x", player->video360_metadata.init_view_pitch, NULL);
                        }
                } else {
-                       if (player->is_content_spherical)
+                       if (player->is_360_feature_enabled && player->is_content_spherical)
                                LOGW("Audio track isn't of the ambisonic type and can't be played back as a spatial sound.\n");
                        MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_SINK, player->ini.audiosink_element, "audiosink", link_audio_sink_now, player);
                }
@@ -5186,7 +5188,7 @@ __mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket)
 
        MMPLAYER_FENTER();
 
-       if (player->set_mode.video_zc || player->is_content_spherical) {
+       if (player->set_mode.video_zc || (player->is_360_feature_enabled && player->is_content_spherical)) {
                LOGD("do not need to add video filters.");
                return MM_ERROR_NONE;
        }
@@ -5264,7 +5266,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        int enable_video_decoded_cb = 0;
        mm_attrs_get_int_by_name(player->attrs, "enable_video_decoded_cb", &enable_video_decoded_cb);
 
-       if (player->is_content_spherical) {
+       if (player->is_360_feature_enabled && player->is_content_spherical) {
                LOGD("video360 elem will be added.");
 
                MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_360, "video360",
@@ -5354,7 +5356,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        switch (surface_type) {
        case MM_DISPLAY_SURFACE_OVERLAY:
        {
-               bool use_tbm = (player->set_mode.video_zc || player->is_content_spherical);
+               bool use_tbm = (player->set_mode.video_zc || (player->is_360_feature_enabled && player->is_content_spherical));
                if (!use_tbm) {
                        LOGD("selected videosink name: %s", videosink_element);
 
@@ -8147,6 +8149,8 @@ int
 _mmplayer_create_player(MMHandleType handle)
 {
        int ret = MM_ERROR_PLAYER_INTERNAL;
+       bool enabled = false;
+
        mm_player_t* player = MM_PLAYER_CAST(handle);
 
        MMPLAYER_FENTER();
@@ -8257,6 +8261,16 @@ _mmplayer_create_player(MMHandleType handle)
 
        /* Set video360 settings to their defaults for just-created player.
         * */
+
+       player->is_360_feature_enabled = FALSE;
+       if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(FEATURE_NAME_SPHERICAL_VIDEO, &enabled)) {
+               LOGI("spherical feature info: %d", enabled);
+               if (enabled)
+                       player->is_360_feature_enabled = TRUE;
+       } else {
+               LOGE("failed to get spherical feature info");
+       }
+
        player->is_content_spherical = FALSE;
        player->is_video360_enabled = TRUE;
        player->video360_metadata.projection_type = VIDEO360_PROJECTION_TYPE_EQUIRECTANGULAR;