[0.6.97] add interface to get sphercal info 18/172318/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Tue, 13 Mar 2018 07:39:19 +0000 (16:39 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 13 Mar 2018 07:39:19 +0000 (16:39 +0900)
Change-Id: I563890ddcddbe16bd5dc5174e84902277791fb2c

packaging/libmm-player.spec
src/include/mm_player.h
src/include/mm_player_360.h
src/mm_player.c
src/mm_player_360.c

index fe91057..31f65a5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.96
+Version:    0.6.97
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 4d3a48f..fade6ca 100644 (file)
@@ -2164,6 +2164,7 @@ int mm_player_get_streaming_buffering_time(MMHandleType player, int *buffer_ms,
 /**
  * These functions are to display the 360 video content
  */
+int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical);
 int mm_player_360_set_enable(MMHandleType player, bool enable);
 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
 
index fb1bae2..12a07c3 100644 (file)
@@ -34,6 +34,7 @@ extern "C"
 | GLOBAL FUNCTION PROTOTYPES                                                            |
 ========================================================================================*/
 
+int _mmplayer_360_is_content_spherical(MMHandleType player, bool *is_spherical);
 int _mmplayer_360_set_enable(MMHandleType player, bool enable);
 int _mmplayer_360_is_enabled(MMHandleType player, bool *enabled);
 int _mmplayer_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
index 7f85b59..adeeec0 100644 (file)
@@ -1347,6 +1347,22 @@ int mm_player_get_audio_only(MMHandleType player, bool *audio_only)
        return result;
 }
 
+int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical)
+{
+       int result = MM_ERROR_NONE;
+
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(is_spherical, MM_ERROR_INVALID_ARGUMENT);
+
+       MMPLAYER_CMD_LOCK(player);
+
+       result = _mmplayer_360_is_content_spherical(player, is_spherical);
+
+       MMPLAYER_CMD_UNLOCK(player);
+
+       return result;
+}
+
 int mm_player_360_set_enable(MMHandleType player, bool enable)
 {
        int result = MM_ERROR_NONE;
index 5a872be..ec85062 100644 (file)
@@ -54,6 +54,28 @@ __mmplayer_check_audio_sink(mm_player_t* player)
        return true;
 }
 
+int _mmplayer_360_is_content_spherical(MMHandleType hplayer, bool *is_spherical)
+{
+       mm_player_t* player = (mm_player_t*) hplayer;
+
+       MMPLAYER_FENTER();
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(is_spherical, MM_ERROR_INVALID_ARGUMENT);
+
+       LOGD("state %s, spherical info %d",
+                       MMPLAYER_STATE_GET_NAME(MMPLAYER_CURRENT_STATE(player)), player->is_content_spherical);
+
+       if (player->state < MM_PLAYER_STATE_READY) {
+               *is_spherical = false;
+               return MM_ERROR_PLAYER_INVALID_STATE;
+       }
+
+       *is_spherical = (bool)player->is_content_spherical;
+
+       MMPLAYER_FLEAVE();
+       return MM_ERROR_NONE;
+}
+
 int _mmplayer_360_set_enable(MMHandleType hplayer, bool enable)
 {
        mm_player_t* player = (mm_player_t*) hplayer;