#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: |
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);
"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);
}
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;
}
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",
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);
_mmplayer_create_player(MMHandleType handle)
{
int ret = MM_ERROR_PLAYER_INTERNAL;
+ bool enabled = false;
+
mm_player_t* player = MM_PLAYER_CAST(handle);
MMPLAYER_FENTER();
/* 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;