[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 fe91057a7525acac1f94a17a4ad6292951ad1855..31f65a50c22a7e7f2ea8e53a025ece67c16948a7 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 4d3a48faa0afb359b1cc5fbe50e9b0492798d704..fade6ca4147b9607b07acc05e9733637ecd52255 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 fb1bae237d4c8a40738001a54c9389ddb3d96b06..12a07c38219add2515924d4a262860db9122c757 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 7f85b59df8ce25f8f1ff000affb914a7aa41ab8d..adeeec0827b20fb0a55affc2632fbbdeb8b8d98e 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 5a872be77d263b5c78f9d873dd9e736b582efcf5..ec85062fc4102e9c1a6b80345dc56d34c948e94b 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;