player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data);
/**
- * @brief Registers a callback function to be invoked when audio frame is decoded. Audio only contents is possible. If included video, error happens.
- * @since_tizen 2.4
- * @param[in] player The handle to the media player
- * @param[in] sync Sync on the clock
- * @param[in] format Audio format of output pcm
- * @param[in] callback The callback function to register
- * @param[in] user_data The user data to be passed to the callback function
- * @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
- * @retval #PLAYER_ERROR_NOT_SUPPORTD Not supported
- * @pre The player state must be #PLAYER_STATE_IDLE by legacy_player_create() or legacy_player_unprepare().
- * @post legacy_player_media_packet_audio_decoded_cb() will be invoked.
- */
-int legacy_player_set_pcm_extraction_mode(legacy_player_h player, bool sync,
- legacy_player_media_packet_audio_decoded_cb callback, void *user_data);
-
-/**
- * @brief Set pcm mode spec. Samplerate, channel is needed.
- * @since_tizen 2.4
- * @param[in] player The handle to the media player
- * @param[in] samplerate Samplerate
- * @param[in] channel Channel
- * @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
- * @retval #PLAYER_ERROR_NOT_SUPPORTD Not supported
- * @pre The player state must be #PLAYER_STATE_IDLE by legacy_player_create() or legacy_player_unprepare().
- * @see legacy_player_set_pcm_extraction_mode()
- */
-int legacy_player_set_pcm_spec(legacy_player_h player, const char *format, int samplerate, int channel);
-
-/**
* @brief Sets the playback rate include streaming mode.
* @since_tizen 3.0
* @details The default value is @c 1.0.
/*
* Internal Macros
*/
-
-/* DEPRECATED_PLAYER_INTERNAL_API */
-int legacy_player_set_pcm_extraction_mode(legacy_player_h player, bool sync, legacy_player_media_packet_audio_decoded_cb callback, void *user_data)
-{
- legacy_player_t *handle = (legacy_player_t *)player;
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
- mmplayer_audio_extract_opt_e opt = MM_PLAYER_AUDIO_EXTRACT_DEINTERLEAVE; /* sync is true */
-
- PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
- if (!sync)
- opt = MM_PLAYER_AUDIO_EXTRACT_NO_SYNC_WITH_CLOCK | MM_PLAYER_AUDIO_EXTRACT_DEINTERLEAVE;
-
- handle->pcm_extract_opt = opt;
- handle->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME] = callback;
- handle->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME] = user_data;
-
- return PLAYER_ERROR_NONE;
-}
-
-/* DEPRECATED_PLAYER_INTERNAL_API */
-int legacy_player_set_pcm_spec(legacy_player_h player, const char *format, int samplerate, int channel)
-{
- legacy_player_t *handle = (legacy_player_t *)player;
- int ret = MM_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
-
- LOGD("format: %s, rate: %d, ch: %d", format, samplerate, channel);
-
- if (format) {
- ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PCM_EXT_FORMAT, format, strlen(format), NULL);
- if (ret != MM_ERROR_NONE)
- return _lplayer_convert_error_code(ret, (char *)__FUNCTION__);
- }
-
- if (samplerate > 0) {
- ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PCM_EXT_SAMPLERATE, samplerate, NULL);
- if (ret != MM_ERROR_NONE)
- return _lplayer_convert_error_code(ret, (char *)__FUNCTION__);
- }
-
- if (channel > 0) {
- ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PCM_EXT_CHANNELS, channel, NULL);
- if (ret != MM_ERROR_NONE)
- return _lplayer_convert_error_code(ret, (char *)__FUNCTION__);
- }
-
- return PLAYER_ERROR_NONE;
-}
-
int legacy_player_set_streaming_playback_rate(legacy_player_h player, float rate)
{
legacy_player_t *handle = (legacy_player_t *)player;
get_current_track
select_track
get_track_language_code
-set_pcm_extraction_mode
-set_pcm_spec
set_streaming_playback_rate
return_buffer
set_media_stream_dynamic_resolution
MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER,
#endif
MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED,
- MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME, /* DEPRECATED_PLAYER_INTERNAL_API */
MUSE_PLAYER_EVENT_TYPE_NUM
} muse_player_event_e;
__mplayer_default_callback, /* MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER */
#endif
NULL, /* MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED */
- NULL, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME, DEPRECATED_PLAYER_INTERNAL_API */
};
static int __mplayer_set_callback_func(muse_player_handle_t *muse_player, muse_player_event_e type, bool set, void *user_data)
return ret;
}
-int player_disp_set_pcm_extraction_mode(muse_module_h module) /* DEPRECATED_PLAYER_INTERNAL_API */
-{
- int ret = PLAYER_ERROR_NONE;
- muse_player_handle_t *muse_player = NULL;
- muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE;
- int sync;
-
- muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- player_msg_get(sync, muse_server_module_get_msg(module));
-
- muse_player->export_audio_data = true;
- ret = legacy_player_set_pcm_extraction_mode(muse_player->player_handle, sync, __mplayer_audio_decoded_cb, module);
-
- PLAYER_RETURN_MSG(api, ret, module);
-
- return ret;
-}
-
-int player_disp_set_pcm_spec(muse_module_h module) /* DEPRECATED_PLAYER_INTERNAL_API */
-{
- int ret = PLAYER_ERROR_NONE;
- muse_player_handle_t *muse_player = NULL;
- muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_SPEC;
- char format[MUSE_URI_MAX_LENGTH] = { 0, };
- int samplerate = 0;
- int channel = 0;
- bool ret_val = true;
-
- ret_val = __mplayer_disp_get_param_value(muse_server_module_get_msg(module),
- MUSE_TYPE_INT, "samplerate", (void *)&samplerate,
- MUSE_TYPE_INT, "channel", (void *)&channel,
- MUSE_TYPE_STRING, "format", (void *)format,
- INVALID_MUSE_TYPE_VALUE);
- if (ret_val) {
- muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- ret = legacy_player_set_pcm_spec(muse_player->player_handle, format, samplerate, channel);
- } else {
- ret = PLAYER_ERROR_INVALID_OPERATION;
- }
-
- PLAYER_RETURN_MSG(api, ret, module);
-
- return ret;
-}
-
int player_disp_set_streaming_playback_rate(muse_module_h module)
{
int ret = PLAYER_ERROR_NONE;
Name: mmsvc-player
Summary: A Media Player module for muse server
-Version: 0.2.120
+Version: 0.2.121
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0