int int_data;
char *buf;
callback_cb_info_s *cb_info;
-}_player_cb_data;
+} _player_cb_data;
typedef struct {
intptr_t remote_pkt;
callback_cb_info_s *cb_info;
-}_media_pkt_fin_data;
-
+} _media_pkt_fin_data;
/*
Global varialbe
*/
static int _player_deinit_memory_buffer(player_cli_s *pc);
-int _player_media_packet_finalize(media_packet_h pkt, int error_code,
- void *user_data)
+int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data)
{
int ret = 0;
tbm_surface_h tsurf = NULL;
char *sndMsg;
if (pkt == NULL || user_data == NULL) {
- LOGE("invalid parameter buffer %p, user_data %p", pkt,
- user_data);
+ LOGE("invalid parameter buffer %p, user_data %p", pkt, user_data);
return MEDIA_PACKET_FINALIZE;
}
return MEDIA_PACKET_FINALIZE;
}
-static int __player_convert_error_code(int code, char* func_name)
+static int __player_convert_error_code(int code, char *func_name)
{
int ret = PLAYER_ERROR_INVALID_OPERATION;
- char* msg="PLAYER_ERROR_INVALID_OPERATION";
- switch(code)
- {
- case MM_ERROR_NONE:
- case MM_ERROR_PLAYER_AUDIO_CODEC_NOT_FOUND:
- case MM_ERROR_PLAYER_VIDEO_CODEC_NOT_FOUND:
- ret = PLAYER_ERROR_NONE;
- msg = "PLAYER_ERROR_NONE";
- break;
- case MM_ERROR_INVALID_ARGUMENT:
- ret = PLAYER_ERROR_INVALID_PARAMETER;
- msg = "PLAYER_ERROR_INVALID_PARAMETER";
- break;
- case MM_ERROR_PLAYER_CODEC_NOT_FOUND:
- case MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_AUDIO:
- case MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_VIDEO:
- case MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_MEDIA_TYPE:
- case MM_ERROR_PLAYER_NOT_SUPPORTED_FORMAT:
- ret = PLAYER_ERROR_NOT_SUPPORTED_FILE;
- msg = "PLAYER_ERROR_NOT_SUPPORTED_FILE";
- break;
- case MM_ERROR_PLAYER_INVALID_STATE:
- case MM_ERROR_PLAYER_NOT_INITIALIZED:
- ret = PLAYER_ERROR_INVALID_STATE;
- msg = "PLAYER_ERROR_INVALID_STATE";
- break;
- case MM_ERROR_PLAYER_INTERNAL:
- case MM_ERROR_PLAYER_INVALID_STREAM:
- case MM_ERROR_PLAYER_STREAMING_FAIL:
- case MM_ERROR_PLAYER_NO_OP:
- ret = PLAYER_ERROR_INVALID_OPERATION;
- msg = "PLAYER_ERROR_INVALID_OPERATION";
- break;
- case MM_ERROR_PLAYER_SOUND_EFFECT_INVALID_STATUS:
- case MM_ERROR_NOT_SUPPORT_API:
- case MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER:
- ret =PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
- msg = "PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE";
- break;
- case MM_ERROR_PLAYER_NO_FREE_SPACE:
- ret = PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE;
- msg = "PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE";
- break;
- case MM_ERROR_PLAYER_FILE_NOT_FOUND:
- ret = PLAYER_ERROR_NO_SUCH_FILE;
- msg = "PLAYER_ERROR_NO_SUCH_FILE";
- break;
- case MM_ERROR_PLAYER_SEEK:
- ret = PLAYER_ERROR_SEEK_FAILED;
- msg = "PLAYER_ERROR_SEEK_FAILED";
- break;
- case MM_ERROR_PLAYER_INVALID_URI:
- case MM_ERROR_PLAYER_STREAMING_INVALID_URL:
- ret = PLAYER_ERROR_INVALID_URI;
- msg = "PLAYER_ERROR_INVALID_URI";
- break;
- case MM_ERROR_PLAYER_STREAMING_CONNECTION_FAIL:
- case MM_ERROR_PLAYER_STREAMING_DNS_FAIL :
- case MM_ERROR_PLAYER_STREAMING_SERVER_DISCONNECTED:
- case MM_ERROR_PLAYER_STREAMING_INVALID_PROTOCOL:
- case MM_ERROR_PLAYER_STREAMING_UNEXPECTED_MSG:
- case MM_ERROR_PLAYER_STREAMING_OUT_OF_MEMORIES:
- case MM_ERROR_PLAYER_STREAMING_RTSP_TIMEOUT:
- case MM_ERROR_PLAYER_STREAMING_BAD_REQUEST:
- case MM_ERROR_PLAYER_STREAMING_NOT_AUTHORIZED:
- case MM_ERROR_PLAYER_STREAMING_PAYMENT_REQUIRED:
- case MM_ERROR_PLAYER_STREAMING_FORBIDDEN:
- case MM_ERROR_PLAYER_STREAMING_CONTENT_NOT_FOUND:
- case MM_ERROR_PLAYER_STREAMING_METHOD_NOT_ALLOWED:
- case MM_ERROR_PLAYER_STREAMING_NOT_ACCEPTABLE:
- case MM_ERROR_PLAYER_STREAMING_PROXY_AUTHENTICATION_REQUIRED:
- case MM_ERROR_PLAYER_STREAMING_SERVER_TIMEOUT:
- case MM_ERROR_PLAYER_STREAMING_GONE:
- case MM_ERROR_PLAYER_STREAMING_LENGTH_REQUIRED:
- case MM_ERROR_PLAYER_STREAMING_PRECONDITION_FAILED:
- case MM_ERROR_PLAYER_STREAMING_REQUEST_ENTITY_TOO_LARGE:
- case MM_ERROR_PLAYER_STREAMING_REQUEST_URI_TOO_LARGE:
- case MM_ERROR_PLAYER_STREAMING_PARAMETER_NOT_UNDERSTOOD:
- case MM_ERROR_PLAYER_STREAMING_CONFERENCE_NOT_FOUND:
- case MM_ERROR_PLAYER_STREAMING_NOT_ENOUGH_BANDWIDTH:
- case MM_ERROR_PLAYER_STREAMING_NO_SESSION_ID:
- case MM_ERROR_PLAYER_STREAMING_METHOD_NOT_VALID_IN_THIS_STATE:
- case MM_ERROR_PLAYER_STREAMING_HEADER_FIELD_NOT_VALID_FOR_SOURCE:
- case MM_ERROR_PLAYER_STREAMING_INVALID_RANGE:
- case MM_ERROR_PLAYER_STREAMING_PARAMETER_IS_READONLY:
- case MM_ERROR_PLAYER_STREAMING_AGGREGATE_OP_NOT_ALLOWED:
- case MM_ERROR_PLAYER_STREAMING_ONLY_AGGREGATE_OP_ALLOWED:
- case MM_ERROR_PLAYER_STREAMING_BAD_TRANSPORT:
- case MM_ERROR_PLAYER_STREAMING_DESTINATION_UNREACHABLE:
- case MM_ERROR_PLAYER_STREAMING_INTERNAL_SERVER_ERROR:
- case MM_ERROR_PLAYER_STREAMING_NOT_IMPLEMENTED:
- case MM_ERROR_PLAYER_STREAMING_BAD_GATEWAY:
- case MM_ERROR_PLAYER_STREAMING_SERVICE_UNAVAILABLE:
- case MM_ERROR_PLAYER_STREAMING_GATEWAY_TIME_OUT:
- case MM_ERROR_PLAYER_STREAMING_OPTION_NOT_SUPPORTED:
- ret = PLAYER_ERROR_CONNECTION_FAILED;
- msg = "PLAYER_ERROR_CONNECTION_FAILED";
- break;
- case MM_ERROR_POLICY_BLOCKED:
- case MM_ERROR_POLICY_INTERRUPTED:
- case MM_ERROR_POLICY_INTERNAL:
- case MM_ERROR_POLICY_DUPLICATED:
- ret = PLAYER_ERROR_SOUND_POLICY;
- msg = "PLAYER_ERROR_SOUND_POLICY";
- break;
- case MM_ERROR_PLAYER_DRM_EXPIRED:
- ret = PLAYER_ERROR_DRM_EXPIRED;
- msg = "PLAYER_ERROR_DRM_EXPIRED";
- break;
- case MM_ERROR_PLAYER_DRM_NOT_AUTHORIZED:
- case MM_ERROR_PLAYER_DRM_NO_LICENSE:
- ret = PLAYER_ERROR_DRM_NO_LICENSE;
- msg = "PLAYER_ERROR_DRM_NO_LICENSE";
- break;
- case MM_ERROR_PLAYER_DRM_FUTURE_USE:
- ret = PLAYER_ERROR_DRM_FUTURE_USE;
- msg = "PLAYER_ERROR_DRM_FUTURE_USE";
- break;
- case MM_ERROR_PLAYER_DRM_OUTPUT_PROTECTION:
- ret = PLAYER_ERROR_DRM_NOT_PERMITTED;
- msg = "PLAYER_ERROR_DRM_NOT_PERMITTED";
- break;
- case MM_ERROR_PLAYER_RESOURCE_LIMIT:
- ret = PLAYER_ERROR_RESOURCE_LIMIT;
- msg = "PLAYER_ERROR_RESOURCE_LIMIT";
- break;
- case MM_ERROR_PLAYER_PERMISSION_DENIED:
- ret = PLAYER_ERROR_PERMISSION_DENIED;
- msg = "PLAYER_ERROR_PERMISSION_DENIED";
+ char *msg = "PLAYER_ERROR_INVALID_OPERATION";
+ switch (code) {
+ case MM_ERROR_NONE:
+ case MM_ERROR_PLAYER_AUDIO_CODEC_NOT_FOUND:
+ case MM_ERROR_PLAYER_VIDEO_CODEC_NOT_FOUND:
+ ret = PLAYER_ERROR_NONE;
+ msg = "PLAYER_ERROR_NONE";
+ break;
+ case MM_ERROR_INVALID_ARGUMENT:
+ ret = PLAYER_ERROR_INVALID_PARAMETER;
+ msg = "PLAYER_ERROR_INVALID_PARAMETER";
+ break;
+ case MM_ERROR_PLAYER_CODEC_NOT_FOUND:
+ case MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_AUDIO:
+ case MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_VIDEO:
+ case MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_MEDIA_TYPE:
+ case MM_ERROR_PLAYER_NOT_SUPPORTED_FORMAT:
+ ret = PLAYER_ERROR_NOT_SUPPORTED_FILE;
+ msg = "PLAYER_ERROR_NOT_SUPPORTED_FILE";
+ break;
+ case MM_ERROR_PLAYER_INVALID_STATE:
+ case MM_ERROR_PLAYER_NOT_INITIALIZED:
+ ret = PLAYER_ERROR_INVALID_STATE;
+ msg = "PLAYER_ERROR_INVALID_STATE";
+ break;
+ case MM_ERROR_PLAYER_INTERNAL:
+ case MM_ERROR_PLAYER_INVALID_STREAM:
+ case MM_ERROR_PLAYER_STREAMING_FAIL:
+ case MM_ERROR_PLAYER_NO_OP:
+ ret = PLAYER_ERROR_INVALID_OPERATION;
+ msg = "PLAYER_ERROR_INVALID_OPERATION";
+ break;
+ case MM_ERROR_PLAYER_SOUND_EFFECT_INVALID_STATUS:
+ case MM_ERROR_NOT_SUPPORT_API:
+ case MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER:
+ ret = PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
+ msg = "PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE";
+ break;
+ case MM_ERROR_PLAYER_NO_FREE_SPACE:
+ ret = PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE;
+ msg = "PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE";
+ break;
+ case MM_ERROR_PLAYER_FILE_NOT_FOUND:
+ ret = PLAYER_ERROR_NO_SUCH_FILE;
+ msg = "PLAYER_ERROR_NO_SUCH_FILE";
+ break;
+ case MM_ERROR_PLAYER_SEEK:
+ ret = PLAYER_ERROR_SEEK_FAILED;
+ msg = "PLAYER_ERROR_SEEK_FAILED";
+ break;
+ case MM_ERROR_PLAYER_INVALID_URI:
+ case MM_ERROR_PLAYER_STREAMING_INVALID_URL:
+ ret = PLAYER_ERROR_INVALID_URI;
+ msg = "PLAYER_ERROR_INVALID_URI";
+ break;
+ case MM_ERROR_PLAYER_STREAMING_CONNECTION_FAIL:
+ case MM_ERROR_PLAYER_STREAMING_DNS_FAIL:
+ case MM_ERROR_PLAYER_STREAMING_SERVER_DISCONNECTED:
+ case MM_ERROR_PLAYER_STREAMING_INVALID_PROTOCOL:
+ case MM_ERROR_PLAYER_STREAMING_UNEXPECTED_MSG:
+ case MM_ERROR_PLAYER_STREAMING_OUT_OF_MEMORIES:
+ case MM_ERROR_PLAYER_STREAMING_RTSP_TIMEOUT:
+ case MM_ERROR_PLAYER_STREAMING_BAD_REQUEST:
+ case MM_ERROR_PLAYER_STREAMING_NOT_AUTHORIZED:
+ case MM_ERROR_PLAYER_STREAMING_PAYMENT_REQUIRED:
+ case MM_ERROR_PLAYER_STREAMING_FORBIDDEN:
+ case MM_ERROR_PLAYER_STREAMING_CONTENT_NOT_FOUND:
+ case MM_ERROR_PLAYER_STREAMING_METHOD_NOT_ALLOWED:
+ case MM_ERROR_PLAYER_STREAMING_NOT_ACCEPTABLE:
+ case MM_ERROR_PLAYER_STREAMING_PROXY_AUTHENTICATION_REQUIRED:
+ case MM_ERROR_PLAYER_STREAMING_SERVER_TIMEOUT:
+ case MM_ERROR_PLAYER_STREAMING_GONE:
+ case MM_ERROR_PLAYER_STREAMING_LENGTH_REQUIRED:
+ case MM_ERROR_PLAYER_STREAMING_PRECONDITION_FAILED:
+ case MM_ERROR_PLAYER_STREAMING_REQUEST_ENTITY_TOO_LARGE:
+ case MM_ERROR_PLAYER_STREAMING_REQUEST_URI_TOO_LARGE:
+ case MM_ERROR_PLAYER_STREAMING_PARAMETER_NOT_UNDERSTOOD:
+ case MM_ERROR_PLAYER_STREAMING_CONFERENCE_NOT_FOUND:
+ case MM_ERROR_PLAYER_STREAMING_NOT_ENOUGH_BANDWIDTH:
+ case MM_ERROR_PLAYER_STREAMING_NO_SESSION_ID:
+ case MM_ERROR_PLAYER_STREAMING_METHOD_NOT_VALID_IN_THIS_STATE:
+ case MM_ERROR_PLAYER_STREAMING_HEADER_FIELD_NOT_VALID_FOR_SOURCE:
+ case MM_ERROR_PLAYER_STREAMING_INVALID_RANGE:
+ case MM_ERROR_PLAYER_STREAMING_PARAMETER_IS_READONLY:
+ case MM_ERROR_PLAYER_STREAMING_AGGREGATE_OP_NOT_ALLOWED:
+ case MM_ERROR_PLAYER_STREAMING_ONLY_AGGREGATE_OP_ALLOWED:
+ case MM_ERROR_PLAYER_STREAMING_BAD_TRANSPORT:
+ case MM_ERROR_PLAYER_STREAMING_DESTINATION_UNREACHABLE:
+ case MM_ERROR_PLAYER_STREAMING_INTERNAL_SERVER_ERROR:
+ case MM_ERROR_PLAYER_STREAMING_NOT_IMPLEMENTED:
+ case MM_ERROR_PLAYER_STREAMING_BAD_GATEWAY:
+ case MM_ERROR_PLAYER_STREAMING_SERVICE_UNAVAILABLE:
+ case MM_ERROR_PLAYER_STREAMING_GATEWAY_TIME_OUT:
+ case MM_ERROR_PLAYER_STREAMING_OPTION_NOT_SUPPORTED:
+ ret = PLAYER_ERROR_CONNECTION_FAILED;
+ msg = "PLAYER_ERROR_CONNECTION_FAILED";
+ break;
+ case MM_ERROR_POLICY_BLOCKED:
+ case MM_ERROR_POLICY_INTERRUPTED:
+ case MM_ERROR_POLICY_INTERNAL:
+ case MM_ERROR_POLICY_DUPLICATED:
+ ret = PLAYER_ERROR_SOUND_POLICY;
+ msg = "PLAYER_ERROR_SOUND_POLICY";
+ break;
+ case MM_ERROR_PLAYER_DRM_EXPIRED:
+ ret = PLAYER_ERROR_DRM_EXPIRED;
+ msg = "PLAYER_ERROR_DRM_EXPIRED";
+ break;
+ case MM_ERROR_PLAYER_DRM_NOT_AUTHORIZED:
+ case MM_ERROR_PLAYER_DRM_NO_LICENSE:
+ ret = PLAYER_ERROR_DRM_NO_LICENSE;
+ msg = "PLAYER_ERROR_DRM_NO_LICENSE";
+ break;
+ case MM_ERROR_PLAYER_DRM_FUTURE_USE:
+ ret = PLAYER_ERROR_DRM_FUTURE_USE;
+ msg = "PLAYER_ERROR_DRM_FUTURE_USE";
+ break;
+ case MM_ERROR_PLAYER_DRM_OUTPUT_PROTECTION:
+ ret = PLAYER_ERROR_DRM_NOT_PERMITTED;
+ msg = "PLAYER_ERROR_DRM_NOT_PERMITTED";
+ break;
+ case MM_ERROR_PLAYER_RESOURCE_LIMIT:
+ ret = PLAYER_ERROR_RESOURCE_LIMIT;
+ msg = "PLAYER_ERROR_RESOURCE_LIMIT";
+ break;
+ case MM_ERROR_PLAYER_PERMISSION_DENIED:
+ ret = PLAYER_ERROR_PERMISSION_DENIED;
+ msg = "PLAYER_ERROR_PERMISSION_DENIED";
}
- LOGE("[%s] %s(0x%08x) : core fw error(0x%x)",func_name,msg, ret, code);
+ LOGE("[%s] %s(0x%08x) : core fw error(0x%x)", func_name, msg, ret, code);
return ret;
}
-static void * _get_mem(player_cli_s *player, int size)
+static void *_get_mem(player_cli_s *player, int size)
{
player_data_s *mem = g_new(player_data_s, sizeof(player_data_s));
- if(mem){
+ if (mem) {
mem->data = g_new(void, size);
mem->next = player->head;
player->head = mem;
static void _del_mem(player_cli_s *player)
{
player_data_s *mem;
- while(player->head){
+ while (player->head) {
mem = player->head->next;
g_free(player->head->data);
g_free(player->head);
msg_buff_s *buff = &cb_info->buff;
char *new;
- if(len && buff->bufLen - MUSE_MSG_MAX_LENGTH <= len) {
- LOGD("realloc Buffer %d -> %d, Msg Length %d",
- buff->bufLen, buff->bufLen + MUSE_MSG_MAX_LENGTH, len);
+ if (len && buff->bufLen - MUSE_MSG_MAX_LENGTH <= len) {
+ LOGD("realloc Buffer %d -> %d, Msg Length %d", buff->bufLen, buff->bufLen + MUSE_MSG_MAX_LENGTH, len);
buff->bufLen += MUSE_MSG_MAX_LENGTH;
new = g_renew(char, buff->recvMsg, buff->bufLen);
- if(new && new != buff->recvMsg){
+ if (new && new != buff->recvMsg)
buff->recvMsg = new;
- }
}
recvLen = muse_core_ipc_recv_msg(cb_info->fd, buff->recvMsg + len);
static void set_null_user_cb(callback_cb_info_s *cb_info, _player_event_e event)
{
- if(cb_info && event < _PLAYER_EVENT_TYPE_NUM){
+ if (cb_info && event < _PLAYER_EVENT_TYPE_NUM) {
cb_info->user_cb[event] = NULL;
cb_info->user_data[event] = NULL;
}
{
bool lock = g_thread_self() != cb_info->event_queue.thread;
- if(lock)
+ if (lock)
g_mutex_lock(&cb_info->event_queue.mutex);
set_null_user_cb(cb_info, event);
- if(lock)
+ if (lock)
g_mutex_unlock(&cb_info->event_queue.mutex);
}
-static int __set_callback(_player_event_e type, player_h player, void *callback,
- void *user_data)
+static int __set_callback(_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;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
int set = 1;
LOGI("Event type : %d ", type);
player_msg_set_callback(api, pc, ret, type, set);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[type] = callback;
pc->cb_info->user_data[type] = user_data;
}
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
int set = 0;
return ret;
}
-static void __prepare_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __prepare_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
- char caps[MUSE_MSG_MAX_LENGTH] = {0};
+ char caps[MUSE_MSG_MAX_LENGTH] = {0, };
_player_event_e ev = _PLAYER_EVENT_TYPE_PREPARE;
- if(player_msg_get_string(caps, recvMsg))
- if(strlen(caps) > 0)
+ if (player_msg_get_string(caps, recvMsg))
+ if (strlen(caps) > 0)
mm_player_mused_realize(cb_info->local_handle, caps);
((player_prepared_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
set_null_user_cb(cb_info, ev);
}
-static void __complete_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __complete_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
_player_event_e ev = _PLAYER_EVENT_TYPE_COMPLETE;
((player_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
}
-static void __interrupt_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __interrupt_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
int code;
_player_event_e ev = _PLAYER_EVENT_TYPE_INTERRUPT;
- if(player_msg_get(code, recvMsg)) {
- ((player_interrupted_cb)cb_info->user_cb[ev])(
- code, cb_info->user_data[ev]);
- }
+ if (player_msg_get(code, recvMsg))
+ ((player_interrupted_cb)cb_info->user_cb[ev])(code, cb_info->user_data[ev]);
}
-static void __error_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __error_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
int code;
_player_event_e ev = _PLAYER_EVENT_TYPE_ERROR;
- if(player_msg_get(code, recvMsg)) {
- ((player_error_cb) cb_info->user_cb[ev])(
- code, cb_info->user_data[ev]);
- }
+ if (player_msg_get(code, recvMsg))
+ ((player_error_cb)cb_info->user_cb[ev])(code, cb_info->user_data[ev]);
}
-static void __buffering_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __buffering_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
int percent;
_player_event_e ev = _PLAYER_EVENT_TYPE_BUFFERING;
- if(player_msg_get(percent, recvMsg)) {
- ((player_buffering_cb) cb_info->user_cb[ev])(
- percent, cb_info->user_data[ev]);
- }
+ if (player_msg_get(percent, recvMsg))
+ ((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, char *recvMsg)
+static void __subtitle_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
int duration = 0;
char text[MUSE_URI_MAX_LENGTH];
_player_event_e ev = _PLAYER_EVENT_TYPE_SUBTITLE;
- if(player_msg_get(duration, recvMsg)
- && player_msg_get_string(text, recvMsg)) {
- ((player_subtitle_updated_cb)cb_info->user_cb[ev])(
- duration, text, cb_info->user_data[ev]);
+ if (player_msg_get(duration, recvMsg)
+ && player_msg_get_string(text, recvMsg)) {
+ ((player_subtitle_updated_cb)cb_info->user_cb[ev])(duration, text, cb_info->user_data[ev]);
}
}
-static void __capture_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __capture_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
unsigned char *data = NULL;
int width = 0;
tbm_bo_handle thandle;
tbm_key key;
- if(player_msg_get(width, recvMsg) && player_msg_get(height, recvMsg)
- && player_msg_get(size, recvMsg)) {
- if(!player_msg_get(key, recvMsg))
+ if (player_msg_get(width, recvMsg) && player_msg_get(height, recvMsg)
+ && player_msg_get(size, recvMsg)) {
+ if (!player_msg_get(key, recvMsg))
goto capture_event_exit1;
bo = tbm_bo_import(cb_info->bufmgr, key);
- if(bo == NULL) {
+ if (bo == NULL) {
LOGE("TBM get error : bo is NULL");
goto capture_event_exit1;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU,
- TBM_OPTION_WRITE | TBM_OPTION_READ);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE | TBM_OPTION_READ);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
goto capture_event_exit2;
}
data = g_new(unsigned char, size);
- if(data){
+ if (data) {
memcpy(data, thandle.ptr, size);
- ((player_video_captured_cb)
- cb_info->user_cb[_PLAYER_EVENT_TYPE_CAPTURE]) (
- data, width, height, size,
- cb_info->user_data[_PLAYER_EVENT_TYPE_CAPTURE]);
+ ((player_video_captured_cb)cb_info->user_cb[_PLAYER_EVENT_TYPE_CAPTURE])(data, width, height, size, cb_info->user_data[_PLAYER_EVENT_TYPE_CAPTURE]);
g_free(data);
- }
- else
+ } else
LOGE("g_new failure");
/* mark to read */
- *((char *)thandle.ptr+size) = 0;
+ *((char *)thandle.ptr + size) = 0;
tbm_bo_unmap(bo);
capture_event_exit2:
set_null_user_cb(cb_info, _PLAYER_EVENT_TYPE_CAPTURE);
}
-static void __seek_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __seek_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
_player_event_e ev = _PLAYER_EVENT_TYPE_SEEK;
set_null_user_cb(cb_info, ev);
}
-static void __media_packet_video_frame_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
- tbm_bo bo[4] = {NULL, };
- tbm_key key[4] = {0, };
+ tbm_bo bo[4] = { NULL, };
+ tbm_key key[4] = { 0, };
tbm_surface_info_s sinfo;
char *surface_info = (char *)&sinfo;
media_packet_h pkt = NULL;
LOGD("width %d, height %d", sinfo.width, sinfo.height);
- for(i = 0; i < 4; i++) {
- if(key[i]){
+ for (i = 0; i < 4; i++) {
+ if (key[i]) {
bo_num++;
bo[i] = tbm_bo_import(cb_info->bufmgr, key[i]);
}
}
- tsurf = tbm_surface_internal_create_with_bos(&sinfo ,bo, bo_num);
+ tsurf = tbm_surface_internal_create_with_bos(&sinfo, bo, bo_num);
if (tsurf) {
/* check media packet format */
if (cb_info->pkt_fmt) {
int pkt_fmt_height = 0;
media_format_mimetype_e pkt_fmt_mimetype = MEDIA_FORMAT_NV12;
- media_format_get_video_info(cb_info->pkt_fmt, &pkt_fmt_mimetype,
- &pkt_fmt_width, &pkt_fmt_height, NULL, NULL);
- if (pkt_fmt_mimetype != mimetype ||
- pkt_fmt_width != sinfo.width ||
- pkt_fmt_height != sinfo.height) {
- LOGW("different format. current 0x%x, %dx%d, new 0x%x, %dx%d",
- pkt_fmt_mimetype, pkt_fmt_width, pkt_fmt_height, mimetype,
- sinfo.width, sinfo.height);
+ media_format_get_video_info(cb_info->pkt_fmt, &pkt_fmt_mimetype, &pkt_fmt_width, &pkt_fmt_height, NULL, NULL);
+ if (pkt_fmt_mimetype != mimetype || pkt_fmt_width != sinfo.width || pkt_fmt_height != sinfo.height) {
+ LOGW("different format. current 0x%x, %dx%d, new 0x%x, %dx%d", pkt_fmt_mimetype, pkt_fmt_width, pkt_fmt_height, mimetype, sinfo.width, sinfo.height);
media_format_unref(cb_info->pkt_fmt);
cb_info->pkt_fmt = NULL;
make_pkt_fmt = true;
}
/* create packet format */
if (make_pkt_fmt) {
- LOGI("make new pkt_fmt - mimetype 0x%x, %dx%d", mimetype,
- sinfo.width, sinfo.height);
+ LOGI("make new pkt_fmt - mimetype 0x%x, %dx%d", mimetype, sinfo.width, sinfo.height);
ret = media_format_create(&cb_info->pkt_fmt);
if (ret == MEDIA_FORMAT_ERROR_NONE) {
ret = media_format_set_video_mime(cb_info->pkt_fmt, mimetype);
fin_data = g_new(_media_pkt_fin_data, 1);
fin_data->remote_pkt = packet;
fin_data->cb_info = cb_info;
- ret = media_packet_create_from_tbm_surface(cb_info->pkt_fmt, tsurf,
- (media_packet_finalize_cb)_player_media_packet_finalize,
- (void *)fin_data, &pkt);
+ ret = media_packet_create_from_tbm_surface(cb_info->pkt_fmt, tsurf, (media_packet_finalize_cb)_player_media_packet_finalize, (void *)fin_data, &pkt);
if (ret != MEDIA_PACKET_ERROR_NONE) {
LOGE("media_packet_create_from_tbm_surface failed");
tbm_surface_destroy(tsurf);
}
if (pkt) {
/* call media packet callback */
- ((player_media_packet_video_decoded_cb)
- cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME])(
- pkt, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]);
+ ((player_media_packet_video_decoded_cb)cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME])(pkt, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]);
}
- for(i = 0; i < bo_num; i++) {
- if(bo[i])
+ for (i = 0; i < bo_num; i++) {
+ if (bo[i])
tbm_bo_unref(bo[i]);
}
}
-static void __audio_frame_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __audio_frame_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
unsigned char *data = NULL;
unsigned int size = 0;
player_audio_raw_data_s audio;
void *audio_frame = &audio;
- if(player_msg_get_array(audio_frame, recvMsg) && player_msg_get(size, recvMsg)) {
- if(!player_msg_get(key, recvMsg))
+ if (player_msg_get_array(audio_frame, recvMsg) && player_msg_get(size, recvMsg)) {
+ if (!player_msg_get(key, recvMsg))
return;
bo = tbm_bo_import(cb_info->bufmgr, key);
- if(bo == NULL) {
+ if (bo == NULL) {
LOGE("TBM get error : bo is NULL");
return;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU,
- TBM_OPTION_WRITE | TBM_OPTION_READ);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE | TBM_OPTION_READ);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
tbm_bo_unref(bo);
return;
}
data = g_new(unsigned char, size);
- if(data){
+ if (data) {
memcpy(data, thandle.ptr, size);
audio.data = data;
audio.size = size;
LOGD("user callback data %p, size %d", audio.data, audio.size);
- ((player_audio_pcm_extraction_cb)
- cb_info->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME]) (
- &audio,
- cb_info->user_data[_PLAYER_EVENT_TYPE_AUDIO_FRAME]);
+ ((player_audio_pcm_extraction_cb)cb_info->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME])(&audio, cb_info->user_data[_PLAYER_EVENT_TYPE_AUDIO_FRAME]);
g_free(data);
- }
- else
+ } else
LOGE("g_new failure");
/* mark to read */
- *((char *)thandle.ptr+size) = 0;
+ *((char *)thandle.ptr + size) = 0;
LOGD("Fin");
tbm_bo_unmap(bo);
}
}
-static void __video_frame_render_error_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __video_frame_render_error_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
}
-static void __pd_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
+static void __pd_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
int type;
_player_event_e ev = _PLAYER_EVENT_TYPE_PD;
- if(player_msg_get(type, recvMsg)) {
- ((player_pd_message_cb)cb_info->user_cb[ev])(
- type, cb_info->user_data[ev]);
- }
+ if (player_msg_get(type, recvMsg))
+ ((player_pd_message_cb)cb_info->user_cb[ev])(type, cb_info->user_data[ev]);
}
-static void __supported_audio_effect_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __supported_audio_effect_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
}
-static void __supported_audio_effect_freset_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __supported_audio_effect_freset_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
}
-static void __missed_plugin_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __missed_plugin_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
}
-static void __media_stream_video_buffer_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __media_stream_video_buffer_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
- //player_media_stream_buffer_status_e status;
+ /* player_media_stream_buffer_status_e status; */
int status;
- if(player_msg_get(status, recvMsg)) {
+ if (player_msg_get(status, recvMsg)) {
((player_media_stream_buffer_status_cb)
- cb_info->user_cb[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS])(
- (player_media_stream_buffer_status_e)status, cb_info->user_data[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS]);
+ cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS])((player_media_stream_buffer_status_e)status, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS]);
}
}
-static void __media_stream_audio_buffer_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __media_stream_audio_buffer_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
- //player_media_stream_buffer_status_e status;
+ /* player_media_stream_buffer_status_e status; */
int status;
- if(player_msg_get(status, recvMsg)) {
+ if (player_msg_get(status, recvMsg)) {
((player_media_stream_buffer_status_cb)
- cb_info->user_cb[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS])(
- (player_media_stream_buffer_status_e)status, cb_info->user_data[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS]);
+ cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS])
+ ((player_media_stream_buffer_status_e)status, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS]);
}
}
-
-static void __media_stream_video_seek_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __media_stream_video_seek_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
unsigned long long offset;
- if(player_msg_get_type(offset, recvMsg, INT64)) {
+ if (player_msg_get_type(offset, recvMsg, INT64)) {
((player_media_stream_seek_cb)
- cb_info->user_cb[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK])(
- offset, cb_info->user_data[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK]);
+ cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK])
+ (offset, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK]);
}
}
-
-static void __media_stream_audio_seek_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __media_stream_audio_seek_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
unsigned long long offset;
- if(player_msg_get_type(offset, recvMsg, INT64)) {
+ if (player_msg_get_type(offset, recvMsg, INT64)) {
((player_media_stream_seek_cb)
- cb_info->user_cb[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK])(
- offset, cb_info->user_data[
- _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK]);
+ cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK])
+ (offset, cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK]);
}
}
-static void __video_stream_changed_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __video_stream_changed_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
int width;
int height;
int fps;
int bit_rate;
- if(player_msg_get(width, recvMsg)
- && player_msg_get(height, recvMsg)
- && player_msg_get(fps, recvMsg)
- && player_msg_get(bit_rate, recvMsg)) {
- ((player_video_stream_changed_cb)
- cb_info->user_cb[
- _PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED])(
- width, height, fps, bit_rate, cb_info->user_data[
- _PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED]);
+ if (player_msg_get(width, recvMsg)
+ && player_msg_get(height, recvMsg)
+ && player_msg_get(fps, recvMsg)
+ && player_msg_get(bit_rate, recvMsg)) {
+ ((player_video_stream_changed_cb)cb_info->user_cb[_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED])
+ (width, height, fps, bit_rate, cb_info->user_data[_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED]);
}
}
-static void __video_bin_created_cb_handler(
- callback_cb_info_s * cb_info, char *recvMsg)
+static void __video_bin_created_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
- char caps[MUSE_MSG_MAX_LENGTH] = {0};
- if(player_msg_get_string(caps, recvMsg))
- if(strlen(caps) > 0)
+ char caps[MUSE_MSG_MAX_LENGTH] = {0, };
+ if (player_msg_get_string(caps, recvMsg))
+ if (strlen(caps) > 0)
mm_player_mused_realize(cb_info->local_handle, caps);
}
{
}
-static void (*_user_callbacks[_PLAYER_EVENT_TYPE_NUM])
- (callback_cb_info_s * cb_info, char *recvMsg) = {
+static void (*_user_callbacks[_PLAYER_EVENT_TYPE_NUM])(callback_cb_info_s *cb_info, char *recvMsg) = {
__prepare_cb_handler, /*_PLAYER_EVENT_TYPE_PREPARE*/
__complete_cb_handler, /*_PLAYER_EVENT_TYPE_COMPLETE*/
__interrupt_cb_handler, /*_PLAYER_EVENT_TYPE_INTERRUPT*/
static void _player_event_job_function(_player_cb_data *data)
{
_player_event_e ev = data->int_data;
- if(data->cb_info->user_cb[ev])
- _user_callbacks[ev](data->cb_info, data->buf);
+ if (data->cb_info->user_cb[ev])
+ _user_callbacks[ev] (data->cb_info, data->buf);
else
LOGW("user callback is unset. type : %d", ev);
g_free(data);
}
-static void * _player_event_queue_loop(void *param)
+static void *_player_event_queue_loop(void *param)
{
- if(!param) {
+ if (!param) {
LOGE("NULL parameter");
return NULL;
}
_player_cb_data *event_data;
g_mutex_lock(&ev->mutex);
- while(ev->running) {
+ while (ev->running) {
g_mutex_lock(&ev->qlock);
- if(g_queue_is_empty(ev->queue)) {
+ if (g_queue_is_empty(ev->queue)) {
g_mutex_unlock(&ev->qlock);
g_cond_wait(&ev->cond, &ev->mutex);
- if(!ev->running)
+ if (!ev->running)
break;
} else
g_mutex_unlock(&ev->qlock);
- while(1) {
+ while (1) {
g_mutex_lock(&ev->qlock);
event_data = (_player_cb_data *)g_queue_pop_head(ev->queue);
g_mutex_unlock(&ev->qlock);
- if(event_data)
+ if (event_data)
_player_event_job_function(event_data);
- else {
+ else
break;
- }
}
}
g_mutex_unlock(&ev->mutex);
g_mutex_init(&ev->mutex);
g_cond_init(&ev->cond);
ev->running = TRUE;
- ev->thread =
- g_thread_new("cb_event_thread", _player_event_queue_loop,
- (gpointer) cb_info);
+ ev->thread = g_thread_new("cb_event_thread", _player_event_queue_loop, (gpointer)cb_info);
g_return_val_if_fail(ev->thread, FALSE);
LOGI("event queue thread %p", ev->thread);
g_thread_join(ev->thread);
g_thread_unref(ev->thread);
- while(!g_queue_is_empty(ev->queue)) {
+ while (!g_queue_is_empty(ev->queue)) {
event_data = (_player_cb_data *)g_queue_pop_head(ev->queue);
- if(event_data) {
+ if (event_data) {
g_free(event_data->buf);
g_free(event_data);
}
static void _player_event_queue_add(player_event_queue *ev, _player_cb_data *data)
{
- if(ev->running){
+ if (ev->running) {
g_mutex_lock(&ev->qlock);
g_queue_push_tail(ev->queue, (gpointer)data);
g_mutex_unlock(&ev->qlock);
}
}
-static void _user_callback_handler(callback_cb_info_s * cb_info,
- _player_event_e event, char *buffer)
+static void _user_callback_handler(callback_cb_info_s *cb_info, _player_event_e event, char *buffer)
{
LOGD("get event %d", event);
- if(event < _PLAYER_EVENT_TYPE_NUM){
- if(cb_info->user_cb[event] && _user_callbacks[event]){
+ if (event < _PLAYER_EVENT_TYPE_NUM) {
+ if (cb_info->user_cb[event] && _user_callbacks[event]) {
_player_cb_data *data = NULL;
- data = g_new( _player_cb_data, 1);
- if(!data) {
+ data = g_new(_player_cb_data, 1);
+ if (!data) {
LOGE("fail to alloc mem");
return;
}
}
}
-static void _add_ret_msg(muse_player_api_e api, callback_cb_info_s *cb_info,
- int offset, int parse_len)
+static void _add_ret_msg(muse_player_api_e api, callback_cb_info_s *cb_info, int offset, int parse_len)
{
ret_msg_s *msg = NULL;
ret_msg_s *last = cb_info->buff.retMsgHead;
-
msg = g_new(ret_msg_s, 1);
- if(msg)
- {
+ if (msg) {
msg->api = api;
msg->msg = strndup(cb_info->buff.recvMsg + offset, parse_len);
msg->next = NULL;
- if(last == NULL)
+ if (last == NULL)
cb_info->buff.retMsgHead = msg;
else {
- while(last->next)
+ while (last->next)
last = last->next;
last->next = msg;
}
- }
- else
+ } else
LOGE("g_new failure");
}
-static ret_msg_s * _get_ret_msg(muse_player_api_e api, callback_cb_info_s *cb_info)
+static ret_msg_s *_get_ret_msg(muse_player_api_e api, callback_cb_info_s *cb_info)
{
ret_msg_s *msg = cb_info->buff.retMsgHead;
ret_msg_s *prev = NULL;
- while(msg){
- if(msg->api == api){
- if(!prev) {
+ while (msg) {
+ if (msg->api == api) {
+ if (!prev)
cb_info->buff.retMsgHead = msg->next;
- }
- else {
+ else
prev->next = msg->next;
- }
return msg;
}
prev = msg;
{
int code = PLAYER_ERROR_SERVICE_DISCONNECTED;
_player_event_e ev = _PLAYER_EVENT_TYPE_ERROR;
- if(!cb_info || !cb_info->user_cb[ev])
+ if (!cb_info || !cb_info->user_cb[ev])
return;
- ((player_error_cb) cb_info->user_cb[ev])(code, cb_info->user_data[ev]);
+ ((player_error_cb) cb_info->user_cb[ev]) (code, cb_info->user_data[ev]);
}
static void *client_cb_handler(gpointer data)
recvMsg[len] = '\0';
parse_len = len;
offset = 0;
- while(offset < len){
+ while (offset < len) {
api = MUSE_PLAYER_API_MAX;
- if(player_msg_get_error_e(api, recvMsg + offset, parse_len, err)) {
- if(api < MUSE_PLAYER_API_MAX){
+ if (player_msg_get_error_e(api, recvMsg + offset, parse_len, err)) {
+ if (api < MUSE_PLAYER_API_MAX) {
g_mutex_lock(&cb_info->player_mutex);
cb_info->buff.recved++;
_add_ret_msg(api, cb_info, offset, parse_len);
g_cond_signal(&cb_info->player_cond[api]);
g_mutex_unlock(&cb_info->player_mutex);
- if (api == MUSE_PLAYER_API_DESTROY) {
+ if (api == MUSE_PLAYER_API_DESTROY)
g_atomic_int_set(&cb_info->running, 0);
- }
- }
- else if(api == MUSE_PLAYER_CB_EVENT) {
+ } else if (api == MUSE_PLAYER_CB_EVENT) {
int event;
char *buffer;
g_mutex_lock(&cb_info->player_mutex);
buffer = strndup(recvMsg + offset, parse_len);
g_mutex_unlock(&cb_info->player_mutex);
- if(player_msg_get(event, buffer)) {
+ if (player_msg_get(event, buffer))
_user_callback_handler(cb_info, event, buffer);
- }
}
}
- if(parse_len == 0) break;
+ if (parse_len == 0)
+ break;
offset += parse_len;
parse_len = len - parse_len;
}
- }while(err == MUSE_MSG_PARSE_ERROR_CONTINUE);
+ } while (err == MUSE_MSG_PARSE_ERROR_CONTINUE);
if (len <= 0)
break;
}
memset(cb_info, 0, sizeof(callback_cb_info_s));
g_mutex_init(&cb_info->player_mutex);
- for(i=0; i<MUSE_PLAYER_API_MAX; i++)
+ for (i = 0; i < MUSE_PLAYER_API_MAX; i++)
g_cond_init(&cb_info->player_cond[i]);
buff = &cb_info->buff;
- buff->recvMsg = g_new(char, MUSE_MSG_MAX_LENGTH+1);
- buff->bufLen = MUSE_MSG_MAX_LENGTH+1;
+ buff->recvMsg = g_new(char, MUSE_MSG_MAX_LENGTH + 1);
+ buff->bufLen = MUSE_MSG_MAX_LENGTH + 1;
buff->recved = 0;
buff->retMsgHead = NULL;
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->thread = g_thread_new("callback_thread", client_cb_handler, (gpointer)cb_info);
return cb_info;
}
-static void callback_destroy(callback_cb_info_s * cb_info)
+static void callback_destroy(callback_cb_info_s *cb_info)
{
int i;
g_return_if_fail(cb_info);
LOGI("%p Callback destroyed", cb_info->thread);
g_mutex_clear(&cb_info->player_mutex);
- for(i=0; i<MUSE_PLAYER_API_MAX; i++)
+ for (i = 0; i < MUSE_PLAYER_API_MAX; i++)
g_cond_clear(&cb_info->player_cond[i]);
g_free(cb_info->buff.recvMsg);
{
int timeout = 0;
- switch(api) {
+ switch (api) {
case MUSE_PLAYER_API_PREPARE:
case MUSE_PLAYER_API_PREPARE_ASYNC:
case MUSE_PLAYER_API_UNPREPARE:
break;
default:
/* check prepare async is done */
- if(pc && CALLBACK_INFO(pc) &&
- CALLBACK_INFO(pc)->user_cb[_PLAYER_EVENT_TYPE_PREPARE])
+ if (pc && CALLBACK_INFO(pc) && CALLBACK_INFO(pc)->user_cb[_PLAYER_EVENT_TYPE_PREPARE])
timeout += SERVER_TIMEOUT(pc);
break;
}
return timeout;
}
-int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info,
- char **ret_buf, int time_out)
+int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out)
{
int ret = PLAYER_ERROR_NONE;
gint64 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
g_mutex_lock(&cb_info->player_mutex);
msg = _get_ret_msg(api, cb_info);
- if(!buff->recved || !msg) {
+ if (!buff->recved || !msg) {
if (!g_cond_wait_until(&cb_info->player_cond[api], &cb_info->player_mutex, end_time)) {
LOGW("api %d return msg does not received %ds", api, time_out);
g_mutex_unlock(&cb_info->player_mutex);
return PLAYER_ERROR_INVALID_OPERATION;
}
}
- if(!msg)
+ if (!msg)
msg = _get_ret_msg(api, cb_info);
- if(msg) {
+ if (msg) {
*ret_buf = msg->msg;
g_free(msg);
- if(!player_msg_get(ret, *ret_buf))
+ if (!player_msg_get(ret, *ret_buf))
ret = PLAYER_ERROR_INVALID_OPERATION;
- }
- else {
+ } else {
LOGE("api %d return msg is not exist", api);
ret = PLAYER_ERROR_INVALID_OPERATION;
}
* Public Implementation
*/
-int player_create(player_h * player)
+int player_create(player_h *player)
{
PLAYER_INSTANCE_CHECK(player);
LOGD("ENTER");
sock_fd = muse_core_client_new();
- if(sock_fd < 0){
+ if (sock_fd < 0) {
LOGE("connection failure %d", errno);
ret = PLAYER_ERROR_INVALID_OPERATION;
goto ErrorExit;
}
pc->cb_info = callback_new(sock_fd);
- if(!pc->cb_info) {
+ if (!pc->cb_info) {
LOGE("fail to create callback");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto ErrorExit;
}
- if(!_player_event_queue_new(pc->cb_info)) {
+ if (!_player_event_queue_new(pc->cb_info)) {
LOGE("fail to create event queue");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto ErrorExit;
ret = wait_for_cb_return(api, pc->cb_info, &ret_buf, CALLBACK_TIME_OUT);
if (ret == PLAYER_ERROR_NONE) {
intptr_t module_addr;
- char stream_path[MUSE_MSG_MAX_LENGTH] = {0,};
- *player = (player_h) pc;
- if(player_msg_get_type(module_addr, ret_buf, POINTER)) {
+ char stream_path[MUSE_MSG_MAX_LENGTH] = {0, };
+ *player = (player_h)pc;
+ if (player_msg_get_type(module_addr, ret_buf, POINTER)) {
pc->cb_info->data_fd = muse_core_client_new_data_ch();
muse_core_send_client_addr(module_addr, pc->cb_info->data_fd);
- LOGD("Data channel fd %d, muse module addr %p",
- pc->cb_info->data_fd, module_addr);
+ LOGD("Data channel fd %d, muse module addr %p", pc->cb_info->data_fd, module_addr);
}
- if(mm_player_mused_create(&INT_HANDLE(pc)) != MM_ERROR_NONE) {
+ if (mm_player_mused_create(&INT_HANDLE(pc)) != MM_ERROR_NONE) {
LOGE("create failure");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto ErrorExit;
}
mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc), TRUE);
SERVER_TIMEOUT(pc) += CALLBACK_TIME_OUT;
- if(player_msg_get_string(stream_path, ret_buf)) {
+ if (player_msg_get_string(stream_path, ret_buf)) {
LOGD("shmsrc stream path : %s", stream_path);
- if(mm_player_set_shm_stream_path(INT_HANDLE(pc), stream_path)
- != MM_ERROR_NONE)
+ if (mm_player_set_shm_stream_path(INT_HANDLE(pc), stream_path)
+ != MM_ERROR_NONE)
goto ErrorExit;
}
} else
goto ErrorExit;
- pc->cb_info->bufmgr = tbm_bufmgr_init (-1);
+ pc->cb_info->bufmgr = tbm_bufmgr_init(-1);
g_free(ret_buf);
return ret;
ErrorExit:
- if(pc && pc->cb_info) {
- if(pc->cb_info->event_queue.running)
+ if (pc && pc->cb_info) {
+ if (pc->cb_info->event_queue.running)
_player_event_queue_destroy(pc->cb_info);
callback_destroy(pc->cb_info);
pc->cb_info = NULL;
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_DESTROY;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
if (CALLBACK_INFO(pc)) {
- if(mm_player_mused_destroy(INT_HANDLE(pc)) != MM_ERROR_NONE)
+ if (mm_player_mused_destroy(INT_HANDLE(pc)) != MM_ERROR_NONE)
ret = PLAYER_ERROR_INVALID_OPERATION;
_player_event_queue_destroy(CALLBACK_INFO(pc));
- tbm_bufmgr_deinit (TBM_BUFMGR(pc));
+ tbm_bufmgr_deinit(TBM_BUFMGR(pc));
callback_destroy(CALLBACK_INFO(pc));
}
return ret;
}
-int player_prepare_async(player_h player, player_prepared_cb callback,
- void *user_data)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int is_streaming = 0;
LOGD("ENTER");
if (pc->cb_info->user_cb[_PLAYER_EVENT_TYPE_PREPARE]) {
- LOGE("PLAYER_ERROR_INVALID_OPERATION (0x%08x) : preparing...",
- PLAYER_ERROR_INVALID_OPERATION);
+ LOGE("PLAYER_ERROR_INVALID_OPERATION (0x%08x) : preparing...", PLAYER_ERROR_INVALID_OPERATION);
return PLAYER_ERROR_INVALID_OPERATION;
} else {
pc->cb_info->user_cb[_PLAYER_EVENT_TYPE_PREPARE] = callback;
}
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(is_streaming, ret_buf);
IS_STREAMING_CONTENT(pc) = is_streaming;
- mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc),
- is_streaming);
+ mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc), is_streaming);
}
g_free(ret_buf);
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- char caps[MUSE_MSG_MAX_LENGTH] = {0};
+ char caps[MUSE_MSG_MAX_LENGTH] = {0, };
int is_streaming = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if (CALLBACK_INFO(pc)) {
- mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "display_visible" , 1,
- NULL);
- }
+ if (CALLBACK_INFO(pc))
+ mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_visible", 1, NULL);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(is_streaming, ret_buf);
IS_STREAMING_CONTENT(pc) = is_streaming;
- mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc),
- is_streaming);
+ mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc), is_streaming);
player_msg_get_string(caps, ret_buf);
- if(strlen(caps) > 0 &&
- mm_player_mused_realize(INT_HANDLE(pc), caps) != MM_ERROR_NONE)
+ if (strlen(caps) > 0 && mm_player_mused_realize(INT_HANDLE(pc), caps) != MM_ERROR_NONE)
ret = PLAYER_ERROR_INVALID_OPERATION;
}
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_UNPREPARE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
mm_player_mused_pre_unrealize(INT_HANDLE(pc));
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
set_null_user_cb_lock(pc->cb_info, _PLAYER_EVENT_TYPE_SEEK);
set_null_user_cb_lock(pc->cb_info, _PLAYER_EVENT_TYPE_PREPARE);
_del_mem(pc);
_player_deinit_memory_buffer(pc);
}
- if(mm_player_mused_unrealize(INT_HANDLE(pc)) != MM_ERROR_NONE)
+ if (mm_player_mused_unrealize(INT_HANDLE(pc)) != MM_ERROR_NONE)
ret = PLAYER_ERROR_INVALID_OPERATION;
g_free(ret_buf);
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- STRING, uri);
+ player_msg_send1(api, pc, ret_buf, ret, STRING, uri);
g_free(ret_buf);
return ret;
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
tbm_bo bo;
tbm_bo_handle thandle;
tbm_key key;
- if(SERVER_TBM_BO(pc)){
+ if (SERVER_TBM_BO(pc)) {
LOGE("Already set the memory buffer. unprepare please");
return PLAYER_ERROR_INVALID_OPERATION;
}
- bo = tbm_bo_alloc (pc->cb_info->bufmgr, size, TBM_BO_DEFAULT);
- if(bo == NULL) {
+ bo = tbm_bo_alloc(pc->cb_info->bufmgr, size, TBM_BO_DEFAULT);
+ if (bo == NULL) {
LOGE("TBM get error : bo is NULL");
return PLAYER_ERROR_INVALID_OPERATION;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto set_memory_exit;
tbm_bo_unmap(bo);
key = tbm_bo_export(bo);
- if(key == 0) {
+ if (key == 0) {
LOGE("TBM get error : key is 0");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto set_memory_exit;
}
- player_msg_send2(api, pc, ret_buf, ret,
- INT, key, INT, size);
+ player_msg_send2(api, pc, ret_buf, ret, INT, key, INT, size);
-set_memory_exit:
+ set_memory_exit:
tbm_bo_unref(bo);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
intptr_t bo_addr = 0;
- if(player_msg_get_type(bo_addr, ret_buf, POINTER))
+ if (player_msg_get_type(bo_addr, ret_buf, POINTER))
SERVER_TBM_BO(pc) = (intptr_t)bo_addr;
}
muse_player_api_e api = MUSE_PLAYER_API_DEINIT_MEMORY_BUFFER;
intptr_t bo_addr = SERVER_TBM_BO(pc);
- if(!bo_addr)
+ if (!bo_addr)
return ret;
player_msg_send1_async(api, pc, POINTER, bo_addr);
return ret;
}
-int player_get_state(player_h player, player_state_e * pstate)
+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;
muse_player_api_e api = MUSE_PLAYER_API_GET_STATE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
int state;
char *ret_buf = NULL;
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" );
+ 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");
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_VOLUME;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- DOUBLE, right, DOUBLE, left);
+ player_msg_send2(api, pc, ret_buf, ret, DOUBLE, right, DOUBLE, left);
g_free(ret_buf);
return ret;
}
PLAYER_NULL_ARG_CHECK(pright);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VOLUME;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
double left = -1;
double right = -1;
char *ret_buf = NULL;
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get_type(left, ret_buf, DOUBLE);
player_msg_get_type(right, ret_buf, DOUBLE);
*pleft = (float)left;
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_TYPE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, type);
+ player_msg_send1(api, pc, ret_buf, ret, INT, type);
g_free(ret_buf);
return ret;
}
PLAYER_INSTANCE_CHECK(player);
muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_POLICY_INFO;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
/* check if stream_info is valid */
int ret = __player_convert_error_code(
- sound_manager_is_available_stream_information(stream_info, NATIVE_API_PLAYER, &is_available)
- , (char*)__FUNCTION__);
+ sound_manager_is_available_stream_information(
+ stream_info, NATIVE_API_PLAYER, &is_available), (char *)__FUNCTION__);
- if(ret == PLAYER_ERROR_NONE)
- {
- if(is_available == false)
+ if (ret == PLAYER_ERROR_NONE) {
+ if (is_available == false)
ret = PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
- else
- {
+ else {
char *stream_type = NULL;
int stream_index = 0;
ret = sound_manager_get_type_from_stream_information(stream_info, &stream_type);
ret = sound_manager_get_index_from_stream_information(stream_info, &stream_index);
if (ret == SOUND_MANAGER_ERROR_NONE)
- {
- player_msg_send2(api, pc, ret_buf, ret,
- STRING, stream_type, INT, stream_index);
- }
+ player_msg_send2(api, pc, ret_buf, ret, STRING, stream_type, INT, stream_index);
else
ret = PLAYER_ERROR_INVALID_OPERATION;
}
}
-int player_set_audio_latency_mode(player_h player,
- audio_latency_mode_e latency_mode)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, latency_mode);
+ player_msg_send1(api, pc, ret_buf, ret, INT, latency_mode);
g_free(ret_buf);
return ret;
}
-int player_get_audio_latency_mode(player_h player,
- audio_latency_mode_e * platency_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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int latency_mode = -1;
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_STOP;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE)
set_null_user_cb_lock(pc->cb_info, _PLAYER_EVENT_TYPE_SEEK);
- }
g_free(ret_buf);
return ret;
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
return ret;
}
-int player_set_play_position(player_h player, int millisecond, bool accurate,
- player_seek_completed_cb callback, void *user_data)
+int player_set_play_position(player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(millisecond >= 0, PLAYER_ERROR_INVALID_PARAMETER,
- "PLAYER_ERROR_INVALID_PARAMETER");
+ PLAYER_CHECK_CONDITION(millisecond >= 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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int pos = millisecond;
LOGD("ENTER");
if (pc->cb_info->user_cb[_PLAYER_EVENT_TYPE_SEEK]) {
- LOGE("PLAYER_ERROR_SEEK_FAILED (0x%08x) : seeking...",
- PLAYER_ERROR_SEEK_FAILED);
+ LOGE("PLAYER_ERROR_SEEK_FAILED (0x%08x) : seeking...", PLAYER_ERROR_SEEK_FAILED);
return PLAYER_ERROR_SEEK_FAILED;
} else {
LOGI("Event type : %d, pos : %d ", _PLAYER_EVENT_TYPE_SEEK, millisecond);
pc->cb_info->user_data[_PLAYER_EVENT_TYPE_SEEK] = user_data;
}
- player_msg_send2(api, pc, ret_buf, ret,
- INT, pos, INT, accurate);
+ player_msg_send2(api, pc, ret_buf, ret, INT, pos, INT, accurate);
if (ret != PLAYER_ERROR_NONE)
set_null_user_cb(pc->cb_info, _PLAYER_EVENT_TYPE_SEEK);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_PLAY_POSITION;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
int pos;
char *ret_buf = NULL;
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int mute = (int)muted;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, mute);
+ player_msg_send1(api, pc, ret_buf, ret, INT, mute);
g_free(ret_buf);
return ret;
}
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int mute = -1;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(mute, ret_buf);
- *muted = (bool)mute;
+ *muted = (bool) mute;
}
g_free(ret_buf);
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, looping);
+ player_msg_send1(api, pc, ret_buf, ret, INT, looping);
g_free(ret_buf);
return ret;
}
-int player_is_looping(player_h player, bool * plooping)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int looping = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(looping, ret_buf);
*plooping = looping;
}
PLAYER_NULL_ARG_CHECK(pduration);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_DURATION;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int duration = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(duration, ret_buf);
*pduration = duration;
}
return ret;
}
-int player_set_display(player_h player, player_display_type_e type,
- player_display_h display)
+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;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
Evas_Object *obj = NULL;
const char *object_type = NULL;
#ifdef HAVE_WAYLAND
void *set_handle = NULL;
void *set_wl_display = NULL;
- Ecore_Wl_Window * wl_window = NULL;
+ Ecore_Wl_Window *wl_window = NULL;
wl_win_msg_type wl_win;
char *wl_win_msg = (char *)&wl_win;
MMPlayerPipelineType mmPipelineType = MM_PLAYER_PIPELINE_CLIENT;
LOGD("ENTER");
- if(type != PLAYER_DISPLAY_TYPE_NONE) {
- obj = (Evas_Object *) display;
- if(!obj)
+ if (type != PLAYER_DISPLAY_TYPE_NONE) {
+ obj = (Evas_Object *)display;
+ if (!obj)
return PLAYER_ERROR_INVALID_PARAMETER;
object_type = evas_object_type_get(obj);
if (object_type) {
- if (type == PLAYER_DISPLAY_TYPE_OVERLAY
- && !strcmp(object_type, "elm_win")) {
+ if (type == PLAYER_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
#ifdef HAVE_WAYLAND
- /* wayland overlay surface*/
+ /* wayland overlay surface */
LOGI("Wayland overlay surface type");
wl_win.type = type;
- evas_object_geometry_get(obj, &wl_win.wl_window_x, &wl_win.wl_window_y,
- &wl_win.wl_window_width, &wl_win.wl_window_height);
+ evas_object_geometry_get(obj, &wl_win.wl_window_x, &wl_win.wl_window_y, &wl_win.wl_window_width, &wl_win.wl_window_height);
wl_window = elm_win_wl_window_get(obj);
set_handle = (void *)ecore_wl_window_surface_get(wl_window);
set_wl_display = (void *)ecore_wl_display_get();
LOGI("xid %d, surface_id %d, surface %p(%d), win_id %d",
- elm_win_xwindow_get(obj),
- ecore_wl_window_surface_id_get(wl_window),
- ecore_wl_window_surface_get(wl_window),
- *(int *)ecore_wl_window_surface_get(wl_window),
- ecore_wl_window_id_get(wl_window));
+ elm_win_xwindow_get(obj),
+ ecore_wl_window_surface_id_get(wl_window),
+ ecore_wl_window_surface_get(wl_window),
+ *(int *)ecore_wl_window_surface_get(wl_window),
+ ecore_wl_window_id_get(wl_window));
#else
/* x window overlay surface */
LOGI("overlay surface type");
#endif
}
#ifdef TIZEN_MOBILE
- else if (type == PLAYER_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image"))
- {
+ else if (type == PLAYER_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
/* evas object surface */
LOGI("evas surface type");
wl_win.type = type;
evas_object_geometry_get(obj, &wl_win.wl_window_x, &wl_win.wl_window_y,
- &wl_win.wl_window_width, &wl_win.wl_window_height);
+ &wl_win.wl_window_width, &wl_win.wl_window_height);
set_handle = display;
}
#endif
else
return PLAYER_ERROR_INVALID_PARAMETER;
- }
- else
+ } else
return PLAYER_ERROR_INVALID_PARAMETER;
}
#ifdef HAVE_WAYLAND
wl_win.wl_window_width = 0;
wl_win.wl_window_height = 0;
}
- player_msg_send_array(api, pc, ret_buf, ret,
- wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
+ player_msg_send_array(api, pc, ret_buf, ret, wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
if (CALLBACK_INFO(pc)) {
ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
"display_surface_type", type,
"pipeline_type", mmPipelineType,
"wl_display", set_wl_display,
- sizeof(void*),
+ sizeof(void *),
"display_overlay", set_handle,
- sizeof(display), (char*)NULL);
+ sizeof(display), (char *)NULL);
if (ret != MM_ERROR_NONE)
LOGE("Failed to display surface change :%d", ret);
ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "wl_window_render_x", wl_win.wl_window_x,
- "wl_window_render_y", wl_win.wl_window_y,
- "wl_window_render_width", wl_win.wl_window_width,
- "wl_window_render_height", wl_win.wl_window_height,
- (char*)NULL);
+ "wl_window_render_x", wl_win.wl_window_x,
+ "wl_window_render_y", wl_win.wl_window_y,
+ "wl_window_render_width", wl_win.wl_window_width,
+ "wl_window_render_height", wl_win.wl_window_height,
+ (char *)NULL);
if (ret != MM_ERROR_NONE)
LOGE("Failed to set wl_window render rectangle :%d", ret);
}
#else
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, xhandle);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, xhandle);
#endif
g_free(ret_buf);
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_MODE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "display_method" , mode, NULL);
- if(ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret,(char*)__FUNCTION__);
+ ret = mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_method", mode, NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
- player_msg_send1(api, pc, ret_buf, ret,
- INT, mode);
+ player_msg_send1(api, pc, ret_buf, ret, INT, mode);
g_free(ret_buf);
return ret;
}
-int player_get_display_mode(player_h player, player_display_mode_e * pmode)
+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;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
int mode = -1;
LOGD("ENTER");
- ret = mm_player_get_attribute(INT_HANDLE(pc), NULL,
- "display_method" , &mode, NULL);
- if(ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret,(char*)__FUNCTION__);
+ ret = mm_player_get_attribute(INT_HANDLE(pc), NULL, "display_method", &mode, NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
*pmode = mode;
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" );
+ 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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- DOUBLE, rate);
+ player_msg_send1(api, pc, ret_buf, ret, DOUBLE, rate);
g_free(ret_buf);
return ret;
}
-int player_set_display_rotation(player_h player,
- player_display_rotation_e rotation)
+int player_set_display_rotation(player_h player, player_display_rotation_e rotation)
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_ROTATION;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "display_rotation", rotation, NULL);
- if(ret != MM_ERROR_NONE)
- {
- return __player_convert_error_code(ret,(char*)__FUNCTION__);
- }
+ ret = mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_rotation", rotation, NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
- player_msg_send1(api, pc, ret_buf, ret,
- INT, rotation);
+ player_msg_send1(api, pc, ret_buf, ret, INT, rotation);
g_free(ret_buf);
return ret;
}
-int player_get_display_rotation(player_h player,
- player_display_rotation_e * protation)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
int rotation = -1;
LOGD("ENTER");
- ret = mm_player_get_attribute(INT_HANDLE(pc), NULL,
- "display_rotation", &rotation, NULL);
- if(ret != MM_ERROR_NONE)
- {
- return __player_convert_error_code(ret,(char*)__FUNCTION__);
- }
+ ret = mm_player_get_attribute(INT_HANDLE(pc), NULL, "display_rotation", &rotation, NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
*protation = rotation;
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
int value = 0;
LOGD("ENTER");
- if(visible==TRUE)
+ if (visible == TRUE)
value = 1;
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "display_visible" , value,
- NULL);
- if(ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret,(char*)__FUNCTION__);
+ ret = mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_visible", value, NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
return ret;
}
-int player_is_display_visible(player_h player, bool * pvisible)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
int value = 0;
LOGD("ENTER");
- ret = mm_player_get_attribute(INT_HANDLE(pc), NULL,
- "display_visible", &value,
- NULL);
- if(ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret,(char*)__FUNCTION__);
+ ret = mm_player_get_attribute(INT_HANDLE(pc), NULL, "display_visible", &value, NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char *)__FUNCTION__);
else {
- if(value)
+ if (value)
*pvisible = TRUE;
else
*pvisible = FALSE;
return ret;
}
-int player_get_content_info(player_h player, player_content_info_e key,
- char **pvalue)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- char value[MUSE_MSG_MAX_LENGTH] = {0,};
+ char value[MUSE_MSG_MAX_LENGTH] = {0, };
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, key);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, key);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get_string(value, ret_buf);
*pvalue = strndup(value, MUSE_MSG_MAX_LENGTH);
}
return ret;
}
-int player_get_codec_info(player_h player, char **paudio_codec,
- char **pvideo_codec)
+int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_codec)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(paudio_codec);
PLAYER_NULL_ARG_CHECK(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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- char video_codec[MUSE_MSG_MAX_LENGTH] = {0,};
- char audio_codec[MUSE_MSG_MAX_LENGTH] = {0,};
+ char video_codec[MUSE_MSG_MAX_LENGTH] = {0, };
+ char audio_codec[MUSE_MSG_MAX_LENGTH] = {0, };
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get_string(video_codec, ret_buf);
player_msg_get_string(audio_codec, ret_buf);
*pvideo_codec = strndup(video_codec, MUSE_MSG_MAX_LENGTH);
return ret;
}
-int player_get_audio_stream_info(player_h player, int *psample_rate,
- int *pchannel, int *pbit_rate)
+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);
PLAYER_NULL_ARG_CHECK(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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int sample_rate = 0;
int channel = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(sample_rate, ret_buf);
player_msg_get(channel, ret_buf);
player_msg_get(bit_rate, ret_buf);
PLAYER_NULL_ARG_CHECK(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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int fps = 0;
int bit_rate = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(fps, ret_buf);
player_msg_get(bit_rate, ret_buf);
*pfps = fps;
PLAYER_NULL_ARG_CHECK(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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int width = 0;
int height = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(width, ret_buf);
player_msg_get(height, ret_buf);
*pwidth = width;
PLAYER_NULL_ARG_CHECK(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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
char *album_art;
int size = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(size, ret_buf);
- if(size > 0){
+ if (size > 0) {
album_art = _get_mem(pc, size);
player_msg_get_array(album_art, ret_buf);
*palbum_art = album_art;
- }
- else
+ } else
*palbum_art = NULL;
*psize = size;
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int count;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(count, ret_buf);
*pcount = count;
}
return ret;
}
-int player_audio_effect_set_equalizer_all_bands(player_h player,
- int *band_levels, int length)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send_array(api, pc, ret_buf, ret,
- band_levels, length, sizeof(int));
+ player_msg_send_array(api, pc, ret_buf, ret, band_levels, length, sizeof(int));
g_free(ret_buf);
return ret;
}
-int player_audio_effect_set_equalizer_band_level(player_h player, int index,
- int level)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, index, INT, level);
+ player_msg_send2(api, pc, ret_buf, ret, INT, index, INT, level);
g_free(ret_buf);
return ret;
}
-int player_audio_effect_get_equalizer_band_level(player_h player, int index,
- int *plevel)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int level;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, index);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, index);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(level, ret_buf);
*plevel = level;
}
return ret;
}
-int player_audio_effect_get_equalizer_level_range(player_h player, int *pmin,
- int *pmax)
+int player_audio_effect_get_equalizer_level_range(player_h player, int *pmin, int *pmax)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pmin);
PLAYER_NULL_ARG_CHECK(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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- int min,max;
+ int min, max;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(min, ret_buf);
player_msg_get(max, ret_buf);
*pmin = min;
return ret;
}
-int player_audio_effect_get_equalizer_band_frequency(player_h player, int index,
- int *pfrequency)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int frequency;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, index);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, index);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(frequency, ret_buf);
*pfrequency = frequency;
}
return ret;
}
-int player_audio_effect_get_equalizer_band_frequency_range(player_h player,
- int index, int *prange)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int range;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, index);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, index);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(range, ret_buf);
*prange = range;
}
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
return ret;
}
-int player_audio_effect_equalizer_is_available(player_h player,
- bool * pavailable)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int available;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(available, ret_buf);
*pavailable = available;
}
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- STRING, path);
+ player_msg_send1(api, pc, ret_buf, ret, STRING, path);
g_free(ret_buf);
return ret;
}
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, millisecond);
+ player_msg_send1(api, pc, ret_buf, ret, INT, millisecond);
g_free(ret_buf);
return ret;
PLAYER_NULL_ARG_CHECK(path);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- STRING, path);
- if(ret == PLAYER_ERROR_NONE) {
+ player_msg_send1(api, pc, ret_buf, ret, STRING, path);
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[type] = dummy_user_callback;
pc->cb_info->user_data[type] = NULL;
}
return ret;
}
-int player_get_progressive_download_status(player_h player,
- unsigned long *pcurrent,
- unsigned long *ptotal_size)
+int player_get_progressive_download_status(player_h player, unsigned long *pcurrent, unsigned long *ptotal_size)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pcurrent);
PLAYER_NULL_ARG_CHECK(ptotal_size);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
unsigned long current, total_size;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get_type(current, ret_buf, POINTER);
player_msg_get_type(total_size, ret_buf, POINTER);
*pcurrent = current;
}
-int player_capture_video(player_h player, player_video_captured_cb callback,
- void *user_data)
+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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
if (pc->cb_info->user_cb[_PLAYER_EVENT_TYPE_CAPTURE]) {
- LOGE("PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x) : capturing...",
- PLAYER_ERROR_VIDEO_CAPTURE_FAILED);
+ LOGE("PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x) : capturing...", PLAYER_ERROR_VIDEO_CAPTURE_FAILED);
return PLAYER_ERROR_VIDEO_CAPTURE_FAILED;
} else {
LOGI("Event type : %d ", _PLAYER_EVENT_TYPE_CAPTURE);
player_msg_send(api, pc, ret_buf, ret);
- if (ret != PLAYER_ERROR_NONE) {
+ if (ret != PLAYER_ERROR_NONE)
set_null_user_cb(pc->cb_info, _PLAYER_EVENT_TYPE_CAPTURE);
- }
g_free(ret_buf);
return ret;
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(cookie);
- PLAYER_CHECK_CONDITION(size>=0,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" );
+ 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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- STRING, cookie, INT, size);
+ player_msg_send2(api, pc, ret_buf, ret, STRING, cookie, INT, size);
g_free(ret_buf);
return ret;
}
-int player_set_streaming_user_agent(player_h player, const char *user_agent,
- int size)
+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" );
+ 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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- STRING, user_agent, INT, size);
+ player_msg_send2(api, pc, ret_buf, ret, STRING, user_agent, INT, size);
g_free(ret_buf);
return ret;
}
-int player_get_streaming_download_progress(player_h player, int *pstart,
- int *pcurrent)
+int player_get_streaming_download_progress(player_h player, int *pstart, int *pcurrent)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pstart);
PLAYER_NULL_ARG_CHECK(pcurrent);
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;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
int start, current;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(start, ret_buf);
player_msg_get(current, ret_buf);
*pstart = start;
}
-int player_set_completed_cb(player_h player, player_completed_cb callback,
- void *user_data)
+int player_set_completed_cb(player_h player, player_completed_cb callback, void *user_data)
{
- return __set_callback(_PLAYER_EVENT_TYPE_COMPLETE, player, callback,
- user_data);
+ return __set_callback(_PLAYER_EVENT_TYPE_COMPLETE, player, callback, user_data);
}
int player_unset_completed_cb(player_h player)
return __unset_callback(_PLAYER_EVENT_TYPE_COMPLETE, player);
}
-int player_set_interrupted_cb(player_h player, player_interrupted_cb callback,
- void *user_data)
+int player_set_interrupted_cb(player_h player, player_interrupted_cb callback, void *user_data)
{
- return __set_callback(_PLAYER_EVENT_TYPE_INTERRUPT, player, callback,
- user_data);
+ return __set_callback(_PLAYER_EVENT_TYPE_INTERRUPT, player, callback, user_data);
}
int player_unset_interrupted_cb(player_h player)
return __unset_callback(_PLAYER_EVENT_TYPE_INTERRUPT, player);
}
-int player_set_error_cb(player_h player, player_error_cb callback,
- void *user_data)
+int player_set_error_cb(player_h player, player_error_cb callback, void *user_data)
{
- return __set_callback(_PLAYER_EVENT_TYPE_ERROR, player, callback,
- user_data);
+ return __set_callback(_PLAYER_EVENT_TYPE_ERROR, player, callback, user_data);
}
int player_unset_error_cb(player_h player)
return __unset_callback(_PLAYER_EVENT_TYPE_ERROR, player);
}
-int player_set_buffering_cb(player_h player, player_buffering_cb callback,
- void *user_data)
+int player_set_buffering_cb(player_h player, player_buffering_cb callback, void *user_data)
{
- return __set_callback(_PLAYER_EVENT_TYPE_BUFFERING, player, callback,
- user_data);
+ return __set_callback(_PLAYER_EVENT_TYPE_BUFFERING, player, callback, user_data);
}
int player_unset_buffering_cb(player_h player)
return __unset_callback(_PLAYER_EVENT_TYPE_BUFFERING, player);
}
-int player_set_subtitle_updated_cb(player_h player,
- player_subtitle_updated_cb callback,
- void *user_data)
+int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb callback, void *user_data)
{
- return __set_callback(_PLAYER_EVENT_TYPE_SUBTITLE, player, callback,
- user_data);
+ return __set_callback(_PLAYER_EVENT_TYPE_SUBTITLE, player, callback, user_data);
}
int player_unset_subtitle_updated_cb(player_h player)
return __unset_callback(_PLAYER_EVENT_TYPE_SUBTITLE, player);
}
-int player_set_progressive_download_message_cb(player_h player,
- player_pd_message_cb callback,
- void *user_data)
+int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type = _PLAYER_EVENT_TYPE_PD;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[type] = callback;
pc->cb_info->user_data[type] = user_data;
LOGI("Event type : %d ", type);
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type = _PLAYER_EVENT_TYPE_PD;
set_null_user_cb_lock(pc->cb_info, type);
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
g_free(ret_buf);
return ret;
}
-int player_set_media_packet_video_frame_decoded_cb(player_h player,
- player_media_packet_video_decoded_cb
- callback, void *user_data)
+int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_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;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type = _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
- if(ret == PLAYER_ERROR_NONE){
- pc->cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] =
- callback;
- pc->cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] =
- user_data;
+ if (ret == PLAYER_ERROR_NONE) {
+ pc->cb_info->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = callback;
+ pc->cb_info->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = user_data;
LOGI("Event type : %d ", _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME);
}
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type = _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME;
set_null_user_cb_lock(pc->cb_info, type);
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
g_free(ret_buf);
return ret;
}
-int player_set_video_stream_changed_cb (player_h player,
- player_video_stream_changed_cb callback, void *user_data)
+int player_set_video_stream_changed_cb(player_h player, player_video_stream_changed_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;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type = _PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[type] = callback;
pc->cb_info->user_data[type] = user_data;
LOGI("Event type : %d ", type);
return ret;
}
-int player_unset_video_stream_changed_cb (player_h player)
+int player_unset_video_stream_changed_cb(player_h player)
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type = _PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED;
set_null_user_cb_lock(pc->cb_info, type);
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
g_free(ret_buf);
return ret;
}
-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)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type;
LOGD("ENTER");
- if(stream_type == PLAYER_STREAM_TYPE_VIDEO)
+ if (stream_type == PLAYER_STREAM_TYPE_VIDEO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS;
- else if(stream_type == PLAYER_STREAM_TYPE_AUDIO)
+ else if (stream_type == PLAYER_STREAM_TYPE_AUDIO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS;
else {
LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type);
return PLAYER_ERROR_INVALID_PARAMETER;
}
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[type] = callback;
pc->cb_info->user_data[type] = user_data;
LOGI("Event type : %d ", type);
return ret;
}
-int player_unset_media_stream_buffer_status_cb (player_h player,
- player_stream_type_e stream_type)
+int player_unset_media_stream_buffer_status_cb(player_h player, player_stream_type_e stream_type)
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type;
LOGD("ENTER");
- if(stream_type == PLAYER_STREAM_TYPE_VIDEO)
+ if (stream_type == PLAYER_STREAM_TYPE_VIDEO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS;
- else if(stream_type == PLAYER_STREAM_TYPE_AUDIO)
+ else if (stream_type == PLAYER_STREAM_TYPE_AUDIO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS;
else {
LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type);
set_null_user_cb_lock(pc->cb_info, type);
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
g_free(ret_buf);
return ret;
}
-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)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type;
LOGD("ENTER");
- if(stream_type == PLAYER_STREAM_TYPE_VIDEO)
+ if (stream_type == PLAYER_STREAM_TYPE_VIDEO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK;
- else if(stream_type == PLAYER_STREAM_TYPE_AUDIO)
+ else if (stream_type == PLAYER_STREAM_TYPE_AUDIO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK;
else {
LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type);
return PLAYER_ERROR_INVALID_PARAMETER;
}
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[type] = callback;
pc->cb_info->user_data[type] = user_data;
LOGI("Event type : %d ", type);
return ret;
}
-int player_unset_media_stream_seek_cb (player_h player,
- player_stream_type_e stream_type)
+int player_unset_media_stream_seek_cb(player_h player, player_stream_type_e stream_type)
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
char *ret_buf = NULL;
_player_event_e type;
LOGD("ENTER");
- if(stream_type == PLAYER_STREAM_TYPE_VIDEO)
+ if (stream_type == PLAYER_STREAM_TYPE_VIDEO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK;
- else if(stream_type == PLAYER_STREAM_TYPE_AUDIO)
+ else if (stream_type == PLAYER_STREAM_TYPE_AUDIO)
type = _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK;
else {
LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type);
set_null_user_cb_lock(pc->cb_info, type);
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, set);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, set);
g_free(ret_buf);
return ret;
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(packet);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_PUSH_MEDIA_STREAM;
char *ret_buf = NULL;
player_push_media_msg_type push_media;
media_packet_is_video(packet, &is_video);
media_packet_is_audio(packet, &is_audio);
- if(is_video)
+ if (is_video)
media_format_get_video_info(format, &push_media.mimetype, NULL, NULL, NULL, NULL);
- else if(is_audio)
+ else if (is_audio)
media_format_get_audio_info(format, &push_media.mimetype, NULL, NULL, NULL, NULL);
#ifdef __UN_USED
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM) {
- bo = tbm_bo_alloc (pc->cb_info->bufmgr, push_media.size, TBM_BO_DEFAULT);
- if(bo == NULL) {
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM) {
+ bo = tbm_bo_alloc(pc->cb_info->bufmgr, push_media.size, TBM_BO_DEFAULT);
+ if (bo == NULL) {
LOGE("TBM get error : bo is NULL");
return PLAYER_ERROR_INVALID_OPERATION;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto push_media_error;
tbm_bo_unmap(bo);
push_media.key = tbm_bo_export(bo);
- if(push_media.key == 0) {
+ if (push_media.key == 0) {
LOGE("TBM get error : key is 0");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto push_media_error;
}
- player_msg_send_array(api, pc, ret_buf, ret,
- push_media_msg, msg_size, sizeof(char));
- } else if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_MSG) {
+ player_msg_send_array(api, pc, ret_buf, ret, push_media_msg, msg_size, sizeof(char));
+ } else if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_MSG) {
buf_size = (int)push_media.size;
- player_msg_send_array2(api, pc, ret_buf, ret,
- push_media_msg, msg_size, sizeof(char),
- buf, buf_size, sizeof(char));
+ player_msg_send_array2(api, pc, ret_buf, ret, push_media_msg, msg_size, sizeof(char), buf, buf_size, sizeof(char));
} else
#endif
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW) {
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW) {
muse_core_ipc_push_data(pc->cb_info->data_fd, buf, push_media.size, push_media.pts);
- player_msg_send_array(api, pc, ret_buf, ret,
- push_media_msg, msg_size, sizeof(char));
+ player_msg_send_array(api, pc, ret_buf, ret, push_media_msg, msg_size, sizeof(char));
}
LOGD("ret_buf %s", ret_buf);
#ifdef __UN_USED
push_media_error:
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
tbm_bo_unref(bo);
#endif
return ret;
}
-int player_set_media_stream_info(player_h player,
- player_stream_type_e type, media_format_h format)
+int player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format)
{
PLAYER_INSTANCE_CHECK(player);
g_return_val_if_fail(format, PLAYER_ERROR_INVALID_OPERATION);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_INFO;
char *ret_buf = NULL;
media_format_mimetype_e mimetype;
LOGD("ENTER");
media_format_ref(format);
- if(type == PLAYER_STREAM_TYPE_VIDEO) {
+ if (type == PLAYER_STREAM_TYPE_VIDEO) {
media_format_get_video_info(format, &mimetype, &width, &height, &avg_bps, &max_bps);
- player_msg_send6(api, pc, ret_buf, ret,
- INT, type, INT, mimetype, INT, width, INT, height, INT, avg_bps, INT, max_bps);
- } else if(type == PLAYER_STREAM_TYPE_AUDIO) {
+ player_msg_send6(api, pc, ret_buf, ret, INT, type, INT, mimetype, INT, width, INT, height, INT, avg_bps, INT, max_bps);
+ } else if (type == PLAYER_STREAM_TYPE_AUDIO) {
media_format_get_audio_info(format, &mimetype, &channel, &samplerate, &bit, &avg_bps);
- player_msg_send6(api, pc, ret_buf, ret,
- INT, type, INT, mimetype, INT, channel, INT, samplerate, INT, avg_bps, INT, bit);
+ player_msg_send6(api, pc, ret_buf, ret, INT, type, INT, mimetype, INT, channel, INT, samplerate, INT, avg_bps, INT, bit);
}
media_format_unref(format);
return ret;
}
-int player_set_media_stream_buffer_max_size(player_h player,
- player_stream_type_e type, unsigned long long max_size)
+int player_set_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long max_size)
{
int ret = PLAYER_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
- player_cli_s *pc = (player_cli_s *) player;
+ 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;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT64, max_size);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT64, max_size);
g_free(ret_buf);
return ret;
}
-int player_get_media_stream_buffer_max_size(player_h player,
- player_stream_type_e type, unsigned long long *pmax_size)
+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;
+ 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;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, type);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, type);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get_type(max_size, ret_buf, INT64);
*pmax_size = max_size;
}
return ret;
}
-int player_set_media_stream_buffer_min_threshold(player_h player,
- player_stream_type_e type, unsigned int percent)
+int player_set_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int percent)
{
int ret = PLAYER_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
- player_cli_s *pc = (player_cli_s *) player;
+ 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;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, percent);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, percent);
g_free(ret_buf);
return ret;
}
-int player_get_media_stream_buffer_min_threshold(player_h player,
- player_stream_type_e type, unsigned int *ppercent)
+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;
+ 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;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, type);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, type);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(percent, ret_buf);
*ppercent = percent;
}
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pcount);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ 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;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, type);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, type);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(count, ret_buf);
*pcount = count;
}
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pindex);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ 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;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, type);
- if(ret == PLAYER_ERROR_NONE){
+ player_msg_send1(api, pc, ret_buf, ret, INT, type);
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_get(index, ret_buf);
*pindex = index;
}
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_SELECT_TRACK;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, index);
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, index);
g_free(ret_buf);
return ret;
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(pcode);
int ret = PLAYER_ERROR_NONE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE;
char *ret_buf = NULL;
- char code[MUSE_MSG_MAX_LENGTH] = {0,};
- const int code_len=2;
+ char code[MUSE_MSG_MAX_LENGTH] = {0, };
+ const int code_len = 2;
LOGD("ENTER");
- player_msg_send2(api, pc, ret_buf, ret,
- INT, type, INT, index);
- if(ret == PLAYER_ERROR_NONE){
- if(player_msg_get_string(code, ret_buf))
+ player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, index);
+ if (ret == PLAYER_ERROR_NONE) {
+ if (player_msg_get_string(code, ret_buf))
*pcode = strndup(code, code_len);
}
#include "player_msg_private.h"
#include "player_internal.h"
-int player_set_pcm_extraction_mode(player_h player,
- bool sync, player_audio_pcm_extraction_cb callback, void *user_data)
+int player_set_pcm_extraction_mode(player_h player, bool sync, player_audio_pcm_extraction_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_SET_PCM_EXTRACTION_MODE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
_player_event_e event = _PLAYER_EVENT_TYPE_AUDIO_FRAME;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- INT, sync);
+ player_msg_send1(api, pc, ret_buf, ret, INT, sync);
- if(ret == PLAYER_ERROR_NONE){
+ if (ret == PLAYER_ERROR_NONE) {
pc->cb_info->user_cb[event] = callback;
pc->cb_info->user_data[event] = user_data;
LOGI("Event type : %d ", event);
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_SPEC;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send3(api, pc, ret_buf, ret,
- STRING, format, INT, samplerate, INT, channel);
+ player_msg_send3(api, pc, ret_buf, ret, STRING, format, INT, samplerate, INT, channel);
g_free(ret_buf);
return ret;
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE;
- player_cli_s *pc = (player_cli_s *) player;
+ player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
LOGD("ENTER");
- player_msg_send1(api, pc, ret_buf, ret,
- DOUBLE, rate);
+ player_msg_send1(api, pc, ret_buf, ret, DOUBLE, rate);
g_free(ret_buf);
return ret;
}
-
pthread_t feeding_thread_id;
} appdata_s;
-static void
-win_delete_request_cb(void *data , Evas_Object *obj , void *event_info)
+static void win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
{
elm_exit();
}
-static Eina_Bool
-keydown_cb(void *data , int type , void *event)
+static Eina_Bool keydown_cb(void *data, int type, void *event)
{
- //appdata_s *ad = data;
+ /* appdata_s *ad = data; */
Ecore_Event_Key *ev = event;
LOGD("start");
if (!strcmp(ev->keyname, KEY_END)) {
/* Let window go to hide state. */
- //elm_win_lower(ad->win);
+ /* elm_win_lower(ad->win); */
LOGD("elm exit");
elm_exit();
static void win_del(void *data, Evas_Object *obj, void *event)
{
- elm_exit();
+ elm_exit();
}
-static Evas_Object* create_win(const char *name)
+static Evas_Object *create_win(const char *name)
{
Evas_Object *eo = NULL;
int w = 0;
if (eo) {
elm_win_title_set(eo, name);
elm_win_borderless_set(eo, EINA_TRUE);
- evas_object_smart_callback_add(eo, "delete,request",win_del, NULL);
+ evas_object_smart_callback_add(eo, "delete,request", win_del, NULL);
elm_win_screen_size_get(eo, NULL, NULL, &w, &h);
- g_print ("window size :%d,%d", w, h);
+ g_print("window size :%d,%d", w, h);
evas_object_resize(eo, w, h);
elm_win_autodel_set(eo, EINA_TRUE);
#ifdef HAVE_WAYLAND
static Evas_Object *create_render_rect(Evas_Object *pParent)
{
- if(!pParent) {
+ if (!pParent)
return NULL;
- }
Evas *pEvas = evas_object_evas_get(pParent);
Evas_Object *pObj = evas_object_rectangle_add(pEvas);
- if(pObj == NULL) {
+ if (pObj == NULL)
return NULL;
- }
evas_object_size_hint_weight_set(pObj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_color_set(pObj, 0, 0, 0, 0);
return pObj;
}
-static void
-create_base_gui(appdata_s *ad)
+static void create_base_gui(appdata_s *ad)
{
/* Enable GLES Backened */
elm_config_preferred_engine_set("3d");
/* Window */
- ad->win = create_win(PACKAGE);//elm_win_util_standard_add(PACKAGE, PACKAGE);
+ /* elm_win_util_standard_add(PACKAGE, PACKAGE); */
+ ad->win = create_win(PACKAGE);
ad->rect = create_render_rect(ad->win);
- /* This is not supported in 3.0
- elm_win_wm_desktop_layout_support_set(ad->win, EINA_TRUE);*/
+ /* This is not supported in 3.0
+ elm_win_wm_desktop_layout_support_set(ad->win, EINA_TRUE); */
elm_win_autodel_set(ad->win, EINA_TRUE);
evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, ad);
create_base_gui(ad);
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, NULL);
- /* open test file*/
+ /* open test file */
ad->file_src = fopen(ES_DEFAULT_H264_VIDEO_PATH, "r");
LOGD("done");
return -1;
}
- if (ad->feeding_thread_id)
- {
+ if (ad->feeding_thread_id) {
pthread_join(ad->feeding_thread_id, NULL);
ad->feeding_thread_id = 0;
}
LOGD("prepared");
ret = player_start(ad->player_handle);
- if (ret != PLAYER_ERROR_NONE) {
+ if (ret != PLAYER_ERROR_NONE)
LOGE("player start failed : 0x%x", ret);
- }
+
LOGD("done");
}
-int bytestream2nalunit(FILE *fd, unsigned char* nal)
+int bytestream2nalunit(FILE * fd, unsigned char *nal)
{
- int nal_length = 0;
- size_t result;
- int read_size = 1;
- unsigned char buffer[1000000];
- unsigned char val, zero_count, i;
- int nal_unit_type = 0;
- int init;
-
- zero_count = 0;
- if (feof(fd))
- return -1;
-
- result = fread(buffer, 1, read_size, fd);
-
- if(result != read_size)
- {
- //exit(1);
- return -1;
- }
- val = buffer[0];
- while (!val)
- {
- if ((zero_count == 2 || zero_count == 3) && val == 1)
- {
- break;
- }
- zero_count++;
- result = fread(buffer, 1, read_size, fd);
-
- if(result != read_size)
- {
- break;
- }
- val = buffer[0];
- }
- nal[nal_length++] = 0;
- nal[nal_length++] = 0;
- nal[nal_length++] = 0;
- nal[nal_length++] = 1;
- zero_count = 0;
- init = 1;
- while(1)
- {
- if (feof(fd))
- return -1;
-
- result = fread(buffer, 1, read_size, fd);
- if(result != read_size)
- {
- if (init == 1)
- return -1;
- break;
- }
- val = buffer[0];
-
- if(init) {
- nal_unit_type = val & 0xf;
- init = 0;
- }
- if (!val)
- {
- zero_count++;
- }
- else
- {
- if ((zero_count == 2 || zero_count == 3 || zero_count == 4) && (val == 1))
- {
- break;
- }
- else
- {
- for (i = 0; i<zero_count; i++)
- {
- nal[nal_length++] = 0;
- }
- nal[nal_length++] = val;
- zero_count = 0;
- }
- }
- }
-
- fseek(fd, -(zero_count + 1), SEEK_CUR);
-
- if (nal_unit_type == 0x7)
- {
- sps_len = nal_length;
- memcpy(sps, nal, nal_length);
- return 0;
- }
- else if (nal_unit_type == 0x8)
- {
- pps_len = nal_length;
- memcpy(pps, nal, nal_length);
- return 0;
- }
- else if (nal_unit_type == 0x5)
- {
- memcpy(tmp_buf, nal, nal_length);
- memcpy(nal, sps, sps_len);
- memcpy(nal + sps_len, pps, pps_len);
- memcpy(nal + sps_len + pps_len, tmp_buf, nal_length);
- nal_length += sps_len + pps_len;
- }
-
- return nal_length;
+ int nal_length = 0;
+ size_t result;
+ int read_size = 1;
+ unsigned char buffer[1000000];
+ unsigned char val, zero_count, i;
+ int nal_unit_type = 0;
+ int init;
+
+ zero_count = 0;
+ if (feof(fd))
+ return -1;
+
+ result = fread(buffer, 1, read_size, fd);
+
+ if (result != read_size)
+ return -1;
+
+ val = buffer[0];
+ while (!val) {
+ if ((zero_count == 2 || zero_count == 3) && val == 1)
+ break;
+ zero_count++;
+ result = fread(buffer, 1, read_size, fd);
+
+ if (result != read_size)
+ break;
+ val = buffer[0];
+ }
+ nal[nal_length++] = 0;
+ nal[nal_length++] = 0;
+ nal[nal_length++] = 0;
+ nal[nal_length++] = 1;
+ zero_count = 0;
+ init = 1;
+ while (1) {
+ if (feof(fd))
+ return -1;
+
+ result = fread(buffer, 1, read_size, fd);
+ if (result != read_size) {
+ if (init == 1)
+ return -1;
+ break;
+ }
+ val = buffer[0];
+
+ if (init) {
+ nal_unit_type = val & 0xf;
+ init = 0;
+ }
+ if (!val) {
+ zero_count++;
+ } else {
+ if ((zero_count == 2 || zero_count == 3 || zero_count == 4) && (val == 1)) {
+ break;
+ } else {
+ for (i = 0; i < zero_count; i++)
+ nal[nal_length++] = 0;
+ nal[nal_length++] = val;
+ zero_count = 0;
+ }
+ }
+ }
+
+ fseek(fd, -(zero_count + 1), SEEK_CUR);
+
+ if (nal_unit_type == 0x7) {
+ sps_len = nal_length;
+ memcpy(sps, nal, nal_length);
+ return 0;
+ } else if (nal_unit_type == 0x8) {
+ pps_len = nal_length;
+ memcpy(pps, nal, nal_length);
+ return 0;
+ } else if (nal_unit_type == 0x5) {
+ memcpy(tmp_buf, nal, nal_length);
+ memcpy(nal, sps, sps_len);
+ memcpy(nal + sps_len, pps, pps_len);
+ memcpy(nal + sps_len + pps_len, tmp_buf, nal_length);
+ nal_length += sps_len + pps_len;
+ }
+
+ return nal_length;
}
static void feed_eos_data(appdata_s *appdata)
}
media_packet_set_flags(ad->video_pkt, MEDIA_PACKET_END_OF_STREAM);
- if (player_push_media_stream(ad->player_handle, ad->video_pkt) != PLAYER_ERROR_NONE) {
+ if (player_push_media_stream(ad->player_handle, ad->video_pkt) != PLAYER_ERROR_NONE)
LOGE("fail to push media packet\n");
- }
media_packet_destroy(ad->video_pkt);
ad->video_pkt = NULL;
goto ERROR;
}
- if (media_packet_set_pts(ad->video_pkt, (uint64_t)(pts/1000000)) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_set_pts(ad->video_pkt, (uint64_t)(pts / 1000000)) != MEDIA_PACKET_ERROR_NONE) {
LOGE("media_packet_set_pts failed\n");
goto ERROR;
}
LOGE("input file read failed\n");
ret = TRUE;
goto ERROR;
- }
- else if (read < 0) {
+ } else if (read < 0) {
LOGD("push EOS");
media_packet_destroy(ad->video_pkt);
ad->video_pkt = NULL;
LOGE("media_packet_create failed\n");
goto ERROR;
}
- media_packet_set_flags (ad->video_pkt, MEDIA_PACKET_END_OF_STREAM);
- if (player_push_media_stream(ad->player_handle, ad->video_pkt) != PLAYER_ERROR_NONE) {
+ media_packet_set_flags(ad->video_pkt, MEDIA_PACKET_END_OF_STREAM);
+ if (player_push_media_stream(ad->player_handle, ad->video_pkt) != PLAYER_ERROR_NONE)
LOGE("fail to push media packet\n");
- }
goto ERROR;
}
ret = TRUE;
ERROR:
- /* destroy media packet after use*/
+ /* destroy media packet after use */
media_packet_destroy(ad->video_pkt);
ad->video_pkt = NULL;
return ret;
{
appdata_s *ad = (appdata_s *)data;
- while (TRUE)
- {
+ while (TRUE) {
static int frame_count = 0;
if (frame_count < ES_DEFAULT_NUMBER_OF_FEED) {
}
}
-void _video_buffer_status_cb (player_media_stream_buffer_status_e status, void *user_data)
+void _video_buffer_status_cb(player_media_stream_buffer_status_e status, void *user_data)
{
if (status == PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN)
- {
LOGE("video buffer is underrun state");
- }
else if (status == PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW)
- {
LOGE("video buffer is overrun state");
- }
}
-void _audio_buffer_status_cb (player_media_stream_buffer_status_e status, void *user_data)
+void _audio_buffer_status_cb(player_media_stream_buffer_status_e status, void *user_data)
{
if (status == PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN)
LOGE("audio buffer is underrun state");
LOGE("audio buffer is overrun state");
}
-void _video_seek_data_cb (unsigned long long offset, void *user_data)
+void _video_seek_data_cb(unsigned long long offset, void *user_data)
{
LOGE("seek offset of video is %llu", offset);
}
-void _audio_seek_data_cb (unsigned long long offset, void *user_data)
+void _audio_seek_data_cb(unsigned long long offset, void *user_data)
{
LOGE("seek offset of audio is %llu", offset);
}
/* set video format */
media_format_set_video_mime(ad->video_fmt, ES_DEFAULT_VIDEO_FORMAT_TYPE);
media_format_set_video_width(ad->video_fmt, ES_DEFAULT_VIDEO_FORMAT_WIDTH);
- media_format_set_video_height(ad->video_fmt,ES_DEFAULT_VIDEO_FORMAT_HEIGHT);
+ media_format_set_video_height(ad->video_fmt, ES_DEFAULT_VIDEO_FORMAT_HEIGHT);
- ret = player_set_media_stream_buffer_status_cb(ad->player_handle, PLAYER_STREAM_TYPE_VIDEO, _video_buffer_status_cb, (void*)ad);
+ ret = player_set_media_stream_buffer_status_cb(ad->player_handle, PLAYER_STREAM_TYPE_VIDEO, _video_buffer_status_cb, (void *)ad);
if (ret != PLAYER_ERROR_NONE) {
LOGE("player set video buffer status cb failed : 0x%x", ret);
goto FAILED;
}
- ret = player_set_media_stream_buffer_status_cb(ad->player_handle, PLAYER_STREAM_TYPE_AUDIO, _audio_buffer_status_cb, (void*)ad);
+ ret = player_set_media_stream_buffer_status_cb(ad->player_handle, PLAYER_STREAM_TYPE_AUDIO, _audio_buffer_status_cb, (void *)ad);
if (ret != PLAYER_ERROR_NONE) {
LOGE("player set audio buffer status cb failed : 0x%x", ret);
goto FAILED;
}
- ret = player_set_media_stream_seek_cb(ad->player_handle, PLAYER_STREAM_TYPE_VIDEO, _video_seek_data_cb, (void*)ad);
+ ret = player_set_media_stream_seek_cb(ad->player_handle, PLAYER_STREAM_TYPE_VIDEO, _video_seek_data_cb, (void *)ad);
if (ret != PLAYER_ERROR_NONE) {
LOGE("player set seek data cb for video failed : 0x%x", ret);
goto FAILED;
}
- ret = player_set_media_stream_seek_cb(ad->player_handle, PLAYER_STREAM_TYPE_AUDIO, _audio_seek_data_cb, (void*)ad);
+ ret = player_set_media_stream_seek_cb(ad->player_handle, PLAYER_STREAM_TYPE_AUDIO, _audio_seek_data_cb, (void *)ad);
if (ret != PLAYER_ERROR_NONE) {
LOGE("player set seek data cb for audio failed : 0x%x", ret);
goto FAILED;
/* send media packet to player */
player_set_media_stream_info(ad->player_handle, PLAYER_STREAM_TYPE_VIDEO, ad->video_fmt);
- ret = player_prepare_async(ad->player_handle, _player_prepared_cb, (void*)ad);
+ ret = player_prepare_async(ad->player_handle, _player_prepared_cb, (void *)ad);
if (ret != PLAYER_ERROR_NONE) {
LOGE("player prepare failed : 0x%x", ret);
goto FAILED;
}
- pthread_create(&ad->feeding_thread_id, NULL, (void*)feed_video_data_thread_func, (void *)ad);
+ pthread_create(&ad->feeding_thread_id, NULL, (void *)feed_video_data_thread_func, (void *)ad);
LOGD("done");
int main(int argc, char *argv[])
{
int ret = 0;
- static appdata_s ad = {0,};
+ static appdata_s ad = {0, };
LOGD("start");
int w, h;
} appdata_s;
-static void
-win_delete_request_cb(void *data , Evas_Object *obj , void *event_info)
+static void win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
{
elm_exit();
}
-static Eina_Bool
-keydown_cb(void *data , int type , void *event)
+static Eina_Bool keydown_cb(void *data, int type, void *event)
{
- //appdata_s *ad = data;
+ /* appdata_s *ad = data; */
Ecore_Event_Key *ev = event;
LOGD("start");
if (!strcmp(ev->keyname, KEY_END)) {
/* Let window go to hide state. */
- //elm_win_lower(ad->win);
+ /* elm_win_lower(ad->win); */
LOGD("elm exit");
elm_exit();
return ECORE_CALLBACK_PASS_ON;
}
-static void
-create_base_gui(appdata_s *ad)
+static void create_base_gui(appdata_s *ad)
{
/* Enable GLES Backened */
elm_config_preferred_engine_set("3d");
/* Window */
ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
- /* This is not supported in 3.0
- elm_win_wm_desktop_layout_support_set(ad->win, EINA_TRUE); */
+ /* This is not supported in 3.0
+ elm_win_wm_desktop_layout_support_set(ad->win, EINA_TRUE); */
elm_win_autodel_set(ad->win, EINA_TRUE);
#if 0
if (elm_win_wm_rotation_supported_get(ad->win)) {
evas_object_show(ad->win);
}
-static void
-_media_packet_video_decoded_cb(media_packet_h packet, void *user_data)
+static void _media_packet_video_decoded_cb(media_packet_h packet, void *user_data)
{
/* This callback function would be called on different thread */
appdata_s *ad = user_data;
return;
}
-static void
-pipe_cb(void *data, void *buf, unsigned int len)
+static void pipe_cb(void *data, void *buf, unsigned int len)
{
/* Now, we get a player surface to be set here. */
appdata_s *ad = data;
/* Destroy previous packet */
if (ad->packet) {
ret = media_packet_destroy(ad->packet);
- if (ret != MEDIA_PACKET_ERROR_NONE) {
+ if (ret != MEDIA_PACKET_ERROR_NONE)
LOGE("Failed to destroy media packet. ret (%d)", ret);
- }
ad->packet = NULL;
}
if (mimetype == MEDIA_FORMAT_I420 || mimetype == MEDIA_FORMAT_NV12 || mimetype == MEDIA_FORMAT_NV12T) {
- tbm_surface_get_info(surface,&suf_info);
- buf_data = (unsigned char*)g_malloc0(suf_info.size);
+ tbm_surface_get_info(surface, &suf_info);
+ buf_data = (unsigned char *)g_malloc0(suf_info.size);
if (!buf_data) {
LOGE("no free space");
return;
if (ad->packet) {
LOGD("destroy packet %p", ad->packet);
ret = media_packet_destroy(ad->packet);
- if (ret != MEDIA_PACKET_ERROR_NONE) {
+ if (ret != MEDIA_PACKET_ERROR_NONE)
LOGE("Failed to destroy media packet. ret (%d)", ret);
- }
ad->packet = NULL;
}
int main(int argc, char *argv[])
{
int ret = 0;
- static appdata_s ad = {0,};
+ static appdata_s ad = {0, };
LOGD("start");
return ret;
}
-
#include <Ecore_Wayland.h>
#endif
#include <eom.h>
-//#define _USE_X_DIRECT_
+/* #define _USE_X_DIRECT_ */
#ifdef _USE_X_DIRECT_
#include <X11/Xlib.h>
#endif
static media_packet_h g_video_pkt = NULL;
static media_format_h g_video_fmt = NULL;
-static int _save(unsigned char * src, int length);
+static int _save(unsigned char *src, int length);
#define DUMP_OUTBUF 1
#if DUMP_OUTBUF
FILE *fp_out2 = NULL;
#endif
-enum
-{
+enum {
CURRENT_STATUS_MAINMENU,
CURRENT_STATUS_HANDLE_NUM,
CURRENT_STATUS_FILENAME,
static Display *g_dpy;
static GC g_gc;
#else
-static Evas_Object* g_xid;
-static Evas_Object* g_external_xid;
-static Evas_Object* selected_xid;
+static Evas_Object *g_xid;
+static Evas_Object *g_external_xid;
+static Evas_Object *selected_xid;
#endif
-static Evas_Object* g_eo[MAX_HANDLE] = {0};
+static Evas_Object *g_eo[MAX_HANDLE] = {0, };
+
static int g_current_surface_type = PLAYER_DISPLAY_TYPE_OVERLAY;
-typedef struct
-{
+typedef struct {
Evas_Object *win;
- Evas_Object *layout_main; /* layout widget based on EDJ */
+ Evas_Object *layout_main; /* layout widget based on EDJ */
#ifdef HAVE_X11
Ecore_X_Window xid;
#elif HAVE_WAYLAND
} appdata;
static appdata ad;
-static player_h g_player[MAX_HANDLE] = {0};
+static player_h g_player[MAX_HANDLE] = {0, };
+
int g_handle_num = 1;
int g_menu_state = CURRENT_STATUS_MAINMENU;
char g_file_list[9][256];
elm_exit();
}
-static Evas_Object* create_win(const char *name)
+static Evas_Object *create_win(const char *name)
{
Evas_Object *eo = NULL;
int w = 0;
int h = 0;
- g_print ("[%s][%d] name=%s\n", __func__, __LINE__, name);
+ g_print("[%s][%d] name=%s\n", __func__, __LINE__, name);
eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
- if (eo)
- {
+ if (eo) {
elm_win_title_set(eo, name);
elm_win_borderless_set(eo, EINA_TRUE);
- evas_object_smart_callback_add(eo, "delete,request",win_del, NULL);
+ evas_object_smart_callback_add(eo, "delete,request", win_del, NULL);
elm_win_screen_size_get(eo, NULL, NULL, &w, &h);
- g_print ("window size :%d,%d", w, h);
+ g_print("window size :%d,%d", w, h);
evas_object_resize(eo, w, h);
elm_win_autodel_set(eo, EINA_TRUE);
#ifdef HAVE_WAYLAND
static Evas_Object *create_image_object(Evas_Object *eo_parent)
{
- if(!eo_parent)
+ if (!eo_parent)
return NULL;
Evas *evas = evas_object_evas_get(eo_parent);
return eo;
}
-void
-create_render_rect_and_bg (Evas_Object* win)
+void create_render_rect_and_bg(Evas_Object *win)
{
- if(!win)
- {
+ if (!win) {
g_print("no win");
return;
}
Evas_Object *bg, *rect;
- bg = elm_bg_add (win);
- elm_win_resize_object_add (win, bg);
- evas_object_size_hint_weight_set (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show (bg);
+ bg = elm_bg_add(win);
+ elm_win_resize_object_add(win, bg);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(bg);
- rect = evas_object_rectangle_add (evas_object_evas_get(win));
- if(!rect)
- {
+ rect = evas_object_rectangle_add(evas_object_evas_get(win));
+ if (!rect) {
g_print("no rect");
return;
}
- evas_object_color_set (rect, 0, 0, 0, 0);
- evas_object_render_op_set (rect, EVAS_RENDER_COPY);
+ evas_object_color_set(rect, 0, 0, 0, 0);
+ evas_object_render_op_set(rect, EVAS_RENDER_COPY);
- elm_win_resize_object_add (win, rect);
- evas_object_size_hint_weight_set (rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show (rect);
- evas_object_show (win);
+ elm_win_resize_object_add(win, rect);
+ evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(rect);
+ evas_object_show(win);
}
-int
-eom_get_output_id (const char *output_name)
+int eom_get_output_id(const char *output_name)
{
eom_output_id *output_ids = NULL;
eom_output_id output_id = 0;
/* get output_ids */
output_ids = eom_get_eom_output_ids(&id_cnt);
- if (id_cnt == 0)
- {
- g_print ("[eom] no external outuputs supported\n");
+ if (id_cnt == 0) {
+ g_print("[eom] no external outuputs supported\n");
return 0;
}
/* find output ids interested */
- for (i = 0; i < id_cnt; i++)
- {
+ for (i = 0; i < id_cnt; i++) {
eom_get_output_type(output_ids[i], &output_type);
- if (!strncmp(output_name, "HDMI", 4))
- {
- if (output_type == EOM_OUTPUT_TYPE_HDMIA || output_type == EOM_OUTPUT_TYPE_HDMIB)
- {
+ if (!strncmp(output_name, "HDMI", 4)) {
+ if (output_type == EOM_OUTPUT_TYPE_HDMIA || output_type == EOM_OUTPUT_TYPE_HDMIB) {
output_id = output_ids[i];
break;
}
- }
- else if (!strncmp(output_name, "Virtual", 4))
- {
- if (output_type == EOM_OUTPUT_TYPE_VIRTUAL)
- {
+ } else if (!strncmp(output_name, "Virtual", 4)) {
+ if (output_type == EOM_OUTPUT_TYPE_VIRTUAL) {
output_id = output_ids[i];
break;
}
}
if (output_ids)
- free (output_ids);
+ free(output_ids);
return output_id;
}
-static void
-eom_notify_cb_output_add (eom_output_id output_id, void *user_data)
+static void eom_notify_cb_output_add(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata*)user_data;
+ appdata *info = (appdata *)user_data;
- if (info->hdmi_output_id != output_id)
- {
- g_print ("[eom] OUTPUT ADDED. SKIP. my output ID is %d\n", info->hdmi_output_id);
+ if (info->hdmi_output_id != output_id) {
+ g_print("[eom] OUTPUT ADDED. SKIP. my output ID is %d\n", info->hdmi_output_id);
return;
}
- g_print ("[eom] output(%d) connected\n", output_id);
+ g_print("[eom] output(%d) connected\n", output_id);
/* it is for external window */
- if (!g_external_xid)
- {
+ if (!g_external_xid) {
g_external_xid = elm_win_add(NULL, "External", ELM_WIN_BASIC);
- if (eom_set_output_window(info->hdmi_output_id, g_external_xid) == EOM_ERROR_NONE)
- {
+ if (eom_set_output_window(info->hdmi_output_id, g_external_xid) == EOM_ERROR_NONE) {
create_render_rect_and_bg(g_external_xid);
- g_print ("[eom] create external window\n");
- }
- else
- {
- evas_object_del (g_external_xid);
+ g_print("[eom] create external window\n");
+ } else {
+ evas_object_del(g_external_xid);
g_external_xid = NULL;
- g_print ("[eom] create external window fail\n");
+ g_print("[eom] create external window fail\n");
}
}
}
-static void
-eom_notify_cb_output_remove (eom_output_id output_id, void *user_data)
+static void eom_notify_cb_output_remove(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata*)user_data;
+ appdata *info = (appdata *)user_data;
player_state_e state;
- if (info->hdmi_output_id != output_id)
- {
- g_print ("[eom] OUTPUT REMOVED. SKIP. my output ID is %d\n", info->hdmi_output_id);
+ if (info->hdmi_output_id != output_id) {
+ g_print("[eom] OUTPUT REMOVED. SKIP. my output ID is %d\n", info->hdmi_output_id);
return;
}
- g_print ("[eom] output(%d) disconnected\n", output_id);
+ g_print("[eom] output(%d) disconnected\n", output_id);
- if(selected_xid==g_external_xid && g_player[0])
- {
+ if (selected_xid == g_external_xid && g_player[0]) {
player_get_state(g_player[0], &state);
- if (state>=PLAYER_STATE_READY)
- {
- if(!g_xid)
- {
+ if (state >= PLAYER_STATE_READY) {
+ if (!g_xid) {
g_xid = create_win(PACKAGE);
if (g_xid == NULL)
return;
}
/* it is for external window */
- if (g_external_xid)
- {
+ if (g_external_xid) {
evas_object_del(g_external_xid);
g_external_xid = NULL;
}
selected_xid = g_xid;
}
-static void
-eom_notify_cb_mode_changed (eom_output_id output_id, void *user_data)
+static void eom_notify_cb_mode_changed(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata*)user_data;
+ appdata *info = (appdata *)user_data;
eom_output_mode_e mode = EOM_OUTPUT_MODE_NONE;
- if (info->hdmi_output_id != output_id)
- {
- g_print ("[eom] MODE CHANGED. SKIP. my output ID is %d\n", info->hdmi_output_id);
+ if (info->hdmi_output_id != output_id) {
+ g_print("[eom] MODE CHANGED. SKIP. my output ID is %d\n", info->hdmi_output_id);
return;
}
eom_get_output_mode(output_id, &mode);
- g_print ("[eom] output(%d) mode changed(%d)\n", output_id, mode);
+ g_print("[eom] output(%d) mode changed(%d)\n", output_id, mode);
}
-static void
-eom_notify_cb_attribute_changed (eom_output_id output_id, void *user_data)
+static void eom_notify_cb_attribute_changed(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata*)user_data;
+ appdata *info = (appdata *)user_data;
eom_output_attribute_e attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
eom_output_attribute_state_e state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
- if (info->hdmi_output_id != output_id)
- {
- g_print ("[eom] ATTR CHANGED. SKIP. my output ID is %d\n", info->hdmi_output_id);
+ if (info->hdmi_output_id != output_id) {
+ g_print("[eom] ATTR CHANGED. SKIP. my output ID is %d\n", info->hdmi_output_id);
return;
}
eom_get_output_attribute(output_id, &attribute);
eom_get_output_attribute_state(output_id, &state);
- g_print ("[eom] output(%d) attribute changed(%d, %d)\n", output_id, attribute, state);
- if (state == EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE)
- {
- g_print ("[eom] active\n");
- if (!g_external_xid)
- {
+ g_print("[eom] output(%d) attribute changed(%d, %d)\n", output_id, attribute, state);
+ if (state == EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE) {
+ g_print("[eom] active\n");
+ if (!g_external_xid) {
g_external_xid = elm_win_add(NULL, "External", ELM_WIN_BASIC);
- if (eom_set_output_window(info->hdmi_output_id, g_external_xid) == EOM_ERROR_NONE)
- {
+ if (eom_set_output_window(info->hdmi_output_id, g_external_xid) == EOM_ERROR_NONE) {
create_render_rect_and_bg(g_external_xid);
- g_print ("[eom] create external window\n");
- }
- else
- {
- evas_object_del (g_external_xid);
+ g_print("[eom] create external window\n");
+ } else {
+ evas_object_del(g_external_xid);
g_external_xid = NULL;
- g_print ("[eom] create external window fail\n");
+ g_print("[eom] create external window fail\n");
}
}
selected_xid = g_external_xid;
/* play video on external window */
if (g_player[0])
- player_set_display(g_player[0], PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(selected_xid));
- }
- else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE)
- {
- g_print ("[eom] inactive\n");
- if(!g_xid)
- {
+ player_set_display(g_player[0], PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(selected_xid));
+ } else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE) {
+ g_print("[eom] inactive\n");
+ if (!g_xid) {
g_xid = create_win(PACKAGE);
if (g_xid == NULL)
- return;
+ return;
g_print("create xid %p\n", g_xid);
create_render_rect_and_bg(g_xid);
elm_win_activate(g_xid);
if (g_player[0])
player_set_display(g_player[0], PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(selected_xid));
- if (g_external_xid)
- {
+ if (g_external_xid) {
evas_object_del(g_external_xid);
g_external_xid = NULL;
}
- }
- else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST)
- {
- g_print ("[eom] lost\n");
- if(!g_xid)
- {
+ } else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST) {
+ g_print("[eom] lost\n");
+ if (!g_xid) {
g_xid = create_win(PACKAGE);
if (g_xid == NULL)
return;
if (g_player[0])
player_set_display(g_player[0], PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(selected_xid));
- if (g_external_xid)
- {
+ if (g_external_xid) {
evas_object_del(g_external_xid);
g_external_xid = NULL;
}
eom_unset_mode_changed_cb(eom_notify_cb_mode_changed);
eom_unset_attribute_changed_cb(eom_notify_cb_attribute_changed);
- eom_deinit ();
+ eom_deinit();
}
}
evas_object_show(win);
/* check external device */
- eom_init ();
- ad->hdmi_output_id = eom_get_output_id ("HDMI");
- if (ad->hdmi_output_id == 0)
- {
- g_print ("[eom] error : HDMI output id is NULL.\n");
+ eom_init();
+ ad->hdmi_output_id = eom_get_output_id("HDMI");
+ if (ad->hdmi_output_id == 0) {
+ g_print("[eom] error : HDMI output id is NULL.\n");
return 0;
}
- g_print ("eom_set_output_attribute EOM_OUTPUT_ATTRIBUTE_NORMAL(id:%d)\n", ad->hdmi_output_id);
- if (eom_set_output_attribute(ad->hdmi_output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL) != EOM_ERROR_NONE)
- {
- g_print ("attribute set fail. cannot use external output\n");
- eom_deinit ();
+ g_print("eom_set_output_attribute EOM_OUTPUT_ATTRIBUTE_NORMAL(id:%d)\n", ad->hdmi_output_id);
+ if (eom_set_output_attribute(ad->hdmi_output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL) != EOM_ERROR_NONE) {
+ g_print("attribute set fail. cannot use external output\n");
+ eom_deinit();
}
eom_get_output_mode(ad->hdmi_output_id, &output_mode);
- if (output_mode != EOM_OUTPUT_MODE_NONE)
- {
+ if (output_mode != EOM_OUTPUT_MODE_NONE) {
g_external_xid = elm_win_add(NULL, "External", ELM_WIN_BASIC);
- if (eom_set_output_window(ad->hdmi_output_id, g_external_xid) == EOM_ERROR_NONE)
- {
+ if (eom_set_output_window(ad->hdmi_output_id, g_external_xid) == EOM_ERROR_NONE) {
create_render_rect_and_bg(g_external_xid);
- g_print ("[eom] create external window\n");
- }
- else
- {
- evas_object_del (g_external_xid);
+ g_print("[eom] create external window\n");
+ } else {
+ evas_object_del(g_external_xid);
g_external_xid = NULL;
- g_print ("[eom] create external window fail\n");
+ g_print("[eom] create external window fail\n");
}
selected_xid = g_external_xid;
}
appdata *ad = data;
int i = 0;
- for (i = 0 ; i < MAX_HANDLE; i++)
- {
- if (g_eo[i])
- {
+ for (i = 0; i < MAX_HANDLE; i++) {
+ if (g_eo[i]) {
evas_object_del(g_eo[i]);
g_eo[i] = NULL;
}
ad->win = NULL;
selected_xid = NULL;
#ifdef _USE_X_DIRECT_
- if(g_dpy)
- {
- if(g_gc)
- XFreeGC (g_dpy, g_gc);
- if(g_xid)
- XDestroyWindow (g_dpy, g_xid);
- XCloseDisplay (g_dpy);
+ if (g_dpy) {
+ if (g_gc)
+ XFreeGC(g_dpy, g_gc);
+ if (g_xid)
+ XDestroyWindow(g_dpy, g_xid);
+ XCloseDisplay(g_dpy);
g_xid = 0;
g_dpy = NULL;
}
eom_unset_mode_changed_cb(eom_notify_cb_mode_changed);
eom_unset_attribute_changed_cb(eom_notify_cb_attribute_changed);
- eom_deinit ();
+ eom_deinit();
return 0;
}
static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s *audio_raw_frame, void *user_data)
{
- player_audio_raw_data_s* audio_raw = audio_raw_frame;
+ player_audio_raw_data_s *audio_raw = audio_raw_frame;
- if (!audio_raw) return;
+ if (!audio_raw)
+ return;
g_print("[Player_Test] decoded_cb_ex! channel: %d channel_mask: %" G_GUINT64_FORMAT "\n", audio_raw->channel, audio_raw->channel_mask);
#ifdef DUMP_OUTBUF
- if(audio_raw->channel_mask == 1 && fp_out1)
+ if (audio_raw->channel_mask == 1 && fp_out1)
fwrite((guint8 *)audio_raw->data, 1, audio_raw->size, fp_out1);
- else if(audio_raw->channel_mask == 2 && fp_out2)
+ else if (audio_raw->channel_mask == 2 && fp_out2)
fwrite((guint8 *)audio_raw->data, 1, audio_raw->size, fp_out2);
#endif
}
#if 0
static void audio_frame_decoded_cb(unsigned char *data, unsigned int size, void *user_data)
{
- int pos=0;
+ int pos = 0;
if (data && g_pcm_fd)
- {
fwrite(data, 1, size, g_pcm_fd);
- }
player_get_play_position(g_player[0], &pos);
g_print("[Player_Test] audio_frame_decoded_cb [size: %d] --- current pos : %d!!!!\n", size, pos);
}
static void subtitle_updated_cb(unsigned long duration, char *text, void *user_data)
{
- g_print("[Player_Test] subtitle_updated_cb!!!! [%ld] %s\n",duration, text);
+ g_print("[Player_Test] subtitle_updated_cb!!!! [%ld] %s\n", duration, text);
}
-static void video_captured_cb(unsigned char *data, int width, int height,unsigned int size, void *user_data)
+static void video_captured_cb(unsigned char *data, int width, int height, unsigned int size, void *user_data)
{
- g_print("[Player_Test] video_captured_cb!!!! width: %d, height : %d, size : %d \n",width, height,size);
+ g_print("[Player_Test] video_captured_cb!!!! width: %d, height : %d, size : %d \n", width, height, size);
_save(data, size);
}
-static int _save(unsigned char * src, int length)
-{ //unlink(CAPTUERD_IMAGE_SAVE_PATH);
- FILE* fp;
- char filename[256] = {0,};
+static int _save(unsigned char *src, int length)
+{
+ /* unlink(CAPTUERD_IMAGE_SAVE_PATH); */
+ FILE *fp;
+ char filename[256] = {0, };
static int WRITE_COUNT = 0;
-
- //gchar *filename = CAPTUERD_IMAGE_SAVE_PATH;
- snprintf (filename, 256, "IMAGE_client%d", WRITE_COUNT);
+ /* gchar *filename = CAPTUERD_IMAGE_SAVE_PATH; */
+ snprintf(filename, 256, "IMAGE_client%d", WRITE_COUNT);
WRITE_COUNT++;
- fp=fopen(filename, "w+");
- if(fp==NULL)
- {
+ fp = fopen(filename, "w+");
+ if (fp == NULL) {
g_print("file open error!!\n");
return FALSE;
- }
- else
- {
+ } else {
g_print("open success\n");
- if(fwrite(src, 1, length, fp ) < 1)
- {
+ if (fwrite(src, 1, length, fp) < 1) {
g_print("file write error!!\n");
fclose(fp);
return FALSE;
int i = 0;
/* delete evas window, if it is */
- for (i = 0 ; i < MAX_HANDLE; i++)
- {
- if (g_eo[i])
- {
+ for (i = 0; i < MAX_HANDLE; i++) {
+ if (g_eo[i]) {
evas_object_del(g_eo[i]);
g_eo[i] = NULL;
}
#ifdef _USE_X_DIRECT_
/* delete x window, if it is */
- if(g_dpy)
- {
- if(g_gc)
- XFreeGC (g_dpy, g_gc);
- if(g_xid)
- XDestroyWindow (g_dpy, g_xid);
- XCloseDisplay (g_dpy);
+ if (g_dpy) {
+ if (g_gc)
+ XFreeGC(g_dpy, g_gc);
+ if (g_xid)
+ XDestroyWindow(g_dpy, g_xid);
+ XCloseDisplay(g_dpy);
g_xid = 0;
g_dpy = NULL;
}
int len = strlen(filename);
int i = 0;
- if ( len < 0 || len > MAX_STRING_LEN-1 )
+ if (len < 0 || len > MAX_STRING_LEN - 1)
return;
- for (i = 0; i < g_handle_num; i++)
- {
- if(g_player[i]!=NULL)
- {
+ for (i = 0; i < g_handle_num; i++) {
+ if (g_player[i] != NULL) {
player_unprepare(g_player[i]);
player_destroy(g_player[i]);
}
g_player[i] = 0;
- if ( player_create(&g_player[i]) != PLAYER_ERROR_NONE )
- {
+ if (player_create(&g_player[i]) != PLAYER_ERROR_NONE)
g_print("player create is failed\n");
- }
}
- strncpy (g_uri, filename, len);
+ strncpy(g_uri, filename, len);
g_uri[len] = '\0';
-#if 0 //ned(APPSRC_TEST)
+#if 0
+ /* ned(APPSRC_TEST) */
gchar uri[100];
gchar *ext;
gsize file_size;
GMappedFile *file;
GError *error = NULL;
- guint8* g_media_mem = NULL;
+ guint8 *g_media_mem = NULL;
ext = filename;
- file = g_mapped_file_new (ext, FALSE, &error);
- file_size = g_mapped_file_get_length (file);
- g_media_mem = (guint8 *) g_mapped_file_get_contents (file);
+ file = g_mapped_file_new(ext, FALSE, &error);
+ file_size = g_mapped_file_get_length(file);
+ g_media_mem = (guint8 *) g_mapped_file_get_contents(file);
g_sprintf(uri, "mem://ext=%s,size=%d", ext ? ext : "", file_size);
g_print("[uri] = %s\n", uri);
- mm_player_set_attribute(g_player[0],
- &g_err_name,
- "profile_uri", uri, strlen(uri),
- "profile_user_param", g_media_mem, file_size
- NULL);
+ mm_player_set_attribute(g_player[0], &g_err_name, "profile_uri", uri, strlen(uri), "profile_user_param", g_media_mem, file_size NULL);
#else
- //player_set_uri(g_player[0], filename);
-#endif /* APPSRC_TEST */
+ /* player_set_uri(g_player[0], filename); */
+#endif
+ /* APPSRC_TEST */
int ret;
player_state_e state;
- for (i = 0; i < g_handle_num; i++)
- {
+ for (i = 0; i < g_handle_num; i++) {
ret = player_get_state(g_player[i], &state);
g_print("player_get_state returned [%d]\n", ret);
g_print("1. After player_create() - Current State : %d \n", state);
}
}
-// use this API instead of player_set_uri
+/* use this API instead of player_set_uri */
static void player_set_memory_buffer_test()
{
GMappedFile *file;
- gsize file_size;
- guint8* g_media_mem = NULL;
+ gsize file_size;
+ guint8 *g_media_mem = NULL;
- file = g_mapped_file_new (g_uri, FALSE, NULL);
- file_size = g_mapped_file_get_length (file);
- g_media_mem = (guint8 *) g_mapped_file_get_contents (file);
+ file = g_mapped_file_new(g_uri, FALSE, NULL);
+ file_size = g_mapped_file_get_length(file);
+ g_media_mem = (guint8 *)g_mapped_file_get_contents(file);
- int ret = player_set_memory_buffer(g_player[0], (void*)g_media_mem, file_size);
- g_print("player_set_memory_buffer ret : %d\n", ret);
+ int ret = player_set_memory_buffer(g_player[0], (void *)g_media_mem, file_size);
+ g_print("player_set_memory_buffer ret : %d\n", ret);
}
int video_packet_count = 0;
video_packet_count++;
- if (video_packet_count > 1000)
- {
+ if (video_packet_count > 1000) {
g_print("EOS.\n");
-// player_submit_packet(g_player[0], NULL, 0, 0, 1);
+
+ /* player_submit_packet(g_player[0], NULL, 0, 0, 1); */
player_push_media_stream(g_player[0], NULL);
g_thread_end = TRUE;
}
-// snprintf(fname, 128, "/opt/storage/usb/test/packet/packet_%d.dat", video_packet_count);
-// snprintf(fptsname, 128, "/opt/storage/usb/test/packet/gstpts_%d.dat", video_packet_count);
+
+ /* snprintf(fname, 128, "/opt/storage/usb/test/packet/packet_%d.dat", video_packet_count); */
+ /* snprintf(fptsname, 128, "/opt/storage/usb/test/packet/gstpts_%d.dat", video_packet_count); */
snprintf(fname, 128, "/home/developer/test/packet/packet_%d.dat", video_packet_count);
snprintf(fptsname, 128, "/home/developer/test/packet/gstpts_%d.dat", video_packet_count);
fp = fopen(fptsname, "rb");
- if (fp)
- {
+ if (fp) {
int pts_len = 0;
pts_len = fread(&pts, 1, sizeof(guint64), fp);
if (pts_len != sizeof(guint64))
- {
g_print("Warning, pts value can be wrong.\n");
- }
fclose(fp);
fp = NULL;
}
fp = fopen(fname, "rb");
- if (fp)
- {
+ if (fp) {
buff_ptr = (guint8 *)g_malloc0(1048576);
- if (!buff_ptr)
- {
+ if (!buff_ptr) {
g_print("no free space\n");
fclose(fp);
fp = NULL;
}
g_print("video need data - data size : %d, pts : %" G_GUINT64_FORMAT "\n", real_read_len, pts);
#if 0
- player_submit_packet(g_player[0], buff_ptr, real_read_len, (pts/1000000), 1);
+ player_submit_packet(g_player[0], buff_ptr, real_read_len, (pts / 1000000), 1);
#else
/* create media packet */
if (g_video_pkt) {
g_print("packet = %p, src = %p\n", g_video_pkt, src);
-
if (media_packet_get_buffer_data_ptr(g_video_pkt, &src) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
- if (media_packet_set_pts(g_video_pkt, (uint64_t)(pts/1000000)) != MEDIA_PACKET_ERROR_NONE)
+ if (media_packet_set_pts(g_video_pkt, (uint64_t)(pts / 1000000)) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
if (media_packet_set_buffer_size(g_video_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE)
#endif
EXIT:
- if (buff_ptr)
- {
+ if (buff_ptr) {
g_free(buff_ptr);
buff_ptr = NULL;
}
memset(fname, 0, 128);
audio_packet_count++;
- if (audio_packet_count > 1000)
- {
+ if (audio_packet_count > 1000) {
g_print("EOS.\n");
-// player_submit_packet(g_player[0], NULL, 0, 0, 0);
+ /* player_submit_packet(g_player[0], NULL, 0, 0, 0); */
player_push_media_stream(g_player[0], NULL);
g_thread_end = TRUE;
}
-// snprintf(fname, 128, "/opt/storage/usb/test/audio_packet/packet_%d.dat", audio_packet_count);
+ /* snprintf(fname, 128, "/opt/storage/usb/test/audio_packet/packet_%d.dat", audio_packet_count); */
snprintf(fname, 128, "/home/developer/test/audio_packet/packet_%d.dat", audio_packet_count);
static guint64 audio_pts = 0;
guint64 audio_dur = 21333333;
fp = fopen(fname, "rb");
- if (fp)
- {
+ if (fp) {
buff_ptr = (guint8 *)g_malloc0(1048576);
- if (!buff_ptr)
- {
+ if (!buff_ptr) {
g_print("no free space\n");
fclose(fp);
fp = NULL;
g_print("\t audio need data - data size : %d, pts : %" G_GUINT64_FORMAT "\n", real_read_len, audio_pts);
}
#if 0
- player_submit_packet(g_player[0], buff_ptr, real_read_len, (audio_pts/1000000), 0);
+ player_submit_packet(g_player[0], buff_ptr, real_read_len, (audio_pts / 1000000), 0);
#else
/* create media packet */
if (g_audio_pkt) {
g_print("packet = %p, src = %p\n", g_audio_pkt, src);
-
if (media_packet_get_buffer_data_ptr(g_audio_pkt, &src) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
- if (media_packet_set_pts(g_audio_pkt, (uint64_t)(audio_pts/1000000)) != MEDIA_PACKET_ERROR_NONE)
+ if (media_packet_set_pts(g_audio_pkt, (uint64_t)(audio_pts / 1000000)) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE)
audio_pts += audio_dur;
EXIT:
- if (buff_ptr)
- {
+ if (buff_ptr) {
g_free(buff_ptr);
buff_ptr = NULL;
}
static void set_content_info(bool is_push_mode)
{
/* testcode for es buff src case, please input url as es_buff://123 or es_buff://push_mode */
-// unsigned char codec_data[45] = {0x0,0x0,0x1,0xb0,0x1,0x0,0x0,0x1,0xb5,0x89,0x13,0x0,0x0,0x1,0x0,0x0,0x0,0x1,0x20,0x0,0xc4,0x8d,0x88,0x5d,0xad,0x14,0x4,0x22,0x14,0x43,0x0,0x0,0x1,0xb2,0x4c,0x61,0x76,0x63,0x35,0x31,0x2e,0x34,0x30,0x2e,0x34};
+ /* unsigned char codec_data[45] = {0x0,0x0,0x1,0xb0,0x1,0x0,0x0,0x1,0xb5,0x89,0x13,0x0,0x0,0x1,0x0,0x0,0x0,0x1,0x20,0x0,0xc4,0x8d,0x88,0x5d,0xad,0x14,0x4,0x22,0x14,0x43,0x0,0x0,0x1,0xb2,0x4c,0x61,0x76,0x63,0x35,0x31,0x2e,0x34,0x30,0x2e,0x34}; */
/* create media format */
media_format_create(&g_audio_fmt);
media_format_create(&g_video_fmt);
- //Video
+ /* Video */
/* configure media format for video and set to player */
media_format_set_video_mime(g_video_fmt, MEDIA_FORMAT_MPEG4_SP);
media_format_set_video_width(g_video_fmt, 640);
- media_format_set_video_height(g_video_fmt,272);
-// player_set_media_stream_info(g_player[0], PLAYER_STREAM_TYPE_VIDEO, g_video_fmt);
+ media_format_set_video_height(g_video_fmt, 272);
+ /* player_set_media_stream_info(g_player[0], PLAYER_STREAM_TYPE_VIDEO, g_video_fmt); */
- //Audio--aac--StarWars.mp4
+ /* Audio--aac--StarWars.mp4 */
media_format_set_audio_mime(g_audio_fmt, MEDIA_FORMAT_AAC);
media_format_set_audio_channel(g_audio_fmt, 2);
media_format_set_audio_samplerate(g_audio_fmt, 48000);
-// player_set_media_stream_info(g_player[0], PLAYER_STREAM_TYPE_AUDIO, g_audio_fmt);
+ /* player_set_media_stream_info(g_player[0], PLAYER_STREAM_TYPE_AUDIO, g_audio_fmt); */
#if 0
-// video_info->mime = g_strdup("video/mpeg"); //CODEC_ID_MPEG4VIDEO
+ /* video_info->mime = g_strdup("video/mpeg"); */ /* CODEC_ID_MPEG4VIDEO */
video_info->width = 640;
video_info->height = 272;
video_info->version = 4;
video_info->codec_extradata = codec_data;
player_set_video_stream_info(g_player[0], video_info);
-
- //audio--aac--StarWars.mp4
-// audio_info->mime = g_strdup("audio/mpeg");
- //audio_info->version = 2;
-// audio_info->user_info = 0; //raw
+ /* audio--aac--StarWars.mp4 */
+ /* audio_info->mime = g_strdup("audio/mpeg"); */
+ /* audio_info->version = 2; */
+ /* audio_info->user_info = 0; */ /* raw */
#endif
#ifdef _ES_PULL_
- if (!is_push_mode)
- {
- player_set_buffer_need_video_data_cb(g_player[0], buffer_need_video_data_cb, (void*)g_player[0]);
- player_set_buffer_need_audio_data_cb(g_player[0], buffer_need_audio_data_cb, (void*)g_player[0]);
+ if (!is_push_mode) {
+ player_set_buffer_need_video_data_cb(g_player[0], buffer_need_video_data_cb, (void *)g_player[0]);
+ player_set_buffer_need_audio_data_cb(g_player[0], buffer_need_audio_data_cb, (void *)g_player[0]);
}
#endif
}
static void feed_video_data_thread_func(void *data)
{
- while (!g_thread_end)
- {
+ while (!g_thread_end) {
buffer_need_video_data_cb(1048576, NULL);
buffer_need_audio_data_cb(1048576, NULL);
}
int ret = FALSE;
int slen = strlen(g_subtitle_uri);
- if ( slen > 0 && slen < MAX_STRING_LEN )
- {
+ if (slen > 0 && slen < MAX_STRING_LEN) {
g_print("0. set subtile path() (size : %d) - %s \n", slen, g_subtitle_uri);
- player_set_subtitle_path(g_player[0],g_subtitle_uri);
- player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void*)g_player[0]);
+ player_set_subtitle_path(g_player[0], g_subtitle_uri);
+ player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void *)g_player[0]);
}
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
player_set_display(g_player[0], g_current_surface_type, GET_DISPLAY(selected_xid));
- player_set_buffering_cb(g_player[0], buffering_cb, (void*)g_player[0]);
- player_set_completed_cb(g_player[0], completed_cb, (void*)g_player[0]);
- player_set_interrupted_cb(g_player[0], interrupted_cb, (void*)g_player[0]);
- player_set_error_cb(g_player[0], error_cb, (void*)g_player[0]);
+ player_set_buffering_cb(g_player[0], buffering_cb, (void *)g_player[0]);
+ player_set_completed_cb(g_player[0], completed_cb, (void *)g_player[0]);
+ player_set_interrupted_cb(g_player[0], interrupted_cb, (void *)g_player[0]);
+ player_set_error_cb(g_player[0], error_cb, (void *)g_player[0]);
if (g_memory_playback)
player_set_memory_buffer_test();
else
player_set_uri(g_player[0], g_uri);
- }
- else
- {
+ } else {
int i = 0;
- for (i = 0; i < g_handle_num; i++)
- {
+ for (i = 0; i < g_handle_num; i++) {
player_set_display(g_player[i], g_current_surface_type, g_eo[i]);
- player_set_buffering_cb(g_player[i], buffering_cb, (void*)g_player[i]);
- player_set_completed_cb(g_player[i], completed_cb, (void*)g_player[i]);
- player_set_interrupted_cb(g_player[i], interrupted_cb, (void*)g_player[i]);
- player_set_error_cb(g_player[i], error_cb, (void*)g_player[i]);
+ player_set_buffering_cb(g_player[i], buffering_cb, (void *)g_player[i]);
+ player_set_completed_cb(g_player[i], completed_cb, (void *)g_player[i]);
+ player_set_interrupted_cb(g_player[i], interrupted_cb, (void *)g_player[i]);
+ player_set_error_cb(g_player[i], error_cb, (void *)g_player[i]);
if (g_memory_playback)
player_set_memory_buffer_test();
else
}
}
- if (strstr(g_uri, "es_buff://"))
- {
+ if (strstr(g_uri, "es_buff://")) {
is_es_push_mode = FALSE;
video_packet_count = 0;
audio_packet_count = 0;
- if (strstr(g_uri, "es_buff://push_mode"))
- {
+ if (strstr(g_uri, "es_buff://push_mode")) {
set_content_info(TRUE);
async = TRUE;
is_es_push_mode = TRUE;
}
#ifdef _ES_PULL_
- else
- {
+ else {
set_content_info(FALSE);
}
#endif
}
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
- if ( async )
- {
- ret = player_prepare_async(g_player[0], prepared_cb, (void*) g_player[0]);
- }
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
+ if (async)
+ ret = player_prepare_async(g_player[0], prepared_cb, (void *)g_player[0]);
else
ret = player_prepare(g_player[0]);
- }
- else
- {
+ } else {
int i = 0;
- for (i = 0; i < g_handle_num; i++)
- {
- if ( async )
- {
- ret = player_prepare_async(g_player[i], prepared_cb, (void*) g_player[i]);
- }
+ for (i = 0; i < g_handle_num; i++) {
+ if (async)
+ ret = player_prepare_async(g_player[i], prepared_cb, (void *)g_player[i]);
else
ret = player_prepare(g_player[i]);
}
}
- if ( ret != PLAYER_ERROR_NONE )
- {
+ if (ret != PLAYER_ERROR_NONE)
g_print("prepare is failed (errno = %d) \n", ret);
- }
+
player_state_e state;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
ret = player_get_state(g_player[0], &state);
g_print("After player_prepare() - Current State : %d \n", state);
- }
- else
- {
+ } else {
int i = 0;
- for (i = 0; i < g_handle_num; i++)
- {
+ for (i = 0; i < g_handle_num; i++) {
ret = player_get_state(g_player[i], &state);
g_print("After player_prepare() - Current State : %d \n", state);
}
}
- if (is_es_push_mode) {
- pthread_create(&g_feed_video_thread_id, NULL, (void*)feed_video_data_thread_func, NULL);
- }
+ if (is_es_push_mode)
+ pthread_create(&g_feed_video_thread_id, NULL, (void *)feed_video_data_thread_func, NULL);
}
{
int ret = FALSE;
int i = 0;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
ret = player_unprepare(g_player[0]);
- if ( ret != PLAYER_ERROR_NONE )
- {
+ if (ret != PLAYER_ERROR_NONE)
g_print("unprepare is failed (errno = %d) \n", ret);
- }
+
ret = player_unset_subtitle_updated_cb(g_player[0]);
g_print("player_unset_subtitle_updated_cb ret %d\n", ret);
ret = player_unset_error_cb(g_player[0]);
g_print("player_unset_error_cb ret %d\n", ret);
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
- if(g_player[i]!=NULL)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
+ if (g_player[i] != NULL) {
ret = player_unprepare(g_player[i]);
- if ( ret != PLAYER_ERROR_NONE )
- {
+ if (ret != PLAYER_ERROR_NONE)
g_print("unprepare is failed (errno = %d) \n", ret);
- }
+
ret = player_unset_subtitle_updated_cb(g_player[i]);
g_print("player_unset_subtitle_updated_cb [%d] ret %d\n", i, ret);
}
}
}
- reset_display(); //attention! surface(evas) -> unprepare -> surface(evas) : evas object will disappear.
- memset(g_subtitle_uri, 0 , sizeof(g_subtitle_uri));
+ /* attention! surface(evas) -> unprepare -> surface(evas) : evas object will disappear. */
+ reset_display();
+ memset(g_subtitle_uri, 0, sizeof(g_subtitle_uri));
player_state_e state;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
ret = player_get_state(g_player[0], &state);
g_print(" After player_unprepare() - Current State : %d \n", state);
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
ret = player_get_state(g_player[i], &state);
g_print(" After player_unprepare() - Current State : %d \n", state);
}
{
int i = 0;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
player_unprepare(g_player[0]);
- for (i = 0; i < g_handle_num ; i++)
- {
+ for (i = 0; i < g_handle_num; i++) {
player_destroy(g_player[i]);
g_player[i] = 0;
}
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
- if(g_player[i]!=NULL)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
+ if (g_player[i] != NULL) {
player_unprepare(g_player[i]);
player_destroy(g_player[i]);
g_player[i] = 0;
}
}
- if (g_stream_info_h)
- {
+ if (g_stream_info_h) {
sound_manager_destroy_stream_information(g_stream_info_h);
g_stream_info_h = NULL;
}
media_packet_destroy(g_audio_pkt);
#if DUMP_OUTBUF
- if (fp_out1)
- fclose(fp_out1);
- if (fp_out2)
- fclose(fp_out2);
+ if (fp_out1)
+ fclose(fp_out1);
+ if (fp_out2)
+ fclose(fp_out2);
#endif
}
{
int bRet = FALSE;
int i = 0;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
- //for checking external display....
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
+ /* for checking external display.... */
player_set_display(g_player[0], g_current_surface_type, GET_DISPLAY(selected_xid));
bRet = player_start(g_player[0]);
g_print("player_start returned [%d]", bRet);
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
bRet = player_start(g_player[i]);
g_print("player_start returned [%d]", bRet);
}
{
int bRet = FALSE;
int i = 0;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
bRet = player_stop(g_player[0]);
g_print("player_stop returned [%d]", bRet);
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
bRet = player_stop(g_player[i]);
g_print("player_stop returned [%d]", bRet);
}
}
g_thread_end = TRUE;
- if (g_feed_video_thread_id)
- {
+ if (g_feed_video_thread_id) {
pthread_join(g_feed_video_thread_id, NULL);
g_feed_video_thread_id = 0;
}
{
int bRet = FALSE;
int i = 0;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
- //for checking external display....
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
+ /* for checking external display.... */
player_set_display(g_player[0], PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(selected_xid));
bRet = player_start(g_player[0]);
g_print("player_start returned [%d]", bRet);
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
bRet = player_start(g_player[i]);
g_print("player_start returned [%d]", bRet);
}
{
int bRet = FALSE;
int i = 0;
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
bRet = player_pause(g_player[0]);
g_print("player_pause returned [%d]", bRet);
- }
- else
- {
- for (i = 0; i < g_handle_num ; i++)
- {
+ } else {
+ for (i = 0; i < g_handle_num; i++) {
bRet = player_pause(g_player[i]);
g_print("player_pause returned [%d]", bRet);
}
static void _player_set_progressive_download()
{
player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
- player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void*)g_player[0]);
+ player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]);
}
static void _player_get_progressive_download_status()
static void set_volume(float volume)
{
- if ( player_set_volume(g_player[0], volume, volume) != PLAYER_ERROR_NONE )
- {
+ if (player_set_volume(g_player[0], volume, volume) != PLAYER_ERROR_NONE)
g_print("failed to set volume\n");
- }
}
-static void get_volume(float* left, float* right)
+static void get_volume(float *left, float *right)
{
player_get_volume(g_player[0], left, right);
g_print(" ==> [Player_Test] volume - left : %f, right : %f\n", *left, *right);
static void set_mute(bool mute)
{
- if ( player_set_mute(g_player[0], mute) != PLAYER_ERROR_NONE )
- {
+ if (player_set_mute(g_player[0], mute) != PLAYER_ERROR_NONE)
g_print("failed to set_mute\n");
- }
}
-static void get_mute(bool *mute)
+static void get_mute(bool * mute)
{
player_is_muted(g_player[0], mute);
g_print(" ==> [Player_Test] mute = %d\n", *mute);
static void set_sound_type(sound_type_e type)
{
- if ( player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE )
- {
+ if (player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE)
g_print("failed to set sound type(%d)\n", type);
- }
else
g_print("set sound type(%d) success", type);
}
-void focus_callback (sound_stream_info_h stream_info, sound_stream_focus_change_reason_e reason_for_change, const char *additional_info, void *user_data)
+void focus_callback(sound_stream_info_h stream_info, sound_stream_focus_change_reason_e reason_for_change, const char *additional_info, void *user_data)
{
g_print("FOCUS callback is called, reason_for_change(%d), additional_info(%s), userdata(%p)", reason_for_change, additional_info, user_data);
return;
static void set_sound_stream_info(int type)
{
- if (g_stream_info_h)
- {
+ if (g_stream_info_h) {
g_print("stream information is already set, please destory handle and try again\n");
return;
}
- if (sound_manager_create_stream_information( type, focus_callback, g_player[0], &g_stream_info_h))
- {
+ if (sound_manager_create_stream_information(type, focus_callback, g_player[0], &g_stream_info_h)) {
g_print("failed to create stream_information()\n");
return;
}
- if ( player_set_audio_policy_info(g_player[0], g_stream_info_h) != PLAYER_ERROR_NONE )
- {
+ if (player_set_audio_policy_info(g_player[0], g_stream_info_h) != PLAYER_ERROR_NONE)
g_print("failed to set sound stream information(%p)\n", g_stream_info_h);
- }
else
g_print("set stream information(%p) success", g_stream_info_h);
}
static void set_position(int position)
{
- if ( player_set_play_position(g_player[0], position, TRUE, seek_completed_cb, g_player[0]) != PLAYER_ERROR_NONE )
- {
+ if (player_set_play_position(g_player[0], position, TRUE, seek_completed_cb, g_player[0]) != PLAYER_ERROR_NONE)
g_print("failed to set position\n");
- }
}
static void set_playback_rate(float rate, bool streaming)
{
- if (streaming)
- {
- if ( player_set_streaming_playback_rate(g_player[0], rate) != PLAYER_ERROR_NONE )
- {
+ if (streaming) {
+ if (player_set_streaming_playback_rate(g_player[0], rate) != PLAYER_ERROR_NONE)
g_print("failed to set streaming playback rate\n");
- }
- }
- else
- {
- if ( player_set_playback_rate(g_player[0], rate) != PLAYER_ERROR_NONE )
- {
+ } else {
+ if (player_set_playback_rate(g_player[0], rate) != PLAYER_ERROR_NONE)
g_print("failed to set playback rate\n");
- }
}
}
int duration = 0;
int ret;
ret = player_get_duration(g_player[0], &duration);
- g_print(" ==> [Player_Test] player_get_duration() return : %d\n",ret);
- g_print(" ==> [Player_Test] Duration: [%d ] msec\n",duration);
+ g_print(" ==> [Player_Test] player_get_duration() return : %d\n", ret);
+ g_print(" ==> [Player_Test] Duration: [%d ] msec\n", duration);
}
static void audio_frame_decoded_cb_ex()
#if DUMP_OUTBUF
fp_out1 = fopen("/home/owner/content/out1.pcm", "wb");
fp_out2 = fopen("/home/owner/content/out2.pcm", "wb");
- if(!fp_out1 || !fp_out2) {
+ if (!fp_out1 || !fp_out2) {
g_print("File open error\n");
return;
}
int h = 0;
char *value = NULL;
- player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ALBUM, &value);
- g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ALBUM: [%s ] \n",value);
- player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ARTIST, &value);
- g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ARTIST: [%s ] \n",value);
- player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_AUTHOR, &value);
- g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_AUTHOR: [%s ] \n",value);
- player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_GENRE, &value);
- g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_GENRE: [%s ] \n",value);
- player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_TITLE, &value);
- g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_TITLE: [%s ] \n",value);
+ player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ALBUM, &value);
+ g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ALBUM: [%s ] \n", value);
+ player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ARTIST, &value);
+ g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ARTIST: [%s ] \n", value);
+ player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_AUTHOR, &value);
+ g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_AUTHOR: [%s ] \n", value);
+ player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_GENRE, &value);
+ g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_GENRE: [%s ] \n", value);
+ player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_TITLE, &value);
+ g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_TITLE: [%s ] \n", value);
void *album;
int size;
player_get_album_art(g_player[0], &album, &size);
g_print(" ==> [Player_Test] Album art : [ data : %p, size : %d ]\n", (unsigned int *)album, size);
- if(value!=NULL)
- {
+ if (value != NULL) {
free(value);
value = NULL;
}
int bit_rate;
int fps, v_bit_rate;
player_get_audio_stream_info(g_player[0], &sample_rate, &channel, &bit_rate);
- g_print(" ==> [Player_Test] Sample Rate: [%d ] , Channel: [%d ] , Bit Rate: [%d ] \n",sample_rate,channel,bit_rate);
+ g_print(" ==> [Player_Test] Sample Rate: [%d ] , Channel: [%d ] , Bit Rate: [%d ] \n", sample_rate, channel, bit_rate);
player_get_video_stream_info(g_player[0], &fps, &v_bit_rate);
- g_print(" ==> [Player_Test] fps: [%d ] , Bit Rate: [%d ] \n",fps,v_bit_rate);
+ g_print(" ==> [Player_Test] fps: [%d ] , Bit Rate: [%d ] \n", fps, v_bit_rate);
char *audio_codec = NULL;
char *video_codec = NULL;
player_get_codec_info(g_player[0], &audio_codec, &video_codec);
- if(audio_codec!=NULL)
- {
- g_print(" ==> [Player_Test] Audio Codec: [%s ] \n",audio_codec);
+ if (audio_codec != NULL) {
+ g_print(" ==> [Player_Test] Audio Codec: [%s ] \n", audio_codec);
free(audio_codec);
audio_codec = NULL;
}
- if(video_codec!=NULL)
- {
- g_print(" ==> [Player_Test] Video Codec: [%s ] \n",video_codec);
+ if (video_codec != NULL) {
+ g_print(" ==> [Player_Test] Video Codec: [%s ] \n", video_codec);
free(video_codec);
video_codec = NULL;
}
player_get_video_size(g_player[0], &w, &h);
- g_print(" ==> [Player_Test] Width: [%d ] , Height: [%d ] \n",w,h);
- }
+ g_print(" ==> [Player_Test] Width: [%d ] , Height: [%d ] \n", w, h);
+}
static void set_looping(bool looping)
{
- if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
- if ( player_set_looping(g_player[0], looping) != PLAYER_ERROR_NONE )
- {
+ if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
+ if (player_set_looping(g_player[0], looping) != PLAYER_ERROR_NONE)
g_print("failed to set_looping\n");
- }
- }
- else
- {
+ } else {
int i = 0;
- for (i = 0; i < g_handle_num; i++)
- {
- if ( player_set_looping(g_player[i], looping) != PLAYER_ERROR_NONE )
- {
+ for (i = 0; i < g_handle_num; i++) {
+ if (player_set_looping(g_player[i], looping) != PLAYER_ERROR_NONE)
g_print("failed to set_looping\n");
- }
}
}
}
int hdmi_output_id;
eom_output_mode_e output_mode;
- switch (option)
- {
- case 0: /* X surface */
+ switch (option) {
+ case 0:
+ /* X surface */
surface_type = PLAYER_DISPLAY_TYPE_OVERLAY;
g_print("change surface type to X\n");
break;
#ifdef TIZEN_MOBILE
- case 1: /* EVAS surface */
+ case 1:
+ /* EVAS surface */
surface_type = PLAYER_DISPLAY_TYPE_EVAS;
g_print("change surface type to EVAS\n");
break;
return;
}
- if (surface_type == g_current_surface_type)
- {
+ if (surface_type == g_current_surface_type) {
g_print("same with the previous surface type(%d)\n", g_current_surface_type);
return;
- }
- else
- {
+ } else {
player_state_e player_state = PLAYER_STATE_NONE;
ret = player_get_state(g_player[0], &player_state);
if (ret)
- {
g_print("failed to player_get_state(), ret(0x%x)\n", ret);
- }
+
reset_display();
- if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY)
- {
+ if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
#ifdef _USE_X_DIRECT_
/* Create xwindow for X surface */
- if(!g_dpy)
- {
- g_dpy = XOpenDisplay (NULL);
- g_xid = create_window (g_dpy, 0, 0, 500, 500);
- g_gc = XCreateGC (g_dpy, g_xid, 0, 0);
+ if (!g_dpy) {
+ g_dpy = XOpenDisplay(NULL);
+ g_xid = create_window(g_dpy, 0, 0, 500, 500);
+ g_gc = XCreateGC(g_dpy, g_xid, 0, 0);
}
g_print("create x window dpy(%p), gc(%x), xid(%d)\n", g_dpy, (unsigned int)g_gc, (int)g_xid);
- XImage *xim = make_transparent_image (g_dpy, 500, 500);
- XPutImage (g_dpy, g_xid, g_gc, xim, 0, 0, 0, 0, 500, 500);
- XSync (g_dpy, False);
+ XImage *xim = make_transparent_image(g_dpy, 500, 500);
+ XPutImage(g_dpy, g_xid, g_gc, xim, 0, 0, 0, 0, 500, 500);
+ XSync(g_dpy, False);
#else
- hdmi_output_id = eom_get_output_id ("HDMI");
+ hdmi_output_id = eom_get_output_id("HDMI");
if (hdmi_output_id == 0)
- g_print ("[eom] error : HDMI output id is NULL.\n");
+ g_print("[eom] error : HDMI output id is NULL.\n");
eom_get_output_mode(hdmi_output_id, &output_mode);
- if (output_mode == EOM_OUTPUT_MODE_NONE)
- {
- if(!g_xid)
- {
+ if (output_mode == EOM_OUTPUT_MODE_NONE) {
+ if (!g_xid) {
g_xid = create_win(PACKAGE);
if (g_xid == NULL)
return;
evas_object_show(g_xid);
g_xid = selected_xid;
}
- }
- else
- {
- //for external
+ } else {
+ /* for external */
}
#endif
ret = player_set_display(g_player[0], surface_type, GET_DISPLAY(selected_xid));
- }
- else
- {
- if(!g_xid)
- {
+ } else {
+ if (!g_xid) {
g_xid = create_win(PACKAGE);
if (g_xid == NULL)
return;
evas_object_show(g_xid);
}
int i = 0;
- for (i = 0; i < g_handle_num ; i++)
- {
+ for (i = 0; i < g_handle_num; i++) {
/* Create evas image object for EVAS surface */
- if (!g_eo[i])
- {
+ if (!g_eo[i]) {
g_eo[i] = create_image_object(g_xid);
g_print("create eo[%d] %p\n", i, g_eo[i]);
evas_object_image_size_set(g_eo[i], 500, 500);
evas_object_image_fill_set(g_eo[i], 0, 0, 500, 500);
evas_object_resize(g_eo[i], 500, 500);
- evas_object_move(g_eo[i], i*20, i*20);
+ evas_object_move(g_eo[i], i * 20, i * 20);
}
ret = player_set_display(g_player[i], surface_type, g_eo[i]);
+
}
}
- if (ret)
- {
+ if (ret) {
g_print("failed to set display, surface_type(%d)\n", surface_type);
return;
}
static void set_display_mode(int mode)
{
- if ( player_set_display_mode(g_player[0], mode) != PLAYER_ERROR_NONE )
- {
+ if (player_set_display_mode(g_player[0], mode) != PLAYER_ERROR_NONE)
g_print("failed to player_set_display_mode\n");
- }
}
static void get_display_mode()
{
player_display_mode_e mode;
player_get_display_mode(g_player[0], &mode);
- g_print(" ==> [Player_Test] Display mode: [%d ] \n",mode);
+ g_print(" ==> [Player_Test] Display mode: [%d ] \n", mode);
}
static void set_display_rotation(int rotation)
{
- if ( player_set_display_rotation(g_player[0], rotation) != PLAYER_ERROR_NONE )
- {
+ if (player_set_display_rotation(g_player[0], rotation) != PLAYER_ERROR_NONE)
g_print("failed to set_display_rotation\n");
- }
}
static void get_display_rotation()
{
player_display_rotation_e rotation = 0;
player_get_display_rotation(g_player[0], &rotation);
- g_print(" ==> [Player_Test] X11 Display rotation: [%d ] \n",rotation);
+ g_print(" ==> [Player_Test] X11 Display rotation: [%d ] \n", rotation);
}
-
static void set_display_visible(bool visible)
{
- if ( player_set_display_visible(g_player[0], visible) != PLAYER_ERROR_NONE )
- {
+ if (player_set_display_visible(g_player[0], visible) != PLAYER_ERROR_NONE)
g_print("failed to player_set_x11_display_visible\n");
- }
}
static void get_display_visible(bool *visible)
static void set_display_dst_roi(int x, int y, int w, int h)
{
#if 0
- if ( player_set_x11_display_dst_roi(g_player[0], x, y, w, h) != PLAYER_ERROR_NONE )
- {
+ if (player_set_x11_display_dst_roi(g_player[0], x, y, w, h) != PLAYER_ERROR_NONE)
g_print("failed to player_set_x11_display_dst_roi\n");
- } else {
+ else
g_print(" ==> [Player_Test] set X11 Display DST ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h);
- }
#endif
}
int w = 0;
int h = 0;
- if ( player_get_x11_display_dst_roi(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE )
- {
+ if (player_get_x11_display_dst_roi(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE)
g_print("failed to player_get_x11_display_dst_roi\n");
- } else {
+ else
g_print(" ==> [Player_Test] got X11 Display DST ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h);
- }
#endif
}
static void set_display_roi_mode(int mode)
{
#if 0
- if ( player_set_x11_display_roi_mode(g_player[0], (player_display_roi_mode_e)mode) != PLAYER_ERROR_NONE )
- {
+ if (player_set_x11_display_roi_mode(g_player[0], (player_display_roi_mode_e) mode) != PLAYER_ERROR_NONE)
g_print("failed to player_set_x11_display_roi_mode\n");
- } else {
+ else
g_print(" ==> [Player_Test] set X11 Display ROI mode (%d)\n", mode);
- }
#endif
}
{
#if 0
player_display_roi_mode_e mode;
- if ( player_get_x11_display_roi_mode(g_player[0], &mode) != PLAYER_ERROR_NONE )
- {
+ if (player_get_x11_display_roi_mode(g_player[0], &mode) != PLAYER_ERROR_NONE)
g_print("failed to player_get_x11_display_roi_mode\n");
- } else {
+ else
g_print(" ==> [Player_Test] got X11 Display ROI mode (%d)\n", mode);
- }
#endif
}
static void set_display_src_crop(int x, int y, int w, int h)
{
#if 0
- if ( player_set_x11_display_src_crop(g_player[0], x, y, w, h) != PLAYER_ERROR_NONE )
- {
+ if (player_set_x11_display_src_crop(g_player[0], x, y, w, h) != PLAYER_ERROR_NONE)
g_print("failed to player_set_x11_display_src_crop\n");
- } else {
+ else
g_print(" ==> [Player_Test] set X11 Display SRC CROP (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h);
- }
#endif
}
int w = 0;
int h = 0;
- if ( player_get_x11_display_src_crop(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE )
- {
+ if (player_get_x11_display_src_crop(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE)
g_print("failed to player_get_x11_display_src_crop\n");
- } else {
+ else
g_print(" ==> [Player_Test] got X11 Display SRC CROP (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h);
- }
#endif
}
{
int len = strlen(subtitle_filename);
- if ( len < 1 || len > MAX_STRING_LEN )
+ if (len < 1 || len > MAX_STRING_LEN)
return;
- strncpy (g_subtitle_uri, subtitle_filename,len);
+ strncpy(g_subtitle_uri, subtitle_filename, len);
g_print("subtitle uri is set to %s\n", g_subtitle_uri);
- player_set_subtitle_path (g_player[0], g_subtitle_uri);
+ player_set_subtitle_path(g_player[0], g_subtitle_uri);
}
static void switch_subtitle(int index)
{
- char* lang_code = NULL;
- if (player_select_track (g_player[0], PLAYER_STREAM_TYPE_TEXT, index) != PLAYER_ERROR_NONE)
- {
+ char *lang_code = NULL;
+ if (player_select_track(g_player[0], PLAYER_STREAM_TYPE_TEXT, index) != PLAYER_ERROR_NONE)
g_print("player_select_track failed\n");
- }
+
if (player_get_track_language_code(g_player[0], PLAYER_STREAM_TYPE_TEXT, index, &lang_code) == PLAYER_ERROR_NONE) {
g_print("selected track code %s\n", lang_code);
free(lang_code);
static void capture_video()
{
- if( player_capture_video(g_player[0],video_captured_cb,NULL)!=PLAYER_ERROR_NONE)
- {
+ if (player_capture_video(g_player[0], video_captured_cb, NULL) != PLAYER_ERROR_NONE)
g_print("failed to player_capture_video\n");
- }
}
static void decoding_audio()
{
#if 0
int ret;
- char *suffix, *dump_path;
- GDateTime *time = g_date_time_new_now_local();
-
- suffix = g_date_time_format(time, "%Y%m%d_%H%M%S.pcm");
- dump_path = g_strjoin(NULL, PLAYER_TEST_DUMP_PATH_PREFIX, suffix, NULL);
- g_pcm_fd = fopen(dump_path, "w+");
- g_free(dump_path);
- g_free(suffix);
- g_date_time_unref(time);
- if(!g_pcm_fd) {
- g_print("Can not create debug dump file");
- }
-
- ret =player_set_audio_frame_decoded_cb(g_player[0], 0, 0,audio_frame_decoded_cb, (void*)g_player[0]);
- if ( ret != PLAYER_ERROR_NONE )
- {
+ char *suffix, *dump_path;
+ GDateTime *time = g_date_time_new_now_local();
+
+ suffix = g_date_time_format(time, "%Y%m%d_%H%M%S.pcm");
+ dump_path = g_strjoin(NULL, PLAYER_TEST_DUMP_PATH_PREFIX, suffix, NULL);
+ g_pcm_fd = fopen(dump_path, "w+");
+ g_free(dump_path);
+ g_free(suffix);
+ g_date_time_unref(time);
+ if (!g_pcm_fd)
+ g_print("Can not create debug dump file");
+
+ ret = player_set_audio_frame_decoded_cb(g_player[0], 0, 0, audio_frame_decoded_cb, (void *)g_player[0]);
+ if (ret != PLAYER_ERROR_NONE)
g_print("player_set_audio_frame_decoded_cb is failed (errno = %d) \n", ret);
- }
#endif
}
+
static void set_audio_eq(int value)
{
bool available = FALSE;
int index, min, max;
- if(value)
- {
- if(player_audio_effect_equalizer_is_available(g_player[0], &available)!=PLAYER_ERROR_NONE)
+ if (value) {
+ if (player_audio_effect_equalizer_is_available(g_player[0], &available) != PLAYER_ERROR_NONE)
g_print("failed to player_audio_effect_equalizer_is_available\n");
- if(available)
- {
- if((player_audio_effect_get_equalizer_bands_count(g_player[0], &index)!=PLAYER_ERROR_NONE) ||
- (player_audio_effect_get_equalizer_level_range(g_player[0], &min, &max)!=PLAYER_ERROR_NONE) ||
- (player_audio_effect_set_equalizer_band_level(g_player[0], index/2, max)!=PLAYER_ERROR_NONE))
- g_print("failed to player_audio_effect_set_equalizer_band_level index %d, level %d\n", index/2, max);
+ if (available) {
+ if ((player_audio_effect_get_equalizer_bands_count(g_player[0], &index) != PLAYER_ERROR_NONE) ||
+ (player_audio_effect_get_equalizer_level_range(g_player[0], &min, &max) != PLAYER_ERROR_NONE) ||
+ (player_audio_effect_set_equalizer_band_level(g_player[0], index / 2, max) != PLAYER_ERROR_NONE))
+ g_print("failed to player_audio_effect_set_equalizer_band_level index %d, level %d\n", index / 2, max);
}
}
- else
- {
- if(player_audio_effect_equalizer_clear(g_player[0])!=PLAYER_ERROR_NONE)
+ else {
+ if (player_audio_effect_equalizer_clear(g_player[0]) != PLAYER_ERROR_NONE)
g_print("failed to player_audio_effect_equalizer_clear\n");
}
static void get_audio_eq()
{
int index, min, max, value;
- player_audio_effect_get_equalizer_bands_count (g_player[0], &index);
+ player_audio_effect_get_equalizer_bands_count(g_player[0], &index);
g_print(" ==> [Player_Test] eq bands count: [%d] \n", index);
player_audio_effect_get_equalizer_level_range(g_player[0], &min, &max);
g_print(" ==> [Player_Test] eq bands range: [%d~%d] \n", min, max);
- player_audio_effect_get_equalizer_band_level(g_player[0], index/2, &value);
+ player_audio_effect_get_equalizer_band_level(g_player[0], index / 2, &value);
g_print(" ==> [Player_Test] eq bands level: [%d] \n", value);
player_audio_effect_get_equalizer_band_frequency(g_player[0], 0, &value);
g_print(" ==> [Player_Test] eq bands frequency: [%d] \n", value);
{
int i = 0;
- if(g_pcm_fd)
- {
+ if (g_pcm_fd)
fclose(g_pcm_fd);
- }
- for (i = 0; i < g_handle_num; i++)
- {
- if(g_player[i]!=NULL)
- {
+ for (i = 0; i < g_handle_num; i++) {
+ if (g_player[i] != NULL) {
player_unprepare(g_player[i]);
player_destroy(g_player[i]);
g_player[i] = 0;
void _interpret_main_menu(char *cmd)
{
- int len = strlen(cmd);
- if ( len == 1 )
- {
- if (strncmp(cmd, "a", 1) == 0)
- {
+ int len = strlen(cmd);
+ if (len == 1) {
+ if (strncmp(cmd, "a", 1) == 0) {
g_menu_state = CURRENT_STATUS_FILENAME;
- }
- else if (strncmp(cmd, "1", 1) == 0)
- {
+ } else if (strncmp(cmd, "1", 1) == 0) {
play_with_ini(g_file_list[0]);
- }
- else if (strncmp(cmd, "2", 1) == 0)
- {
+ } else if (strncmp(cmd, "2", 1) == 0) {
play_with_ini(g_file_list[1]);
- }
- else if (strncmp(cmd, "3", 1) == 0)
- {
+ } else if (strncmp(cmd, "3", 1) == 0) {
play_with_ini(g_file_list[2]);
- }
- else if (strncmp(cmd, "4", 1) == 0)
- {
+ } else if (strncmp(cmd, "4", 1) == 0) {
play_with_ini(g_file_list[3]);
- }
- else if (strncmp(cmd, "5", 1) == 0)
- {
+ } else if (strncmp(cmd, "5", 1) == 0) {
play_with_ini(g_file_list[4]);
- }
- else if (strncmp(cmd, "6", 1) == 0)
- {
+ } else if (strncmp(cmd, "6", 1) == 0) {
play_with_ini(g_file_list[5]);
- }
- else if (strncmp(cmd, "7", 1) == 0)
- {
+ } else if (strncmp(cmd, "7", 1) == 0) {
play_with_ini(g_file_list[6]);
- }
- else if (strncmp(cmd, "8", 1) == 0)
- {
+ } else if (strncmp(cmd, "8", 1) == 0) {
play_with_ini(g_file_list[7]);
- }
- else if (strncmp(cmd, "9", 1) == 0)
- {
+ } else if (strncmp(cmd, "9", 1) == 0) {
play_with_ini(g_file_list[8]);
- }
- else if (strncmp(cmd, "b", 1) == 0)
- {
+ } else if (strncmp(cmd, "b", 1) == 0) {
_player_play();
- }
- else if (strncmp(cmd, "c", 1) == 0)
- {
+ } else if (strncmp(cmd, "c", 1) == 0) {
_player_stop();
- }
- else if (strncmp(cmd, "d", 1) == 0)
- {
+ } else if (strncmp(cmd, "d", 1) == 0) {
_player_resume();
- }
- else if (strncmp(cmd, "e", 1) == 0)
- {
+ } else if (strncmp(cmd, "e", 1) == 0) {
_player_pause();
- }
- else if (strncmp(cmd, "S", 1) == 0)
- {
+ } else if (strncmp(cmd, "S", 1) == 0) {
_player_state();
- }
- else if (strncmp(cmd, "f", 1) == 0)
- {
+ } else if (strncmp(cmd, "f", 1) == 0) {
g_menu_state = CURRENT_STATUS_VOLUME;
- }
- else if (strncmp(cmd, "g", 1) == 0)
- {
+ } else if (strncmp(cmd, "g", 1) == 0) {
float left;
float right;
get_volume(&left, &right);
- }
- else if (strncmp(cmd, "z", 1) == 0)
- {
+ } else if (strncmp(cmd, "z", 1) == 0) {
g_menu_state = CURRENT_STATUS_SOUND_TYPE;
- }
- else if (strncmp(cmd, "k", 1) == 0)
- {
+ } else if (strncmp(cmd, "k", 1) == 0) {
g_menu_state = CURRENT_STATUS_SOUND_STREAM_INFO;
- }
- else if (strncmp(cmd, "h", 1) == 0 )
- {
+ } else if (strncmp(cmd, "h", 1) == 0) {
g_menu_state = CURRENT_STATUS_MUTE;
- }
- else if (strncmp(cmd, "i", 1) == 0 )
- {
+ } else if (strncmp(cmd, "i", 1) == 0) {
bool mute;
get_mute(&mute);
- }
- else if (strncmp(cmd, "j", 1) == 0 )
- {
+ } else if (strncmp(cmd, "j", 1) == 0) {
g_menu_state = CURRENT_STATUS_POSITION_TIME;
- }
- else if (strncmp(cmd, "l", 1) == 0 )
- {
+ } else if (strncmp(cmd, "l", 1) == 0) {
get_position();
- }
- else if (strncmp(cmd, "m", 1) == 0 )
- {
+ } else if (strncmp(cmd, "m", 1) == 0) {
get_duration();
- }
- else if (strncmp(cmd, "n", 1) == 0 )
- {
+ } else if (strncmp(cmd, "n", 1) == 0) {
get_stream_info();
- }
- else if (strncmp(cmd, "o", 1) == 0 )
- {
+ } else if (strncmp(cmd, "o", 1) == 0) {
g_menu_state = CURRENT_STATUS_LOOPING;
- }
- else if (strncmp(cmd, "p", 1) == 0 )
- {
+ } else if (strncmp(cmd, "p", 1) == 0) {
bool looping;
get_looping(&looping);
- }
- else if (strncmp(cmd, "r", 1) == 0 )
- {
+ } else if (strncmp(cmd, "r", 1) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_MODE;
- }
- else if (strncmp(cmd, "s", 1) == 0 )
- {
+ } else if (strncmp(cmd, "s", 1) == 0) {
get_display_mode();
- }
- else if (strncmp(cmd, "t", 1) == 0 )
- {
+ } else if (strncmp(cmd, "t", 1) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_ROTATION;
- }
- else if (strncmp(cmd, "u", 1) == 0 )
- {
+ } else if (strncmp(cmd, "u", 1) == 0) {
get_display_rotation();
- }
- else if (strncmp(cmd, "v", 1) == 0 )
- {
+ } else if (strncmp(cmd, "v", 1) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_VISIBLE;
- }
- else if (strncmp(cmd, "w", 1) == 0 )
- {
+ } else if (strncmp(cmd, "w", 1) == 0) {
bool visible;
get_display_visible(&visible);
- }
- else if (strncmp(cmd, "x", 1) == 0 )
- {
+ } else if (strncmp(cmd, "x", 1) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_DST_ROI;
- }
- else if (strncmp(cmd, "y", 1) == 0 )
- {
+ } else if (strncmp(cmd, "y", 1) == 0) {
get_display_dst_roi();
- }
- else if (strncmp(cmd, "M", 1) == 0 )
- {
+ } else if (strncmp(cmd, "M", 1) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_ROI_MODE;
- }
- else if (strncmp(cmd, "N", 1) == 0 )
- {
+ } else if (strncmp(cmd, "N", 1) == 0) {
get_display_roi_mode();
- }
- else if (strncmp(cmd, "F", 1) == 0 )
- {
+ } else if (strncmp(cmd, "F", 1) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_SRC_CROP;
- }
- else if (strncmp(cmd, "G", 1) == 0 )
- {
+ } else if (strncmp(cmd, "G", 1) == 0) {
get_display_src_crop();
- }
- else if (strncmp(cmd, "A", 1) == 0 )
- {
+ } else if (strncmp(cmd, "A", 1) == 0) {
g_menu_state = CURRENT_STATUS_SUBTITLE_FILENAME;
- }
- else if (strncmp(cmd, "C", 1) == 0 )
- {
+ } else if (strncmp(cmd, "C", 1) == 0) {
capture_video();
- }
- else if (strncmp(cmd, "D", 1) == 0 )
- {
+ } else if (strncmp(cmd, "D", 1) == 0) {
decoding_audio();
- }
- else if (strncmp(cmd, "q", 1) == 0)
- {
+ } else if (strncmp(cmd, "q", 1) == 0) {
quit_pushing = TRUE;
quit_program();
- }
- else if (strncmp(cmd, "E", 1) == 0 )
- {
+ } else if (strncmp(cmd, "E", 1) == 0) {
g_menu_state = CURRENT_STATUS_AUDIO_EQUALIZER;
- }
- else if (strncmp(cmd, "H", 1) == 0 )
- {
+ } else if (strncmp(cmd, "H", 1) == 0) {
get_audio_eq();
- }
- else
- {
+ } else {
g_print("unknown menu \n");
}
- }
- else if(len == 2)
- {
- if (strncmp(cmd, "pr", 2) == 0)
- {
- _player_prepare(FALSE); // sync
- }
- else if (strncmp(cmd, "pa", 2) == 0)
- {
- _player_prepare(TRUE); // async
- }
- else if (strncmp(cmd, "un", 2) == 0)
- {
+ } else if (len == 2) {
+ if (strncmp(cmd, "pr", 2) == 0) {
+ /* sync */
+ _player_prepare(FALSE);
+ } else if (strncmp(cmd, "pa", 2) == 0) {
+ /* async */
+ _player_prepare(TRUE);
+ } else if (strncmp(cmd, "un", 2) == 0) {
_player_unprepare();
- }
- else if (strncmp(cmd, "dt", 2) == 0)
- {
+ } else if (strncmp(cmd, "dt", 2) == 0) {
_player_destroy();
- }
- else if (strncmp(cmd, "sp", 2) == 0)
- {
+ } else if (strncmp(cmd, "sp", 2) == 0) {
_player_set_progressive_download();
- }
- else if (strncmp(cmd, "gp", 2) == 0)
- {
+ } else if (strncmp(cmd, "gp", 2) == 0) {
_player_get_progressive_download_status();
- }
- else if (strncmp(cmd, "mp", 2) == 0)
- {
+ } else if (strncmp(cmd, "mp", 2) == 0) {
g_memory_playback = (g_memory_playback ? FALSE : TRUE);
g_print("memory playback = %d\n", g_memory_playback);
- }
- else if (strncmp(cmd, "ds", 2) == 0 )
- {
+ } else if (strncmp(cmd, "ds", 2) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_SURFACE_CHANGE;
- }
- else if (strncmp(cmd, "nb", 2) == 0 )
- {
+ } else if (strncmp(cmd, "nb", 2) == 0) {
g_menu_state = CURRENT_STATUS_HANDLE_NUM;
- }
- else if (strncmp(cmd, "tr", 2) == 0 )
- {
+ } else if (strncmp(cmd, "tr", 2) == 0) {
g_menu_state = CURRENT_STATUS_PLAYBACK_RATE;
- }
- else if (strncmp(cmd, "ss", 2) == 0 )
- {
+ } else if (strncmp(cmd, "ss", 2) == 0) {
g_menu_state = CURRENT_STATUS_SWITCH_SUBTITLE;
- }
- else if(strncmp(cmd, "X3", 2) == 0)
- {
+ } else if (strncmp(cmd, "X3", 2) == 0) {
audio_frame_decoded_cb_ex();
- }
- else if(strncmp(cmd, "X4", 2) == 0)
- {
+ } else if (strncmp(cmd, "X4", 2) == 0) {
set_pcm_spec();
- }
- else
- {
+ } else {
g_print("unknown menu \n");
}
- }
- else
- {
- if (strncmp(cmd, "trs", 3) == 0 )
- {
+ } else {
+ if (strncmp(cmd, "trs", 3) == 0)
g_menu_state = CURRENT_STATUS_STREAMING_PLAYBACK_RATE;
- }
else
- {
g_print("unknown menu \n");
- }
}
}
g_print("-----------------------------------------------------------------------------------------\n");
g_print("*. Sample List in [%s] \t", MMTS_SAMPLELIST_INI_DEFAULT_PATH);
g_print("nb. num. of handles \n");
- for( idx = 1; idx <= INI_SAMPLE_LIST_MAX ; idx++ )
- {
- if (strlen (g_file_list[idx-1]) > 0)
- g_print("%d. Play [%s]\n", idx, g_file_list[idx-1]);
+ for (idx = 1; idx <= INI_SAMPLE_LIST_MAX; idx++) {
+ if (strlen(g_file_list[idx - 1]) > 0)
+ g_print("%d. Play [%s]\n", idx, g_file_list[idx - 1]);
}
g_print("-----------------------------------------------------------------------------------------\n");
g_print("[playback] a. Create\t");
g_print("e. Pause \t");
g_print("un. Unprepare \t");
g_print("dt. Destroy \n");
- g_print("[State] S. Player State \n");
+ g_print("[State] S. Player State \n");
g_print("[ volume ] f. Set Volume\t");
g_print("g. Get Volume\t");
g_print("z. Set Sound type\t");
g_print("i. Get Mute\n");
g_print("[audio eq] E. Set Audio EQ\t");
g_print("H. Get Audio EQ\n");
- g_print("[position] j. Set Position \t");
+ g_print("[position] j. Set Position \t");
g_print("l. Get Position\n");
g_print("[trick] tr. set playback rate\n");
g_print("[duration] m. Get Duration\n");
static void displaymenu()
{
- if (g_menu_state == CURRENT_STATUS_MAINMENU)
- {
+ if (g_menu_state == CURRENT_STATUS_MAINMENU) {
display_sub_basic();
- }
- else if (g_menu_state == CURRENT_STATUS_HANDLE_NUM)
- {
+ } else if (g_menu_state == CURRENT_STATUS_HANDLE_NUM) {
g_print("*** input number of handles.(recommended only for EVAS surface)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_FILENAME)
- {
+ } else if (g_menu_state == CURRENT_STATUS_FILENAME) {
g_print("*** input mediapath.\n");
- }
- else if (g_menu_state == CURRENT_STATUS_VOLUME)
- {
+ } else if (g_menu_state == CURRENT_STATUS_VOLUME) {
g_print("*** input volume value.(0~1.0)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) {
g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO)
- {
+ } else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO) {
g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:RINGTONE 5:CALL 6:VOIP)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_MUTE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_MUTE) {
g_print("*** input mute value.(0: Not Mute, 1: Mute) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_POSITION_TIME)
- {
+ } else if (g_menu_state == CURRENT_STATUS_POSITION_TIME) {
g_print("*** input position value(msec)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_LOOPING)
- {
+ } else if (g_menu_state == CURRENT_STATUS_LOOPING) {
g_print("*** input looping value.(0: Not Looping, 1: Looping) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_SURFACE_CHANGE) {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_SURFACE_CHANGE) {
g_print("*** input display surface type.(0: X surface, 1: EVAS surface) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_MODE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_MODE) {
g_print("*** input display mode value.(0: LETTER BOX, 1: ORIGIN SIZE, 2: FULL_SCREEN, 3: CROPPED_FULL, 4: ORIGIN_OR_LETTER, 5: ROI) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROTATION)
- {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROTATION) {
g_print("*** input display rotation value.(0: NONE, 1: 90, 2: 180, 3: 270, 4:F LIP_HORZ, 5: FLIP_VERT ) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_VISIBLE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_VISIBLE) {
g_print("*** input display visible value.(0: HIDE, 1: SHOW) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROI_MODE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROI_MODE) {
g_print("*** input display roi mode.(0: FULL_SCREEN, 1: LETTER BOX)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_DST_ROI)
- {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_DST_ROI) {
g_print("*** input display roi value sequentially.(x, y, w, h)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_DISPLAY_SRC_CROP)
- {
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_SRC_CROP) {
g_print("*** input display source crop value sequentially.(x, y, w, h)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_SUBTITLE_FILENAME)
- {
+ } else if (g_menu_state == CURRENT_STATUS_SUBTITLE_FILENAME) {
g_print(" *** input subtitle file path.\n");
- }
- else if (g_menu_state == CURRENT_STATUS_AUDIO_EQUALIZER)
- {
+ } else if (g_menu_state == CURRENT_STATUS_AUDIO_EQUALIZER) {
g_print(" *** input audio eq value.(0: UNSET, 1: SET) \n");
- }
- else if (g_menu_state == CURRENT_STATUS_PLAYBACK_RATE || g_menu_state == CURRENT_STATUS_STREAMING_PLAYBACK_RATE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_PLAYBACK_RATE || g_menu_state == CURRENT_STATUS_STREAMING_PLAYBACK_RATE) {
g_print(" *** input playback rate.(-5.0 ~ 5.0)\n");
- }
- else if (g_menu_state == CURRENT_STATUS_SWITCH_SUBTITLE)
- {
+ } else if (g_menu_state == CURRENT_STATUS_SWITCH_SUBTITLE) {
int count = 0, cur_index = 0;
int ret = 0;
- ret = player_get_track_count (g_player[0], PLAYER_STREAM_TYPE_TEXT, &count);
- if(ret!=PLAYER_ERROR_NONE)
- g_print ("player_get_track_count fail!!!!\n");
- else if (count)
- {
- g_print ("Total subtitle tracks = %d \n", count);
- player_get_current_track (g_player[0], PLAYER_STREAM_TYPE_TEXT, &cur_index);
- g_print ("Current index = %d \n", cur_index);
- g_print (" *** input correct index 0 to %d\n:", (count - 1));
- }
- else
+ ret = player_get_track_count(g_player[0], PLAYER_STREAM_TYPE_TEXT, &count);
+ if (ret != PLAYER_ERROR_NONE)
+ g_print("player_get_track_count fail!!!!\n");
+ else if (count) {
+ g_print("Total subtitle tracks = %d \n", count);
+ player_get_current_track(g_player[0], PLAYER_STREAM_TYPE_TEXT, &cur_index);
+ g_print("Current index = %d \n", cur_index);
+ g_print(" *** input correct index 0 to %d\n:", (count - 1));
+ } else
g_print("no track\n");
- }
- else
- {
+ } else {
g_print("*** unknown status.\n");
quit_program();
}
g_print(" >>> ");
}
-gboolean timeout_menu_display(void* data)
+gboolean timeout_menu_display(void *data)
{
displaymenu();
return FALSE;
}
-gboolean timeout_quit_program(void* data)
+gboolean timeout_quit_program(void *data)
{
quit_program();
return FALSE;
g_menu_state = CURRENT_STATUS_MAINMENU;
}
-static void interpret (char *cmd)
+static void interpret(char *cmd)
{
- switch (g_menu_state)
- {
- case CURRENT_STATUS_MAINMENU:
+ switch (g_menu_state) {
+ case CURRENT_STATUS_MAINMENU:
{
_interpret_main_menu(cmd);
}
break;
- case CURRENT_STATUS_HANDLE_NUM:
+ case CURRENT_STATUS_HANDLE_NUM:
{
int num_handle = atoi(cmd);
if (0 >= num_handle || num_handle > MAX_HANDLE)
- {
g_print("not supported this number for handles(%d)\n", num_handle);
- }
else
- {
g_handle_num = num_handle;
- }
+
reset_menu_state();
}
break;
- case CURRENT_STATUS_FILENAME:
+ case CURRENT_STATUS_FILENAME:
{
input_filename(cmd);
reset_menu_state();
}
break;
- case CURRENT_STATUS_VOLUME:
+ case CURRENT_STATUS_VOLUME:
{
float level = atof(cmd);
set_volume(level);
reset_menu_state();
}
break;
- case CURRENT_STATUS_SOUND_TYPE:
+ case CURRENT_STATUS_SOUND_TYPE:
{
int type = atoi(cmd);
set_sound_type(type);
reset_menu_state();
}
break;
- case CURRENT_STATUS_SOUND_STREAM_INFO:
+ case CURRENT_STATUS_SOUND_STREAM_INFO:
{
int type = atoi(cmd);
set_sound_stream_info(type);
reset_menu_state();
}
break;
- case CURRENT_STATUS_MUTE:
+ case CURRENT_STATUS_MUTE:
{
int mute = atoi(cmd);
set_mute(mute);
reset_menu_state();
}
break;
- case CURRENT_STATUS_POSITION_TIME:
+ case CURRENT_STATUS_POSITION_TIME:
{
long position = atol(cmd);
set_position(position);
reset_menu_state();
}
break;
- case CURRENT_STATUS_LOOPING:
+ case CURRENT_STATUS_LOOPING:
{
int looping = atoi(cmd);
set_looping(looping);
reset_menu_state();
}
break;
- case CURRENT_STATUS_DISPLAY_SURFACE_CHANGE:
+ case CURRENT_STATUS_DISPLAY_SURFACE_CHANGE:
{
int type = atoi(cmd);
change_surface(type);
reset_menu_state();
}
break;
- case CURRENT_STATUS_DISPLAY_MODE:
+ case CURRENT_STATUS_DISPLAY_MODE:
{
int mode = atoi(cmd);
set_display_mode(mode);
reset_menu_state();
}
break;
- case CURRENT_STATUS_DISPLAY_ROTATION:
+ case CURRENT_STATUS_DISPLAY_ROTATION:
{
int rotation = atoi(cmd);
set_display_rotation(rotation);
reset_menu_state();
}
break;
- case CURRENT_STATUS_DISPLAY_VISIBLE:
+ case CURRENT_STATUS_DISPLAY_VISIBLE:
{
int visible = atoi(cmd);
set_display_visible(visible);
reset_menu_state();
}
break;
- case CURRENT_STATUS_DISPLAY_DST_ROI:
+ case CURRENT_STATUS_DISPLAY_DST_ROI:
{
int value = atoi(cmd);
static int roi_x = 0;
}
}
break;
- case CURRENT_STATUS_DISPLAY_SRC_CROP:
+ case CURRENT_STATUS_DISPLAY_SRC_CROP:
{
int value = atoi(cmd);
static int crop_x = 0;
}
}
break;
- case CURRENT_STATUS_DISPLAY_ROI_MODE:
+ case CURRENT_STATUS_DISPLAY_ROI_MODE:
{
int value = atoi(cmd);
set_display_roi_mode(value);
reset_menu_state();
}
break;
- case CURRENT_STATUS_SUBTITLE_FILENAME:
+ case CURRENT_STATUS_SUBTITLE_FILENAME:
{
input_subtitle_filename(cmd);
reset_menu_state();
}
break;
- case CURRENT_STATUS_AUDIO_EQUALIZER:
+ case CURRENT_STATUS_AUDIO_EQUALIZER:
{
int value = atoi(cmd);
set_audio_eq(value);
reset_menu_state();
}
break;
- case CURRENT_STATUS_PLAYBACK_RATE:
+ case CURRENT_STATUS_PLAYBACK_RATE:
{
float rate = atof(cmd);
set_playback_rate(rate, FALSE);
reset_menu_state();
}
break;
- case CURRENT_STATUS_STREAMING_PLAYBACK_RATE:
+ case CURRENT_STATUS_STREAMING_PLAYBACK_RATE:
{
float rate = atof(cmd);
set_playback_rate(rate, TRUE);
reset_menu_state();
}
break;
- case CURRENT_STATUS_SWITCH_SUBTITLE:
+ case CURRENT_STATUS_SWITCH_SUBTITLE:
{
int index = atoi(cmd);
switch_subtitle(index);
reset_menu_state();
}
break;
- }
+ }
g_timeout_add(100, timeout_menu_display, 0);
}
-gboolean input (GIOChannel *channel)
+gboolean input(GIOChannel *channel)
{
- gchar buf[MAX_STRING_LEN];
- gsize read;
- GError *error = NULL;
+ gchar buf[MAX_STRING_LEN];
+ gsize read;
+ GError *error = NULL;
- g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error);
- buf[read] = '\0';
- g_strstrip(buf);
- interpret (buf);
+ g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error);
+ buf[read] = '\0';
+ g_strstrip(buf);
+ interpret(buf);
- return TRUE;
+ return TRUE;
}
int main(int argc, char *argv[])
{
GIOChannel *stdin_channel;
stdin_channel = g_io_channel_unix_new(0);
- g_io_channel_set_flags (stdin_channel, G_IO_FLAG_NONBLOCK, NULL);
+ g_io_channel_set_flags(stdin_channel, G_IO_FLAG_NONBLOCK, NULL);
g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)input, NULL);
displaymenu();
#define MUSE_PLAYER_HEAD_GAP(api) ((api)/(1000)+(1))*(1000)
- typedef enum {
- MUSE_PLAYER_API_CREATE = API_CREATE,
- MUSE_PLAYER_API_DESTROY = API_DESTROY,
- MUSE_PLAYER_API_PREPARE,
- MUSE_PLAYER_API_PREPARE_ASYNC,
- MUSE_PLAYER_API_UNPREPARE,
- MUSE_PLAYER_API_SET_URI,
- MUSE_PLAYER_API_START,
- MUSE_PLAYER_API_STOP,
- MUSE_PLAYER_API_PAUSE,
- MUSE_PLAYER_API_SET_MEMORY_BUFFER,
- MUSE_PLAYER_API_DEINIT_MEMORY_BUFFER,
- MUSE_PLAYER_API_GET_STATE,
- MUSE_PLAYER_API_SET_VOLUME,
- MUSE_PLAYER_API_GET_VOLUME,
- MUSE_PLAYER_API_SET_SOUND_TYPE,
- MUSE_PLAYER_API_SET_AUDIO_POLICY_INFO,
- MUSE_PLAYER_API_SET_AUDIO_LATENCY_MODE,
- MUSE_PLAYER_API_GET_AUDIO_LATENCY_MODE,
- MUSE_PLAYER_API_SET_PLAY_POSITION,
- MUSE_PLAYER_API_GET_PLAY_POSITION,
- MUSE_PLAYER_API_SET_MUTE,
- MUSE_PLAYER_API_IS_MUTED,
- MUSE_PLAYER_API_SET_LOOPING,
- MUSE_PLAYER_API_IS_LOOPING,
- MUSE_PLAYER_API_GET_DURATION,
- MUSE_PLAYER_API_SET_DISPLAY,
- MUSE_PLAYER_API_SET_DISPLAY_MODE,
- MUSE_PLAYER_API_GET_DISPLAY_MODE,
- MUSE_PLAYER_API_SET_PLAYBACK_RATE,
- MUSE_PLAYER_API_SET_DISPLAY_ROTATION,
- MUSE_PLAYER_API_GET_DISPLAY_ROTATION,
- MUSE_PLAYER_API_SET_DISPLAY_VISIBLE,
- MUSE_PLAYER_API_IS_DISPLAY_VISIBLE,
- MUSE_PLAYER_API_GET_CONTENT_INFO,
- MUSE_PLAYER_API_GET_CODEC_INFO,
- MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO,
- MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO,
- MUSE_PLAYER_API_GET_VIDEO_SIZE,
- MUSE_PLAYER_API_GET_ALBUM_ART,
- MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BANDS_COUNT,
- MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_ALL_BANDS,
- MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_BAND_LEVEL,
- MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_LEVEL,
- MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE,
- MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY,
- MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY_RANGE,
- MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_CLEAR,
- MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_IS_AVAILABLE,
- MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH,
- MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS,
- MUSE_PLAYER_API_CAPTURE_VIDEO,
- MUSE_PLAYER_API_SET_STREAMING_COOKIE,
- MUSE_PLAYER_API_SET_STREAMING_USER_AGENT,
- MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS,
- MUSE_PLAYER_API_SET_SUBTITLE_PATH,
- MUSE_PLAYER_API_SET_SUBTITLE_POSITION_OFFSET,
- MUSE_PLAYER_API_PUSH_MEDIA_STREAM,
- MUSE_PLAYER_API_SET_MEDIA_STREAM_INFO,
- MUSE_PLAYER_API_SET_CALLBACK,
- MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB,
- MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE,
- MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE,
- MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD,
- MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD,
- MUSE_PLAYER_API_GET_TRACK_COUNT,
- MUSE_PLAYER_API_GET_CURRENT_TRACK,
- MUSE_PLAYER_API_SELECT_TRACK,
- MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE,
- MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE,
- MUSE_PLAYER_API_SET_PCM_SPEC,
- MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE,
- MUSE_PLAYER_API_MAX
- } muse_player_api_e;
+typedef enum {
+ MUSE_PLAYER_API_CREATE = API_CREATE,
+ MUSE_PLAYER_API_DESTROY = API_DESTROY,
+ MUSE_PLAYER_API_PREPARE,
+ MUSE_PLAYER_API_PREPARE_ASYNC,
+ MUSE_PLAYER_API_UNPREPARE,
+ MUSE_PLAYER_API_SET_URI,
+ MUSE_PLAYER_API_START,
+ MUSE_PLAYER_API_STOP,
+ MUSE_PLAYER_API_PAUSE,
+ MUSE_PLAYER_API_SET_MEMORY_BUFFER,
+ MUSE_PLAYER_API_DEINIT_MEMORY_BUFFER,
+ MUSE_PLAYER_API_GET_STATE,
+ MUSE_PLAYER_API_SET_VOLUME,
+ MUSE_PLAYER_API_GET_VOLUME,
+ MUSE_PLAYER_API_SET_SOUND_TYPE,
+ MUSE_PLAYER_API_SET_AUDIO_POLICY_INFO,
+ MUSE_PLAYER_API_SET_AUDIO_LATENCY_MODE,
+ MUSE_PLAYER_API_GET_AUDIO_LATENCY_MODE,
+ MUSE_PLAYER_API_SET_PLAY_POSITION,
+ MUSE_PLAYER_API_GET_PLAY_POSITION,
+ MUSE_PLAYER_API_SET_MUTE,
+ MUSE_PLAYER_API_IS_MUTED,
+ MUSE_PLAYER_API_SET_LOOPING,
+ MUSE_PLAYER_API_IS_LOOPING,
+ MUSE_PLAYER_API_GET_DURATION,
+ MUSE_PLAYER_API_SET_DISPLAY,
+ MUSE_PLAYER_API_SET_DISPLAY_MODE,
+ MUSE_PLAYER_API_GET_DISPLAY_MODE,
+ MUSE_PLAYER_API_SET_PLAYBACK_RATE,
+ MUSE_PLAYER_API_SET_DISPLAY_ROTATION,
+ MUSE_PLAYER_API_GET_DISPLAY_ROTATION,
+ MUSE_PLAYER_API_SET_DISPLAY_VISIBLE,
+ MUSE_PLAYER_API_IS_DISPLAY_VISIBLE,
+ MUSE_PLAYER_API_GET_CONTENT_INFO,
+ MUSE_PLAYER_API_GET_CODEC_INFO,
+ MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO,
+ MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO,
+ MUSE_PLAYER_API_GET_VIDEO_SIZE,
+ MUSE_PLAYER_API_GET_ALBUM_ART,
+ MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BANDS_COUNT,
+ MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_ALL_BANDS,
+ MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_BAND_LEVEL,
+ MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_LEVEL,
+ MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE,
+ MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY,
+ MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY_RANGE,
+ MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_CLEAR,
+ MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_IS_AVAILABLE,
+ MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH,
+ MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS,
+ MUSE_PLAYER_API_CAPTURE_VIDEO,
+ MUSE_PLAYER_API_SET_STREAMING_COOKIE,
+ MUSE_PLAYER_API_SET_STREAMING_USER_AGENT,
+ MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS,
+ MUSE_PLAYER_API_SET_SUBTITLE_PATH,
+ MUSE_PLAYER_API_SET_SUBTITLE_POSITION_OFFSET,
+ MUSE_PLAYER_API_PUSH_MEDIA_STREAM,
+ MUSE_PLAYER_API_SET_MEDIA_STREAM_INFO,
+ MUSE_PLAYER_API_SET_CALLBACK,
+ MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB,
+ MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE,
+ MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE,
+ MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD,
+ MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD,
+ MUSE_PLAYER_API_GET_TRACK_COUNT,
+ MUSE_PLAYER_API_GET_CURRENT_TRACK,
+ MUSE_PLAYER_API_SELECT_TRACK,
+ MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE,
+ MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE,
+ MUSE_PLAYER_API_SET_PCM_SPEC,
+ MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE,
+ MUSE_PLAYER_API_MAX
+} muse_player_api_e;
- typedef enum {
- MUSE_PLAYER_CB_EVENT = MUSE_PLAYER_HEAD_GAP(MUSE_PLAYER_API_MAX),
- MUSE_PLAYER_CB_MAX
- } muse_player_cb_e;
+typedef enum {
+ MUSE_PLAYER_CB_EVENT = MUSE_PLAYER_HEAD_GAP(MUSE_PLAYER_API_MAX),
+ MUSE_PLAYER_CB_MAX
+} muse_player_cb_e;
typedef enum {
_PLAYER_EVENT_TYPE_PREPARE,
_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED,
_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED,
_PLAYER_EVENT_TYPE_NUM
-}_player_event_e;
+} _player_event_e;
#ifndef USE_ECORE_FUNCTIONS
typedef enum {
PLAYER_MESSAGE_EOS,
PLAYER_MESSAGE_LOOP_EXIT,
PLAYER_MESSAGE_MAX
-}_player_message_e;
+} _player_message_e;
#endif
-typedef struct _player_s{
+typedef struct _player_s {
MMHandleType mm_handle;
const void* user_cb[_PLAYER_EVENT_TYPE_NUM];
void* user_data[_PLAYER_EVENT_TYPE_NUM];
player_error_e error_code;
bool is_doing_jobs;
media_format_h pkt_fmt;
-}player_s;
+} player_s;
typedef struct _ret_msg_s{
gint api;
gchar *msg;
struct _ret_msg_s *next;
-}ret_msg_s;
+} ret_msg_s;
typedef struct {
gint bufLen;
gchar *recvMsg;
gint recved;
ret_msg_s *retMsgHead;
-}msg_buff_s;
+} msg_buff_s;
typedef struct _player_data{
void *data;
struct _player_data *next;
-}player_data_s;
+} player_data_s;
typedef struct {
GThread *thread;
intptr_t bo;
gboolean is_streaming;
gint timeout;
-}server_info_s;
+} server_info_s;
typedef struct _player_cli_s{
callback_cb_info_s *cb_info;
player_data_s *head;
server_info_s server;
-}player_cli_s;
+} player_cli_s;
/* Internal handle */
#define INT_HANDLE(h) ((h)->cb_info->local_handle)
#define SERVER_TIMEOUT(h) ((h)->server.timeout)
int _get_api_timeout(player_cli_s *pc, muse_player_api_e api);
-int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info,
- char **ret_buf, int time_out);
+int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out);
int player_sound_register(player_h player, int pid);
int player_is_streaming(player_h player, bool *is_streaming);
Name: capi-media-player
Summary: A Media Daemon player library in Tizen Native API
-Version: 0.3.2
+Version: 0.3.3
Release: 0
Group: Multimedia/API
License: Apache-2.0
handle = muse_core_ipc_get_handle(module);
- ret = player_get_state((player_h) handle, &state);
+ ret = player_get_state((player_h)handle, &state);
- if(ret != PLAYER_ERROR_NONE)
+ if (ret != PLAYER_ERROR_NONE)
return ret;
- switch(state) {
+ switch (state) {
case PLAYER_STATE_PLAYING:
- player_stop((player_h) handle);
+ player_stop((player_h)handle);
/* FALLTHROUGH */
case PLAYER_STATE_PAUSED:
case PLAYER_STATE_READY:
- player_unprepare((player_h) handle);
+ player_unprepare((player_h)handle);
/* FALLTHROUGH */
case PLAYER_STATE_IDLE:
- player_destroy((player_h) handle);
+ player_destroy((player_h)handle);
break;
default:
return PLAYER_ERROR_NONE;
}
-int (*cmd_dispatcher[MUSE_MODULE_EVENT_MAX]) (muse_module_h module) = {
- player_cmd_shutdown, /* MUSE_MODULE_EVENT_SHUTDOWN */
- NULL, /* MUSE_MODULE_EVENT_DEBUG_INFO_DUMP */
+int (*cmd_dispatcher[MUSE_MODULE_EVENT_MAX])(muse_module_h module) = {
+ player_cmd_shutdown, /* MUSE_MODULE_EVENT_SHUTDOWN */
+ NULL, /* MUSE_MODULE_EVENT_DEBUG_INFO_DUMP */
};
GMutex mutex;
GCond cond;
gint running;
-}data_thread_info_t;
+} data_thread_info_t;
typedef struct {
intptr_t handle;
uint64_t size;
media_format_mimetype_e mimetype;
media_buffer_flags_e flags;
-}push_data_q_t;
+} push_data_q_t;
typedef struct {
player_h player;
muse_module_h module;
-}prepare_data_t;
+} prepare_data_t;
/*
* define for lagacy API for mused
*/
#ifdef HAVE_WAYLAND
-extern int player_set_display_wl_for_mused(player_h player, player_display_type_e type, intptr_t surface,
- int x, int y, int w, int h);
+extern int player_set_display_wl_for_mused(player_h player, player_display_type_e type, intptr_t surface, int x, int y, int w, int h);
#else
extern int player_set_display_for_mused(player_h player, player_display_type_e type, unsigned int xhandle);
#endif
-extern int player_set_audio_policy_info_for_mused(player_h player,
- char *stream_type, int stream_index);
+extern int player_set_audio_policy_info_for_mused(player_h player, char *stream_type, int stream_index);
-int player_set_shm_stream_path_for_mused (player_h player, const char *stream_path);
+int player_set_shm_stream_path_for_mused(player_h player, const char *stream_path);
int player_get_raw_video_caps(player_h player, char **caps);
/*
* Internal Implementation
player_h player;
char *caps = NULL;
- if(!prepare_data) {
+ if (!prepare_data) {
LOGE("user data of callback is NULL");
return;
}
player = prepare_data->player;
g_free(prepare_data);
- if(player_get_raw_video_caps(player, &caps) == PLAYER_ERROR_NONE) {
- if(caps) {
+ if (player_get_raw_video_caps(player, &caps) == PLAYER_ERROR_NONE) {
+ if (caps) {
player_msg_event1(api, ev, module, STRING, caps);
g_free(caps);
return;
player_msg_event2(api, ev, module, INT, duration, STRING, text);
}
-static void _capture_video_cb(unsigned char *data, int width, int height,
- unsigned int size, void *user_data)
+static void _capture_video_cb(unsigned char *data, int width, int height, unsigned int size, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_CAPTURE;
LOGD("ENTER");
- bo = tbm_bo_alloc (bufmgr, size+1, TBM_BO_DEFAULT);
- if(!bo) {
+ bo = tbm_bo_alloc(bufmgr, size + 1, TBM_BO_DEFAULT);
+ if (!bo) {
LOGE("TBM get error : tbm_bo_alloc return NULL");
return;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
goto capture_event_exit1;
}
memcpy(thandle.ptr, data, size);
key = tbm_bo_export(bo);
- if(key == 0)
- {
+ if (key == 0) {
LOGE("TBM get error : export key is 0");
checker = 0;
goto capture_event_exit2;
}
/* mark to write */
- *((char *)thandle.ptr+size) = 1;
+ *((char *)thandle.ptr + size) = 1;
- player_msg_event4(api, ev, module, INT, width, INT, height,
- INT, size, INT, key);
+ player_msg_event4(api, ev, module, INT, width, INT, height, INT, size, INT, key);
capture_event_exit2:
tbm_bo_unmap(bo);
- while(checker && expired--) {
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
- checker = *((char *)thandle.ptr+size);
+ while (checker && expired--) {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
+ checker = *((char *)thandle.ptr + size);
tbm_bo_unmap(bo);
}
tbm_surface_h suf;
tbm_bo bo[4];
int bo_num;
- tbm_key key[4] = {0,};
+ tbm_key key[4] = {0, };
tbm_surface_info_s sinfo;
int i;
char *surface_info = (char *)&sinfo;
memset(&sinfo, 0, sizeof(tbm_surface_info_s));
ret = media_packet_get_tbm_surface(pkt, &suf);
- if(ret != MEDIA_PACKET_ERROR_NONE){
+ if (ret != MEDIA_PACKET_ERROR_NONE) {
LOGE("get tbm surface error %d", ret);
return;
}
bo_num = tbm_surface_internal_get_num_bos(suf);
- for(i = 0; i < bo_num; i++) {
+ for (i = 0; i < bo_num; i++) {
bo[i] = tbm_surface_internal_get_bo(suf, i);
- if(bo[i])
+ if (bo[i])
key[i] = tbm_bo_export(bo[i]);
else
LOGE("bo_num is %d, bo[%d] is NULL", bo_num, i);
- };
+ }
ret = tbm_surface_get_info(suf, &sinfo);
- if(ret != TBM_SURFACE_ERROR_NONE){
+ if (ret != TBM_SURFACE_ERROR_NONE) {
LOGE("tbm_surface_get_info error %d", ret);
return;
}
media_packet_get_format(pkt, &fmt);
media_format_get_video_info(fmt, &mimetype, NULL, NULL, NULL, NULL);
- player_msg_event6_array(api, ev, module,
- INT, key[0],
- INT, key[1],
- INT, key[2],
- INT, key[3],
- POINTER, packet,
- INT, mimetype,
- surface_info, surface_info_size, sizeof(char));
+ player_msg_event6_array(api, ev, module, INT, key[0], INT, key[1], INT, key[2], INT, key[3], POINTER, packet, INT, mimetype, surface_info, surface_info_size, sizeof(char));
}
-static void _audio_frame_decoded_cb(player_audio_raw_data_s *audio_frame, void *user_data)
+static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_AUDIO_FRAME;
unsigned int expired = 0x0fffffff;
int size = 0;
void *data = NULL;
- if(audio_frame) {
+ if (audio_frame) {
size = audio_frame->size;
data = audio_frame->data;
} else {
LOGD("ENTER");
- bo = tbm_bo_alloc (bufmgr, size+1, TBM_BO_DEFAULT);
- if(!bo) {
+ bo = tbm_bo_alloc(bufmgr, size + 1, TBM_BO_DEFAULT);
+ if (!bo) {
LOGE("TBM get error : tbm_bo_alloc return NULL");
return;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
tbm_bo_unref(bo);
return;
}
memcpy(thandle.ptr, data, size);
key = tbm_bo_export(bo);
- if(key == 0)
- {
+ if (key == 0) {
LOGE("TBM get error : export key is 0");
checker = 0;
tbm_bo_unmap(bo);
return;
}
/* mark to write */
- *((char *)thandle.ptr+size) = 1;
+ *((char *)thandle.ptr + size) = 1;
tbm_bo_unmap(bo);
- player_msg_event2_array(api, ev, module, INT, key, INT, size,
- audio_frame, sizeof(player_audio_raw_data_s), sizeof(char));
+ player_msg_event2_array(api, ev, module, INT, key, INT, size, audio_frame, sizeof(player_audio_raw_data_s), sizeof(char));
- while(checker && expired--) {
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
- checker = *((char *)thandle.ptr+size);
+ while (checker && expired--) {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
+ checker = *((char *)thandle.ptr + size);
tbm_bo_unmap(bo);
}
tbm_bo_unref(bo);
}
-
-static void _video_stream_changed_cb(
- int width, int height, int fps, int bit_rate, void *user_data)
+static void _video_stream_changed_cb(int width, int height, int fps, int bit_rate, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED;
muse_module_h module = (muse_module_h)user_data;
- player_msg_event4(api, ev, module,
- INT, width, INT, height, INT, fps, INT, bit_rate);
+ player_msg_event4(api, ev, module, INT, width, INT, height, INT, fps, INT, bit_rate);
}
-static void _media_stream_audio_buffer_status_cb(
- player_media_stream_buffer_status_e status, void *user_data)
+static void _media_stream_audio_buffer_status_cb(player_media_stream_buffer_status_e status, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS;
player_msg_event1(api, ev, module, INT, status);
}
-static void _media_stream_video_buffer_status_cb(
- player_media_stream_buffer_status_e status, void *user_data)
+static void _media_stream_video_buffer_status_cb(player_media_stream_buffer_status_e status, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS;
player_msg_event1(api, ev, module, INT, status);
}
-static void _media_stream_audio_seek_cb(
- unsigned long long offset, void *user_data)
+static void _media_stream_audio_seek_cb(unsigned long long offset, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK;
muse_module_h module = (muse_module_h)user_data;
- player_msg_event1(api, ev, module,
- INT64, offset);
+ player_msg_event1(api, ev, module, INT64, offset);
}
-static void _media_stream_video_seek_cb(
- unsigned long long offset, void *user_data)
+static void _media_stream_video_seek_cb(unsigned long long offset, void *user_data)
{
muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
_player_event_e ev = _PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK;
muse_module_h module = (muse_module_h)user_data;
- player_msg_event1(api, ev, module,
- INT64, offset);
+ player_msg_event1(api, ev, module, INT64, offset);
}
static void _set_completed_cb(player_h player, void *module, bool set)
{
- if(set)
+ if (set)
player_set_completed_cb(player, _completed_cb, module);
else
player_unset_completed_cb(player);
static void _set_interrupted_cb(player_h player, void *module, bool set)
{
- if(set)
+ if (set)
player_set_interrupted_cb(player, _interrupted_cb, module);
else
player_unset_interrupted_cb(player);
static void _set_error_cb(player_h player, void *module, bool set)
{
- if(set)
+ if (set)
player_set_error_cb(player, _error_cb, module);
else
player_unset_error_cb(player);
static void _set_subtitle_cb(player_h player, void *module, bool set)
{
- if(set)
+ if (set)
player_set_subtitle_updated_cb(player, _subtitle_updated_cb, module);
else
player_unset_subtitle_updated_cb(player);
static void _set_buffering_cb(player_h player, void *module, bool set)
{
- if(set)
+ if (set)
player_set_buffering_cb(player, _buffering_cb, module);
else
player_unset_buffering_cb(player);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
- if(set)
+ if (set)
ret = player_set_progressive_download_message_cb(player, _pd_msg_cb, module);
else
ret = player_unset_progressive_download_message_cb(player);
player_msg_return(api, ret, module);
}
-static void _set_media_packet_video_frame_cb(player_h player,
- void *data, bool set)
+static void _set_media_packet_video_frame_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
muse_module_h module = (muse_module_h)data;
- if(set){
- ret = player_set_media_packet_video_frame_decoded_cb(
- player, _media_packet_video_decoded_cb, module);
- } else {
+ if (set)
+ ret = player_set_media_packet_video_frame_decoded_cb(player, _media_packet_video_decoded_cb, module);
+ else
ret = player_unset_media_packet_video_frame_decoded_cb(player);
- }
player_msg_return(api, ret, module);
}
-static void _set_video_stream_changed_cb(player_h player,
- void *data, bool set)
+static void _set_video_stream_changed_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
muse_module_h module = (muse_module_h)data;
- if(set){
- ret = player_set_video_stream_changed_cb(
- player, _video_stream_changed_cb, module);
- } else {
+ if (set)
+ ret = player_set_video_stream_changed_cb(player, _video_stream_changed_cb, module);
+ else
ret = player_unset_video_stream_changed_cb(player);
- }
player_msg_return(api, ret, module);
}
-static void _set_media_stream_audio_seek_cb(player_h player,
- void *data, bool set)
+static void _set_media_stream_audio_seek_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
muse_module_h module = (muse_module_h)data;
- if(set){
- ret = player_set_media_stream_seek_cb(
- player, PLAYER_STREAM_TYPE_AUDIO,
- _media_stream_audio_seek_cb, module);
- } else {
- ret = player_unset_media_stream_seek_cb(
- player, PLAYER_STREAM_TYPE_AUDIO);
- }
+ if (set)
+ ret = player_set_media_stream_seek_cb(player, PLAYER_STREAM_TYPE_AUDIO, _media_stream_audio_seek_cb, module);
+ else
+ ret = player_unset_media_stream_seek_cb(player, PLAYER_STREAM_TYPE_AUDIO);
player_msg_return(api, ret, module);
}
-static void _set_media_stream_video_seek_cb(player_h player,
- void *data, bool set)
+static void _set_media_stream_video_seek_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
muse_module_h module = (muse_module_h)data;
- if(set){
- ret = player_set_media_stream_seek_cb(
- player, PLAYER_STREAM_TYPE_VIDEO,
- _media_stream_video_seek_cb, module);
- } else {
- ret = player_unset_media_stream_seek_cb(
- player, PLAYER_STREAM_TYPE_VIDEO);
- }
+ if (set)
+ ret = player_set_media_stream_seek_cb(player, PLAYER_STREAM_TYPE_VIDEO, _media_stream_video_seek_cb, module);
+ else
+ ret = player_unset_media_stream_seek_cb(player, PLAYER_STREAM_TYPE_VIDEO);
player_msg_return(api, ret, module);
}
-static void _set_media_stream_audio_buffer_cb(player_h player,
- void *data, bool set)
+static void _set_media_stream_audio_buffer_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
muse_module_h module = (muse_module_h)data;
- if(set){
- ret = player_set_media_stream_buffer_status_cb(
- player, PLAYER_STREAM_TYPE_AUDIO,
- _media_stream_audio_buffer_status_cb, module);
- } else {
- ret = player_unset_media_stream_buffer_status_cb(
- player, PLAYER_STREAM_TYPE_AUDIO);
- }
+ if (set)
+ ret = player_set_media_stream_buffer_status_cb(player, PLAYER_STREAM_TYPE_AUDIO, _media_stream_audio_buffer_status_cb, module);
+ else
+ ret = player_unset_media_stream_buffer_status_cb(player, PLAYER_STREAM_TYPE_AUDIO);
player_msg_return(api, ret, module);
}
-static void _set_media_stream_video_buffer_cb(player_h player,
- void *data, bool set)
+static void _set_media_stream_video_buffer_cb(player_h player, void *data, bool set)
{
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK;
muse_module_h module = (muse_module_h)data;
- if(set){
- ret = player_set_media_stream_buffer_status_cb(
- player, PLAYER_STREAM_TYPE_VIDEO,
- _media_stream_video_buffer_status_cb, module);
- } else {
- ret = player_unset_media_stream_buffer_status_cb(
- player, PLAYER_STREAM_TYPE_VIDEO);
- }
+ if (set)
+ ret = player_set_media_stream_buffer_status_cb(player, PLAYER_STREAM_TYPE_VIDEO, _media_stream_video_buffer_status_cb, module);
+ else
+ ret = player_unset_media_stream_buffer_status_cb(player, PLAYER_STREAM_TYPE_VIDEO);
player_msg_return(api, ret, module);
}
-static void (*set_callback_func[_PLAYER_EVENT_TYPE_NUM])
- (player_h player, void *user_data, bool set) = {
- NULL, /* _PLAYER_EVENT_TYPE_PREPARE */
- _set_completed_cb, /* _PLAYER_EVENT_TYPE_COMPLETE */
- _set_interrupted_cb, /* _PLAYER_EVENT_TYPE_INTERRUPT */
- _set_error_cb, /* _PLAYER_EVENT_TYPE_ERROR */
- _set_buffering_cb, /* _PLAYER_EVENT_TYPE_BUFFERING */
- _set_subtitle_cb, /* _PLAYER_EVENT_TYPE_SUBTITLE */
- NULL, /* _PLAYER_EVENT_TYPE_CAPTURE */
- NULL, /* _PLAYER_EVENT_TYPE_SEEK */
- _set_media_packet_video_frame_cb, /* _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME */
- NULL, /* _PLAYER_EVENT_TYPE_AUDIO_FRAME */
- NULL, /* _PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR */
- _set_pd_msg_cb, /* _PLAYER_EVENT_TYPE_PD */
- NULL, /* _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT */
- NULL, /* _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET */
- NULL, /* _PLAYER_EVENT_TYPE_MISSED_PLUGIN */
+static void (*set_callback_func[_PLAYER_EVENT_TYPE_NUM])(player_h player, void *user_data, bool set) = {
+ NULL, /* _PLAYER_EVENT_TYPE_PREPARE */
+ _set_completed_cb, /* _PLAYER_EVENT_TYPE_COMPLETE */
+ _set_interrupted_cb, /* _PLAYER_EVENT_TYPE_INTERRUPT */
+ _set_error_cb, /* _PLAYER_EVENT_TYPE_ERROR */
+ _set_buffering_cb, /* _PLAYER_EVENT_TYPE_BUFFERING */
+ _set_subtitle_cb, /* _PLAYER_EVENT_TYPE_SUBTITLE */
+ NULL, /* _PLAYER_EVENT_TYPE_CAPTURE */
+ NULL, /* _PLAYER_EVENT_TYPE_SEEK */
+ _set_media_packet_video_frame_cb, /* _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME */
+ NULL, /* _PLAYER_EVENT_TYPE_AUDIO_FRAME */
+ NULL, /* _PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR */
+ _set_pd_msg_cb, /* _PLAYER_EVENT_TYPE_PD */
+ NULL, /* _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT */
+ NULL, /* _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET */
+ NULL, /* _PLAYER_EVENT_TYPE_MISSED_PLUGIN */
#ifdef _PLAYER_FOR_PRODUCT
- NULL, /* _PLAYER_EVENT_TYPE_IMAGE_BUFFER */
- NULL, /*_PLAYER_EVENT_TYPE_SELECTED_SUBTITLE_LANGUAGE */
+ NULL, /* _PLAYER_EVENT_TYPE_IMAGE_BUFFER */
+ NULL, /*_PLAYER_EVENT_TYPE_SELECTED_SUBTITLE_LANGUAGE */
#endif
_set_media_stream_video_buffer_cb, /*_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS*/
_set_media_stream_audio_buffer_cb, /*_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS*/
_set_media_stream_video_seek_cb, /*_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK*/
_set_media_stream_audio_seek_cb, /*_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK*/
- NULL, /*_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED*/
- _set_video_stream_changed_cb, /*_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED*/
- NULL, /*_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED*/
+ NULL, /*_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED*/
+ _set_video_stream_changed_cb, /*_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED*/
+ NULL, /*_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED*/
};
static int player_disp_set_callback(muse_module_h module)
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(set, muse_core_client_get_msg(module));
- if(type < _PLAYER_EVENT_TYPE_NUM && set_callback_func[type] != NULL){
- set_callback_func[type]((player_h)handle, module, set);
- }
+ if (type < _PLAYER_EVENT_TYPE_NUM && set_callback_func[type] != NULL)
+ set_callback_func[type] ((player_h)handle, module, set);
return PLAYER_ERROR_NONE;
}
player_msg_get(pid, muse_core_client_get_msg(module));
- if(ret == PLAYER_ERROR_NONE)
+ if (ret == PLAYER_ERROR_NONE)
ret = player_sound_register(player, pid);
else
player_msg_return(api, ret, module);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
handle = (intptr_t)player;
muse_core_ipc_set_handle(module, handle);
thread_i = g_new(data_thread_info_t, 1);
g_mutex_init(&thread_i->mutex);
g_cond_init(&thread_i->cond);
thread_i->queue = g_queue_new();
- thread_i->thread = (gpointer) g_thread_new("push_media",
- _player_push_media_stream_handler, module);
+ thread_i->thread = (gpointer)g_thread_new("push_media", _player_push_media_stream_handler, module);
muse_core_client_set_cust_data(module, thread_i);
unlink(stream_path);
ret = player_set_shm_stream_path_for_mused(player, stream_path);
- player_msg_return2(api, ret, module,
- POINTER, module_addr, STRING, stream_path);
- }
- else
+ player_msg_return2(api, ret, module, POINTER, module_addr, STRING, stream_path);
+ } else
player_msg_return(api, ret, module);
return ret;
handle = muse_core_ipc_get_handle(module);
player_msg_get_string(uri, muse_core_client_get_msg(module));
- ret = player_set_uri((player_h) handle, uri);
+ ret = player_set_uri((player_h)handle, uri);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- player = (player_h) handle;
+ player = (player_h)handle;
ret = player_prepare(player);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
player_is_streaming(player, &is_streaming);
ret = player_get_raw_video_caps(player, &caps);
- if(ret == PLAYER_ERROR_NONE && caps) {
+ if (ret == PLAYER_ERROR_NONE && caps) {
player_msg_return2(api, ret, module, STRING, caps, INT, is_streaming);
g_free(caps);
} else
handle = muse_core_ipc_get_handle(module);
- player = (player_h) handle;
+ player = (player_h)handle;
prepare_data = g_new(prepare_data_t, 1);
prepare_data->player = player;
prepare_data->module = module;
ret = player_prepare_async(player, _prepare_async_cb, prepare_data);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
player_is_streaming(player, &is_streaming);
player_msg_return1(api, ret, module, INT, is_streaming);
return ret;
player_h player;
handle = muse_core_ipc_get_handle(module);
- player = (player_h) handle;
+ player = (player_h)handle;
ret = player_unprepare(player);
handle = muse_core_ipc_get_handle(module);
- ret = player_destroy((player_h) handle);
+ ret = player_destroy((player_h)handle);
thread_i = (data_thread_info_t *)muse_core_client_get_cust_data(module);
thread_i->running = 0;
g_free(thread_i);
muse_core_client_set_cust_data(module, NULL);
- if(audio_format) {
+ if (audio_format) {
media_format_unref(audio_format);
audio_format = NULL;
}
- if(video_format) {
+ if (video_format) {
media_format_unref(video_format);
video_format = NULL;
}
handle = muse_core_ipc_get_handle(module);
- ret = player_start((player_h) handle);
+ ret = player_start((player_h)handle);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_stop((player_h) handle);
+ ret = player_stop((player_h)handle);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_pause((player_h) handle);
+ ret = player_pause((player_h)handle);
player_msg_return(api, ret, module);
player_msg_get(size, muse_core_client_get_msg(module));
bo = tbm_bo_import(bufmgr, key);
- if(bo == NULL) {
+ if (bo == NULL) {
LOGE("TBM get error : bo is NULL");
ret = PLAYER_ERROR_INVALID_OPERATION;
player_msg_return(api, ret, module);
return ret;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
ret = PLAYER_ERROR_INVALID_OPERATION;
player_msg_return(api, ret, module);
}
bo_addr = (intptr_t)bo;
- ret = player_set_memory_buffer((player_h) handle, thandle.ptr, size);
+ ret = player_set_memory_buffer((player_h)handle, thandle.ptr, size);
player_msg_return1(api, ret, module, INT, bo_addr);
return ret;
intptr_t bo_addr;
tbm_bo bo;
- if(player_msg_get(bo_addr, muse_core_client_get_msg(module))) {
+ if (player_msg_get(bo_addr, muse_core_client_get_msg(module))) {
- bo = (tbm_bo)bo_addr;
+ bo = (tbm_bo) bo_addr;
tbm_bo_unmap(bo);
tbm_bo_unref(bo);
player_msg_get_type(left, muse_core_client_get_msg(module), DOUBLE);
player_msg_get_type(right, muse_core_client_get_msg(module), DOUBLE);
- ret = player_set_volume((player_h) handle, (float)left, (float)right);
+ ret = player_set_volume((player_h)handle, (float)left, (float)right);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_volume((player_h) handle, &left, &right);
+ ret = player_get_volume((player_h)handle, &left, &right);
player_msg_return2(api, ret, module, DOUBLE, left, DOUBLE, right);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_state((player_h) handle, &state);
+ ret = player_get_state((player_h)handle, &state);
player_msg_return1(api, ret, module, INT, state);
return ret;
}
-
static int player_disp_set_play_position(muse_module_h module)
{
int ret = -1;
player_msg_get(pos, muse_core_client_get_msg(module));
player_msg_get(accurate, muse_core_client_get_msg(module));
- ret = player_set_play_position((player_h) handle, pos, accurate, _seek_complate_cb ,module);
+ ret = player_set_play_position((player_h)handle, pos, accurate, _seek_complate_cb, module);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_play_position((player_h) handle, &pos);
+ ret = player_get_play_position((player_h)handle, &pos);
player_msg_return1(api, ret, module, INT, pos);
#ifdef HAVE_WAYLAND
player_msg_get_array(wl_win_msg, muse_core_client_get_msg(module));
- ret = player_set_display_wl_for_mused((player_h) handle, wl_win.type, wl_win.surface,
- wl_win.wl_window_x, wl_win.wl_window_y, wl_win.wl_window_width, wl_win.wl_window_height);
+ ret = player_set_display_wl_for_mused((player_h)handle, wl_win.type, wl_win.surface, wl_win.wl_window_x, wl_win.wl_window_y, wl_win.wl_window_width, wl_win.wl_window_height);
#else
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(xhandle, muse_core_client_get_msg(module));
- ret = player_set_display_for_mused((player_h) handle, type, xhandle);
+ ret = player_set_display_for_mused((player_h)handle, type, xhandle);
#endif
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(mute, muse_core_client_get_msg(module));
- ret = player_set_mute((player_h) handle, (bool)mute);
+ ret = player_set_mute((player_h)handle, (bool)mute);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_is_muted((player_h) handle, &mute);
+ ret = player_is_muted((player_h)handle, &mute);
player_msg_return1(api, ret, module, INT, mute);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_duration((player_h) handle, &duration);
+ ret = player_get_duration((player_h)handle, &duration);
player_msg_return1(api, ret, module, INT, duration);
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
- ret = player_set_sound_type((player_h) handle, (sound_type_e)type);
+ ret = player_set_sound_type((player_h)handle, (sound_type_e)type);
player_msg_return(api, ret, module);
player_msg_get(stream_index, muse_core_client_get_msg(module));
player_msg_get_string(stream_type, muse_core_client_get_msg(module));
- ret = player_set_audio_policy_info_for_mused((player_h) handle,
- stream_type, stream_index);
+ ret = player_set_audio_policy_info_for_mused((player_h)handle, stream_type, stream_index);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(latency_mode, muse_core_client_get_msg(module));
- ret = player_set_audio_latency_mode((player_h) handle,
- (audio_latency_mode_e)latency_mode);
+ ret = player_set_audio_latency_mode((player_h)handle, (audio_latency_mode_e)latency_mode);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_audio_latency_mode((player_h) handle, &latency_mode);
+ ret = player_get_audio_latency_mode((player_h)handle, &latency_mode);
player_msg_return1(api, ret, module, INT, latency_mode);
handle = muse_core_ipc_get_handle(module);
player_msg_get(looping, muse_core_client_get_msg(module));
- ret = player_set_looping((player_h) handle, (bool)looping);
+ ret = player_set_looping((player_h)handle, (bool)looping);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_is_looping((player_h) handle, &looping);
+ ret = player_is_looping((player_h)handle, &looping);
player_msg_return1(api, ret, module, INT, looping);
handle = muse_core_ipc_get_handle(module);
player_msg_get(mode, muse_core_client_get_msg(module));
- ret = player_set_display_mode((player_h) handle, (player_display_mode_e)mode);
+ ret = player_set_display_mode((player_h)handle, (player_display_mode_e)mode);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_display_mode((player_h) handle, &mode);
+ ret = player_get_display_mode((player_h)handle, &mode);
player_msg_return1(api, ret, module, INT, mode);
handle = muse_core_ipc_get_handle(module);
player_msg_get_type(rate, muse_core_client_get_msg(module), DOUBLE);
- ret = player_set_playback_rate((player_h) handle, (float)rate);
+ ret = player_set_playback_rate((player_h)handle, (float)rate);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(rotation, muse_core_client_get_msg(module));
- ret = player_set_display_rotation((player_h) handle,
- (player_display_rotation_e)rotation);
+ ret = player_set_display_rotation((player_h)handle, (player_display_rotation_e)rotation);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_display_rotation((player_h) handle, &rotation);
+ ret = player_get_display_rotation((player_h)handle, &rotation);
player_msg_return1(api, ret, module, INT, rotation);
handle = muse_core_ipc_get_handle(module);
player_msg_get(visible, muse_core_client_get_msg(module));
- ret = player_set_display_visible((player_h) handle, visible);
+ ret = player_set_display_visible((player_h)handle, visible);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_is_display_visible((player_h) handle, &visible);
+ ret = player_is_display_visible((player_h)handle, &visible);
player_msg_return1(api, ret, module, INT, visible);
handle = muse_core_ipc_get_handle(module);
player_msg_get(key, muse_core_client_get_msg(module));
- ret = player_get_content_info((player_h) handle, key, &value);
+ ret = player_get_content_info((player_h)handle, key, &value);
- if(ret == PLAYER_ERROR_NONE) {
+ if (ret == PLAYER_ERROR_NONE) {
player_msg_return1(api, ret, module, STRING, value);
free(value);
- }
- else
+ } else
player_msg_return(api, ret, module);
-
return ret;
}
handle = muse_core_ipc_get_handle(module);
- ret = player_get_codec_info((player_h) handle, &audio_codec, &video_codec);
+ ret = player_get_codec_info((player_h)handle, &audio_codec, &video_codec);
- if(ret == PLAYER_ERROR_NONE) {
- player_msg_return2(api, ret, module,
- STRING, audio_codec, STRING, video_codec);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_return2(api, ret, module, STRING, audio_codec, STRING, video_codec);
free(audio_codec);
free(video_codec);
- }
- else
+ } else
player_msg_return(api, ret, module);
return ret;
handle = muse_core_ipc_get_handle(module);
- ret = player_get_audio_stream_info((player_h) handle,
- &sample_rate, &channel, &bit_rate);
+ ret = player_get_audio_stream_info((player_h)handle, &sample_rate, &channel, &bit_rate);
- player_msg_return3(api, ret, module,
- INT, sample_rate, INT, channel, INT, bit_rate);
+ player_msg_return3(api, ret, module, INT, sample_rate, INT, channel, INT, bit_rate);
return ret;
}
handle = muse_core_ipc_get_handle(module);
- ret = player_get_video_stream_info((player_h) handle, &fps, &bit_rate);
+ ret = player_get_video_stream_info((player_h)handle, &fps, &bit_rate);
- player_msg_return2(api, ret, module,
- INT, fps, INT, bit_rate);
+ player_msg_return2(api, ret, module, INT, fps, INT, bit_rate);
return ret;
}
handle = muse_core_ipc_get_handle(module);
- ret = player_get_video_size((player_h) handle, &width, &height);
+ ret = player_get_video_size((player_h)handle, &width, &height);
- player_msg_return2(api, ret, module,
- INT, width, INT, height);
+ player_msg_return2(api, ret, module, INT, width, INT, height);
return ret;
}
handle = muse_core_ipc_get_handle(module);
- ret = player_get_album_art((player_h) handle, &album_art, &size);
+ ret = player_get_album_art((player_h)handle, &album_art, &size);
- if(ret == PLAYER_ERROR_NONE) {
- player_msg_return_array(api, ret, module,
- album_art, size, sizeof(char));
- }
+ if (ret == PLAYER_ERROR_NONE)
+ player_msg_return_array(api, ret, module, album_art, size, sizeof(char));
else
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_audio_effect_get_equalizer_bands_count((player_h) handle, &count);
+ ret = player_audio_effect_get_equalizer_bands_count((player_h)handle, &count);
player_msg_return1(api, ret, module, INT, count);
player_msg_get(length, muse_core_client_get_msg(module));
band_levels = (int *)g_try_new(int, length);
- if(band_levels) {
+ if (band_levels) {
player_msg_get_array(band_levels, muse_core_client_get_msg(module));
- ret = player_audio_effect_set_equalizer_all_bands((player_h) handle, band_levels, length);
+ ret = player_audio_effect_set_equalizer_all_bands((player_h)handle, band_levels, length);
g_free(band_levels);
- }
- else
+ } else
ret = PLAYER_ERROR_INVALID_OPERATION;
player_msg_return(api, ret, module);
player_msg_get(index, muse_core_client_get_msg(module));
player_msg_get(level, muse_core_client_get_msg(module));
- ret = player_audio_effect_set_equalizer_band_level((player_h) handle, index, level);
+ ret = player_audio_effect_set_equalizer_band_level((player_h)handle, index, level);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(index, muse_core_client_get_msg(module));
- ret = player_audio_effect_get_equalizer_band_level((player_h) handle, index, &level);
+ ret = player_audio_effect_get_equalizer_band_level((player_h)handle, index, &level);
player_msg_return1(api, ret, module, INT, level);
handle = muse_core_ipc_get_handle(module);
- ret = player_audio_effect_get_equalizer_level_range((player_h) handle, &min, &max);
+ ret = player_audio_effect_get_equalizer_level_range((player_h)handle, &min, &max);
player_msg_return2(api, ret, module, INT, min, INT, max);
handle = muse_core_ipc_get_handle(module);
player_msg_get(index, muse_core_client_get_msg(module));
- ret = player_audio_effect_get_equalizer_band_frequency((player_h) handle, index, &frequency);
+ ret = player_audio_effect_get_equalizer_band_frequency((player_h)handle, index, &frequency);
player_msg_return1(api, ret, module, INT, frequency);
handle = muse_core_ipc_get_handle(module);
player_msg_get(index, muse_core_client_get_msg(module));
- ret = player_audio_effect_get_equalizer_band_frequency_range((player_h) handle,
- index, &range);
+ ret = player_audio_effect_get_equalizer_band_frequency_range((player_h)handle, index, &range);
player_msg_return1(api, ret, module, INT, range);
handle = muse_core_ipc_get_handle(module);
- ret = player_audio_effect_equalizer_clear((player_h) handle);
+ ret = player_audio_effect_equalizer_clear((player_h)handle);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_audio_effect_equalizer_is_available((player_h) handle, &available);
+ ret = player_audio_effect_equalizer_is_available((player_h)handle, &available);
player_msg_return1(api, ret, module, INT, available);
handle = muse_core_ipc_get_handle(module);
player_msg_get_string(path, muse_core_client_get_msg(module));
- ret = player_set_subtitle_path((player_h) handle, path);
+ ret = player_set_subtitle_path((player_h)handle, path);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(millisecond, muse_core_client_get_msg(module));
- ret = player_set_subtitle_position_offset((player_h) handle, millisecond);
+ ret = player_set_subtitle_position_offset((player_h)handle, millisecond);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get_string(path, muse_core_client_get_msg(module));
- ret = player_set_progressive_download_path((player_h) handle, path);
- if(ret == PLAYER_ERROR_NONE) {
- player_set_video_bin_created_cb((player_h) handle,
- _video_bin_created_cb, module);
- }
+ ret = player_set_progressive_download_path((player_h)handle, path);
+ if (ret == PLAYER_ERROR_NONE)
+ player_set_video_bin_created_cb((player_h)handle, _video_bin_created_cb, module);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_progressive_download_status((player_h) handle,
- ¤t, &total_size);
+ ret = player_get_progressive_download_status((player_h)handle, ¤t, &total_size);
player_msg_return2(api, ret, module, POINTER, current, POINTER, total_size);
handle = muse_core_ipc_get_handle(module);
- ret = player_capture_video((player_h) handle, _capture_video_cb, module);
+ ret = player_capture_video((player_h)handle, _capture_video_cb, module);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(size, muse_core_client_get_msg(module));
- cookie = (char *)g_try_new(char, size+1);
- if(cookie) {
+ cookie = (char *)g_try_new(char, size + 1);
+ if (cookie) {
player_msg_get_string(cookie, muse_core_client_get_msg(module));
- ret = player_set_streaming_cookie((player_h) handle, cookie, size);
+ ret = player_set_streaming_cookie((player_h)handle, cookie, size);
g_free(cookie);
- }
- else
+ } else
ret = PLAYER_ERROR_INVALID_OPERATION;
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(size, muse_core_client_get_msg(module));
- user_agent = (char *)g_try_new(char, size+1);
- if(user_agent) {
+ user_agent = (char *)g_try_new(char, size + 1);
+ if (user_agent) {
player_msg_get_string(user_agent, muse_core_client_get_msg(module));
- ret = player_set_streaming_user_agent((player_h) handle, user_agent, size);
+ ret = player_set_streaming_user_agent((player_h)handle, user_agent, size);
g_free(user_agent);
- }
- else
+ } else
ret = PLAYER_ERROR_INVALID_OPERATION;
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
- ret = player_get_streaming_download_progress((player_h) handle, &start, ¤t);
+ ret = player_get_streaming_download_progress((player_h)handle, &start, ¤t);
player_msg_return2(api, ret, module, INT, start, INT, current);
LOGD("Enter");
- if(!module){
+ if (!module) {
LOGE("Null parameter");
return NULL;
}
- data_thread_info_t *thread_i =
- (data_thread_info_t *)muse_core_client_get_cust_data(module);
- if(!thread_i){
+ data_thread_info_t *thread_i = (data_thread_info_t *)muse_core_client_get_cust_data(module);
+ if (!thread_i) {
LOGE("Null parameter");
return NULL;
}
g_mutex_lock(&thread_i->mutex);
- while(thread_i->running) {
- if(g_queue_is_empty(thread_i->queue)) {
+ while (thread_i->running) {
+ if (g_queue_is_empty(thread_i->queue)) {
g_cond_wait(&thread_i->cond, &thread_i->mutex);
- if(!thread_i->running) {
+ if (!thread_i->running)
break;
- }
}
- while(1) {
+ while (1) {
qData = g_queue_pop_head(thread_i->queue);
g_mutex_unlock(&thread_i->mutex);
- if(qData) {
+ if (qData) {
push_media.mimetype = qData->mimetype;
push_media.pts = qData->pts;
push_media.size = qData->size;
push_media.flags = qData->flags;
buf = muse_core_ipc_get_data(module);
_push_media_stream(qData->handle, &push_media, buf);
- if(buf)
+ if (buf)
muse_core_ipc_delete_data(buf);
g_free(qData);
} else {
media_packet_h packet;
media_format_mimetype_e mimetype;
- if(push_media->mimetype & MEDIA_FORMAT_VIDEO) {
- if(!video_format) {
+ if (push_media->mimetype & MEDIA_FORMAT_VIDEO) {
+ if (!video_format) {
media_format_create(&video_format);
- if(!video_format) {
+ if (!video_format) {
LOGE("fail to create media format");
return PLAYER_ERROR_INVALID_PARAMETER;
}
ret |= media_format_set_video_mime(video_format, push_media->mimetype);
}
ret |= media_format_get_video_info(video_format, &mimetype, NULL, NULL, NULL, NULL);
- if(mimetype != push_media->mimetype) {
+ if (mimetype != push_media->mimetype) {
media_format_unref(video_format);
media_format_create(&video_format);
ret |= media_format_set_video_mime(video_format, push_media->mimetype);
}
format = video_format;
- }
- else if(push_media->mimetype & MEDIA_FORMAT_AUDIO) {
- if(!audio_format) {
+ } else if (push_media->mimetype & MEDIA_FORMAT_AUDIO) {
+ if (!audio_format) {
media_format_create(&audio_format);
- if(!audio_format) {
+ if (!audio_format) {
LOGE("fail to create media format");
return PLAYER_ERROR_INVALID_PARAMETER;
}
ret |= media_format_set_audio_mime(audio_format, push_media->mimetype);
}
ret |= media_format_get_audio_info(audio_format, &mimetype, NULL, NULL, NULL, NULL);
- if(mimetype != push_media->mimetype) {
+ if (mimetype != push_media->mimetype) {
media_format_unref(audio_format);
media_format_create(&audio_format);
ret |= media_format_set_audio_mime(audio_format, push_media->mimetype);
}
format = audio_format;
- }
- else
+ } else
ret = MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
-
- if(ret != MEDIA_FORMAT_ERROR_NONE) {
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
LOGE("Invalid MIME %d", push_media->mimetype);
return PLAYER_ERROR_INVALID_PARAMETER;
}
if (buf) {
- ret = media_packet_create_from_external_memory(format, buf,
- push_media->size, NULL, NULL, &packet);
- if(ret != MEDIA_PACKET_ERROR_NONE) {
+ ret = media_packet_create_from_external_memory(format, buf, push_media->size, NULL, NULL, &packet);
+ if (ret != MEDIA_PACKET_ERROR_NONE) {
LOGE("fail to create media packet with external mem");
return PLAYER_ERROR_INVALID_PARAMETER;
}
- }
- else {
+ } else {
ret = media_packet_create(format, NULL, NULL, &packet);
- if(ret != MEDIA_PACKET_ERROR_NONE) {
+ if (ret != MEDIA_PACKET_ERROR_NONE) {
LOGE("fail to create media packet");
return PLAYER_ERROR_INVALID_PARAMETER;
}
media_packet_set_flags(packet, push_media->flags);
ret = player_push_media_stream((player_h)handle, packet);
- if(ret != PLAYER_ERROR_NONE)
+ if (ret != PLAYER_ERROR_NONE)
LOGE("ret %d", ret);
media_packet_destroy(packet);
char *buf = NULL;
handle = muse_core_ipc_get_handle(module);
- if(!player_msg_get_array(push_media_msg, muse_core_client_get_msg(module))) {
+ if (!player_msg_get_array(push_media_msg, muse_core_client_get_msg(module))) {
ret = PLAYER_ERROR_INVALID_OPERATION;
goto push_media_stream_exit1;
}
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM) {
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM) {
bo = tbm_bo_import(bufmgr, push_media.key);
- if(bo == NULL) {
+ if (bo == NULL) {
LOGE("TBM get error : bo is NULL");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto push_media_stream_exit1;
}
- thandle = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
- if(thandle.ptr == NULL)
- {
+ thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
+ if (thandle.ptr == NULL) {
LOGE("TBM get error : handle pointer is NULL");
ret = PLAYER_ERROR_INVALID_OPERATION;
goto push_media_stream_exit2;
}
buf = thandle.ptr;
- } else if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_MSG) {
- buf = g_new(char,push_media.size);
- if(!buf) {
+ } else if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_MSG) {
+ buf = g_new(char, push_media.size);
+ if (!buf) {
ret = PLAYER_ERROR_OUT_OF_MEMORY;
goto push_media_stream_exit1;
}
player_msg_get_array(buf, muse_core_client_get_msg(module));
- } else if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW) {
+ } else if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW) {
push_data_q_t *qData = g_new(push_data_q_t, 1);
- data_thread_info_t *thread_i =
- (data_thread_info_t *)muse_core_client_get_cust_data(module);
- if(!qData) {
+ data_thread_info_t *thread_i = (data_thread_info_t *)muse_core_client_get_cust_data(module);
+ if (!qData) {
ret = PLAYER_ERROR_OUT_OF_MEMORY;
goto push_media_stream_exit1;
}
qData->size = push_media.size;
qData->flags = push_media.flags;
- g_queue_push_tail(thread_i->queue ,qData);
+ g_queue_push_tail(thread_i->queue, qData);
g_cond_signal(&thread_i->cond);
}
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW)
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW)
ret = PLAYER_ERROR_NONE;
else
ret = _push_media_stream(handle, &push_media, buf);
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
tbm_bo_unmap(bo);
push_media_stream_exit2:
- if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
+ if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_TBM)
tbm_bo_unref(bo);
- else if(push_media.buf_type == PUSH_MEDIA_BUF_TYPE_MSG)
+ else if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_MSG)
g_free(buf);
push_media_stream_exit1:
player_msg_get(mimetype, muse_core_client_get_msg(module));
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(avg_bps, muse_core_client_get_msg(module));
- if(type == PLAYER_STREAM_TYPE_VIDEO) {
+ if (type == PLAYER_STREAM_TYPE_VIDEO) {
player_msg_get(width, muse_core_client_get_msg(module));
player_msg_get(height, muse_core_client_get_msg(module));
player_msg_get(max_bps, muse_core_client_get_msg(module));
- } else if(type == PLAYER_STREAM_TYPE_AUDIO) {
+ } else if (type == PLAYER_STREAM_TYPE_AUDIO) {
player_msg_get(channel, muse_core_client_get_msg(module));
player_msg_get(samplerate, muse_core_client_get_msg(module));
player_msg_get(bit, muse_core_client_get_msg(module));
goto set_media_stream_info_exit;
}
- if(media_format_create(&format) == MEDIA_FORMAT_ERROR_NONE) {
- if(type == PLAYER_STREAM_TYPE_VIDEO) {
+ if (media_format_create(&format) == MEDIA_FORMAT_ERROR_NONE) {
+ if (type == PLAYER_STREAM_TYPE_VIDEO) {
ret = media_format_set_video_mime(format, mimetype);
ret |= media_format_set_video_width(format, width);
ret |= media_format_set_video_height(format, height);
ret |= media_format_set_video_avg_bps(format, avg_bps);
ret |= media_format_set_video_max_bps(format, max_bps);
- } else if(type == PLAYER_STREAM_TYPE_AUDIO) {
+ } else if (type == PLAYER_STREAM_TYPE_AUDIO) {
ret = media_format_set_audio_mime(format, mimetype);
ret |= media_format_set_audio_channel(format, channel);
ret |= media_format_set_audio_samplerate(format, samplerate);
ret |= media_format_set_audio_bit(format, bit);
ret |= media_format_set_audio_avg_bps(format, avg_bps);
}
- if(ret != MEDIA_FORMAT_ERROR_NONE) {
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
ret = PLAYER_ERROR_INVALID_OPERATION;
goto set_media_stream_info_exit;
}
- }
- else {
+ } else {
ret = PLAYER_ERROR_OUT_OF_MEMORY;
goto set_media_stream_info_exit;
}
ret = player_set_media_stream_info((player_h)handle, type, format);
-set_media_stream_info_exit:
+ set_media_stream_info_exit:
player_msg_return(api, ret, module);
return ret;
}
muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE;
player_stream_type_e type;
unsigned long long max_size;
- //unsigned upper_max_size, lower_max_size;
+ /* unsigned upper_max_size, lower_max_size; */
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE;
player_stream_type_e type;
unsigned long long max_size;
- //unsigned upper_max_size, lower_max_size;
+ /* unsigned upper_max_size, lower_max_size; */
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
- ret = player_get_media_stream_buffer_max_size((player_h) handle, type, &max_size);
- if(ret == PLAYER_ERROR_NONE) {
+ ret = player_get_media_stream_buffer_max_size((player_h)handle, type, &max_size);
+ if (ret == PLAYER_ERROR_NONE) {
#if 0
upper_max_size = (unsigned)((max_size >> 32) & 0xffffffff);
lower_max_size = (unsigned)(max_size & 0xffffffff);
- player_msg_return2(api, ret, module,
- INT, upper_max_size, INT, lower_max_size);
+ player_msg_return2(api, ret, module, INT, upper_max_size, INT, lower_max_size);
#else
- player_msg_return1(api, ret, module,
- INT64, max_size);
+ player_msg_return1(api, ret, module, INT64, max_size);
#endif
- }
- else
+ } else
player_msg_return(api, ret, module);
return ret;
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(percent, muse_core_client_get_msg(module));
- ret = player_set_media_stream_buffer_min_threshold((player_h) handle, type, percent);
+ ret = player_set_media_stream_buffer_min_threshold((player_h)handle, type, percent);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
- ret = player_get_media_stream_buffer_min_threshold((player_h) handle, type, &percent);
- if(ret == PLAYER_ERROR_NONE) {
+ ret = player_get_media_stream_buffer_min_threshold((player_h)handle, type, &percent);
+ if (ret == PLAYER_ERROR_NONE)
player_msg_return1(api, ret, module, INT, percent);
- }
else
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
- ret = player_get_track_count((player_h) handle, type, &count);
- if(ret == PLAYER_ERROR_NONE) {
+ ret = player_get_track_count((player_h)handle, type, &count);
+ if (ret == PLAYER_ERROR_NONE)
player_msg_return1(api, ret, module, INT, count);
- }
else
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
- ret = player_get_current_track((player_h) handle, type, &index);
- if(ret == PLAYER_ERROR_NONE) {
+ ret = player_get_current_track((player_h)handle, type, &index);
+ if (ret == PLAYER_ERROR_NONE)
player_msg_return1(api, ret, module, INT, index);
- }
else
player_msg_return(api, ret, module);
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(index, muse_core_client_get_msg(module));
- ret = player_select_track((player_h) handle, type, index);
+ ret = player_select_track((player_h)handle, type, index);
player_msg_return(api, ret, module);
return ret;
player_stream_type_e type;
int index;
char *code;
- const int code_len=2;
+ const int code_len = 2;
handle = muse_core_ipc_get_handle(module);
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(index, muse_core_client_get_msg(module));
- ret = player_get_track_language_code((player_h) handle, type, index, &code);
- if(ret == PLAYER_ERROR_NONE) {
+ ret = player_get_track_language_code((player_h)handle, type, index, &code);
+ if (ret == PLAYER_ERROR_NONE)
player_msg_return_array(api, ret, module, code, code_len, sizeof(char));
- }
else
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get(sync, muse_core_client_get_msg(module));
- ret = player_set_pcm_extraction_mode((player_h) handle,
- sync, _audio_frame_decoded_cb, module);
+ ret = player_set_pcm_extraction_mode((player_h)handle, sync, _audio_frame_decoded_cb, module);
player_msg_return(api, ret, module);
handle = muse_core_ipc_get_handle(module);
player_msg_get_type(rate, muse_core_client_get_msg(module), DOUBLE);
- ret = player_set_streaming_playback_rate((player_h) handle, (float)rate);
+ ret = player_set_streaming_playback_rate((player_h)handle, (float)rate);
player_msg_return(api, ret, module);
return ret;
}
-int (*dispatcher[MUSE_PLAYER_API_MAX]) (muse_module_h module) = {
- player_disp_create, /* MUSE_PLAYER_API_CREATE */
- player_disp_destroy, /* MUSE_PLAYER_API_DESTROY */
- player_disp_prepare, /* MUSE_PLAYER_API_PREPARE */
- player_disp_prepare_async, /* MUSE_PLAYER_API_PREPARE_ASYNC */
- player_disp_unprepare, /* MUSE_PLAYER_API_UNPREPARE */
- player_disp_set_uri, /* MUSE_PLAYER_API_SET_URI */
- player_disp_start, /* MUSE_PLAYER_API_START */
- player_disp_stop, /* MUSE_PLAYER_API_STOP */
- player_disp_pause, /* MUSE_PLAYER_API_PAUSE */
- player_disp_set_memory_buffer, /* MUSE_PLAYER_API_SET_MEMORY_BUFFER */
- player_disp_deinit_memory_buffer, /* MUSE_PLAYER_API_DEINIT_MEMORY_BUFFER */
- player_disp_get_state, /* MUSE_PLAYER_API_GET_STATE */
- player_disp_set_volume, /* MUSE_PLAYER_API_SET_VOLUME */
- player_disp_get_volume, /* MUSE_PLAYER_API_GET_VOLUME */
- player_disp_set_sound_type, /* MUSE_PLAYER_API_SET_SOUND_TYPE */
- player_disp_set_audio_policy_info, /* MUSE_PLAYER_API_SET_AUDIO_POLICY_INFO */
- player_disp_set_latency_mode, /* MUSE_PLAYER_API_SET_AUDIO_LATENCY_MODE */
- player_disp_get_latency_mode, /* MUSE_PLAYER_API_GET_AUDIO_LATENCY_MODE */
- player_disp_set_play_position, /* MUSE_PLAYER_API_SET_PLAY_POSITION */
- player_disp_get_play_position, /* MUSE_PLAYER_API_GET_PLAY_POSITION */
- player_disp_set_mute, /* MUSE_PLAYER_API_SET_MUTE */
- player_disp_is_muted, /* MUSE_PLAYER_API_IS_MUTED */
- player_disp_set_looping, /* MUSE_PLAYER_API_SET_LOOPING */
- player_disp_is_looping, /* MUSE_PLAYER_API_IS_LOOPING */
- player_disp_get_duration, /* MUSE_PLAYER_API_GET_DURATION */
- player_disp_set_display, /* MUSE_PLAYER_API_SET_DISPLAY */
- player_disp_set_display_mode, /* MUSE_PLAYER_API_SET_DISPLAY_MODE */
- player_disp_get_display_mode, /* MUSE_PLAYER_API_GET_DISPLAY_MODE */
- player_disp_set_playback_rate, /* MUSE_PLAYER_API_SET_PLAYBACK_RATE */
- player_disp_set_display_rotation, /* MUSE_PLAYER_API_SET_DISPLAY_ROTATION */
- player_disp_get_display_rotation, /* MUSE_PLAYER_API_GET_DISPLAY_ROTATION */
- player_disp_set_display_visible, /* MUSE_PLAYER_API_SET_DISPLAY_VISIBLE */
- player_disp_is_display_visible, /* MUSE_PLAYER_API_IS_DISPLAY_VISIBLE */
- player_disp_get_content_info, /* MUSE_PLAYER_API_GET_CONTENT_INFO */
- player_disp_get_codec_info, /* MUSE_PLAYER_API_GET_CODEC_INFO */
- player_disp_get_audio_stream_info, /* MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO */
- player_disp_get_video_stream_info, /* MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO */
- player_disp_get_video_size, /* MUSE_PLAYER_API_GET_VIDEO_SIZE */
- player_disp_get_album_art, /* MUSE_PLAYER_API_GET_ALBUM_ART */
- player_disp_get_eq_bands_count, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BANDS_COUNT */
- player_disp_set_eq_all_bands, /* MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_ALL_BANDS */
- player_disp_set_eq_band_level, /* MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_BAND_LEVEL */
- player_disp_get_eq_band_level, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_LEVEL */
- player_disp_get_eq_level_range, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE */
- player_disp_get_eq_band_frequency, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY */
- player_disp_get_eq_band_frequency_range, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY_RANGE */
- player_disp_eq_clear, /* MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_CLEAR */
- player_disp_eq_is_available, /* MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_IS_AVAILABLE */
- player_disp_set_progressive_download_path, /* MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH */
- player_disp_get_progressive_download_status, /* MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS */
- player_disp_capture_video, /* MUSE_PLAYER_API_CAPTURE_VIDEO */
- player_disp_set_streaming_cookie, /* MUSE_PLAYER_API_SET_STREAMING_COOKIE */
- player_disp_set_streaming_user_agent, /* MUSE_PLAYER_API_SET_STREAMING_USER_AGENT */
- player_disp_get_streaming_download_progress, /* MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS */
- player_disp_set_subtitle_path, /* MUSE_PLAYER_API_SET_SUBTITLE_PATH */
- player_disp_set_subtitle_position_offset, /* MUSE_PLAYER_API_SET_SUBTITLE_POSITION_OFFSET */
- player_disp_push_media_stream, /* MUSE_PLAYER_API_PUSH_MEDIA_STREAM */
- player_disp_set_media_stream_info, /* MUSE_PLAYER_API_SET_MEDIA_STREAM_INFO */
- player_disp_set_callback, /* MUSE_PLAYER_API_SET_CALLBACK */
- player_disp_media_packet_finalize_cb, /* MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB */
- player_disp_set_media_stream_buffer_max_size, /* MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE */
- player_disp_get_media_stream_buffer_max_size, /* MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE */
- player_disp_set_media_stream_buffer_min_threshold, /* MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD */
- player_disp_get_media_stream_buffer_min_threshold, /* MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD */
- player_disp_get_track_count, /* MUSE_PLAYER_API_GET_TRACK_COUNT */
- player_disp_get_current_track, /* MUSE_PLAYER_API_GET_CURRENT_TRACK */
- player_disp_select_track, /* MUSE_PLAYER_API_SELECT_TRACK */
- player_disp_get_track_language_code, /* MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE */
- player_disp_set_pcm_extraction_mode, /* MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE */
- player_disp_set_pcm_spec, /* MUSE_PLAYER_API_SET_PCM_SPEC */
- player_disp_set_streaming_playback_rate, /* MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE */
+int (*dispatcher[MUSE_PLAYER_API_MAX])(muse_module_h module) = {
+ player_disp_create, /* MUSE_PLAYER_API_CREATE */
+ player_disp_destroy, /* MUSE_PLAYER_API_DESTROY */
+ player_disp_prepare, /* MUSE_PLAYER_API_PREPARE */
+ player_disp_prepare_async, /* MUSE_PLAYER_API_PREPARE_ASYNC */
+ player_disp_unprepare, /* MUSE_PLAYER_API_UNPREPARE */
+ player_disp_set_uri, /* MUSE_PLAYER_API_SET_URI */
+ player_disp_start, /* MUSE_PLAYER_API_START */
+ player_disp_stop, /* MUSE_PLAYER_API_STOP */
+ player_disp_pause, /* MUSE_PLAYER_API_PAUSE */
+ player_disp_set_memory_buffer, /* MUSE_PLAYER_API_SET_MEMORY_BUFFER */
+ player_disp_deinit_memory_buffer, /* MUSE_PLAYER_API_DEINIT_MEMORY_BUFFER */
+ player_disp_get_state, /* MUSE_PLAYER_API_GET_STATE */
+ player_disp_set_volume, /* MUSE_PLAYER_API_SET_VOLUME */
+ player_disp_get_volume, /* MUSE_PLAYER_API_GET_VOLUME */
+ player_disp_set_sound_type, /* MUSE_PLAYER_API_SET_SOUND_TYPE */
+ player_disp_set_audio_policy_info, /* MUSE_PLAYER_API_SET_AUDIO_POLICY_INFO */
+ player_disp_set_latency_mode, /* MUSE_PLAYER_API_SET_AUDIO_LATENCY_MODE */
+ player_disp_get_latency_mode, /* MUSE_PLAYER_API_GET_AUDIO_LATENCY_MODE */
+ player_disp_set_play_position, /* MUSE_PLAYER_API_SET_PLAY_POSITION */
+ player_disp_get_play_position, /* MUSE_PLAYER_API_GET_PLAY_POSITION */
+ player_disp_set_mute, /* MUSE_PLAYER_API_SET_MUTE */
+ player_disp_is_muted, /* MUSE_PLAYER_API_IS_MUTED */
+ player_disp_set_looping, /* MUSE_PLAYER_API_SET_LOOPING */
+ player_disp_is_looping, /* MUSE_PLAYER_API_IS_LOOPING */
+ player_disp_get_duration, /* MUSE_PLAYER_API_GET_DURATION */
+ player_disp_set_display, /* MUSE_PLAYER_API_SET_DISPLAY */
+ player_disp_set_display_mode, /* MUSE_PLAYER_API_SET_DISPLAY_MODE */
+ player_disp_get_display_mode, /* MUSE_PLAYER_API_GET_DISPLAY_MODE */
+ player_disp_set_playback_rate, /* MUSE_PLAYER_API_SET_PLAYBACK_RATE */
+ player_disp_set_display_rotation, /* MUSE_PLAYER_API_SET_DISPLAY_ROTATION */
+ player_disp_get_display_rotation, /* MUSE_PLAYER_API_GET_DISPLAY_ROTATION */
+ player_disp_set_display_visible, /* MUSE_PLAYER_API_SET_DISPLAY_VISIBLE */
+ player_disp_is_display_visible, /* MUSE_PLAYER_API_IS_DISPLAY_VISIBLE */
+ player_disp_get_content_info, /* MUSE_PLAYER_API_GET_CONTENT_INFO */
+ player_disp_get_codec_info, /* MUSE_PLAYER_API_GET_CODEC_INFO */
+ player_disp_get_audio_stream_info, /* MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO */
+ player_disp_get_video_stream_info, /* MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO */
+ player_disp_get_video_size, /* MUSE_PLAYER_API_GET_VIDEO_SIZE */
+ player_disp_get_album_art, /* MUSE_PLAYER_API_GET_ALBUM_ART */
+ player_disp_get_eq_bands_count, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BANDS_COUNT */
+ player_disp_set_eq_all_bands, /* MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_ALL_BANDS */
+ player_disp_set_eq_band_level, /* MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_BAND_LEVEL */
+ player_disp_get_eq_band_level, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_LEVEL */
+ player_disp_get_eq_level_range, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE */
+ player_disp_get_eq_band_frequency, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY */
+ player_disp_get_eq_band_frequency_range, /* MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_BAND_FREQUENCY_RANGE */
+ player_disp_eq_clear, /* MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_CLEAR */
+ player_disp_eq_is_available, /* MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_IS_AVAILABLE */
+ player_disp_set_progressive_download_path, /* MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH */
+ player_disp_get_progressive_download_status, /* MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS */
+ player_disp_capture_video, /* MUSE_PLAYER_API_CAPTURE_VIDEO */
+ player_disp_set_streaming_cookie, /* MUSE_PLAYER_API_SET_STREAMING_COOKIE */
+ player_disp_set_streaming_user_agent, /* MUSE_PLAYER_API_SET_STREAMING_USER_AGENT */
+ player_disp_get_streaming_download_progress, /* MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS */
+ player_disp_set_subtitle_path, /* MUSE_PLAYER_API_SET_SUBTITLE_PATH */
+ player_disp_set_subtitle_position_offset, /* MUSE_PLAYER_API_SET_SUBTITLE_POSITION_OFFSET */
+ player_disp_push_media_stream, /* MUSE_PLAYER_API_PUSH_MEDIA_STREAM */
+ player_disp_set_media_stream_info, /* MUSE_PLAYER_API_SET_MEDIA_STREAM_INFO */
+ player_disp_set_callback, /* MUSE_PLAYER_API_SET_CALLBACK */
+ player_disp_media_packet_finalize_cb, /* MUSE_PLAYER_API_MEDIA_PACKET_FINALIZE_CB */
+ player_disp_set_media_stream_buffer_max_size, /* MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE */
+ player_disp_get_media_stream_buffer_max_size, /* MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE */
+ player_disp_set_media_stream_buffer_min_threshold, /* MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD */
+ player_disp_get_media_stream_buffer_min_threshold, /* MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD */
+ player_disp_get_track_count, /* MUSE_PLAYER_API_GET_TRACK_COUNT */
+ player_disp_get_current_track, /* MUSE_PLAYER_API_GET_CURRENT_TRACK */
+ player_disp_select_track, /* MUSE_PLAYER_API_SELECT_TRACK */
+ player_disp_get_track_language_code, /* MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE */
+ player_disp_set_pcm_extraction_mode, /* MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE */
+ player_disp_set_pcm_spec, /* MUSE_PLAYER_API_SET_PCM_SPEC */
+ player_disp_set_streaming_playback_rate, /* MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE */
};
-