int legacy_player_set_replaygain_enabled(player_h player, bool enabled);
int legacy_player_is_replaygain_enabled(player_h player, bool *enabled);
+/* audio offload */
+int legacy_player_set_audio_offload_enabled(player_h player, bool enabled);
+int legacy_player_is_audio_offload_enabled(player_h player, bool *enabled);
+
/**
* @}
*/
*enabled = _enable;
return PLAYER_ERROR_NONE;
}
+
+int legacy_player_set_audio_offload_enabled(player_h player, bool enabled)
+{
+ player_s *handle = (player_s *)player;
+ int ret = MM_ERROR_NONE;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+
+ LOGD("set audio offload %d", enabled);
+
+ ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_AUDIO_OFFLOAD, (int)enabled, (char *)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+ return PLAYER_ERROR_NONE;
+}
+
+int legacy_player_is_audio_offload_enabled(player_h player, bool *enabled)
+{
+ player_s *handle = (player_s *)player;
+ int ret = MM_ERROR_NONE;
+ int val = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(enabled);
+
+ if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
+ LOGE("PLAYER_ERROR_INVALID_STATE : current state - %d", handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
+
+ ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_AUDIO_OFFLOAD, &val, (char *)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+ *enabled = (bool)val;
+ LOGD("get audio offload %d", *enabled);
+ return PLAYER_ERROR_NONE;
+}
return ret;
}
+
+int player_disp_set_audio_offload_enabled(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_OFFLOAD_ENABLED;
+ muse_player_handle_s *muse_player = NULL;
+ int val = 0;
+ muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
+ player_msg_get(val, muse_server_module_get_msg(module));
+
+ ret = legacy_player_set_audio_offload_enabled(muse_player->player_handle, (bool)val);
+
+ PLAYER_RETURN_MSG(api, ret, module);
+
+ return ret;
+}
+
+int player_disp_is_audio_offload_enabled(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_IS_AUDIO_OFFLOAD_ENABLED;
+ muse_player_handle_s *muse_player = NULL;
+ bool val = false;
+
+ muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
+
+ ret = legacy_player_is_audio_offload_enabled(muse_player->player_handle, &val);
+
+ PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_INT, "val", (int)val);
+
+ return ret;
+}