LEGACY_PLAYER_CALLBACK_TYPE_RETURN_BUFFER,
LEGACY_PLAYER_CALLBACK_TYPE_SERVICE_DISCONNECTED,
LEGACY_PLAYER_CALLBACK_TYPE_INTERRUPT_STARTED,
- LEGACY_PLAYER_CALLBACK_TYPE_STATE_CHANGED,
LEGACY_PLAYER_CALLBACK_TYPE_NUM
} legacy_player_callback_type_e;
*/
typedef void (*legacy_player_video_stream_changed_cb)(int width, int height, int fps, int bit_rate, void *user_data);
-/**
- * @brief Called when the media player is state changed(actually unrealized now).
- */
-typedef void (*legacy_player_state_changed_cb)(int state_previous, int state_current, void *user_data);
-
/**
* @brief Creates a player handle for playing multimedia content.
* @since_tizen 2.3
/* check internal api callback */
L_PLAYER_USER_CB_LOCK(handle, event_type_internal);
if (handle->user_cb[event_type_internal]) {
- LOGD("event type %d, status %d, bytes %llu", event_type_internal, buffer_status, buffer_bytes);
+ LOGD("event type %d, status %d, bytes %"PRIu64, event_type_internal, buffer_status, buffer_bytes);
((legacy_player_media_stream_buffer_status_cb_ex)handle->user_cb[event_type_internal]) \
(event_type_internal, buffer_status, buffer_bytes, handle->user_data[event_type_internal]);
}
handle->user_data[LEGACY_PLAYER_CALLBACK_TYPE_PREPARE] = NULL;
}
L_PLAYER_USER_CB_UNLOCK(handle, LEGACY_PLAYER_CALLBACK_TYPE_PREPARE);
- } else if (msg->state.previous > MM_PLAYER_STATE_NULL && msg->state.current == MM_PLAYER_STATE_NULL) {
- LOGI("Unrealized!");
- if (handle->user_cb[LEGACY_PLAYER_CALLBACK_TYPE_STATE_CHANGED]) {
- ((legacy_player_state_changed_cb)handle->user_cb[LEGACY_PLAYER_CALLBACK_TYPE_STATE_CHANGED])(
- __lplayer_convert_state(msg->state.previous),
- __lplayer_convert_state(msg->state.current),
- handle->user_data[LEGACY_PLAYER_CALLBACK_TYPE_STATE_CHANGED]);
- }
}
break;
case MM_MESSAGE_BEGIN_OF_STREAM: /* 0x104 */
__mplayer_remove_export_media_packet(module);
}
-static void __mmplayer_state_changed_cb(int state_previous, int state_current, void *user_data)
-{
- muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
- muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_STATE_CHANGED;
- muse_module_h module = (muse_module_h)user_data;
-
- LOGD("ENTER state %d -> %d", state_previous, state_current);
-
- PLAYER_SEND_EVENT_MSG(api, ev, module,
- MUSE_TYPE_INT, "previous", state_previous,
- MUSE_TYPE_INT, "current", state_current);
-}
-
static void __mplayer_error_cb(int code, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
__mplayer_default_callback, /* MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER */
NULL, /* MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED */
__mmplayer_flush_buffer, /* MUSE_PLAYER_EVENT_TYPE_INTERRUPT_STARTED */
- __mmplayer_state_changed_cb /* MUSE_PLAYER_EVENT_TYPE_STATE_CHANGED */
};
static int __mplayer_set_callback_func(muse_player_handle_t *muse_player, muse_player_event_e type, bool set, void *user_data)
int width = 0;
int height = 0;
if (!muse_player->video_format) {
- media_format_create(&muse_player->video_format);
- if (!muse_player->video_format) {
+ ret = media_format_create(&muse_player->video_format);
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
LOGE("fail to create media format");
return PLAYER_ERROR_INVALID_PARAMETER;
}
int channel = 0;
int samplerate = 0;
if (!muse_player->audio_format) {
- media_format_create(&muse_player->audio_format);
- if (!muse_player->audio_format) {
+ ret = media_format_create(&muse_player->audio_format);
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
LOGE("fail to create media format");
return PLAYER_ERROR_INVALID_PARAMETER;
}
if (ret != PLAYER_ERROR_NONE)
goto ERROR;
- if (legacy_player_set_callback(muse_player->player_handle,
- MUSE_PLAYER_EVENT_TYPE_STATE_CHANGED,
- __mplayer_callback_function[MUSE_PLAYER_EVENT_TYPE_STATE_CHANGED],
- (void *)module) != PLAYER_ERROR_NONE)
- LOGW("failed to set state changed callback");
-
muse_player->total_size_of_buffers = DEFAULT_VDEC_TOTAL_SIZE_OF_BUFFER;
muse_player->extra_size_of_buffers = DEFAULT_VDEC_EXTRA_SIZE_OF_BUFFER;
g_mutex_init(&muse_player->list_lock);