} player_error_e;
/**
- * @brief Enumeration for progressive download message type.
- * @since_tizen 2.3
- */
-typedef enum {
- PLAYER_PD_STARTED = 0, /**< Progressive download is started */
- PLAYER_PD_COMPLETED, /**< Progressive download is completed */
-} player_pd_message_type_e;
-
-/**
* @brief Enumeration for display type.
* @since_tizen 2.3
*/
typedef void (*player_buffering_cb)(int percent, void *user_data);
/**
- * @brief Called when progressive download is started or completed.
- * @since_tizen 2.3
- * @param[in] type The message type for progressive download
- * @param[in] user_data The user data passed from the callback registration function
- * @see legacy_player_set_progressive_download_path()
- */
-typedef void (*player_pd_message_cb)(player_pd_message_type_e type, void *user_data);
-
-/**
* @brief Called when the video is captured.
* @since_tizen 2.3
* @remarks The color space format of the captured image is IMAGE_UTIL_COLORSPACE_RGB888.
* @pre The player state must be set to #PLAYER_STATE_READY by calling legacy_player_prepare() or set to #PLAYER_STATE_PAUSED by calling legacy_player_pause().
* @post The player state will be #PLAYER_STATE_PLAYING.
* @post It invokes legacy_player_completed_cb() when playback completes, if you set a callback with legacy_player_set_completed_cb().
- * @post It invokes legacy_player_pd_message_cb() when progressive download starts or completes, if you set a download path with legacy_player_set_progressive_download_path() and a callback with legacy_player_set_progressive_download_message_cb().
* @see legacy_player_prepare()
* @see legacy_player_prepare_async()
* @see legacy_player_stop()
* @see legacy_player_pause()
* @see legacy_player_set_completed_cb()
* @see legacy_player_completed_cb()
- * @see legacy_player_set_progressive_download_path()
- * @see legacy_player_set_progressive_download_message_cb()
- * @see legacy_player_pd_message_cb()
*/
int legacy_player_start(player_h player);
* @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
* @pre The player state must be set to #PLAYER_STATE_PLAYING by calling legacy_player_start() or set to #PLAYER_STATE_PAUSED by calling legacy_player_pause().
* @post The player state will be #PLAYER_STATE_READY.
- * @post The downloading will be aborted if you use progressive download.
* @see legacy_player_start()
* @see legacy_player_pause()
*/
int legacy_player_unset_buffering_cb(player_h player);
/**
- * @brief Sets a path to download, progressively.
- * @since_tizen 2.3
- * @remarks Progressive download will be started when you invoke legacy_player_start().
- * @param[in] player The handle to the media player
- * @param[in] path The absolute path to download
- * @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_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling legacy_player_create() or legacy_player_unprepare().
- * @see legacy_player_set_progressive_download_message_cb()
- * @see legacy_player_unset_progressive_download_message_cb()
- */
-int legacy_player_set_progressive_download_path(player_h player, const char *path);
-
-/**
- * @brief Gets the status of progressive download.
- * @since_tizen 2.3
- * @param[in] player The handle to the media player
- * @param[out] current The current download position (bytes)
- * @param[out] total_size The total size of the file (bytes)
- * @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 progressive download path must be set by calling legacy_player_set_progressive_download_path().
- * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling legacy_player_start() or set to #PLAYER_STATE_PAUSED by calling legacy_player_pause().
- */
-int legacy_player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size);
-
-/**
- * @brief Registers a callback function to be invoked when progressive download is started or completed.
- * @since_tizen 2.3
- * @param[in] player The handle to the media player
- * @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_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature
- * @pre The path to download must be set by calling legacy_player_set_progressive_download_path().
- * @post legacy_player_pd_message_cb() will be invoked.
- * @see legacy_player_unset_progressive_download_message_cb()
- * @see legacy_player_set_progressive_download_path()
- */
-int legacy_player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data);
-
-/**
- * @brief Unregisters the callback function.
- * @since_tizen 2.3
- * @param[in] player The handle to the media player
- * @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
- * @see legacy_player_set_progressive_download_message_cb()
- */
-int legacy_player_unset_progressive_download_message_cb(player_h player);
-
-/**
* @brief Sets the playback rate.
* @since_tizen 2.3
* @details The default value is @c 1.0.
player_state_e state;
player_internal_state_e internal_state;
bool is_display_visible;
- bool is_progressive_download;
bool is_media_stream;
pthread_t prepare_async_thread;
pthread_t message_thread;
break;
case MM_MESSAGE_STATE_CHANGED: /* 0x03 */
LOGI("STATE CHANGED INTERNALLY - from : %d, to : %d (CAPI State : %d)", msg->state.previous, msg->state.current, handle->state);
- if ((handle->is_progressive_download && msg->state.previous == MM_PLAYER_STATE_NULL && msg->state.current == MM_PLAYER_STATE_READY) ||
- (msg->state.previous == MM_PLAYER_STATE_READY && msg->state.current == MM_PLAYER_STATE_PAUSED)) {
+ if (msg->state.previous == MM_PLAYER_STATE_READY && msg->state.current == MM_PLAYER_STATE_PAUSED) {
LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
/* asyc && prepared cb has been set */
return 1;
}
-static int __pd_message_callback(int message, void *param, void *user_data)
-{
- player_s *handle = (player_s *)user_data;
- player_pd_message_type_e type;
- switch (message) {
- case MM_MESSAGE_PD_DOWNLOADER_START:
- type = PLAYER_PD_STARTED;
- break;
- case MM_MESSAGE_PD_DOWNLOADER_END:
- type = PLAYER_PD_COMPLETED;
- break;
- default:
- return 0;
- }
-
- LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PD);
-
- if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PD])
- ((player_pd_message_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PD])(type, handle->user_data[MUSE_PLAYER_EVENT_TYPE_PD]);
-
- LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PD);
-
- return 0;
-}
-
static MMDisplaySurfaceType __player_convert_display_type(player_display_type_e type)
{
switch (type) {
{
switch (type) {
case MUSE_PLAYER_EVENT_TYPE_PREPARE: /* fall through */
- case MUSE_PLAYER_EVENT_TYPE_PD: /* fall through */
case MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS_WITH_INFO: /* fall through */
case MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS_WITH_INFO: /* fall through */
return TRUE;
goto ERROR;
}
- if (!handle->is_progressive_download) {
- ret = pthread_create(&handle->prepare_async_thread, NULL, (void *)__prepare_async_thread_func, (void *)handle);
+ ret = pthread_create(&handle->prepare_async_thread, NULL, (void *)__prepare_async_thread_func, (void *)handle);
- if (ret != 0) {
- LOGE("[%s] failed to create thread ret = %d", __FUNCTION__, ret);
- LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
- if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
- handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
- /* user_data will be free at player_disp_prepare_async() */
- handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
- }
- LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
- __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
- return PLAYER_ERROR_OUT_OF_MEMORY;
+ if (ret != 0) {
+ LOGE("[%s] failed to create thread ret = %d", __FUNCTION__, ret);
+ LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
+ if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
+ handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
+ /* user_data will be free at player_disp_prepare_async() */
+ handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
}
+ LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
+ __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
+ return PLAYER_ERROR_OUT_OF_MEMORY;
}
LOGI("[%s] End", __FUNCTION__);
return __player_convert_error_code(ret, (char *)__FUNCTION__);
}
- if (!handle->is_progressive_download)
- ret = mm_player_pause(handle->mm_handle);
-
+ ret = mm_player_pause(handle->mm_handle);
if (ret != MM_ERROR_NONE) {
int uret;
uret = mm_player_unrealize(handle->mm_handle);
} else {
__player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
handle->is_display_visible = TRUE;
- handle->is_progressive_download = FALSE;
LOGI("[%s] End", __FUNCTION__);
PLAYER_TRACE_END();
return PLAYER_ERROR_NONE;
LOGW("[%s] Failed to set display_visible '1' (0x%x)", __FUNCTION__, ret);
}
if (handle->internal_state == PLAYER_INTERNAL_STATE_STOPPED) {
- if (handle->is_progressive_download) {
- LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
- return PLAYER_ERROR_INVALID_OPERATION;
- }
-
ret = mm_player_start(handle->mm_handle);
LOGI("[%s] stop -> start() ", __FUNCTION__);
} else {
return PLAYER_ERROR_NONE;
}
-int legacy_player_set_progressive_download_path(player_h player, const char *path)
-{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(path);
-
- player_s *handle = (player_s *)player;
- PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
- int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PD_MODE, MM_PLAYER_PD_MODE_URI, "pd_location", path, strlen(path), (char *)NULL);
- if (ret != MM_ERROR_NONE) {
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
- } else {
- handle->is_progressive_download = 1;
- return PLAYER_ERROR_NONE;
- }
-}
-
-int legacy_player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size)
-{
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(current);
- PLAYER_NULL_ARG_CHECK(total_size);
- player_s *handle = (player_s *)player;
- if (handle->state != PLAYER_STATE_PLAYING && handle->state != PLAYER_STATE_PAUSED) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
- guint64 _current;
- guint64 _total;
- int ret = mm_player_get_pd_status(handle->mm_handle, &_current, &_total);
- if (ret != MM_ERROR_NONE) {
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
- } else {
- *current = _current;
- *total_size = _total;
- return PLAYER_ERROR_NONE;
- }
-}
-
int legacy_player_capture_video(player_h player, player_video_captured_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
return __unset_callback(MUSE_PLAYER_EVENT_TYPE_SUBTITLE, player);
}
-int legacy_player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data)
-{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
-
- player_s *handle = (player_s *)player;
-
- if (handle->state != PLAYER_STATE_IDLE && handle->state != PLAYER_STATE_READY) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
-
- int ret = mm_player_set_pd_message_callback(handle->mm_handle, __pd_message_callback, (void *)handle);
- if (ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
-
- handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PD] = callback;
- handle->user_data[MUSE_PLAYER_EVENT_TYPE_PD] = user_data;
- LOGI("[%s] Event type : %d ", __FUNCTION__, MUSE_PLAYER_EVENT_TYPE_PD);
- return PLAYER_ERROR_NONE;
-}
-
-int legacy_player_unset_progressive_download_message_cb(player_h player)
-{
- PLAYER_INSTANCE_CHECK(player);
- player_s *handle = (player_s *)player;
-
- LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PD);
- handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PD] = NULL;
- handle->user_data[MUSE_PLAYER_EVENT_TYPE_PD] = NULL;
- LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PD);
- LOGI("[%s] Event type : %d ", __FUNCTION__, MUSE_PLAYER_EVENT_TYPE_PD);
-
- int ret = mm_player_set_pd_message_callback(handle->mm_handle, NULL, NULL);
- if (ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
- else
- return PLAYER_ERROR_NONE;
-}
-
int legacy_player_release_video_stream_bo(player_h player, void* bo)
{
PLAYER_INSTANCE_CHECK(player);
audio_effect_get_equalizer_band_frequency_range
audio_effect_equalizer_clear
audio_effect_equalizer_is_available
-set_progressive_download_path
-get_progressive_download_status
capture_video
set_streaming_cookie
set_streaming_user_agent
MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME,
MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME,
MUSE_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR,
- MUSE_PLAYER_EVENT_TYPE_PD,
MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT,
MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET,
MUSE_PLAYER_EVENT_TYPE_MISSED_PLUGIN,
return;
}
-static void _pd_msg_cb(player_pd_message_type_e type, void *user_data)
-{
- muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
- muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_PD;
- muse_module_h module = (muse_module_h)user_data;
-
- LOGD("ENTER");
-
- PLAYER_SEND_EVENT_MSG(api, ev, module, MUSE_TYPE_INT, "type", (int)type);
-}
-
static int _get_tbm_surface_format(int in_format, uint32_t *out_format)
{
if (in_format <= MM_PIXEL_FORMAT_INVALID || in_format >= MM_PIXEL_FORMAT_NUM || out_format == NULL) {
legacy_player_unset_buffering_cb(player);
}
-static void _set_pd_msg_cb(player_h player, void *module, bool set)
-{
- int ret = PLAYER_ERROR_NONE;
- muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
-
- if (set)
- ret = legacy_player_set_progressive_download_message_cb(player, _pd_msg_cb, module);
- else
- ret = legacy_player_unset_progressive_download_message_cb(player);
-
- PLAYER_RETURN_MSG(api, ret, module);
-}
-
static void _set_media_packet_video_frame_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
_set_media_packet_video_frame_cb, /* MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME */
NULL, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME */
NULL, /* MUSE_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR */
- _set_pd_msg_cb, /* MUSE_PLAYER_EVENT_TYPE_PD */
NULL, /* MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT */
NULL, /* MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET */
NULL, /* MUSE_PLAYER_EVENT_TYPE_MISSED_PLUGIN */
return ret;
}
-int player_disp_set_progressive_download_path(muse_module_h module)
-{
- int ret = PLAYER_ERROR_NONE;
- muse_player_handle_s *muse_player = NULL;
- muse_player_api_e api = MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH;
- char dw_path[MUSE_URI_MAX_LENGTH] = { 0, };
-
- muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
- player_msg_get_string(dw_path, muse_server_module_get_msg(module));
-
- if ((ret = _check_supportable(module, dw_path)) == PLAYER_ERROR_NONE)
- ret = legacy_player_set_progressive_download_path(muse_player->player_handle, dw_path);
-
- PLAYER_RETURN_MSG(api, ret, module);
- return ret;
-}
-
-int player_disp_get_progressive_download_status(muse_module_h module)
-{
- int ret = PLAYER_ERROR_NONE;
- muse_player_handle_s *muse_player = NULL;
- muse_player_api_e api = MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS;
- unsigned long current = 0;
- unsigned long total_size = 0;
-
- muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
-
- ret = legacy_player_get_progressive_download_status(muse_player->player_handle, ¤t, &total_size);
-
- PLAYER_RETURN_MSG(api, ret, module,
- MUSE_TYPE_POINTER, "current", (POINTER)current,
- MUSE_TYPE_POINTER, "total_size", (POINTER)total_size);
-
- return ret;
-}
-
int player_disp_capture_video(muse_module_h module)
{
int ret = PLAYER_ERROR_NONE;
Name: mmsvc-player
Summary: A Media Player module for muse server
-Version: 0.2.91
+Version: 0.2.92
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0