LOGD("get audio offload %d", *enabled);
return PLAYER_ERROR_NONE;
}
+
+int legacy_player_set_pitch_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 pitch control %d", enabled);
+ ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PITCH_CONTROL, (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_pitch_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_PITCH_CONTROL, &val, (char *)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+ *enabled = (bool)val;
+ LOGD("get pitch control %d", *enabled);
+ return PLAYER_ERROR_NONE;
+}
+
+int legacy_player_set_pitch_value(player_h player, float pitch)
+{
+ player_s *handle = (player_s *)player;
+ int ret = MM_ERROR_NONE;
+ PLAYER_INSTANCE_CHECK(player);
+
+ if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
+ LOGE("PLAYER_ERROR_INVALID_STATE : current state - %d", handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
+
+ LOGD("set pitch value %1.3f", pitch);
+ ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PITCH_VALUE, (double)pitch, (char *)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+ return PLAYER_ERROR_NONE;
+}
+
+int legacy_player_get_pitch_value(player_h player, float *pitch)
+{
+ player_s *handle = (player_s *)player;
+ int ret = MM_ERROR_NONE;
+ double value = 0.0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pitch);
+
+ 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_PITCH_VALUE, &value, (char *)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+ *pitch = (float)value;
+ LOGD("get pitch value %1.3f", *pitch);
+
+ return PLAYER_ERROR_NONE;
+}
return ret;
}
+
+int player_disp_set_pitch_enabled(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_PITCH_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_pitch_enabled(muse_player->player_handle, (bool)val);
+
+ PLAYER_RETURN_MSG(api, ret, module);
+
+ return ret;
+}
+
+int player_disp_is_pitch_enabled(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_IS_PITCH_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_pitch_enabled(muse_player->player_handle, &val);
+
+ PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_INT, "val", (int)val);
+
+ return ret;
+}
+
+int player_disp_set_pitch_value(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_PITCH_VALUE;
+ muse_player_handle_s *muse_player = NULL;
+ double pitch = 0.0;
+ muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
+ player_msg_get_type(pitch, muse_server_module_get_msg(module), DOUBLE);
+
+ ret = legacy_player_set_pitch_value(muse_player->player_handle, (float)pitch);
+
+ PLAYER_RETURN_MSG(api, ret, module);
+
+ return ret;
+}
+
+int player_disp_get_pitch_value(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_PITCH_VALUE;
+ muse_player_handle_s *muse_player = NULL;
+ float pitch = 0.0;
+
+ muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
+
+ ret = legacy_player_get_pitch_value(muse_player->player_handle, &pitch);
+
+ PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_DOUBLE, "pitch", (double)pitch);
+
+ return ret;
+}