[0.2.59] add handling for audio_only 35/141735/3
authorEunhae Choi <eunhae1.choi@samsung.com>
Tue, 1 Aug 2017 08:47:36 +0000 (17:47 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 1 Aug 2017 09:37:39 +0000 (18:37 +0900)
Change-Id: Iea8e90730591489b44d48ac7027ce88dbe83bd28

legacy/include/legacy_player.h
legacy/src/legacy_player.c
muse/api.list
muse/src/muse_player.c
packaging/mmsvc-player.spec

index 1f9b246ec7995d6708ec3c61de46f48b29b5b6ef..bf36492395a1dd81a8e74fd0f65ba74edd1dab1d 100644 (file)
@@ -2187,6 +2187,39 @@ int legacy_player_get_max_adaptive_variant_limit(player_h player, int *bandwidth
  */
 bool _check_enabled_user_cb_lock(int event_id);
 
+/**
+ * @brief Sets the audio only mode.
+ * @since_tizen 4.0
+ * @details This function is used to disable or enable video rendering during playback.
+ * @param[in] player       The handle to the media player
+ * @param[in] audio_only   The new audio only status: (@c true = enable audio only, @c false = disable audio only)
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #PLAYER_ERROR_NONE                Successful
+ * @retval #PLAYER_ERROR_INVALID_PARAMETER   Invalid parameter
+ * @retval #PLAYER_ERROR_INVALID_OPERATION   Invalid operation
+ * @retval #PLAYER_ERROR_INVALID_STATE       Invalid player state
+ * @pre The player state must be one of: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
+ * @see player_is_audio_only()
+ */
+int legacy_player_set_audio_only(player_h player, bool audio_only);
+
+/**
+ * @brief Gets the audio only mode status.
+ * @since_tizen 4.0
+ * @param[in]  player      The handle to the media player
+ * @param[out] paudio_only  The current audio only status: (@c true = audio only enabled, @c false = audio only disabled)
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #PLAYER_ERROR_NONE                Successful
+ * @retval #PLAYER_ERROR_INVALID_PARAMETER   Invalid parameter
+ * @retval #PLAYER_ERROR_INVALID_OPERATION   Invalid operation
+ * @pre The player state must be one of: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
+ * @see player_set_audio_only()
+ */
+int legacy_player_is_audio_only(player_h player, bool *paudio_only);
+
+
 /**
  * @}
  */
index 2ef8a24274123a49bfaef9ab3c2a5a7028314443..c684cdfe4b572a056f736fd0edeceeb6514491d3 100644 (file)
@@ -3206,3 +3206,31 @@ int legacy_player_get_max_adaptive_variant_limit(player_h player, int *bandwidth
 
        return PLAYER_ERROR_NONE;
 }
+
+int legacy_player_set_audio_only(player_h player, bool audio_only)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       player_s *handle = (player_s *)player;
+
+       int ret = mm_player_set_audio_only(handle->mm_handle, audio_only);
+       if (ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+       else
+               return PLAYER_ERROR_NONE;
+}
+
+int legacy_player_is_audio_only(player_h player, bool *paudio_only)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(paudio_only);
+       player_s *handle = (player_s *)player;
+       bool audio_only = false;
+
+       int ret = mm_player_get_audio_only(handle->mm_handle, &audio_only);
+       if (ret != MM_ERROR_NONE) {
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+       } else {
+               *paudio_only = audio_only;
+               return PLAYER_ERROR_NONE;
+       }
+}
index 0e1593fd87c2c8ba2e4262d4190d76c5f557646e..57b9e82a3a273a736d4f2d0730c8958dad754f01 100644 (file)
@@ -80,4 +80,6 @@ get_media_packet_video_frame_pool_size
 enable_media_packet_video_frame_decoded_cb
 get_adaptive_variant_info
 set_max_adaptive_variant_limit
-get_max_adaptive_variant_limit
\ No newline at end of file
+get_max_adaptive_variant_limit
+set_audio_only
+is_audio_only
\ No newline at end of file
index 153e144156776c9db96e5b4fc0307379543b6317..5ea1413943d03da8f8550bfdeaee8c1b7ec16448 100644 (file)
@@ -2850,3 +2850,36 @@ int player_disp_get_max_adaptive_variant_limit(muse_module_h module)
 
        return ret;
 }
+
+int player_disp_set_audio_only(muse_module_h module)
+{
+       int ret = PLAYER_ERROR_NONE;
+       muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_ONLY;
+       muse_player_handle_s *muse_player = NULL;
+       int audio_only = 0;
+
+       muse_player = (muse_player_handle_s *)muse_core_ipc_get_handle(module);
+       player_msg_get(audio_only, muse_core_client_get_msg(module));
+
+       ret = legacy_player_set_audio_only(muse_player->player_handle, (bool)audio_only);
+
+       player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_is_audio_only(muse_module_h module)
+{
+       int ret = PLAYER_ERROR_NONE;
+       muse_player_api_e api = MUSE_PLAYER_API_IS_AUDIO_ONLY;
+       muse_player_handle_s *muse_player = NULL;
+       bool audio_only;
+
+       muse_player = (muse_player_handle_s *)muse_core_ipc_get_handle(module);
+
+       ret = legacy_player_is_audio_only(muse_player->player_handle, &audio_only);
+
+       player_msg_return1(api, ret, module, INT, audio_only);
+
+       return ret;
+}
index cdc72fbae1270592e91475563fd835077fa63573..b9353765e8c55b870024e9db87872f3ae4be6ec0 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.58
+Version:    0.2.59
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0