#define PLAYER_FEATURE_SOUND_STREAM "http://tizen.org/feature/multimedia.player.stream_info"
#define PLAYER_FEATURE_OPENGL "http://tizen.org/feature/opengles.version.2_0"
#define PLAYER_FEATURE_SPHERICAL_VIDEO "http://tizen.org/feature/multimedia.player.spherical_video"
+#define PLAYER_FEATURE_AUDIO_OFFLOAD "http://tizen.org/feature/multimedia.player.audio_offload"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
int int_data;
callback_cb_info_s *cb_info;
_player_recv_data *recv_data;
- GMutex event_mutex;
} _player_cb_data;
typedef struct {
static void _player_event_queue_add(player_event_queue *ev, _player_cb_data *data);
static bool _player_need_sync_context(int event_id);
static void _player_remove_idle_event(callback_cb_info_s *cb_info, muse_player_event_e event_type, bool remove_all);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
typedef void (*player_retrieve_buffer_cb)(void *user_data);
static void __retrieve_buffer_cb(void *user_data);
+static void __player_media_packet_video_decoded_cb(media_packet_h packet, void *user_data);
static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data);
static int __player_unset_retrieve_buffer_cb(player_h player);
-#endif
static void _player_release_internal_memory(player_cli_s *pc, bool deinit_server_mem);
/*
char *param_name = NULL;
void *value = NULL;
- LOGE("ENTER");
-
void *jobj = muse_core_msg_object_new(buf, NULL, &err);
if (!jobj) {
static int __set_callback(muse_player_event_e type, player_h player, void *callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
int set = 1;
- if (MUSE_PLAYER_EVENT_TYPE_BUFFERING == type) {
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+
+ if (type == MUSE_PLAYER_EVENT_TYPE_BUFFERING) {
if (!_player_check_network_availability())
return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
+ pc->cb_info->drop_buffering_message = FALSE;
}
if (!CALLBACK_INFO(pc))
static int __unset_callback(muse_player_event_e type, player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
int set = 0;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGI("Event type : %d ", type);
PLAYER_NULL_ARG_CHECK(CALLBACK_INFO(pc));
((player_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
+static void __player_media_packet_video_decoded_cb(media_packet_h packet, void *user_data)
+{
+ if (!packet || !user_data) {
+ LOGE("invalid param [packet:%p, user_data:%p]", packet, user_data);
+ return;
+ }
+
+ LOGD("render packet %p", packet);
+
+ mm_display_interface_evas_render(DP_INTERFACE((player_cli_s *)user_data), packet);
+}
+
static void __retrieve_buffer_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
{
muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER;
((player_retrieve_buffer_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
}
-#endif
static void __interrupt_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
{
int percent;
muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_BUFFERING;
- if (player_msg_get(percent, recv_data->buffer))
+ if (player_msg_get(percent, recv_data->buffer)) {
+ g_mutex_lock(&cb_info->buffering_cb_mutex);
+ if (cb_info->drop_buffering_message) {
+ LOGD("Drop buffering callback");
+ g_mutex_unlock(&cb_info->buffering_cb_mutex);
+ return;
+ }
+ g_mutex_unlock(&cb_info->buffering_cb_mutex);
((player_buffering_cb)cb_info->user_cb[ev])(percent, cb_info->user_data[ev]);
+ }
+
}
static void __subtitle_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
}
EXIT:
- if (recv_data->tfd[0] > INVALID_DEFAULT_VALUE)
- close(recv_data->tfd[0]);
+ PLAYER_CLOSE_FD(recv_data->tfd[0]);
+
memset(recv_data->tfd, INVALID_DEFAULT_VALUE, sizeof(recv_data->tfd));
if (bo)
static void __seek_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
{
+ int ret = MM_ERROR_NONE;
muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_SEEK;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- void *dl_handle = NULL;
- int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
g_mutex_lock(&cb_info->seek_cb_mutex);
switch (cb_info->seek_cb_state) {
break;
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (cb_info->evas_info && cb_info->evas_info->support_video) {
- if (cb_info->evas_info->handle && cb_info->evas_info->visible != EVAS_VISIBLE_FALSE) {
- dl_handle = dlopen(PATH_DISP_LIB, RTLD_LAZY);
- if (dl_handle) {
- PLAYER_DISP_DLSYM(dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- int ret = p_disp_set_evas_display_visible(cb_info->evas_info->handle, true);
- dlclose(dl_handle);
- if (ret != MM_ERROR_NONE)
- LOGW("failed to set visible at evas 0x%x", ret);
- else
- cb_info->evas_info->visible = EVAS_VISIBLE_TRUE;
- } else {
- LOGW("not support video rendering");
- }
- }
+ ret = mm_display_interface_get_type(cb_info->dp_info.interface, &display_type);
+ if (ret == MM_ERROR_NONE && display_type == MM_DISPLAY_TYPE_EVAS &&
+ cb_info->dp_info.visible != PLAYER_VISIBLE_INFO_FALSE) {
+ LOGW("set display visible true for EVAS");
+ if (mm_display_interface_evas_set_visible(cb_info->dp_info.interface, true) != MM_ERROR_NONE)
+ LOGE("mm_display_interface_evas_set_visible failed");
+ } else {
+ LOGW("get display type ret 0x%x, type %d", ret, display_type);
}
-#endif
+
LOGD("call seek cb");
((player_seek_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
set_null_user_cb(cb_info, ev);
LOGD("total num of tsurf list = %d", g_list_length(pc->cb_info->tsurf_list));
for (l = g_list_first(pc->cb_info->tsurf_list); l; l = g_list_next(l)) {
- player_tsurf_info_t *tmp = (player_tsurf_info_t *)l->data;
+ player_tsurf_info_s *tmp = (player_tsurf_info_s *)l->data;
LOGD("%p will be removed", tmp);
if (tmp) {
return;
}
-static player_tsurf_info_t *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, int *key, int height, int width)
+static player_tsurf_info_s *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, intptr_t key, int height, int width)
{
GList *l = NULL;
g_mutex_lock(&cb_info->data_mutex);
for (l = g_list_first(cb_info->tsurf_list); l; l = g_list_next(l)) {
- player_tsurf_info_t *tmp = (player_tsurf_info_t *)l->data;
- if (tmp && key && (tmp->key[0] == key[0])) {
- LOGD("found tsurf_data of tbm_key %d", key[0]);
+ player_tsurf_info_s *tmp = (player_tsurf_info_s *)l->data;
+ if (tmp && key && (tmp->key == key)) {
+ LOGD("found tsurf_data of tbm_key %" PRIdPTR, key);
/* need to check tsuf info to support DRC */
if ((tbm_surface_get_height(tmp->tsurf) != height) ||
static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data)
{
tbm_bo bo[4] = { NULL, };
- int key[4] = { INVALID_DEFAULT_VALUE, };
tbm_surface_info_s sinfo;
char *surface_info = (char *)&sinfo;
media_packet_h pkt = NULL;
tbm_surface_h tsurf = NULL;
- player_tsurf_info_t *tsurf_data = NULL;
+ player_tsurf_info_s *tsurf_data = NULL;
int bo_num = 0;
media_format_mimetype_e mimetype = MEDIA_FORMAT_NV12;
bool make_pkt_fmt = false;
int ret = MEDIA_FORMAT_ERROR_NONE;
_media_pkt_video_fin_data *fin_data = NULL;
+ intptr_t key = 0;
intptr_t v_data = 0;
uint64_t pts = 0;
int i = 0, orientation = 0;
void *jobj = muse_core_msg_object_new(recv_data->buffer, NULL, &err);
if (!jobj ||
- !muse_core_msg_object_get_value("key[0]", jobj, MUSE_TYPE_ANY, &key[0]) ||
- !muse_core_msg_object_get_value("key[1]", jobj, MUSE_TYPE_ANY, &key[1]) ||
- !muse_core_msg_object_get_value("key[2]", jobj, MUSE_TYPE_ANY, &key[2]) ||
- !muse_core_msg_object_get_value("key[3]", jobj, MUSE_TYPE_ANY, &key[3]) ||
+ !muse_core_msg_object_get_value("key", jobj, MUSE_TYPE_POINTER, &key) ||
!muse_core_msg_object_get_value("v_data", jobj, MUSE_TYPE_POINTER, &v_data) ||
!muse_core_msg_object_get_value("mimetype", jobj, MUSE_TYPE_ANY, &mimetype) ||
!muse_core_msg_object_get_value("pts", jobj, MUSE_TYPE_INT64, &pts) ||
bo[i] = tbm_bo_import_fd(cb_info->bufmgr, recv_data->tfd[i]);
}
- tsurf_data = g_new(player_tsurf_info_t, 1);
- if (!tsurf_data) {
- LOGE("failed to alloc tsurf info");
- goto ERROR;
- }
- memset(tsurf_data->key, INVALID_DEFAULT_VALUE, sizeof(tsurf_data->key));
-
tsurf = tbm_surface_internal_create_with_bos(&sinfo, bo, bo_num);
if (!tsurf) {
LOGE("failed to create tbm surface");
- g_free(tsurf_data);
goto ERROR;
}
- memcpy(tsurf_data->key, key, sizeof(tsurf_data->key));
- tsurf_data->tsurf = tsurf;
+
if (cb_info->use_tsurf_pool) {
+ tsurf_data = g_try_new(player_tsurf_info_s, 1);
+ if (!tsurf_data) {
+ LOGE("failed to alloc tsurf info");
+ goto ERROR;
+ }
+ tsurf_data->key = key;
+ tsurf_data->tsurf = tsurf;
+
g_mutex_lock(&cb_info->data_mutex);
cb_info->tsurf_list = g_list_append(cb_info->tsurf_list, tsurf_data);
- LOGD("key %d is added to the pool", key[0]);
+ LOGD("key %" PRIdPTR " is added to the pool", key);
if (cb_info->video_frame_pool_size < g_list_length(cb_info->tsurf_list))
LOGE("need to check the pool size: %d < %d", cb_info->video_frame_pool_size, g_list_length(cb_info->tsurf_list));
g_mutex_unlock(&cb_info->data_mutex);
}
}
- fin_data = g_new0(_media_pkt_video_fin_data, 1);
+ fin_data = g_try_new0(_media_pkt_video_fin_data, 1);
if (!fin_data) {
LOGE("failed to alloc fin_data");
goto ERROR;
media_packet_destroy(pkt);
}
- for (i = 0; i < MUSE_NUM_FD; i++) { /* if tsruf pool is enabled, bo_num can be zero. */
- if (recv_data->tfd[i] > INVALID_DEFAULT_VALUE)
- close(recv_data->tfd[i]);
- }
+ /* if tsruf pool is enabled, bo_num can be zero. */
+ for (i = 0; i < MUSE_NUM_FD; i++)
+ PLAYER_CLOSE_FD(recv_data->tfd[i]);
for (i = 0; i < bo_num; i++) {
if (bo[i])
ERROR:
if (pkt)
media_packet_destroy(pkt);
+ else if (!tsurf_data && tsurf)
+ tbm_surface_destroy(tsurf);
if (fin_data)
g_free(fin_data);
- for (i = 0; i < MUSE_NUM_FD; i++) { /* if tsruf pool is enabled, bo_num can be zero. */
- if (recv_data->tfd[i] > INVALID_DEFAULT_VALUE)
- close(recv_data->tfd[i]);
- }
+ /* if tsruf pool is enabled, bo_num can be zero. */
+ for (i = 0; i < MUSE_NUM_FD; i++)
+ PLAYER_CLOSE_FD(recv_data->tfd[i]);
for (i = 0; i < bo_num; i++) {
if (bo[i])
tbm_bo bo = NULL;
tbm_bo_handle thandle;
int key = INVALID_DEFAULT_VALUE;
- player_audio_raw_data_s audio; /* DEPRECATED_PLAYER_INTERNAL_API */
+ player_audio_decoded_data_info_t audio;
media_packet_h pkt = NULL;
media_format_h fmt = NULL;
_media_pkt_audio_fin_data *fin_data = NULL;
goto EXIT;
}
- memcpy(&audio, thandle.ptr, sizeof(player_audio_raw_data_s));
- audio.data = thandle.ptr + sizeof(player_audio_raw_data_s);
+ memcpy(&audio, thandle.ptr, sizeof(player_audio_decoded_data_info_t));
+ audio.data = thandle.ptr + sizeof(player_audio_decoded_data_info_t);
tbm_bo_unmap(bo);
/* LOGD("user callback data %p, size %d", audio.data, audio.size); */
((player_media_packet_audio_decoded_cb)cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME])
(pkt, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME]);
- } else if (cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME]) { /* DEPRECATED_PLAYER_INTERNAL_API, will be removed */
- ((player_audio_pcm_extraction_cb)cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME])
- (&audio, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME]);
} else {
LOGE("there is no registered cb");
goto EXIT;
}
EXIT:
- if (recv_data->tfd[0] > INVALID_DEFAULT_VALUE)
- close(recv_data->tfd[0]);
+ PLAYER_CLOSE_FD(recv_data->tfd[0]);
+
memset(recv_data->tfd, INVALID_DEFAULT_VALUE, sizeof(recv_data->tfd));
if (fmt)
}
static void (*_user_callbacks[MUSE_PLAYER_EVENT_TYPE_NUM])(callback_cb_info_s *cb_info, _player_recv_data *recv_data) = {
- __prepare_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_PREPARE */
+ __prepare_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_PREPARE */
__complete_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_COMPLETE */
__interrupt_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_INTERRUPT */
__error_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_ERROR */
__media_stream_audio_seek_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK */
NULL, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED */
__video_stream_changed_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED */
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
__retrieve_buffer_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER */
-#endif
- __media_packet_audio_frame_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME, DEPRECATED_PLAYER_INTERNAL_API */
__disconnected_error_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED */
};
_player_cb_data *data = (_player_cb_data *)user_data;
muse_player_event_e ev;
- if (data == NULL) {
- LOGE("data is null");
+ if (!data || !data->cb_info) {
+ LOGE("invalid user data");
return FALSE;
}
ev = data->int_data;
if ((ev != MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME) &&
(ev != MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME))
- LOGD("enter ev:%d", ev);
-
- g_mutex_lock(&data->event_mutex);
-
- if (data->cb_info == NULL) {
- /* tried to remove before at _player_remove_idle_event */
- LOGW("cb_info is NULL. event %d", data->int_data);
- goto DONE;
- }
+ LOGD("enter ev:%d(%p)", ev, data);
/* remove event from list */
g_mutex_lock(&data->cb_info->event_queue.idle_ev_mutex);
}
g_mutex_unlock(&data->cb_info->event_queue.idle_ev_mutex);
- if ((data->cb_info->user_cb[ev] || ev == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED ||
- (data->cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME] && ev == MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME)) &&
+ if ((data->cb_info->user_cb[ev] || ev == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED) &&
(_user_callbacks[ev]))
_user_callbacks[ev](data->cb_info, data->recv_data);
else
LOGW("user callback is unset. type : %d", ev);
-DONE:
- /* unlock and release event */
- g_mutex_unlock(&data->event_mutex);
- g_mutex_clear(&data->event_mutex);
-
- if (data->recv_data) {
- g_free(data->recv_data->buffer);
- g_free(data->recv_data);
- }
- g_free(data);
-
return FALSE; /* remove from the event list */
}
}
}
+static void _destroy_event_data(gpointer user_data)
+{
+ _player_cb_data *data = (_player_cb_data *)user_data;
+
+ if (data == NULL) {
+ LOGW("data is null");
+ return;
+ }
+
+ LOGD("remove event data %p (%d)", data, data->int_data);
+ if (data->recv_data) {
+ g_free(data->recv_data->buffer);
+ data->recv_data->buffer = NULL;
+ g_free(data->recv_data);
+ data->recv_data = NULL;
+ }
+
+ g_free(data);
+}
+
static void *_player_event_queue_loop(void *param)
{
if (!param) {
g_mutex_lock(&ev->qlock);
event_data = (_player_cb_data *)g_queue_pop_head(ev->queue);
g_mutex_unlock(&ev->qlock);
- if (event_data) {
- muse_player_event_e event_type = event_data->int_data;
-
- if (event_type == MUSE_PLAYER_EVENT_TYPE_SEEK) {
- g_mutex_lock(&cb_info->seek_cb_mutex);
- if (cb_info->seek_cb_state == PLAYER_SEEK_CB_STATE_WAIT) {
- /* push event into queue again. */
- _player_event_queue_add(ev, event_data);
- g_mutex_unlock(&cb_info->seek_cb_mutex);
- break;
- }
+
+ if (!event_data)
+ break;
+
+ muse_player_event_e event_type = event_data->int_data;
+
+ if (event_type == MUSE_PLAYER_EVENT_TYPE_SEEK) {
+ g_mutex_lock(&cb_info->seek_cb_mutex);
+ if (cb_info->seek_cb_state == PLAYER_SEEK_CB_STATE_WAIT) {
+ /* push event into queue again. */
+ _player_event_queue_add(ev, event_data);
g_mutex_unlock(&cb_info->seek_cb_mutex);
+ break;
}
+ g_mutex_unlock(&cb_info->seek_cb_mutex);
+ } else if (event_type == MUSE_PLAYER_EVENT_TYPE_BUFFERING) {
+ g_mutex_lock(&cb_info->buffering_cb_mutex);
+ if (cb_info->drop_buffering_message) {
+ LOGD("Drop buffering event");
+ g_mutex_unlock(&cb_info->buffering_cb_mutex);
+
+ _destroy_event_data(event_data);
+ break;
+ }
+ g_mutex_unlock(&cb_info->buffering_cb_mutex);
+ }
- if (_player_need_sync_context(event_type)) {
- if ((cb_info->user_cb[event_type] || (event_type == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED)) &&
- _user_callbacks[event_type]) {
- g_mutex_lock(&ev->idle_ev_mutex);
- ev->idle_ev_list = g_list_append(ev->idle_ev_list, (gpointer)event_data);
- g_mutex_unlock(&ev->idle_ev_mutex);
-
- LOGD("add ev %d to main loop", event_type);
-
- g_idle_add_full(G_PRIORITY_DEFAULT,
- (GSourceFunc)_player_event_job_function,
- (gpointer)event_data,
- NULL);
- } else {
- LOGW("there is no registered cb for ev:%d", event_type);
- if (event_data->recv_data) {
- g_free(event_data->recv_data->buffer);
- g_free(event_data->recv_data);
- }
- g_free(event_data);
- }
+ if (_player_need_sync_context(event_type)) {
+ if ((cb_info->user_cb[event_type] || (event_type == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED)) &&
+ _user_callbacks[event_type]) {
+ g_mutex_lock(&ev->idle_ev_mutex);
+ ev->idle_ev_list = g_list_append(ev->idle_ev_list, (gpointer)event_data);
+ g_mutex_unlock(&ev->idle_ev_mutex);
+
+ LOGD("add ev %d to main loop", event_type);
+
+ g_idle_add_full(G_PRIORITY_DEFAULT,
+ (GSourceFunc)_player_event_job_function,
+ (gpointer)event_data,
+ (GDestroyNotify)_destroy_event_data);
} else {
- _player_event_job_function(event_data);
+ LOGW("there is no registered cb for ev:%d", event_type);
+ _destroy_event_data(event_data);
}
} else {
- break;
+ _player_event_job_function(event_data);
+ _destroy_event_data(event_data);
}
}
}
continue;
}
- if (g_mutex_trylock(&event_data->event_mutex)) {
-
- gboolean ret = FALSE;
- if (remove_all || (event_data->int_data == event_type)) {
-
- LOGD("remove idle event [%p:%d]", event_data, event_data->int_data);
-
- ret = g_idle_remove_by_data(event_data);
- if (ret == FALSE) {
- /* will be handled at _player_event_job_function() as an exception */
- event_data->cb_info = NULL;
- LOGW("failed to remove, idle callback will be called later");
- }
+ if ((event_data->int_data != event_type) && !remove_all)
+ continue;
- /* set cb to null */
- set_null_user_cb(cb_info, event_data->int_data);
- ev->idle_ev_list = g_list_remove(ev->idle_ev_list, (gpointer)event_data);
+ LOGD("remove idle event [%p:%d]", event_data, event_data->int_data);
- g_mutex_unlock(&event_data->event_mutex);
+ /* set cb to null */
+ if (remove_all)
+ set_null_user_cb(cb_info, event_data->int_data);
- if (ret == TRUE) {
- g_mutex_clear(&event_data->event_mutex);
- if (event_data->recv_data) {
- g_free(event_data->recv_data->buffer);
- g_free(event_data->recv_data);
- }
- g_free(event_data);
- event_data = NULL;
- LOGD("remove idle event done");
- } /* else : will be handled if the cb is called. */
- } else {
- g_mutex_unlock(&event_data->event_mutex);
- }
- } else {
- LOGW("event(%d) lock failed. it's being called...", event_data->int_data);
- }
+ ev->idle_ev_list = g_list_remove(ev->idle_ev_list, (gpointer)event_data);
- /* continue: keep checking next event_data */
+ if (!g_idle_remove_by_data(event_data))
+ LOGW("failed to find source with %p", event_data);
}
if (remove_all) {
/* LOGD("get event %d", event); */
if (event < MUSE_PLAYER_EVENT_TYPE_NUM) {
- if ((cb_info->user_cb[event] && _user_callbacks[event]) ||
- (event == MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_AUDIO_FRAME && /* DEPRECATED_PLAYER_INTERNAL_API */
- cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME] && _user_callbacks[event])){
+ if (cb_info->user_cb[event] && _user_callbacks[event]) {
_player_cb_data *data = NULL;
data = g_new(_player_cb_data, 1);
if (!data) {
data->int_data = (int)event;
data->cb_info = cb_info;
data->recv_data = recv_data;
- g_mutex_init(&data->event_mutex);
_player_event_queue_add(&cb_info->event_queue, data);
return true;
}
}
- LOGE("failed to add event to queue");
+ LOGE("failed to add event to queue %d", event);
return false;
}
data->int_data = (int)event;
data->cb_info = cb_info;
data->recv_data = NULL;
- g_mutex_init(&data->event_mutex);
_player_event_queue_add(&cb_info->event_queue, data);
}
}
g_mutex_init(&cb_info->data_mutex);
g_mutex_init(&cb_info->seek_cb_mutex);
+ g_mutex_init(&cb_info->buffering_cb_mutex);
+ cb_info->drop_buffering_message = FALSE;
buff = &cb_info->buff;
buff->recvMsg = g_new(char, MUSE_MSG_MAX_LENGTH + 1);
g_atomic_int_set(&cb_info->running, 1);
cb_info->fd = sockfd;
- cb_info->thread = g_thread_new("callback_thread", client_cb_handler, (gpointer) cb_info);
cb_info->tfd = INVALID_DEFAULT_VALUE;
+ cb_info->data_fd = INVALID_DEFAULT_VALUE;
+ cb_info->thread = g_thread_new("callback_thread", client_cb_handler, (gpointer) cb_info);
return cb_info;
}
g_mutex_clear(&cb_info->data_mutex);
g_mutex_clear(&cb_info->seek_cb_mutex);
+ g_mutex_clear(&cb_info->buffering_cb_mutex);
g_free(cb_info->buff.recvMsg);
_remove_all_ret_msg(cb_info);
g_free(cb_info->buff.part_of_msg);
+
g_free(cb_info);
}
int player_create(player_h *player)
{
- PLAYER_INSTANCE_CHECK(player);
-
int ret = PLAYER_ERROR_NONE;
int sock_fd = INVALID_DEFAULT_VALUE;
int pid = getpid();
muse_player_api_e api = MUSE_PLAYER_API_CREATE;
int module_index = INVALID_DEFAULT_VALUE;
player_cli_s *pc = NULL;
- char *ret_buf = NULL;
+ gchar *ret_buf = NULL;
int retry_count = CONNECTION_RETRY;
- bool retry = false;
+
+ PLAYER_INSTANCE_CHECK(player);
LOGD("ENTER");
if (pc == NULL)
return PLAYER_ERROR_OUT_OF_MEMORY;
- while (--retry_count) {
+ while (retry_count--) {
ret = PLAYER_ERROR_NONE;
sock_fd = muse_client_new();
if (sock_fd <= INVALID_DEFAULT_VALUE) {
LOGE("connection failure %d", errno);
ret = PLAYER_ERROR_INVALID_OPERATION;
- retry = true;
usleep(CONNECTION_TIME_OUT * G_TIME_SPAN_MILLISECOND);
- goto ERROR;
+ goto ERROR_RETRY;
}
if (muse_client_get_module_index(MODULE_NAME, &module_index) != MM_ERROR_NONE) {
LOGE("muse client get module index failed");
+ ret = PLAYER_ERROR_INVALID_OPERATION;
goto ERROR;
}
}
ret = client_wait_for_server_ack(api, pc->cb_info, CREATE_CB_TIME_OUT);
- if (ret == PLAYER_ERROR_INVALID_OPERATION) {
- retry = true;
- goto ERROR;
- }
- retry = false;
+ if (ret == PLAYER_ERROR_INVALID_OPERATION)
+ goto ERROR_RETRY;
if (!_player_event_queue_new(pc->cb_info)) {
LOGE("fail to create event queue");
} else {
goto ERROR;
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- pc->cb_info->evas_info = g_new0(player_evas_info_s, 1);
- if (pc->cb_info->evas_info == NULL) {
- ret = PLAYER_ERROR_OUT_OF_MEMORY;
- goto ERROR;
- }
- EVAS_INFO(pc)->visible = EVAS_VISIBLE_NONE;
-#endif
+
pc->cb_info->bufmgr = tbm_bufmgr_init(-1);
pc->push_media_stream = FALSE;
- pc->support_video = FALSE;
- EVAS_INFO(pc)->support_video = FALSE;
- pc->is_audio_only = FALSE;
- PLAYER_DISP_DLOPEN(pc); /* update supported_video */
+ /* get display interface handle */
+ if (mm_display_interface_init(&DP_INTERFACE(pc)) != MM_ERROR_NONE)
+ LOGW("display interface init failed");
g_free(ret_buf);
return ret;
ERROR:
+ retry_count = 0;
+ERROR_RETRY:
if (pc && pc->cb_info) {
if (pc->cb_info->event_queue.running)
_player_event_queue_destroy(pc->cb_info);
muse_client_close(sock_fd);
}
sock_fd = INVALID_DEFAULT_VALUE;
+
g_free(ret_buf);
ret_buf = NULL;
LOGE("ret value : %d, retry #%d", ret, CONNECTION_RETRY - retry_count);
- if (!retry)
- break;
}
g_free(pc);
pc = NULL;
int player_destroy(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_DESTROY;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_destroy_evas_display)(void **) = NULL;
-#endif
LOGD("ENTER %p", pc);
/* clear cb and release mem */
set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_PREPARE);
_player_release_internal_memory(pc, true);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (CALLBACK_INFO(pc) && EVAS_INFO(pc)) {
- if (EVAS_INFO(pc)->support_video && EVAS_HANDLE(pc)) {
+ if (DP_INTERFACE(pc)) {
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_EVAS) {
player_unset_media_packet_video_frame_decoded_cb(player);
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
- if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
- LOGW("fail to unset evas client");
__player_unset_retrieve_buffer_cb(player);
}
- g_free(EVAS_INFO(pc));
+
+ mm_display_interface_deinit(DP_INTERFACE(pc));
+ DP_INTERFACE(pc) = NULL;
}
-#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
callback_destroy(CALLBACK_INFO(pc));
}
- if (pc->dl_handle)
- PLAYER_DISP_DLCLOSE(pc->dl_handle); /* update supported_video */
-
g_free(pc);
pc = NULL;
int player_prepare_async(player_h player, player_prepared_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PREPARE_ASYNC;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- LOGD("ENTER");
+ PLAYER_INSTANCE_CHECK(player);
+
+ LOGD("ENTER %p %p", pc, callback);
if (pc->cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
LOGE("PLAYER_ERROR_INVALID_OPERATION (0x%08x) : preparing...", PLAYER_ERROR_INVALID_OPERATION);
int player_prepare(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PREPARE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER %p", pc);
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_unprepare(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_UNPREPARE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL;
player_state_e state = PLAYER_STATE_NONE;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
LOGD("ENTER %p", pc);
set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK);
set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_PREPARE);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_INFO(pc)->support_video && EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
- ret = p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(pc), false);
- if (ret != PLAYER_ERROR_NONE)
- LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+ if (!DP_INTERFACE(pc))
+ goto _PLAYER_UNPREPARE;
+
+
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type != MM_DISPLAY_TYPE_EVAS)
+ goto _PLAYER_UNPREPARE;
+
+ if (CALLBACK_INFO(pc)->dp_info.visible != PLAYER_VISIBLE_INFO_FALSE) {
+ mm_ret = mm_display_interface_evas_set_visible(DP_INTERFACE(pc), false);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_set_visible failed 0x%x", mm_ret);
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
}
-#endif
+ mm_ret = mm_display_interface_evas_flush(DP_INTERFACE(pc), false);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_flush failed 0x%x", mm_ret);
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+
+_PLAYER_UNPREPARE:
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
_player_release_internal_memory(pc, false);
pc->cb_info->video_frame_pool_size = 0;
__player_remove_tsurf_list(pc);
- pc->is_audio_only = FALSE;
g_free(ret_buf);
int player_set_uri(player_h player, const char *uri)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(uri);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_URI;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
char path[MAX_URL_LEN] = {0, };
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(uri);
+
LOGD("ENTER");
if (_player_get_valid_path(uri, path) != PLAYER_ERROR_NONE)
int player_set_memory_buffer(player_h player, const void *data, int size)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(data);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_MEMORY_BUFFER;
player_cli_s *pc = (player_cli_s *)player;
tbm_bo_handle thandle;
tbm_fd tfd = INVALID_DEFAULT_VALUE;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(data);
+
LOGD("ENTER");
/* before setting mem buffer, player state have to be checked. */
pc->push_media_stream = FALSE;
EXIT:
- if (tfd > INVALID_DEFAULT_VALUE)
- close(tfd);
+ PLAYER_CLOSE_FD(tfd);
tbm_bo_unref(bo);
int player_get_state(player_h player, player_state_e *pstate)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pstate);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pstate);
+
LOGD("ENTER");
ret = _get_current_state(pc, pstate);
int player_set_volume(player_h player, float left, float right)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(left >= 0 && left <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(right >= 0 && right <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
- /* not support to set different value into each channel */
- PLAYER_CHECK_CONDITION(left == right, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_VOLUME;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(left, 0, 1.0);
+ PLAYER_RANGE_ARG_CHECK(right, 0, 1.0);
+
+ /* not support to set different value into each channel */
+ PLAYER_CHECK_CONDITION(left == right, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER %f", left);
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_get_volume(player_h player, float *left, float *right)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(left && right);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VOLUME;
player_cli_s *pc = (player_cli_s *)player;
double volume = 0.0;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(left && right);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SOUND_STREAM);
- PLAYER_INSTANCE_CHECK(player);
-
muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_STREAM_INFO;
player_cli_s *pc = (player_cli_s *)player;
bool is_available = false;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SOUND_STREAM);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(stream_info);
+
LOGD("ENTER");
/* check if stream_info is valid */
int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_mode)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_LATENCY_MODE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(latency_mode, AUDIO_LATENCY_MODE_LOW, AUDIO_LATENCY_MODE_HIGH);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "latency_mode", (int)latency_mode);
int player_get_audio_latency_mode(player_h player, audio_latency_mode_e *platency_mode)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(platency_mode);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_AUDIO_LATENCY_MODE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int latency_mode = -1;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(platency_mode);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_start(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_START;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
LOGD("ENTER %p", pc);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-
- if (CALLBACK_INFO(pc) && EVAS_INFO(pc)->support_video) {
- if (EVAS_HANDLE(pc) && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE
- || EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), true);
- if (ret != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
- return PLAYER_ERROR_INVALID_OPERATION;
- }
- /* avoid setting true at all times, when player is resumed */
- EVAS_INFO(pc)->visible = EVAS_VISIBLE_TRUE;
- }
+
+ if (!DP_INTERFACE(pc))
+ goto _PLAYER_START;
+
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type != MM_DISPLAY_TYPE_EVAS ||
+ CALLBACK_INFO(pc)->dp_info.visible == PLAYER_VISIBLE_INFO_FALSE)
+ goto _PLAYER_START;
+
+ /* set proper visible to evas renderer */
+ if (mm_display_interface_evas_set_visible(DP_INTERFACE(pc), true) != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_set_visible failed");
+ return PLAYER_ERROR_INVALID_OPERATION;
}
-#endif
+
+ /* avoid setting true at all times, when player is resumed */
+ CALLBACK_INFO(pc)->dp_info.visible = PLAYER_VISIBLE_INFO_TRUE;
+
+_PLAYER_START:
+ g_mutex_lock(&pc->cb_info->buffering_cb_mutex);
+ pc->cb_info->drop_buffering_message = TRUE;
+ g_mutex_unlock(&pc->cb_info->buffering_cb_mutex);
+
+ _player_remove_idle_event(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_BUFFERING, false);
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+ g_mutex_lock(&pc->cb_info->buffering_cb_mutex);
+ pc->cb_info->drop_buffering_message = FALSE;
+ g_mutex_unlock(&pc->cb_info->buffering_cb_mutex);
+
g_free(ret_buf);
LOGD("LEAVE 0x%X", ret);
int player_stop(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_STOP;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
player_state_e state = PLAYER_STATE_NONE;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER %p", pc);
/* check player state */
return PLAYER_ERROR_INVALID_STATE;
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (CALLBACK_INFO(pc) && EVAS_HANDLE(pc) &&
- EVAS_INFO(pc)->support_video && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE
- || EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), false);
- if (ret != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
- return PLAYER_ERROR_INVALID_OPERATION;
- }
- /* do not update EVAS_INFO(pc)->visible to set visible true if start again */
+ if (!DP_INTERFACE(pc))
+ goto _PLAYER_STOP;
+
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type != MM_DISPLAY_TYPE_EVAS ||
+ CALLBACK_INFO(pc)->dp_info.visible == PLAYER_VISIBLE_INFO_FALSE)
+ goto _PLAYER_STOP;
+
+ mm_ret = mm_display_interface_evas_set_visible(DP_INTERFACE(pc), false);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_set_visible failed 0x%x", mm_ret);
+ return PLAYER_ERROR_INVALID_OPERATION;
}
-#endif
+_PLAYER_STOP:
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
if (ret == PLAYER_ERROR_NONE)
set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK);
int player_pause(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PAUSE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER %p", pc);
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
static int _set_play_position(player_h player, int64_t pos, bool accurate, player_seek_completed_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(pos >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_PLAY_POSITION;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_CHECK_CONDITION(pos >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER %p", pc);
if (!pc->cb_info) {
int player_set_play_position(player_h player, int milliseconds, bool accurate, player_seek_completed_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(milliseconds >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
int64_t pos = (int64_t)(milliseconds * G_GINT64_CONSTANT(1000000));
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_CHECK_CONDITION(milliseconds >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
ret = _set_play_position(player, pos, accurate, callback, user_data);
int player_set_play_position_nsec(player_h player, int64_t nanoseconds, bool accurate, player_seek_completed_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(nanoseconds >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
int64_t pos = nanoseconds;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_CHECK_CONDITION(nanoseconds >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
ret = _set_play_position(player, pos, accurate, callback, user_data);
static int _get_play_position(player_h player, int64_t *pos)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pos);
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_PLAY_POSITION;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pos);
+
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
if (ret == PLAYER_ERROR_NONE) {
int player_get_play_position(player_h player, int *milliseconds)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(milliseconds);
-
int ret = PLAYER_ERROR_NONE;
int64_t pos = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(milliseconds);
+
/* LOGD("ENTER"); */
ret = _get_play_position(player, &pos);
int player_get_play_position_nsec(player_h player, int64_t *nanoseconds)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(nanoseconds);
-
int ret = PLAYER_ERROR_NONE;
int64_t pos = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(nanoseconds);
+
/* LOGD("ENTER"); */
ret = _get_play_position(player, &pos);
int player_set_mute(player_h player, bool muted)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_MUTE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int mute = (int)muted;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "mute", mute);
int player_is_muted(player_h player, bool *muted)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(muted);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_IS_MUTED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int mute = -1;
- LOGD("ENTER");
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(muted);
+
+ LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
if (ret == PLAYER_ERROR_NONE) {
int player_set_looping(player_h player, bool looping)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_LOOPING;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "looping", (int)looping);
int player_is_looping(player_h player, bool *plooping)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(plooping);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_IS_LOOPING;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int looping = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(plooping);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
static int _get_duration(player_h player, int64_t *duration)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(duration);
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_DURATION;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(duration);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_get_duration(player_h player, int *milliseconds)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(milliseconds);
-
int ret = PLAYER_ERROR_NONE;
int64_t duration = 0; /* nsec */
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(milliseconds);
+
LOGD("ENTER");
ret = _get_duration(player, &duration);
int player_get_duration_nsec(player_h player, int64_t *nanoseconds)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(nanoseconds);
-
int ret = PLAYER_ERROR_NONE;
int64_t duration = 0; /* nsec */
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(nanoseconds);
+
LOGD("ENTER");
ret = _get_duration(player, &duration);
}
/* The player_display_type_e is different at wearable profile */
-int _player_convert_display_type(player_display_type_e type, player_private_display_type_e *out_type)
+int _player_convert_display_type(player_display_type_e type, mm_display_type_e *out_type)
{
int ret = PLAYER_ERROR_NONE;
+
PLAYER_NULL_ARG_CHECK(out_type);
switch (type) {
case PLAYER_DISPLAY_TYPE_OVERLAY:
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY;
+ *out_type = MM_DISPLAY_TYPE_OVERLAY;
+ break;
+ case PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI:
+ *out_type = MM_DISPLAY_TYPE_OVERLAY_SYNC_UI;
break;
case PLAYER_DISPLAY_TYPE_EVAS:
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS;
+ *out_type = MM_DISPLAY_TYPE_EVAS;
break;
case PLAYER_DISPLAY_TYPE_NONE:
- *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE;
+ *out_type = MM_DISPLAY_TYPE_NONE;
break;
default:
ret = PLAYER_ERROR_INVALID_PARAMETER;
}
LOGD("display type(%d) -> (%d)", type, *out_type);
+
return ret;
}
int player_set_display(player_h player, player_display_type_e type, player_display_h display)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
wl_win_msg_type wl_win;
char *wl_win_msg = (char *)&wl_win;
- unsigned int wl_surface_id;
- player_private_display_type_e conv_type = PLAYER_DISPLAY_TYPE_NONE;
- unsigned int (*p_disp_set_wl_display)(int, void *) = NULL;
+ mm_display_type_e conv_type = MM_DISPLAY_TYPE_NONE;
int arr_msg_len = 0;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_destroy_evas_display)(void **) = NULL;
- int (*p_disp_create_evas_display)(void *, void **) = NULL;
- int (*p_disp_set_evas_display_old_info)(void *, void *, int, int, int) = NULL;
- int (*p_disp_set_evas_display_roi_area)(void *, int, int, int, int) = NULL;
- void (*p_disp_media_packet_video_decode_cb)(media_packet_h, void *) = NULL;
-#endif
pid_t pid = getpid();
pid_t tid = syscall(SYS_gettid);
- LOGD("ENTER");
+ PLAYER_INSTANCE_CHECK(player);
- LOGD("Check if API is called in main thread. pid [%d], tid [%d]", pid, tid);
- if (pid != tid) {
- LOGE("API isn't called in main thread");
- return PLAYER_ERROR_INVALID_OPERATION;
+ if (type != PLAYER_DISPLAY_TYPE_NONE) {
+ LOGD("Check if API is called in main thread. pid [%d], tid [%d]", pid, tid);
+ if (pid != tid) {
+ LOGE("API isn't called in main thread");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
}
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
+ /* check display interface handle */
+ if (!DP_INTERFACE(pc)) {
+ LOGE("display interface not supported");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
LOGD("ENTER type: %d", type);
if (ret != PLAYER_ERROR_NONE)
return ret;
- if (conv_type != PLAYER_PRIVATE_DISPLAY_TYPE_NONE) {
- if (!display)
+ if (conv_type != MM_DISPLAY_TYPE_NONE) {
+ if (!display) {
+ LOGE("type[%d] NULL handle for display", type);
return PLAYER_ERROR_INVALID_PARAMETER;
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- /**
- * To support repeating play and stop, Evas_handle should not be destroyed in player_unprepare.
- * When the display type changes, Player need to destroy Evas_handle to set values of video output,
- * Otherwise, the values is not set because of checking Evas_handle.
- */
- if (CALLBACK_INFO(pc) && EVAS_HANDLE(pc)) {
- LOGW("evas client already exists");
- player_unset_media_packet_video_frame_decoded_cb(player);
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
- if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
- LOGW("fail to unset evas client");
- __player_unset_retrieve_buffer_cb(player);
- /* need to set display information again to new handle */
- EVAS_INFO(pc)->update_needed = TRUE;
}
-#endif
- /* set evas_render or wayland */
- if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_wl_display, "disp_set_wl_display");
- wl_surface_id = p_disp_set_wl_display(ELM_WAYLAND_WIN, display);
- if (wl_surface_id > 0) {
- wl_win.surface_id = wl_surface_id;
- wl_win.type = conv_type;
- } else return PLAYER_ERROR_INVALID_OPERATION;
+
+ mm_ret = mm_display_interface_set_display(DP_INTERFACE(pc), conv_type, display, &wl_win.surface_id);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("[INVALID_OPERATION] set display failed[0x%x]", mm_ret);
+ return PLAYER_ERROR_INVALID_OPERATION;
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- else if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_EVAS) {
- if (!CALLBACK_INFO(pc)) {
- LOGE("there is no cb info in player handle");
+
+ if (conv_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ g_strlcpy(wl_win.exported_shell_handle, (char *)display, MAX_EXPORTED_SHELL_HANDLE_LEN);
+ } else if (conv_type == MM_DISPLAY_TYPE_EVAS) {
+ /* before evas handle is created, user could set display information */
+ player_display_mode_e mode = PLAYER_DISPLAY_MODE_LETTER_BOX;
+ player_display_rotation_e rotation = PLAYER_DISPLAY_ROTATION_NONE;
+ bool visible = false;
+
+ ret = player_get_display_mode(player, &mode);
+ ret |= player_get_display_rotation(player, &rotation);
+ ret |= player_is_display_visible(player, &visible);
+
+ if (ret != PLAYER_ERROR_NONE) {
+ LOGE("get current display settings");
return PLAYER_ERROR_INVALID_OPERATION;
}
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_create_evas_display, "disp_create_evas_display");
- ret = p_disp_create_evas_display(display, &EVAS_HANDLE(pc));
- if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
+ LOGD("current setting : mode %d, rotation %d, visible %d, roi %d,%d,%dx%d",
+ mode, rotation, visible,
+ CALLBACK_INFO(pc)->dp_info.roi_x,
+ CALLBACK_INFO(pc)->dp_info.roi_y,
+ CALLBACK_INFO(pc)->dp_info.roi_w,
+ CALLBACK_INFO(pc)->dp_info.roi_h);
+
+ mm_ret = mm_display_interface_evas_set_mode(DP_INTERFACE(pc), mode);
+ mm_ret |= mm_display_interface_evas_set_rotation(DP_INTERFACE(pc), rotation);
+ mm_ret |= mm_display_interface_evas_set_visible(DP_INTERFACE(pc), visible);
+ if (mode == PLAYER_DISPLAY_MODE_DST_ROI) {
+ mm_ret |= mm_display_interface_evas_set_roi_area(DP_INTERFACE(pc),
+ CALLBACK_INFO(pc)->dp_info.roi_x, CALLBACK_INFO(pc)->dp_info.roi_y,
+ CALLBACK_INFO(pc)->dp_info.roi_w, CALLBACK_INFO(pc)->dp_info.roi_h);
+ }
- /* before evas handle is created, user could set display information */
- if (EVAS_INFO(pc)->update_needed) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_old_info, "disp_set_evas_display_old_info");
- ret = p_disp_set_evas_display_old_info(display, EVAS_HANDLE(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible);
- if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
- if (EVAS_INFO(pc)->mode == PLAYER_DISPLAY_MODE_DST_ROI) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");
- ret = p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), EVAS_INFO(pc)->roi_x, EVAS_INFO(pc)->roi_y, EVAS_INFO(pc)->roi_w, EVAS_INFO(pc)->roi_h);
- if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
- }
- EVAS_INFO(pc)->update_needed = FALSE;
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("set mm_display_interface failed");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
+
+ if (player_set_media_packet_video_frame_decoded_cb(player,
+ __player_media_packet_video_decoded_cb, player) != MM_ERROR_NONE) {
+ LOGE("fail to set decoded callback");
+ return PLAYER_ERROR_INVALID_OPERATION;
}
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_media_packet_video_decode_cb, "disp_media_packet_video_decode_cb");
- ret = player_set_media_packet_video_frame_decoded_cb(player, p_disp_media_packet_video_decode_cb, (void *)EVAS_HANDLE(pc));
- if (ret != PLAYER_ERROR_NONE)
- LOGW("fail to set decoded callback");
if (__player_set_retrieve_buffer_cb(player, __retrieve_buffer_cb, pc))
LOGW("fail to set __retrieve_buffer_cb");
}
-#endif
- } else { /* PLAYER_DISPLAY_TYPE_NONE */
- LOGI("Wayland surface type is NONE");
- wl_win.type = conv_type;
}
+ wl_win.type = conv_type;
+
arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0));
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
- MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+ MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+
g_free(ret_buf);
return ret;
int player_set_display_mode(player_h player, player_display_mode_e mode)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(PLAYER_DISPLAY_MODE_LETTER_BOX <= mode && mode < PLAYER_DISPLAY_MODE_NUM, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_MODE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_set_evas_display_disp_mode)(void *, int) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(mode, PLAYER_DISPLAY_MODE_LETTER_BOX, PLAYER_DISPLAY_MODE_DST_ROI);
+
LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_disp_mode, "disp_set_evas_display_disp_mode");
- ret = p_disp_set_evas_display_disp_mode(EVAS_HANDLE(pc), mode);
- if (ret != MM_ERROR_NONE)
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+ return PLAYER_ERROR_NOT_AVAILABLE;
+ }
+
+ if (display_type == MM_DISPLAY_TYPE_EVAS) {
+ mm_ret = mm_display_interface_evas_set_mode(DP_INTERFACE(pc), mode);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_set_mode failed 0x%x", mm_ret);
return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
- } else {
- EVAS_INFO(pc)->mode = mode;
- EVAS_INFO(pc)->update_needed = TRUE;
+ }
}
-#endif
+
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "mode", (int)mode);
+
g_free(ret_buf);
+
return ret;
}
int player_get_display_mode(player_h player, player_display_mode_e *pmode)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pmode);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_DISPLAY_MODE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int mode = -1;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_get_evas_display_disp_mode)(void *, int *) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pmode);
LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_disp_mode, "disp_get_evas_display_disp_mode");
- ret = p_disp_get_evas_display_disp_mode(EVAS_HANDLE(pc), &mode);
- *pmode = (player_display_mode_e) mode;
- if (ret != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
+
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+ return PLAYER_ERROR_NOT_AVAILABLE;
}
-#endif
+
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
if (ret == PLAYER_ERROR_NONE) {
player_msg_get_type(mode, ret_buf, INT);
*pmode = mode;
}
g_free(ret_buf);
+
return ret;
}
int player_set_video_roi_area(player_h player, double x_scale, double y_scale,
double w_scale, double h_scale)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_ROI_AREA;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
- PLAYER_CHECK_CONDITION(CALLBACK_INFO(pc) != NULL && EVAS_HANDLE(pc) == NULL,
- PLAYER_ERROR_INVALID_OPERATION, "Display type is EVAS, video display interface is not supported");
+
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+ return PLAYER_ERROR_NOT_AVAILABLE;
+ }
+
+ if (display_type == MM_DISPLAY_TYPE_EVAS) {
+ LOGE("Display type is EVAS, video display interface is not supported");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
if (!_player_video_roi_area_is_valid(x_scale, y_scale, w_scale, h_scale))
return PLAYER_ERROR_INVALID_PARAMETER;
int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale,
double *w_scale, double *h_scale)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(x_scale && y_scale && w_scale && h_scale);
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_ROI_AREA;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
double scale_x = 0, scale_y = 0, scale_w = 0, scale_h = 0;
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+ return PLAYER_ERROR_NOT_AVAILABLE;
+ }
+
+ PLAYER_NULL_ARG_CHECK(x_scale && y_scale && w_scale && h_scale);
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_set_display_roi_area(player_h player, int x, int y, int width, int height)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(width > 0 && height > 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_ROI_AREA;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
wl_win_msg_type wl_win;
char *wl_win_msg = (char *)&wl_win;
int arr_msg_len = 0;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_set_evas_display_roi_area)(void *, int, int, int, int) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_CHECK_CONDITION(width > 0 && height > 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");
- ret = p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), x, y, width, height);
- if (ret == MM_ERROR_EVASRENDER_INVALID_ARGUMENT)
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_EVAS) {
+ mm_ret = mm_display_interface_evas_set_roi_area(DP_INTERFACE(pc), x, y, width, height);
+ if (mm_ret == MM_ERROR_EVASRENDER_INVALID_ARGUMENT)
return PLAYER_ERROR_INVALID_PARAMETER;
- else if (ret != MM_ERROR_NONE)
+ else if (mm_ret != MM_ERROR_NONE)
return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
- } else {
- EVAS_INFO(pc)->roi_x = x;
- EVAS_INFO(pc)->roi_y = y;
- EVAS_INFO(pc)->roi_w = width;
- EVAS_INFO(pc)->roi_h = height;
- EVAS_INFO(pc)->update_needed = TRUE;
}
-#endif
+
wl_win.win_roi_x = x;
wl_win.win_roi_y = y;
wl_win.win_roi_width = width;
arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0));
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
- MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+ MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg);
+
+ if (ret == PLAYER_ERROR_NONE) {
+ CALLBACK_INFO(pc)->dp_info.roi_x = x;
+ CALLBACK_INFO(pc)->dp_info.roi_y = y;
+ CALLBACK_INFO(pc)->dp_info.roi_w = width;
+ CALLBACK_INFO(pc)->dp_info.roi_h = height;
+ }
g_free(ret_buf);
+
return ret;
}
int player_set_playback_rate(player_h player, float rate)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(rate >= -5.0 && rate <= 5.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_PLAYBACK_RATE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(rate, -5.0, 5.0);
+
LOGD("ENTER");
if (rate != 0) {
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_DOUBLE, "rate", (double)rate);
int player_set_display_rotation(player_h player, player_display_rotation_e rotation)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(PLAYER_DISPLAY_ROTATION_NONE <= rotation && rotation <= PLAYER_DISPLAY_ROTATION_270, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_ROTATION;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_set_evas_display_rotation)(void *, int) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(rotation, PLAYER_DISPLAY_ROTATION_NONE, PLAYER_DISPLAY_ROTATION_270);
LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_rotation, "disp_set_evas_display_rotation");
- ret = p_disp_set_evas_display_rotation(EVAS_HANDLE(pc), rotation);
- if (ret != MM_ERROR_NONE)
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+ return PLAYER_ERROR_NOT_AVAILABLE;
+ }
+
+ if (display_type == MM_DISPLAY_TYPE_EVAS) {
+ mm_ret = mm_display_interface_evas_set_rotation(DP_INTERFACE(pc), rotation);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_set_rotation failed 0x%x", mm_ret);
return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
- } else {
- EVAS_INFO(pc)->rotation = rotation;
- EVAS_INFO(pc)->update_needed = TRUE;
+ }
}
-#endif
+
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "rotation", (int)rotation);
+
g_free(ret_buf);
+
return ret;
}
int player_get_display_rotation(player_h player, player_display_rotation_e *protation)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(protation);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_DISPLAY_ROTATION;
char *ret_buf = NULL;
int rotation = -1;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_get_evas_display_rotation)(void *, int *) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
- LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_rotation, "disp_get_evas_display_rotation");
- ret = p_disp_get_evas_display_rotation(EVAS_HANDLE(pc), &rotation);
- *protation = (player_display_rotation_e) rotation;
- if (ret != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
+
+ if (display_type == MM_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+ LOGE("Function is not available in MM_DISPLAY_TYPE_OVERLAY_SYNC_UI type");
+ return PLAYER_ERROR_NOT_AVAILABLE;
}
-#endif
+
+ PLAYER_NULL_ARG_CHECK(protation);
+
+ LOGD("ENTER");
+
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
if (ret == PLAYER_ERROR_NONE) {
player_msg_get_type(rotation, ret_buf, INT);
*protation = rotation;
}
g_free(ret_buf);
+
return ret;
}
int player_set_display_visible(player_h player, bool visible)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_VISIBLE;
char *ret_buf = NULL;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- int (*p_disp_set_evas_display_visible)(void *, bool) = NULL;
-#endif
+ mm_display_type_e display_type = MM_DISPLAY_TYPE_NONE;
+
+ PLAYER_INSTANCE_CHECK(player);
LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), visible);
- if (ret != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
+ PLAYER_GET_DISPLAY_TYPE(pc, display_type);
- EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE;
- return PLAYER_ERROR_NONE;
- } else {
- EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE;
- EVAS_INFO(pc)->update_needed = TRUE;
+ if (display_type == MM_DISPLAY_TYPE_EVAS) {
+ mm_ret = mm_display_interface_evas_set_visible(DP_INTERFACE(pc), visible);
+ if (mm_ret != MM_ERROR_NONE) {
+ LOGE("mm_display_interface_evas_set_visible failed 0x%x", mm_ret);
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
}
-#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "visible", (int)visible);
+
g_free(ret_buf);
+
+ if (ret == PLAYER_ERROR_NONE)
+ CALLBACK_INFO(pc)->dp_info.visible = visible ? PLAYER_VISIBLE_INFO_TRUE : PLAYER_VISIBLE_INFO_FALSE;
+
return ret;
}
int player_is_display_visible(player_h player, bool *pvisible)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pvisible);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_IS_DISPLAY_VISIBLE;
char *ret_buf = NULL;
int value = -1;
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- bool visible = 0;
- int (*p_disp_get_evas_display_visible)(void *, bool *) = NULL;
-#endif
- LOGD("ENTER");
- PLAYER_VIDEO_SUPPORTABLE_CHECK(pc);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pvisible);
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_visible, "disp_get_evas_display_visible");
- ret = p_disp_get_evas_display_visible(EVAS_HANDLE(pc), &visible);
- if (visible)
- *pvisible = TRUE;
- else
- *pvisible = FALSE;
+ LOGD("ENTER");
- if (ret != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
- }
-#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
if (ret == PLAYER_ERROR_NONE) {
player_msg_get_type(value, ret_buf, INT);
}
g_free(ret_buf);
+
return ret;
}
int player_get_content_info(player_h player, player_content_info_e key, char **pvalue)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pvalue);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_CONTENT_INFO;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
char value[MUSE_MSG_MAX_LENGTH] = { 0, };
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pvalue);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "key", (int)key);
int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_codec)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(paudio_codec || pvideo_codec);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_INFO;
player_cli_s *pc = (player_cli_s *)player;
char audio_codec[MUSE_MSG_MAX_LENGTH] = { 0, };
bool ret_val = TRUE;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(paudio_codec || pvideo_codec);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchannel, int *pbit_rate)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(psample_rate || pchannel || pbit_rate);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO;
player_cli_s *pc = (player_cli_s *)player;
int channel = 0;
int bit_rate = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(psample_rate || pchannel || pbit_rate);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_get_video_stream_info(player_h player, int *pfps, int *pbit_rate)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pfps || pbit_rate);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO;
player_cli_s *pc = (player_cli_s *)player;
int fps = 0;
int bit_rate = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pfps || pbit_rate);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_get_video_size(player_h player, int *pwidth, int *pheight)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pwidth && pheight);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_SIZE;
player_cli_s *pc = (player_cli_s *)player;
int width = 0;
int height = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pwidth && pheight);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_get_album_art(player_h player, void **palbum_art, int *psize)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(palbum_art && psize);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_ALBUM_ART;
player_cli_s *pc = (player_cli_s *)player;
int key = INVALID_DEFAULT_VALUE;
void *jobj = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(palbum_art && psize);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
g_free(ret_buf);
- if (tfd > INVALID_DEFAULT_VALUE)
- close(tfd);
+ PLAYER_CLOSE_FD(tfd);
if (CALLBACK_INFO(pc))
pc->cb_info->tfd = INVALID_DEFAULT_VALUE;
int player_audio_effect_get_equalizer_bands_count(player_h player, int *pcount)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pcount);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BANDS_COUNT;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int count;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pcount);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_levels, int length)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(band_levels);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_ALL_BANDS;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(band_levels);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_audio_effect_set_equalizer_band_level(player_h player, int index, int level)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_BAND_LEVEL;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_audio_effect_get_equalizer_band_level(player_h player, int index, int *plevel)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(plevel);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_LEVEL;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int level;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(plevel);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "index", index);
int player_audio_effect_get_equalizer_level_range(player_h player, int *pmin, int *pmax)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pmin && pmax);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int min = 0, max = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pmin && pmax);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_audio_effect_get_equalizer_band_frequency(player_h player, int index, int *pfrequency)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pfrequency);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int frequency;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pfrequency);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "index", index);
int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int index, int *prange)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(prange);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY_RANGE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int range;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(prange);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "index", index);
int player_audio_effect_equalizer_clear(player_h player)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_CLEAR;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_audio_effect_equalizer_is_available(player_h player, bool *pavailable)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pavailable);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_IS_AVAILABLE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int available;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pavailable);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_set_subtitle_path(player_h player, const char *path)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_SUBTITLE_PATH;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
char subtitle_path[MAX_URL_LEN] = {0, };
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
if (path && _player_get_valid_path(path, subtitle_path) != PLAYER_ERROR_NONE)
int player_set_subtitle_position_offset(player_h player, int milliseconds)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_SUBTITLE_POSITION_OFFSET;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "milliseconds", milliseconds);
int player_capture_video(player_h player, player_video_captured_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_CAPTURE_VIDEO;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+
LOGD("ENTER");
if (pc->cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE]) {
LOGE("PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x) : capturing...", PLAYER_ERROR_VIDEO_CAPTURE_FAILED);
int player_set_streaming_cookie(player_h player, const char *cookie, int size)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(cookie);
- PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_COOKIE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(cookie);
+ PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_set_streaming_user_agent(player_h player, const char *user_agent, int size)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(user_agent);
- PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_USER_AGENT;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(user_agent);
+ PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_get_streaming_download_progress(player_h player, int *start, int *end)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(start && end);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int start_pos = 0, end_pos = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(start && end);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
return __set_callback(MUSE_PLAYER_EVENT_TYPE_COMPLETE, player, callback, user_data);
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
static void __retrieve_buffer_cb(void *user_data)
{
player_cli_s *player = (player_cli_s *)user_data;
int ret = PLAYER_ERROR_NONE;
bool gapless = false;
- int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL;
- ret = player_is_gapless((player_h)user_data, &gapless);
+ ret = player_is_gapless((player_h)player, &gapless);
if (ret != PLAYER_ERROR_NONE) {
LOGW("player_is_gapless is failed");
return;
}
- PLAYER_DISP_DLSYM(player->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
- ret = p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(player), gapless);
- if (ret != PLAYER_ERROR_NONE)
- LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+ ret = mm_display_interface_evas_flush(DP_INTERFACE(player), gapless);
+
+ LOGW("flush all packet : 0x%x [gapless %d]", ret, gapless);
}
static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data)
{
return __unset_callback(MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER, player);
}
-#endif
int player_unset_completed_cb(player_h player)
{
int player_set_media_packet_audio_frame_decoded_cb(player_h player, media_format_h format,
player_audio_extract_option_e opt, player_media_packet_audio_decoded_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_PACKET_AUDIO_FRAME_DECODED_CB;
int channel = 0;
int samplerate = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+ PLAYER_RANGE_ARG_CHECK(opt, PLAYER_AUDIO_EXTRACT_DEFAULT, PLAYER_AUDIO_EXTRACT_NO_SYNC_AND_DEINTERLEAVE);
+
LOGD("ENTER");
if (format) {
return __unset_callback(MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED, player);
}
-int player_set_media_stream_buffer_status_cb(player_h player, player_stream_type_e stream_type, player_media_stream_buffer_status_cb callback, void *user_data)
+int player_set_media_stream_buffer_status_cb(player_h player,
+ player_stream_type_e stream_type, player_media_stream_buffer_status_cb callback, void *user_data)
{
+ muse_player_event_e type;
+
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
- muse_player_event_e type;
LOGD("ENTER");
int player_unset_media_stream_buffer_status_cb(player_h player, player_stream_type_e stream_type)
{
- PLAYER_INSTANCE_CHECK(player);
muse_player_event_e type;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
if (stream_type == PLAYER_STREAM_TYPE_VIDEO) {
return __unset_callback(type, player);
}
-int player_set_media_stream_seek_cb(player_h player, player_stream_type_e stream_type, player_media_stream_seek_cb callback, void *user_data)
+int player_set_media_stream_seek_cb(player_h player,
+ player_stream_type_e stream_type, player_media_stream_seek_cb callback, void *user_data)
{
+ muse_player_event_e type;
+
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
- muse_player_event_e type;
LOGD("ENTER");
int player_unset_media_stream_seek_cb(player_h player, player_stream_type_e stream_type)
{
- PLAYER_INSTANCE_CHECK(player);
muse_player_event_e type;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
if (stream_type == PLAYER_STREAM_TYPE_VIDEO) {
/* TODO Implement raw data socket channel */
int player_push_media_stream(player_h player, media_packet_h packet)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(packet);
int ret = PLAYER_ERROR_NONE;
int packet_ret = MEDIA_PACKET_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
char *codec_data = NULL;
unsigned int codec_data_size = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(packet);
+
LOGD("ENTER");
- if(media_packet_get_buffer_data_ptr(packet, (void **)&buf) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_get_buffer_data_ptr(packet, (void **)&buf) != MEDIA_PACKET_ERROR_NONE) {
LOGE("failed to get buffer data ptr");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if(media_packet_get_buffer_size(packet, &push_media.size) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_get_buffer_size(packet, &push_media.size) != MEDIA_PACKET_ERROR_NONE) {
LOGE("failed to get buffer size");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if(media_packet_get_pts(packet, &push_media.pts) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_get_pts(packet, &push_media.pts) != MEDIA_PACKET_ERROR_NONE) {
LOGE("failed to get buffer pts");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if(media_packet_get_format(packet, &format) != MEDIA_PACKET_ERROR_NONE) { /* format ref count is increased */
+ if (media_packet_get_format(packet, &format) != MEDIA_PACKET_ERROR_NONE) { /* format ref count is increased */
LOGE("failed to get media format");
return PLAYER_ERROR_INVALID_OPERATION;
}
packet_ret |= media_packet_is_audio(packet, &is_audio);
packet_ret |= media_packet_is_end_of_stream(packet, &is_eos);
if (is_video)
- packet_ret |= media_format_get_video_info(format, &push_media.mimetype, &push_media.width, &push_media.height, NULL, NULL);
+ packet_ret |= media_format_get_video_info(format, &push_media.mimetype,
+ &push_media.width, &push_media.height, NULL, NULL);
else if (is_audio)
- packet_ret |= media_format_get_audio_info(format, &push_media.mimetype, NULL, NULL, NULL, NULL);
+ packet_ret |= media_format_get_audio_info(format, &push_media.mimetype,
+ &push_media.channels, &push_media.samplerate, NULL, NULL);
media_format_unref(format);
#ifdef __UN_USED
ERROR:
- if (tfd > INVALID_DEFAULT_VALUE)
- close(tfd);
+
+ PLAYER_CLOSE_FD(tfd);
if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
tbm_bo_unref(bo);
return ret;
}
-int player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format)
+int player_foreach_media_stream_supported_format(player_h player, player_supported_media_format_cb callback, void *user_data)
{
+ int ret = PLAYER_ERROR_NONE;
+ player_cli_s *pc = (player_cli_s *)player;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_STREAM_SUPPORTED_FORMAT;
+ char *ret_buf = NULL;
+ int format_info[MAX_SUPPORTED_MEDIA_FORMAT] = {0,};
+ int len = 0, idx = 0;
+
PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
+ player_msg_get_type(len, ret_buf, INT);
+ player_msg_get_array(format_info, ret_buf);
+
+ LOGD("num of format %d", len);
+ for (idx = 0 ; idx < len ; idx++) {
+ if (!callback(format_info[idx], user_data)) {
+ LOGW("stop foreach callback");
+ break;
+ }
+ }
+
+ LOGD("LEAVE 0x%X", ret);
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format)
+{
g_return_val_if_fail(format, PLAYER_ERROR_INVALID_OPERATION);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
int bit = 0;
int frame_rate = 0;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
media_format_ref(format);
int player_set_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long max_size)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(PLAYER_STREAM_TYPE_DEFAULT <= type && type <= PLAYER_STREAM_TYPE_TEXT, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(max_size > 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(type, PLAYER_STREAM_TYPE_AUDIO, PLAYER_STREAM_TYPE_VIDEO);
+ PLAYER_CHECK_CONDITION(max_size > 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_get_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long *pmax_size)
{
int ret = PLAYER_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pmax_size);
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE;
char *ret_buf = NULL;
unsigned long long max_size;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pmax_size);
+ PLAYER_RANGE_ARG_CHECK(type, PLAYER_STREAM_TYPE_AUDIO, PLAYER_STREAM_TYPE_VIDEO);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "type", type);
int player_set_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int percent)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(PLAYER_STREAM_TYPE_DEFAULT <= type && type <= PLAYER_STREAM_TYPE_TEXT, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(type, PLAYER_STREAM_TYPE_DEFAULT, PLAYER_STREAM_TYPE_TEXT);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_get_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int *ppercent)
{
int ret = PLAYER_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(ppercent);
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD;
char *ret_buf = NULL;
- uint percent;
+ unsigned int percent;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(ppercent);
LOGD("ENTER");
int player_get_track_count(player_h player, player_stream_type_e type, int *pcount)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pcount);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_COUNT;
char *ret_buf = NULL;
int count;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pcount);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "type", type);
int player_get_current_track(player_h player, player_stream_type_e type, int *pindex)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pindex);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_CURRENT_TRACK;
char *ret_buf = NULL;
int index;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pindex);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "type", type);
int player_select_track(player_h player, player_stream_type_e type, int index)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SELECT_TRACK;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "type", type, MUSE_TYPE_INT, "index", index);
int player_get_track_language_code(player_h player, player_stream_type_e type, int index, char **pcode)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pcode);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE;
char code[MUSE_MSG_MAX_LENGTH] = { 0, };
int code_len = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pcode);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "type", type, MUSE_TYPE_INT, "index", index);
int player_foreach_adaptive_variant(player_h player, player_adaptive_variant_cb callback, void *user_data)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_ADAPTIVE_VARIANT_INFO;
char *token = NULL;
char *ptr = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int width, int height)
{
int ret = PLAYER_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(bandwidth >= -1 && width >= -1 && height >= -1,
- PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_MAX_ADAPTIVE_VARIANT_LIMIT;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_CHECK_CONDITION(bandwidth >= -1 && width >= -1 && height >= -1,
+ PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_get_max_adaptive_variant_limit(player_h player, int *pbandwidth, int *pwidth, int *pheight)
{
int ret = PLAYER_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pbandwidth || pwidth || pheight);
-
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_MAX_ADAPTIVE_VARIANT_LIMIT;
char *ret_buf = NULL;
int bandwidth = -1, width = -1, height = -1;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(pbandwidth || pwidth || pheight);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_set_audio_only(player_h player, bool audio_only)
{
int ret = PLAYER_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_ONLY;
char *ret_buf = NULL;
player_state_e state = PLAYER_STATE_NONE;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER audio_only: %d", audio_only);
/* check player state */
return PLAYER_ERROR_INVALID_STATE;
}
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- pc->is_audio_only = (gboolean)audio_only;
- return PLAYER_ERROR_NONE;
- }
-#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "audio_only", (int)audio_only);
+
g_free(ret_buf);
LOGD("LEAVE 0x%X", ret);
- return ret;
+ return ret;
}
int player_is_audio_only(player_h player, bool *paudio_only)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(paudio_only);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_IS_AUDIO_ONLY;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int audio_only = 0;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(paudio_only);
+
LOGD("ENTER");
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
- if (EVAS_HANDLE(pc)) {
- *paudio_only = (bool)pc->is_audio_only;
- return PLAYER_ERROR_NONE;
- }
-#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
if (ret == PLAYER_ERROR_NONE) {
player_msg_get(audio_only, ret_buf);
*paudio_only = (bool)audio_only;
}
+
g_free(ret_buf);
LOGD("LEAVE 0x%X", ret);
+
return ret;
}
{
#define MIN_BUFFER_TIME -1
int ret = PLAYER_ERROR_NONE;
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(prebuffer_ms >= MIN_BUFFER_TIME && rebuffer_ms >= MIN_BUFFER_TIME, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_BUFFERING_TIME;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_CHECK_CONDITION(prebuffer_ms >= MIN_BUFFER_TIME && rebuffer_ms >= MIN_BUFFER_TIME,
+ PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_get_streaming_buffering_time(player_h player, int *prebuffer_ms, int *rebuffer_ms)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(prebuffer_ms || rebuffer_ms);
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_STREAMING_BUFFERING_TIME;
player_cli_s *pc = (player_cli_s *)player;
int prebuffering_time = 0, rebuffering_time = 0;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(prebuffer_ms || rebuffer_ms);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_360_is_content_spherical(player_h player, bool *is_spherical)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(is_spherical);
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_IS_CONTENT_SPHERICAL;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = 0;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(is_spherical);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_360_set_enabled(player_h player, bool enabled)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_SET_ENABLED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = (int)enabled;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER %d", enabled);
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "val", val);
int player_360_is_enabled(player_h player, bool *enabled)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(enabled);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_IS_ENABLED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = 0;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(enabled);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_360_set_direction_of_view(player_h player, float yaw, float pitch)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(yaw >= (float)-M_PI && yaw <= (float)M_PI, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(pitch >= (float)-M_PI / 2 && pitch <= (float)M_PI / 2, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_SET_DIRECTION_OF_VIEW;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(yaw, (float)-M_PI, (float)M_PI);
+ PLAYER_RANGE_ARG_CHECK(pitch, ((float)-M_PI / 2), ((float)M_PI / 2));
+
LOGD("ENTER %f %f", yaw, pitch);
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_360_get_direction_of_view(player_h player, float *yaw, float *pitch)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(yaw && pitch);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_GET_DIRECTION_OF_VIEW;
player_cli_s *pc = (player_cli_s *)player;
double pitch_val = -1;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(yaw && pitch);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_360_set_zoom(player_h player, float level)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(level >= 1.0 && level <= 10.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_SET_ZOOM;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(level, 1.0, 10.0);
+
LOGD("ENTER %f", level);
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_DOUBLE, "level", (double)level);
int player_360_get_zoom(player_h player, float *level)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(level);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_GET_ZOOM;
player_cli_s *pc = (player_cli_s *)player;
double zoom = -1;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(level);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_360_set_field_of_view(player_h player, int horizontal_degrees, int vertical_degrees)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(horizontal_degrees >= 1 && horizontal_degrees <= 360, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(vertical_degrees >= 1 && vertical_degrees <= 180, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_SET_FIELD_OF_VIEW;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(horizontal_degrees, 1, 360);
+ PLAYER_RANGE_ARG_CHECK(vertical_degrees, 1, 180);
+
LOGD("ENTER %d %d", horizontal_degrees, vertical_degrees);
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_360_get_field_of_view(player_h player, int *horizontal_degrees, int *vertical_degrees)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(horizontal_degrees && vertical_degrees);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_GET_FIELD_OF_VIEW;
player_cli_s *pc = (player_cli_s *)player;
int v_val = -1;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(horizontal_degrees && vertical_degrees);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_360_set_zoom_with_field_of_view(player_h player, float level, int horizontal_degrees, int vertical_degrees)
{
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
- PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
-
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(horizontal_degrees >= 1 && horizontal_degrees <= 360, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(vertical_degrees >= 1 && vertical_degrees <= 180, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(level >= 1.0 && level <= 10.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_360_SET_ZOOM_WITH_FIELD_OF_VIEW;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_OPENGL);
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SPHERICAL_VIDEO);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(horizontal_degrees, 1, 360);
+ PLAYER_RANGE_ARG_CHECK(vertical_degrees, 1, 180);
+ PLAYER_RANGE_ARG_CHECK(level, 1.0, 10.0);
+
LOGD("ENTER %f %d %d", level, horizontal_degrees, vertical_degrees);
PLAYER_SEND_MSG(api, pc, ret_buf, ret,
int player_set_replaygain_enabled(player_h player, bool enabled)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_REPLAYGAIN_ENABLED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = (int)enabled;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "val", val);
int player_is_replaygain_enabled(player_h player, bool *enabled)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(enabled);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_IS_REPLAYGAIN_ENABLED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = -1;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(enabled);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_audio_pitch_set_enabled(player_h player, bool enabled)
{
- PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PITCH_SET_ENABLED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = (int)enabled;
+ PLAYER_INSTANCE_CHECK(player);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "val", val);
int player_audio_pitch_is_enabled(player_h player, bool *enabled)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(enabled);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PITCH_IS_ENABLED;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int val = -1;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(enabled);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
int player_audio_pitch_set_value(player_h player, float value)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(value >= 0.5 && value <= 2.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PITCH_SET_VALUE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(value, 0.5, 2.0);
+
LOGD("ENTER %1.3f", value);
PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_DOUBLE, "pitch", (double)value);
int player_audio_pitch_get_value(player_h player, float *value)
{
- PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(value);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_PITCH_GET_VALUE;
player_cli_s *pc = (player_cli_s *)player;
double pitch = 0.0;
char *ret_buf = NULL;
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(value);
+
LOGD("ENTER");
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
LOGD("LEAVE 0x%X", ret);
return ret;
}
+
+int player_audio_offload_foreach_supported_format(player_h player, player_supported_media_format_cb callback, void *user_data)
+{
+ int ret = PLAYER_ERROR_NONE;
+ player_cli_s *pc = (player_cli_s *)player;
+ muse_player_api_e api = MUSE_PLAYER_API_AUDIO_OFFLOAD_GET_SUPPORTED_FORMAT;
+ char *ret_buf = NULL;
+ int format_info[MAX_SUPPORTED_MEDIA_FORMAT] = {0,};
+ int len = 0, idx = 0;
+
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_AUDIO_OFFLOAD);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
+ player_msg_get_type(len, ret_buf, INT);
+ player_msg_get_array(format_info, ret_buf);
+
+ LOGD("num of format %d", len);
+ for (idx = 0 ; idx < len ; idx++) {
+ if (!callback(format_info[idx], user_data)) {
+ LOGW("stop foreach callback");
+ break;
+ }
+ }
+
+ LOGD("LEAVE 0x%X", ret);
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_audio_offload_set_enabled(player_h player, bool enabled)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_AUDIO_OFFLOAD_SET_ENABLED;
+ player_cli_s *pc = (player_cli_s *)player;
+ char *ret_buf = NULL;
+ int val = (int)enabled;
+
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_AUDIO_OFFLOAD);
+ PLAYER_INSTANCE_CHECK(player);
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "val", val);
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_audio_offload_is_enabled(player_h player, bool *enabled)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_AUDIO_OFFLOAD_IS_ENABLED;
+ player_cli_s *pc = (player_cli_s *)player;
+ char *ret_buf = NULL;
+ int val = -1;
+
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_AUDIO_OFFLOAD);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(enabled);
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get(val, ret_buf);
+ *enabled = (bool)val;
+ }
+
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_audio_offload_is_activated(player_h player, bool *activated)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_AUDIO_OFFLOAD_IS_ACTIVATED;
+ player_cli_s *pc = (player_cli_s *)player;
+ char *ret_buf = NULL;
+ int val = -1;
+
+ PLAYER_FEATURE_CHECK(PLAYER_FEATURE_AUDIO_OFFLOAD);
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(activated);
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get(val, ret_buf);
+ *activated = (bool)val;
+ }
+
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_set_audio_codec_type(player_h player, player_codec_type_e codec_type)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_RANGE_ARG_CHECK(codec_type, PLAYER_CODEC_TYPE_HW, PLAYER_CODEC_TYPE_SW);
+
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_CODEC_TYPE;
+ player_cli_s *pc = (player_cli_s *)player;
+ char *ret_buf = NULL;
+
+ LOGD("ENTER codec: %d", codec_type);
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+ MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_AUDIO,
+ MUSE_TYPE_INT, "codec_type", codec_type);
+
+ g_free(ret_buf);
+ LOGD("LEAVE");
+ return ret;
+
+}
+
+int player_get_audio_codec_type(player_h player, player_codec_type_e *codec_type)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(codec_type);
+
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_TYPE;
+ player_cli_s *pc = (player_cli_s *)player;
+ char *ret_buf = NULL;
+ int type = 0;
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+ MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_AUDIO);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get(type, ret_buf);
+ *codec_type = type;
+ }
+
+ g_free(ret_buf);
+ LOGD("LEAVE codec: %d", *codec_type);
+ return ret;
+}