From: Gilbok Lee Date: Wed, 19 Dec 2018 02:59:46 +0000 (+0900) Subject: [0.3.107] Apply tizen coding rule X-Git-Tag: submit/tizen/20190107.101656^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64816fa34e01e2a3fc6da0c30e281545452cc6b7;p=platform%2Fcore%2Fapi%2Fplayer.git [0.3.107] Apply tizen coding rule - modify space and brace Change-Id: Id3797d5de97a00395d44058f23b76074ca2d1289 --- diff --git a/disp/player_display.c b/disp/player_display.c index 95421b7..e0c9ebb 100644 --- a/disp/player_display.c +++ b/disp/player_display.c @@ -53,9 +53,9 @@ typedef struct { struct tizen_resource *tz_resource; } wl_client; -static int _wl_client_create(wl_client ** wlclient); -static int _wl_client_get_wl_window_wl_surface_id(wl_client * wlclient, struct wl_surface *surface, struct wl_display *display); -static void _wl_client_finalize(wl_client * wlclient); +static int _wl_client_create(wl_client **wlclient); +static int _wl_client_get_wl_window_wl_surface_id(wl_client *wlclient, struct wl_surface *surface, struct wl_display *display); +static void _wl_client_finalize(wl_client *wlclient); /*elm wayland window use display and ecore wayland window use ecore_win */ @@ -71,12 +71,12 @@ unsigned int disp_set_wl_display(int wl_win_type, void *win) unsigned int wl_surface_id = 0; Evas *e; wl_client *wlclient; - int ret = FALSE; + int ret = 0; /* get wl_window */ if (wl_win_type == ELM_WAYLAND_WIN) { /* elm win */ - obj = (Evas_Object *) win; + obj = (Evas_Object *)win; object_type = evas_object_type_get(obj); return_val_if_fail(object_type != NULL, FALSE); @@ -91,13 +91,17 @@ unsigned int disp_set_wl_display(int wl_win_type, void *win) return_val_if_fail(wl_window != NULL, FALSE); LOGI("ELM Wayland overlay surface type"); - } else return FALSE; + } else { + return 0; + } } else if (wl_win_type == ECORE_WAYLAND_WIN) { /* ecore win */ - wl_window = (Ecore_Wl2_Window *) win; + wl_window = (Ecore_Wl2_Window *)win; LOGD("Ecore Wayland Window handle(%p)", wl_window); LOGI("ECORE Wayland overlay surface type"); - } else return FALSE; + } else { + return 0; + } /* Need to let wayland-server know that video is rendered in this wl_window @@ -125,10 +129,8 @@ unsigned int disp_set_wl_display(int wl_win_type, void *win) wl_surface_id = _wl_client_get_wl_window_wl_surface_id(wlclient, wl_surface, wl_display); LOGD("wl_surface_id = %d", wl_surface_id); /* need to free always */ - if (wlclient) { - g_free(wlclient); - wlclient = NULL; - } + g_free(wlclient); + return_val_if_fail(wl_surface_id > 0, FALSE); return wl_surface_id; @@ -139,7 +141,7 @@ void disp_get_evas_display_geometry_info(void *display, int *x, int *y, int *wid Evas_Object *obj = NULL; return_if_fail(display != NULL) int e_x = 0, e_y = 0, e_w = 0, e_h = 0; - obj = (Evas_Object *) display; + obj = (Evas_Object *)display; evas_object_geometry_get(obj, &e_x, &e_y, &e_w, &e_h); *x = e_x; *y = e_y; @@ -261,7 +263,7 @@ int disp_create_evas_display(void *display, MMHandleType *evas_handle) const char *object_type = NULL; return_val_if_fail(display != NULL, MM_ERROR_INVALID_ARGUMENT); - obj = (Evas_Object *) display; + obj = (Evas_Object *)display; return_val_if_fail(obj != NULL, MM_ERROR_INVALID_ARGUMENT); object_type = evas_object_type_get(obj); @@ -316,7 +318,7 @@ static void handle_global(void *data, struct wl_registry *registry, uint32_t nam } } -static void handle_global_remove(void * data, struct wl_registry * registry, uint32_t name) +static void handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { LOGD("Removed global object: name(%d)", name); } @@ -341,12 +343,12 @@ static int _wl_client_create(wl_client ** wlclient) } return MM_ERROR_NONE; - ERROR: +ERROR: *wlclient = NULL; return MM_ERROR_PLAYER_NO_FREE_SPACE; } -static int _wl_client_get_wl_window_wl_surface_id(wl_client * wlclient, struct wl_surface *surface, struct wl_display *display) +static int _wl_client_get_wl_window_wl_surface_id(wl_client *wlclient, struct wl_surface *surface, struct wl_display *display) { goto_if_fail(wlclient != NULL, failed); goto_if_fail(surface != NULL, failed); @@ -379,13 +381,13 @@ static int _wl_client_get_wl_window_wl_surface_id(wl_client * wlclient, struct w return wl_surface_id; - failed: +failed: LOGE("Failed to get wl_surface_id"); return 0; } -static void _wl_client_finalize(wl_client * wlclient) +static void _wl_client_finalize(wl_client *wlclient) { LOGD("start finalize wlclient"); return_if_fail(wlclient != NULL) diff --git a/include/player.h b/include/player.h index d5935bf..81beb3f 100644 --- a/include/player.h +++ b/include/player.h @@ -160,14 +160,14 @@ typedef enum { * @brief The player display handle. * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif */ -typedef void* player_display_h; +typedef void *player_display_h; #ifndef GET_DISPLAY /** * @brief Definition for a display handle from evas object. * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif */ -#define GET_DISPLAY(x) (void*)(x) +#define GET_DISPLAY(x) (void *)(x) #endif /** @@ -354,7 +354,7 @@ typedef void (*player_media_packet_video_decoded_cb)(media_packet_h packet, void * @see player_set_media_stream_buffer_max_size() * @see player_set_media_stream_buffer_min_threshold() */ -typedef void (*player_media_stream_buffer_status_cb) (player_media_stream_buffer_status_e status, void *user_data); +typedef void (*player_media_stream_buffer_status_cb)(player_media_stream_buffer_status_e status, void *user_data); /** * @brief Called to notify the next push-buffer offset when seeking is occurred. @@ -364,7 +364,7 @@ typedef void (*player_media_stream_buffer_status_cb) (player_media_stream_buffer * @param[in] offset The new byte position to seek * @param[in] user_data The user data passed from the callback registration function */ -typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *user_data); +typedef void (*player_media_stream_seek_cb)(unsigned long long offset, void *user_data); /** * @} @@ -388,7 +388,7 @@ typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *us * @param[in] user_data The user data passed from the callback registration function * @see player_set_video_stream_changed_cb() */ -typedef void (*player_video_stream_changed_cb) (int width, int height, int fps, int bit_rate, void *user_data); +typedef void (*player_video_stream_changed_cb)(int width, int height, int fps, int bit_rate, void *user_data); /** * @} @@ -421,7 +421,7 @@ typedef void (*player_buffering_cb)(int percent, void *user_data); * @param[in] user_data The user data passed from the callback registration function * @see player_foreach_adaptive_variant() */ -typedef void (*player_adaptive_variant_cb) (int bandwidth, int width, int height, void *user_data); +typedef void (*player_adaptive_variant_cb)(int bandwidth, int width, int height, void *user_data); /** * @} @@ -523,7 +523,7 @@ int player_prepare(player_h player); * @see player_unprepare() * @see player_set_uri() */ -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); /** * @brief Resets the media player. @@ -573,7 +573,7 @@ int player_unprepare(player_h player); * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). * @see player_set_memory_buffer() */ -int player_set_uri(player_h player, const char * uri); +int player_set_uri(player_h player, const char *uri); /** * @brief Sets memory as the data source. @@ -597,7 +597,7 @@ int player_set_uri(player_h player, const char * uri); * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). * @see player_set_uri() */ -int player_set_memory_buffer(player_h player, const void * data, int size); +int player_set_memory_buffer(player_h player, const void *data, int size); /** * @brief Gets the player's current state. @@ -1311,7 +1311,7 @@ int player_set_display_visible(player_h player, bool visible); * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation * @see player_set_display_visible() */ -int player_is_display_visible(player_h player, bool* visible); +int player_is_display_visible(player_h player, bool *visible); /** * @brief Sets the rotation settings of the video surface display. @@ -1375,7 +1375,7 @@ int player_get_display_rotation(player_h player, player_display_rotation_e *rota * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED. */ -int player_get_content_info(player_h player, player_content_info_e key, char ** value); +int player_get_content_info(player_h player, player_content_info_e key, char **value); /** * @brief Gets the audio and video codec information. @@ -1605,7 +1605,7 @@ int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_level * @see player_audio_effect_set_equalizer_band_level() * @see player_audio_effect_set_equalizer_all_bands() */ -int player_audio_effect_get_equalizer_level_range(player_h player, int* min, int* max); +int player_audio_effect_get_equalizer_level_range(player_h player, int *min, int *max); /** * @brief Gets the band frequency of the equalizer. @@ -2627,4 +2627,3 @@ int player_360_set_zoom_with_field_of_view(player_h player, float level, int hor #endif #endif /* __TIZEN_MEDIA_PLAYER_H__ */ - diff --git a/include/player_internal.h b/include/player_internal.h index 635bf3c..adcfb74 100644 --- a/include/player_internal.h +++ b/include/player_internal.h @@ -149,7 +149,7 @@ typedef void (*player_audio_pcm_extraction_cb)(player_audio_raw_data_s *audio_ra * @see player_set_media_stream_buffer_max_size() * @see player_set_media_stream_buffer_min_threshold() */ -typedef void (*player_media_stream_buffer_status_cb_ex) (player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data); +typedef void (*player_media_stream_buffer_status_cb_ex)(player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data); /** * @brief Registers a callback function to be invoked when audio frame is decoded. Audio only contents is possible. If included video, error happens. @@ -282,7 +282,7 @@ int player_set_ecore_wl_display(player_h player, player_display_type_e type, voi * @see player_set_buffer_enough_video_data_cb() * @see player_set_buffer_enough_audio_data_cb() */ -typedef void (*player_buffer_enough_data_cb) (void *user_data); +typedef void (*player_buffer_enough_data_cb)(void *user_data); /** * @brief Called when the buffer level drops below the threshold. @@ -292,7 +292,7 @@ typedef void (*player_buffer_enough_data_cb) (void *user_data); * @see player_set_buffer_need_video_data_cb() * @see player_set_buffer_need_audio_data_cb() */ -typedef void (*player_buffer_need_data_cb) (unsigned int size, void *user_data); +typedef void (*player_buffer_need_data_cb)(unsigned int size, void *user_data); /** * @brief Submits packet to appsrc, used in external demux mode diff --git a/include/player_msg.h b/include/player_msg.h index 3896dac..15e8c9f 100644 --- a/include/player_msg.h +++ b/include/player_msg.h @@ -23,8 +23,8 @@ extern "C" { #define INVALID_DEFAULT_VALUE -1 -extern int _player_send_msg(muse_player_api_e api, player_cli_s *player, char* msg, tbm_fd tfd, char **retbuf); -extern int _player_send_msg_async(int send_fd, char* msg); +extern int _player_send_msg(muse_player_api_e api, player_cli_s *player, char *msg, tbm_fd tfd, char **retbuf); +extern int _player_send_msg_async(int send_fd, char *msg); /** * @brief Create and send message. Wait for server result. diff --git a/include/player_private.h b/include/player_private.h index e67600c..06c35cc 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -244,10 +244,10 @@ do { \ } while (0) -int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api); -int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s * cb_info, char **ret_buf, int time_out); +int client_get_api_timeout(player_cli_s *pc, muse_player_api_e api); +int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out); int _player_convert_display_type(player_display_type_e type, player_private_display_type_e *out_type); -int _player_get_valid_path(const char* uri, char* origin); +int _player_get_valid_path(const char *uri, char *origin); #ifdef __cplusplus } diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 352d617..a205d07 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,6 +1,6 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.106 +Version: 0.3.107 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index 07c8729..e7ff79c 100644 --- a/src/player.c +++ b/src/player.c @@ -51,7 +51,7 @@ typedef struct { tbm_fd tfd[MUSE_NUM_FD]; - char* buffer; + char *buffer; } _player_recv_data; typedef struct { @@ -68,8 +68,8 @@ typedef struct { bool use_tsurf_pool; } _media_pkt_fin_data; -static int _player_deinit_memory_buffer(player_cli_s * pc); -static void _player_event_queue_add(player_event_queue * ev, _player_cb_data * data); +static int _player_deinit_memory_buffer(player_cli_s *pc); +static void _player_event_queue_add(player_event_queue *ev, _player_cb_data *data); static bool _player_need_sync_context(int event_id); static void _player_remove_idle_event(callback_cb_info_s *cb_info, muse_player_event_e event_type, bool remove_all); #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -78,7 +78,7 @@ static void __retrieve_buffer_cb(void *user_data); static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data); static int __player_unset_retrieve_buffer_cb(player_h player); #endif -static void _player_release_internal_memory(player_cli_s * pc, bool deinit_server_mem); +static void _player_release_internal_memory(player_cli_s *pc, bool deinit_server_mem); /* * Internal Implementation @@ -121,7 +121,7 @@ int _player_send_msg(muse_player_api_e api, player_cli_s *player, char *msg, tbm return ret; } -int _player_send_msg_async(int send_fd, char* msg) +int _player_send_msg_async(int send_fd, char *msg) { int send_len = 0; @@ -160,7 +160,7 @@ static int _get_current_state(player_cli_s *pc, player_state_e *pstate) return ret; } -static bool _player_get_param_value(char* buf, ...) +static bool _player_get_param_value(char *buf, ...) { muse_core_msg_parse_err_e err = MUSE_MSG_PARSE_ERROR_NONE; bool ret = true; @@ -212,7 +212,7 @@ int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user { int ret = MEDIA_PACKET_FINALIZE; muse_player_api_e api = MUSE_PLAYER_API_RETURN_VIDEO_DATA; - _media_pkt_fin_data *fin_data = (_media_pkt_fin_data *) user_data; + _media_pkt_fin_data *fin_data = (_media_pkt_fin_data *)user_data; intptr_t v_data = 0; char *snd_msg = NULL; int snd_len = 0; @@ -326,7 +326,7 @@ static bool _player_check_network_availability(void) return TRUE; } -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) { @@ -338,7 +338,7 @@ static void *_get_mem(player_cli_s * player, int size) return NULL; } -static void _del_mem(player_cli_s * player) +static void _del_mem(player_cli_s *player) { player_data_s *mem; while (player->head) { @@ -349,12 +349,12 @@ static void _del_mem(player_cli_s * player) } } -static int player_recv_msg(callback_cb_info_s * cb_info, tbm_fd *tfd) +static int player_recv_msg(callback_cb_info_s *cb_info, tbm_fd *tfd) { int recvLen = 0; msg_buff_s *buff = &cb_info->buff; - memset(buff->recvMsg, 0x00, sizeof(char)*buff->bufLen); + memset(buff->recvMsg, 0x00, sizeof(char) * buff->bufLen); memset(tfd, INVALID_DEFAULT_VALUE, sizeof(*tfd) * MUSE_NUM_FD); recvLen = muse_core_msg_recv_fd(cb_info->fd, buff->recvMsg, MUSE_MSG_MAX_LENGTH, tfd); if (recvLen <= 0) { @@ -383,7 +383,7 @@ static int player_recv_msg(callback_cb_info_s * cb_info, tbm_fd *tfd) g_free(tmp); return 0; } - memset(buff->recvMsg, 0x00, sizeof(char)*buff->bufLen); + memset(buff->recvMsg, 0x00, sizeof(char) * buff->bufLen); } g_snprintf(buff->recvMsg, buff->bufLen, "%s%s", buff->part_of_msg, tmp); recvLen += strlen(buff->part_of_msg); @@ -413,7 +413,7 @@ static int player_recv_msg(callback_cb_info_s * cb_info, tbm_fd *tfd) return recvLen; } -static void set_null_user_cb(callback_cb_info_s * cb_info, muse_player_event_e event) +static void set_null_user_cb(callback_cb_info_s *cb_info, muse_player_event_e event) { if (cb_info && event < MUSE_PLAYER_EVENT_TYPE_NUM) { cb_info->user_cb[event] = NULL; @@ -424,7 +424,7 @@ static void set_null_user_cb(callback_cb_info_s * cb_info, muse_player_event_e e /* Notice : have to be called via API to avoid deadlock * to clear the cb setting at the cb thread, set_null_user_cb() have to be called instead. */ -static void set_null_user_cb_lock(callback_cb_info_s * cb_info, muse_player_event_e event) +static void set_null_user_cb_lock(callback_cb_info_s *cb_info, muse_player_event_e event) { bool lock = false; @@ -454,7 +454,7 @@ static int __set_callback(muse_player_event_e type, player_h player, void *callb 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; @@ -480,7 +480,7 @@ static int __unset_callback(muse_player_event_e type, player_h player) { PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK; int set = 0; @@ -494,37 +494,37 @@ static int __unset_callback(muse_player_event_e type, player_h player) return ret; } -static void __prepare_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __prepare_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_PREPARE; - ((player_prepared_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]); + ((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, _player_recv_data *recv_data) +static void __complete_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_COMPLETE; - ((player_completed_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]); + ((player_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]); } #ifdef TIZEN_FEATURE_EVAS_RENDERER -static void __retrieve_buffer_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __retrieve_buffer_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER; - ((player_retrieve_buffer_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]); + ((player_retrieve_buffer_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]); } #endif -static void __interrupt_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __interrupt_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_INTERRUPT; - ((player_interrupted_cb) cb_info->user_cb[ev]) (PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, cb_info->user_data[ev]); + ((player_interrupted_cb)cb_info->user_cb[ev])(PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, cb_info->user_data[ev]); } -static void __error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __error_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { int code; muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_ERROR; @@ -536,27 +536,27 @@ static void __error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data * set_null_user_cb(cb_info, MUSE_PLAYER_EVENT_TYPE_PREPARE); } } - ((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 __disconnected_error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __disconnected_error_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_ERROR; - ((player_error_cb) cb_info->user_cb[ev]) (PLAYER_ERROR_SERVICE_DISCONNECTED, cb_info->user_data[ev]); + ((player_error_cb)cb_info->user_cb[ev])(PLAYER_ERROR_SERVICE_DISCONNECTED, cb_info->user_data[ev]); } -static void __buffering_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __buffering_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { int percent; muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_BUFFERING; if (player_msg_get(percent, recv_data->buffer)) - ((player_buffering_cb) cb_info->user_cb[ev]) (percent, cb_info->user_data[ev]); + ((player_buffering_cb)cb_info->user_cb[ev])(percent, cb_info->user_data[ev]); } -static void __subtitle_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __subtitle_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { int duration = 0; char text[MUSE_URI_MAX_LENGTH] = { 0, }; @@ -568,10 +568,10 @@ static void __subtitle_cb_handler(callback_cb_info_s * cb_info, _player_recv_dat MUSE_TYPE_STRING, "text", (void *)text, INVALID_MUSE_TYPE_VALUE); if (ret) - ((player_subtitle_updated_cb) cb_info->user_cb[ev]) (duration, text, cb_info->user_data[ev]); + ((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, _player_recv_data *recv_data) +static void __capture_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { unsigned char *data = NULL; int width = 0; @@ -606,10 +606,11 @@ static void __capture_cb_handler(callback_cb_info_s * cb_info, _player_recv_data data = g_new(unsigned char, size); if (data) { memcpy(data, thandle.ptr, size); - ((player_video_captured_cb) cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE]) (data, width, height, size, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE]); + ((player_video_captured_cb)cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE])(data, width, height, size, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE]); g_free(data); - } else + } else { LOGE("g_new failure"); + } tbm_bo_unmap(bo); } @@ -631,7 +632,7 @@ EXIT: set_null_user_cb(cb_info, MUSE_PLAYER_EVENT_TYPE_CAPTURE); } -static void __seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __seek_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_SEEK; #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -667,7 +668,7 @@ static void __seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *r } #endif LOGD("call seek cb"); - ((player_seek_completed_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]); + ((player_seek_completed_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]); set_null_user_cb(cb_info, ev); break; @@ -684,7 +685,7 @@ static void __seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *r g_mutex_unlock(&cb_info->seek_cb_mutex); } -static void __player_remove_tsurf_list(player_cli_s * pc) +static void __player_remove_tsurf_list(player_cli_s *pc) { GList *l = NULL; @@ -693,7 +694,7 @@ static void __player_remove_tsurf_list(player_cli_s * pc) LOGD("total num of tsurf list = %d", g_list_length(pc->cb_info->tsurf_list)); for (l = g_list_first(pc->cb_info->tsurf_list); l; l = g_list_next(l)) { - player_tsurf_info_t* tmp = (player_tsurf_info_t *)l->data; + player_tsurf_info_t *tmp = (player_tsurf_info_t *)l->data; LOGD("%p will be removed", tmp); if (tmp) { @@ -711,7 +712,7 @@ static void __player_remove_tsurf_list(player_cli_s * pc) return; } -static player_tsurf_info_t* __player_get_tsurf_from_list(callback_cb_info_s * cb_info, int *key, int height, int width) +static player_tsurf_info_t *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, int *key, int height, int width) { GList *l = NULL; @@ -765,7 +766,7 @@ static media_packet_rotate_method_e __convert_packet_orient_info(int orientation return rotate; } -static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { tbm_bo bo[4] = { NULL, }; int key[4] = { INVALID_DEFAULT_VALUE, }; @@ -905,14 +906,14 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, /* Keep the fd id to check validation when the pkt is destroyed. */ fin_data->fd_id = muse_client_get_fd_id_value(fin_data->fd); - 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 || !pkt) { LOGE("media_packet_create_from_tbm_surface failed %d %p", ret, pkt); goto ERROR; } if (pts != 0) { - ret = media_packet_set_pts(pkt, (uint64_t) pts); + ret = media_packet_set_pts(pkt, (uint64_t)pts); if (ret != MEDIA_PACKET_ERROR_NONE) LOGE("media_packet_set_pts failed"); } @@ -923,7 +924,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info, if (cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]) { /* call media packet callback */ - ((player_media_packet_video_decoded_cb) cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]) (pkt, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]); + ((player_media_packet_video_decoded_cb)cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME])(pkt, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]); } else { LOGE("_video_decoded_cb is not set"); media_packet_destroy(pkt); @@ -966,7 +967,7 @@ ERROR: return; } -static void __audio_frame_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __audio_frame_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { tbm_bo bo = NULL; tbm_bo_handle thandle; @@ -999,7 +1000,7 @@ static void __audio_frame_cb_handler(callback_cb_info_s * cb_info, _player_recv_ audio.data = thandle.ptr + sizeof(player_audio_raw_data_s); /* LOGD("user callback data %p, size %d", audio.data, audio.size); */ - ((player_audio_pcm_extraction_cb) cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME]) (&audio, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME]); + ((player_audio_pcm_extraction_cb)cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME])(&audio, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME]); tbm_bo_unmap(bo); EXIT: @@ -1017,34 +1018,36 @@ EXIT: } } -static void __video_frame_render_error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __video_frame_render_error_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { } -static void __supported_audio_effect_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __supported_audio_effect_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { } -static void __supported_audio_effect_preset_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __supported_audio_effect_preset_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { } -static void __missed_plugin_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __missed_plugin_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { } -static void __media_stream_video_buffer_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_stream_video_buffer_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { /* player_media_stream_buffer_status_e status; */ int status; if (player_msg_get(status, recv_data->buffer)) { ((player_media_stream_buffer_status_cb) - cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS]) ((player_media_stream_buffer_status_e) status, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS]); + cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS]) + ((player_media_stream_buffer_status_e)status, + cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS]); } } -static void __media_stream_audio_buffer_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_stream_audio_buffer_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { /* player_media_stream_buffer_status_e status; */ int status; @@ -1052,12 +1055,13 @@ static void __media_stream_audio_buffer_cb_handler(callback_cb_info_s * cb_info, if (player_msg_get(status, recv_data->buffer)) { ((player_media_stream_buffer_status_cb) cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS]) - ((player_media_stream_buffer_status_e) status, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS]); + ((player_media_stream_buffer_status_e) status, + cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS]); } } -static void __media_stream_video_buffer_cb_handler_ex(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_stream_video_buffer_cb_handler_ex(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { /* player_media_stream_buffer_status_e status; */ int status; @@ -1075,7 +1079,7 @@ static void __media_stream_video_buffer_cb_handler_ex(callback_cb_info_s * cb_in } } -static void __media_stream_audio_buffer_cb_handler_ex(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_stream_audio_buffer_cb_handler_ex(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { /* player_media_stream_buffer_status_e status; */ int status; @@ -1094,7 +1098,7 @@ static void __media_stream_audio_buffer_cb_handler_ex(callback_cb_info_s * cb_in } -static void __media_stream_video_seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_stream_video_seek_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { unsigned long long offset; @@ -1105,7 +1109,7 @@ static void __media_stream_video_seek_cb_handler(callback_cb_info_s * cb_info, _ } } -static void __media_stream_audio_seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __media_stream_audio_seek_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { unsigned long long offset; @@ -1116,7 +1120,7 @@ static void __media_stream_audio_seek_cb_handler(callback_cb_info_s * cb_info, _ } } -static void __video_stream_changed_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) +static void __video_stream_changed_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { int width; int height; @@ -1130,12 +1134,12 @@ static void __video_stream_changed_cb_handler(callback_cb_info_s * cb_info, _pla MUSE_TYPE_INT, "bit_rate", (void *)&bit_rate, INVALID_MUSE_TYPE_VALUE); if (ret_val) { - ((player_video_stream_changed_cb) cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED]) + ((player_video_stream_changed_cb)cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED]) (width, height, fps, bit_rate, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED]); } } -static void (*_user_callbacks[MUSE_PLAYER_EVENT_TYPE_NUM]) (callback_cb_info_s * cb_info, _player_recv_data *recv_data) = { +static void (*_user_callbacks[MUSE_PLAYER_EVENT_TYPE_NUM])(callback_cb_info_s *cb_info, _player_recv_data *recv_data) = { __prepare_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_PREPARE */ __complete_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_COMPLETE */ __interrupt_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_INTERRUPT */ @@ -1198,7 +1202,7 @@ gboolean _player_event_job_function(void *user_data) g_mutex_unlock(&data->cb_info->event_queue.idle_ev_mutex); if (data->cb_info->user_cb[ev]) - _user_callbacks[ev] (data->cb_info, data->recv_data); + _user_callbacks[ev](data->cb_info, data->recv_data); else LOGW("user callback is unset. type : %d", ev); @@ -1254,7 +1258,7 @@ static void *_player_event_queue_loop(void *param) while (1) { g_mutex_lock(&ev->qlock); - event_data = (_player_cb_data *) g_queue_pop_head(ev->queue); + event_data = (_player_cb_data *)g_queue_pop_head(ev->queue); g_mutex_unlock(&ev->qlock); if (event_data) { muse_player_event_e event_type = ((_player_cb_data *)event_data)->int_data; @@ -1304,7 +1308,7 @@ static void *_player_event_queue_loop(void *param) return NULL; } -static gboolean _player_event_queue_new(callback_cb_info_s * cb_info) +static gboolean _player_event_queue_new(callback_cb_info_s *cb_info) { g_return_val_if_fail(cb_info, FALSE); player_event_queue *ev = &cb_info->event_queue; @@ -1319,7 +1323,7 @@ static gboolean _player_event_queue_new(callback_cb_info_s * cb_info) g_mutex_init(&ev->idle_ev_mutex); - 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); @@ -1405,7 +1409,7 @@ static void _player_remove_idle_event(callback_cb_info_s *cb_info, muse_player_e return; } -static void _player_event_queue_destroy(callback_cb_info_s * cb_info) +static void _player_event_queue_destroy(callback_cb_info_s *cb_info) { g_return_if_fail(cb_info); player_event_queue *ev = &cb_info->event_queue; @@ -1422,7 +1426,7 @@ static void _player_event_queue_destroy(callback_cb_info_s * cb_info) ev->thread = NULL; while (!g_queue_is_empty(ev->queue)) { - event_data = (_player_cb_data *) g_queue_pop_head(ev->queue); + event_data = (_player_cb_data *)g_queue_pop_head(ev->queue); if (event_data) { g_free(event_data->recv_data->buffer); g_free(event_data->recv_data); @@ -1436,7 +1440,7 @@ static void _player_event_queue_destroy(callback_cb_info_s * cb_info) g_mutex_clear(&ev->idle_ev_mutex); } -static void _player_event_queue_remove(player_event_queue * ev_queue, int ev) +static void _player_event_queue_remove(player_event_queue *ev_queue, int ev) { GList *item; @@ -1460,17 +1464,17 @@ static void _player_event_queue_remove(player_event_queue * ev_queue, int ev) g_mutex_unlock(&ev_queue->qlock); } -static void _player_event_queue_add(player_event_queue * ev, _player_cb_data * data) +static void _player_event_queue_add(player_event_queue *ev, _player_cb_data *data) { if (ev->running) { g_mutex_lock(&ev->qlock); - g_queue_push_tail(ev->queue, (gpointer) data); + g_queue_push_tail(ev->queue, (gpointer)data); g_mutex_unlock(&ev->qlock); g_cond_signal(&ev->cond); } } -static bool _user_callback_handler(callback_cb_info_s * cb_info, muse_player_event_e event, _player_recv_data *recv_data) +static bool _user_callback_handler(callback_cb_info_s *cb_info, muse_player_event_e event, _player_recv_data *recv_data) { /* LOGD("get event %d", event); */ @@ -1496,7 +1500,7 @@ static bool _user_callback_handler(callback_cb_info_s * cb_info, muse_player_eve return false; } -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; @@ -1517,7 +1521,7 @@ static void _add_ret_msg(muse_player_api_e api, callback_cb_info_s * cb_info, in 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; @@ -1535,7 +1539,7 @@ static ret_msg_s *_get_ret_msg(muse_player_api_e api, callback_cb_info_s * cb_in return NULL; } -static void _remove_all_ret_msg(callback_cb_info_s * cb_info) +static void _remove_all_ret_msg(callback_cb_info_s *cb_info) { ret_msg_s *msg = cb_info->buff.retMsgHead; ret_msg_s *prev = NULL; @@ -1549,7 +1553,7 @@ static void _remove_all_ret_msg(callback_cb_info_s * cb_info) } } -static void _notify_disconnected(callback_cb_info_s * cb_info) +static void _notify_disconnected(callback_cb_info_s *cb_info) { muse_player_event_e event = MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED; if (!cb_info || !cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR]) @@ -1597,7 +1601,7 @@ static void *client_cb_handler(gpointer data) while (offset < len) { api = MUSE_PLAYER_API_MAX; // LOGD(">>>>>> [%d/%d] %p, %s", offset, len, recvMsg + offset, recvMsg + offset); -// usleep(10*1000); +// usleep(10 * 1000); void *jobj = muse_core_msg_object_new(recvMsg + offset, &parse_len, &err); if (jobj) { @@ -1621,7 +1625,7 @@ static void *client_cb_handler(gpointer data) recv_data = g_new0(_player_recv_data, 1); if (recv_data != NULL) { memcpy(recv_data->tfd, tfd, sizeof(recv_data->tfd)); - recv_data->buffer = g_strndup(recvMsg+offset, parse_len); + recv_data->buffer = g_strndup(recvMsg + offset, parse_len); } else { LOGE("failed to alloc recv_data."); g_mutex_unlock(&cb_info->player_mutex); @@ -1703,7 +1707,7 @@ static callback_cb_info_s *callback_new(gint sockfd) 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); @@ -1740,12 +1744,11 @@ static void callback_destroy(callback_cb_info_s * cb_info) g_free(cb_info->buff.recvMsg); _remove_all_ret_msg(cb_info); - if (cb_info->buff.part_of_msg) - g_free(cb_info->buff.part_of_msg); + g_free(cb_info->buff.part_of_msg); g_free(cb_info); } -int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api) +int client_get_api_timeout(player_cli_s *pc, muse_player_api_e api) { int timeout = 0; @@ -1768,7 +1771,7 @@ int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api) return timeout; /* ms */ } -int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s * cb_info, char **ret_buf, int time_out) +int client_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_MILLISECOND; @@ -1813,7 +1816,7 @@ int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s * cb_inf return ret; } -int client_wait_for_server_ack(muse_player_api_e api, callback_cb_info_s * cb_info, int time_out) +int client_wait_for_server_ack(muse_player_api_e api, callback_cb_info_s *cb_info, int time_out) { int ret = PLAYER_ERROR_NONE; gint64 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_MILLISECOND; @@ -1844,7 +1847,7 @@ int client_wait_for_server_ack(muse_player_api_e api, callback_cb_info_s * cb_in * Public Implementation */ -int player_create(player_h * player) +int player_create(player_h *player) { PLAYER_INSTANCE_CHECK(player); @@ -1905,7 +1908,7 @@ int player_create(player_h * player) ret = client_wait_for_cb_return(api, pc->cb_info, &ret_buf, CALLBACK_TIME_OUT * 2); if (ret == PLAYER_ERROR_NONE) { intptr_t module_addr = 0; - *player = (player_h) pc; + *player = (player_h)pc; if (player_msg_get_type(module_addr, ret_buf, POINTER)) { pc->cb_info->data_fd = muse_client_new_data_ch(); if ((pc->cb_info->data_fd < 0) || (!muse_core_fd_is_valid(pc->cb_info->data_fd))) { @@ -1951,7 +1954,7 @@ int player_create(player_h * player) LOGD("LEAVE 0x%X", ret); return ret; - ERROR: +ERROR: if (pc && pc->cb_info) { if (pc->cb_info->event_queue.running) _player_event_queue_destroy(pc->cb_info); @@ -1981,7 +1984,7 @@ int player_destroy(player_h player) 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; #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -2035,7 +2038,7 @@ int player_prepare_async(player_h player, player_prepared_cb callback, void *use 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; LOGD("ENTER"); @@ -2069,7 +2072,7 @@ int player_prepare(player_h player) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_PREPARE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %p", pc); @@ -2094,7 +2097,7 @@ int player_unprepare(player_h player) 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; int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL; player_state_e state = PLAYER_STATE_NONE; @@ -2189,7 +2192,7 @@ int _player_get_valid_path(const char *uri, char *valid_path) if (storage_get_origin_internal_path((file_path) ? (file_path) : (uri), MAX_URL_LEN, valid_path) < 0) { /* cannot convert path. use the original one. */ - strncpy(valid_path, (file_path) ? (file_path) : (uri), MAX_URL_LEN-1); + strncpy(valid_path, (file_path) ? (file_path) : (uri), MAX_URL_LEN - 1); } else { /* need to use converted path. */ SECURE_LOGD("Converted path : %s -> %s", uri, valid_path); @@ -2206,7 +2209,7 @@ int player_set_uri(player_h player, const char *uri) 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; char path[MAX_URL_LEN] = {0, }; @@ -2217,7 +2220,7 @@ int player_set_uri(player_h player, const char *uri) SECURE_LOGD("new path : %s", path); - PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_STRING, "path", (const char*)path); + PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_STRING, "path", (const char *)path); pc->push_media_stream = FALSE; g_free(ret_buf); @@ -2230,7 +2233,7 @@ int player_set_memory_buffer(player_h player, const void *data, int size) 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 = NULL; tbm_bo_handle thandle; @@ -2286,7 +2289,7 @@ int player_set_memory_buffer(player_h player, const void *data, int size) return ret; } -static void _player_release_internal_memory(player_cli_s * pc, bool deinit_server_mem) +static void _player_release_internal_memory(player_cli_s *pc, bool deinit_server_mem) { if (!pc) return; @@ -2297,7 +2300,7 @@ static void _player_release_internal_memory(player_cli_s * pc, bool deinit_serve _player_deinit_memory_buffer(pc); } -static int _player_deinit_memory_buffer(player_cli_s * pc) +static int _player_deinit_memory_buffer(player_cli_s *pc) { PLAYER_INSTANCE_CHECK(pc); int ret = PLAYER_ERROR_NONE; @@ -2318,7 +2321,7 @@ int player_get_state(player_h player, player_state_e *pstate) PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(pstate); int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; LOGD("ENTER"); @@ -2333,7 +2336,7 @@ int player_set_volume(player_h player, float left, float right) 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"); @@ -2352,7 +2355,7 @@ int player_get_volume(player_h player, float *pleft, float *pright) PLAYER_NULL_ARG_CHECK(pleft && 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; @@ -2386,7 +2389,7 @@ int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_inf PLAYER_INSTANCE_CHECK(player); muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_STREAM_INFO; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; bool is_available = false; char *ret_buf = NULL; @@ -2408,7 +2411,7 @@ int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_inf ret = sound_manager_get_index_from_stream_information(stream_info, &stream_index); if (ret == SOUND_MANAGER_ERROR_NONE) PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_STRING, "stream_type", (const char*)stream_type, + MUSE_TYPE_STRING, "stream_type", (const char *)stream_type, MUSE_TYPE_INT, "stream_index", stream_index); else ret = PLAYER_ERROR_INVALID_OPERATION; @@ -2426,7 +2429,7 @@ int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_ 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"); @@ -2436,13 +2439,13 @@ int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_ 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; @@ -2465,7 +2468,7 @@ int player_start(player_h player) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_START; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %p", pc); @@ -2500,7 +2503,7 @@ int player_stop(player_h player) 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; player_state_e state = PLAYER_STATE_NONE; #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -2548,7 +2551,7 @@ int player_pause(player_h player) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_PAUSE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %p", pc); @@ -2567,7 +2570,7 @@ static int _set_play_position(player_h player, int64_t pos, bool accurate, playe 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; LOGD("ENTER %p", pc); @@ -2657,7 +2660,7 @@ static int _get_play_position(player_h player, int64_t *pos) int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_PLAY_POSITION; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; PLAYER_SEND_MSG(api, pc, ret_buf, ret); @@ -2715,7 +2718,7 @@ int player_set_mute(player_h player, bool muted) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_MUTE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int mute = (int)muted; @@ -2726,13 +2729,13 @@ int player_set_mute(player_h player, bool muted) return ret; } -int player_is_muted(player_h player, bool * muted) +int player_is_muted(player_h player, bool *muted) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(muted); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_IS_MUTED; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int mute = -1; @@ -2741,7 +2744,7 @@ int player_is_muted(player_h player, bool * muted) PLAYER_SEND_MSG(api, pc, ret_buf, ret); if (ret == PLAYER_ERROR_NONE) { player_msg_get(mute, ret_buf); - *muted = (bool) mute; + *muted = (bool)mute; } g_free(ret_buf); @@ -2753,7 +2756,7 @@ int player_set_looping(player_h player, bool looping) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_LOOPING; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -2763,13 +2766,13 @@ int player_set_looping(player_h player, bool looping) 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; @@ -2791,7 +2794,7 @@ static int _get_duration(player_h player, int64_t *duration) 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; LOGD("ENTER"); @@ -2879,7 +2882,7 @@ int player_set_display(player_h player, player_display_type_e type, player_displ 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; wl_win_msg_type wl_win; char *wl_win_msg = (char *)&wl_win; @@ -2983,9 +2986,9 @@ int player_set_display(player_h player, player_display_type_e type, player_displ wl_win.type = conv_type; } - arr_msg_len = (sizeof(wl_win_msg_type)/sizeof(int) + (sizeof(wl_win_msg_type)%sizeof(int) ? 1 : 0)); + arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0)); PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int*)wl_win_msg); + MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg); g_free(ret_buf); return ret; @@ -2997,7 +3000,7 @@ int player_set_display_mode(player_h player, player_display_mode_e mode) PLAYER_CHECK_CONDITION(PLAYER_DISPLAY_MODE_LETTER_BOX <= mode && mode < PLAYER_DISPLAY_MODE_NUM, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); int ret = PLAYER_ERROR_NONE; 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; #ifdef TIZEN_FEATURE_EVAS_RENDERER int (*p_disp_set_evas_display_disp_mode)(void *, int) = NULL; @@ -3023,13 +3026,13 @@ int player_set_display_mode(player_h player, player_display_mode_e mode) 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; muse_player_api_e api = MUSE_PLAYER_API_GET_DISPLAY_MODE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int mode = -1; #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -3066,7 +3069,7 @@ int player_set_video_roi_area(player_h player, double x_scale, double y_scale, PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_ROI_AREA; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -3097,7 +3100,7 @@ int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale, int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_ROI_AREA; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; double scale_x = 0, scale_y = 0, scale_w = 0, scale_h = 0; @@ -3135,7 +3138,7 @@ int player_set_display_roi_area(player_h player, int x, int y, int width, int he int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_ROI_AREA; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; wl_win_msg_type wl_win; char *wl_win_msg = (char *)&wl_win; @@ -3170,9 +3173,9 @@ int player_set_display_roi_area(player_h player, int x, int y, int width, int he wl_win.win_roi_width = width; wl_win.win_roi_height = height; - arr_msg_len = (sizeof(wl_win_msg_type)/sizeof(int) + (sizeof(wl_win_msg_type)%sizeof(int) ? 1 : 0)); + arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0)); PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int*)wl_win_msg); + MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg); g_free(ret_buf); return ret; @@ -3184,7 +3187,7 @@ int player_set_playback_rate(player_h player, float rate) 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"); @@ -3203,7 +3206,7 @@ int player_set_display_rotation(player_h player, player_display_rotation_e rotat 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; #ifdef TIZEN_FEATURE_EVAS_RENDERER int (*p_disp_set_evas_display_rotation)(void *, int) = NULL; @@ -3230,12 +3233,12 @@ int player_set_display_rotation(player_h player, player_display_rotation_e rotat 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; muse_player_api_e api = MUSE_PLAYER_API_GET_DISPLAY_ROTATION; char *ret_buf = NULL; int rotation = -1; @@ -3271,7 +3274,7 @@ int player_set_display_visible(player_h player, bool visible) { 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_DISPLAY_VISIBLE; char *ret_buf = NULL; #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -3301,12 +3304,12 @@ int player_set_display_visible(player_h player, bool visible) 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; muse_player_api_e api = MUSE_PLAYER_API_IS_DISPLAY_VISIBLE; char *ret_buf = NULL; int value = -1; @@ -3353,7 +3356,7 @@ int player_get_content_info(player_h player, player_content_info_e key, char **p 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, }; @@ -3374,7 +3377,7 @@ int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_co PLAYER_NULL_ARG_CHECK(paudio_codec || pvideo_codec); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_INFO; - player_cli_s *pc = (player_cli_s *) player; + 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, }; @@ -3407,7 +3410,7 @@ int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchann PLAYER_NULL_ARG_CHECK(psample_rate || pchannel || pbit_rate); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int sample_rate = 0; int channel = 0; @@ -3444,7 +3447,7 @@ int player_get_video_stream_info(player_h player, int *pfps, int *pbit_rate) PLAYER_NULL_ARG_CHECK(pfps || pbit_rate); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int fps = 0; int bit_rate = 0; @@ -3477,7 +3480,7 @@ int player_get_video_size(player_h player, int *pwidth, int *pheight) PLAYER_NULL_ARG_CHECK(pwidth && pheight); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_SIZE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int width = 0; int height = 0; @@ -3508,7 +3511,7 @@ int player_get_album_art(player_h player, void **palbum_art, int *psize) PLAYER_NULL_ARG_CHECK(palbum_art && psize); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_ALBUM_ART; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; char *album_art; int size = 0; @@ -3577,8 +3580,7 @@ EXIT: if (jobj) muse_core_msg_object_free(jobj); - if (ret_buf) - g_free(ret_buf); + g_free(ret_buf); if (tfd > INVALID_DEFAULT_VALUE) close(tfd); @@ -3604,7 +3606,7 @@ int player_audio_effect_get_equalizer_bands_count(player_h player, int *pcount) 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; @@ -3625,7 +3627,7 @@ int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_level 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"); @@ -3644,7 +3646,7 @@ int player_audio_effect_set_equalizer_band_level(player_h player, int index, int 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"); @@ -3663,7 +3665,7 @@ int player_audio_effect_get_equalizer_band_level(player_h player, int index, int 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; @@ -3684,7 +3686,7 @@ int player_audio_effect_get_equalizer_level_range(player_h player, int *pmin, in PLAYER_NULL_ARG_CHECK(pmin && pmax); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int min = 0, max = 0; @@ -3714,7 +3716,7 @@ int player_audio_effect_get_equalizer_band_frequency(player_h player, int index, 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; @@ -3735,7 +3737,7 @@ int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int 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; @@ -3755,7 +3757,7 @@ int player_audio_effect_equalizer_clear(player_h player) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_EQUALIZER_CLEAR; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -3765,13 +3767,13 @@ int player_audio_effect_equalizer_clear(player_h player) 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; @@ -3791,7 +3793,7 @@ int player_set_subtitle_path(player_h player, const char *path) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_SUBTITLE_PATH; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; char subtitle_path[MAX_URL_LEN] = {0, }; @@ -3800,7 +3802,7 @@ int player_set_subtitle_path(player_h player, const char *path) if (path && _player_get_valid_path(path, subtitle_path) != PLAYER_ERROR_NONE) return PLAYER_ERROR_INVALID_PARAMETER; - PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_STRING, "subtitle_path", (const char*)subtitle_path); + PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_STRING, "subtitle_path", (const char *)subtitle_path); g_free(ret_buf); return ret; } @@ -3810,7 +3812,7 @@ int player_set_subtitle_position_offset(player_h player, int milliseconds) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_SUBTITLE_POSITION_OFFSET; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -3827,7 +3829,7 @@ int player_capture_video(player_h player, player_video_captured_cb callback, voi 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"); @@ -3856,7 +3858,7 @@ int player_set_streaming_cookie(player_h player, const char *cookie, int size) 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"); @@ -3875,7 +3877,7 @@ int player_set_streaming_user_agent(player_h player, const char *user_agent, int PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_USER_AGENT; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -3893,7 +3895,7 @@ int player_get_streaming_download_progress(player_h player, int *start, int *end PLAYER_NULL_ARG_CHECK(start && end); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int start_pos = 0, end_pos = 0; @@ -4003,7 +4005,7 @@ int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media 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; muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME; @@ -4029,7 +4031,7 @@ int player_unset_media_packet_video_frame_decoded_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; muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME; @@ -4052,7 +4054,7 @@ int player_set_video_stream_changed_cb(player_h player, player_video_stream_chan 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; muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED; @@ -4078,7 +4080,7 @@ 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; muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED; @@ -4101,7 +4103,7 @@ int player_set_media_stream_buffer_status_cb(player_h player, player_stream_type 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; muse_player_event_e type; @@ -4109,11 +4111,11 @@ int player_set_media_stream_buffer_status_cb(player_h player, player_stream_type LOGD("ENTER"); - if (stream_type == PLAYER_STREAM_TYPE_VIDEO) + if (stream_type == PLAYER_STREAM_TYPE_VIDEO) { type = MUSE_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 = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS; - else { + } else { LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type); return PLAYER_ERROR_INVALID_PARAMETER; } @@ -4136,7 +4138,7 @@ int player_unset_media_stream_buffer_status_cb(player_h player, player_stream_ty { 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; muse_player_event_e type; @@ -4144,11 +4146,11 @@ int player_unset_media_stream_buffer_status_cb(player_h player, player_stream_ty LOGD("ENTER"); - if (stream_type == PLAYER_STREAM_TYPE_VIDEO) + if (stream_type == PLAYER_STREAM_TYPE_VIDEO) { type = MUSE_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 = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS; - else { + } else { LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type); return PLAYER_ERROR_INVALID_PARAMETER; } @@ -4168,7 +4170,7 @@ int player_set_media_stream_seek_cb(player_h player, player_stream_type_e stream 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; muse_player_event_e type; @@ -4176,11 +4178,11 @@ int player_set_media_stream_seek_cb(player_h player, player_stream_type_e stream LOGD("ENTER"); - if (stream_type == PLAYER_STREAM_TYPE_VIDEO) + if (stream_type == PLAYER_STREAM_TYPE_VIDEO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK; - else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) + } else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK; - else { + } else { LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type); return PLAYER_ERROR_INVALID_PARAMETER; } @@ -4203,7 +4205,7 @@ int player_unset_media_stream_seek_cb(player_h player, player_stream_type_e stre { 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; muse_player_event_e type; @@ -4211,11 +4213,11 @@ int player_unset_media_stream_seek_cb(player_h player, player_stream_type_e stre LOGD("ENTER"); - if (stream_type == PLAYER_STREAM_TYPE_VIDEO) + if (stream_type == PLAYER_STREAM_TYPE_VIDEO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK; - else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) + } else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK; - else { + } else { LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type); return PLAYER_ERROR_INVALID_PARAMETER; } @@ -4236,7 +4238,7 @@ int player_push_media_stream(player_h player, media_packet_h packet) PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(packet); int ret = PLAYER_ERROR_NONE; - 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; @@ -4310,8 +4312,8 @@ int player_push_media_stream(player_h player, media_packet_h packet) arr_msg_len = (msg_size / sizeof(int) + (msg_size % sizeof(int) ? 1 : 0)); arr_buf_len = (buf_size / sizeof(int) + (buf_size % sizeof(int) ? 1 : 0)); PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_ARRAY, "push_media_msg", arr_msg_len, (int*)push_media_msg, - MUSE_TYPE_ARRAY, "buf", arr_buf_len, (int*)buf); + MUSE_TYPE_ARRAY, "push_media_msg", arr_msg_len, (int *)push_media_msg, + MUSE_TYPE_ARRAY, "buf", arr_buf_len, (int *)buf); } else #endif @@ -4324,13 +4326,13 @@ int player_push_media_stream(player_h player, media_packet_h packet) arr_msg_len = (msg_size / sizeof(int) + (msg_size % sizeof(int) ? 1 : 0)); PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_ARRAY, "push_media_msg", arr_msg_len, (int*)push_media_msg); + MUSE_TYPE_ARRAY, "push_media_msg", arr_msg_len, (int *)push_media_msg); } LOGD("ret_buf %s", ret_buf); #ifdef __UN_USED - ERROR: +ERROR: if (tfd > INVALID_DEFAULT_VALUE) close(tfd); @@ -4347,7 +4349,7 @@ int player_set_media_stream_info(player_h player, player_stream_type_e type, med 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; @@ -4408,7 +4410,7 @@ int player_set_media_stream_buffer_max_size(player_h player, player_stream_type_ PLAYER_CHECK_CONDITION(max_size > 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; + 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; @@ -4427,7 +4429,7 @@ int player_get_media_stream_buffer_max_size(player_h player, player_stream_type_ 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; @@ -4449,7 +4451,7 @@ int player_set_media_stream_buffer_min_threshold(player_h player, player_stream_ PLAYER_CHECK_CONDITION(PLAYER_STREAM_TYPE_DEFAULT <= type && type <= PLAYER_STREAM_TYPE_TEXT, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; + 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; @@ -4468,7 +4470,7 @@ int player_get_media_stream_buffer_min_threshold(player_h player, player_stream_ 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; @@ -4490,7 +4492,7 @@ int player_get_track_count(player_h player, player_stream_type_e type, int *pcou 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; @@ -4512,7 +4514,7 @@ int player_get_current_track(player_h player, player_stream_type_e type, int *pi 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; @@ -4533,7 +4535,7 @@ int player_select_track(player_h player, player_stream_type_e type, int index) { PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; muse_player_api_e api = MUSE_PLAYER_API_SELECT_TRACK; char *ret_buf = NULL; @@ -4550,7 +4552,7 @@ int player_get_track_language_code(player_h player, player_stream_type_e type, i 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, }; @@ -4579,7 +4581,7 @@ int player_foreach_adaptive_variant(player_h player, player_adaptive_variant_cb 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_GET_ADAPTIVE_VARIANT_INFO; char *ret_buf = NULL; char var_info[MUSE_MSG_MAX_LENGTH] = { 0, }; @@ -4628,7 +4630,7 @@ int player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int wi PLAYER_INSTANCE_CHECK(player); PLAYER_CHECK_CONDITION(bandwidth >= -1 && width >= -1 && height >= -1, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; muse_player_api_e api = MUSE_PLAYER_API_SET_MAX_ADAPTIVE_VARIANT_LIMIT; char *ret_buf = NULL; @@ -4651,7 +4653,7 @@ int player_get_max_adaptive_variant_limit(player_h player, int *pbandwidth, int PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(pbandwidth || pwidth || pheight); - 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_MAX_ADAPTIVE_VARIANT_LIMIT; char *ret_buf = NULL; int bandwidth = -1, width = -1, height = -1; @@ -4684,7 +4686,7 @@ int player_set_audio_only(player_h player, bool audio_only) { int ret = PLAYER_ERROR_NONE; PLAYER_INSTANCE_CHECK(player); - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_ONLY; char *ret_buf = NULL; player_state_e state = PLAYER_STATE_NONE; @@ -4722,7 +4724,7 @@ int player_is_audio_only(player_h player, bool *paudio_only) PLAYER_NULL_ARG_CHECK(paudio_only); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_IS_AUDIO_ONLY; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int audio_only = 0; @@ -4751,7 +4753,7 @@ int player_set_streaming_buffering_time(player_h player, int buffer_ms, int rebu PLAYER_INSTANCE_CHECK(player); PLAYER_CHECK_CONDITION(buffer_ms >= 0 && rebuffer_ms >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); - 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_STREAMING_BUFFERING_TIME; char *ret_buf = NULL; @@ -4773,7 +4775,7 @@ int player_get_streaming_buffering_time(player_h player, int *buffer_ms, int *re int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_STREAMING_BUFFERING_TIME; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; int buffering_time = 0, rebuffering_time = 0; char *ret_buf = NULL; @@ -4811,7 +4813,7 @@ int player_360_is_content_spherical(player_h player, bool *is_spherical) int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_IS_CONTENT_SPHERICAL; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int val = 0; @@ -4836,7 +4838,7 @@ int player_360_set_enabled(player_h player, bool enabled) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_ENABLED; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int val = (int)enabled; @@ -4858,7 +4860,7 @@ int player_360_is_enabled(player_h player, bool *enabled) PLAYER_NULL_ARG_CHECK(enabled); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_IS_ENABLED; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int val = 0; @@ -4882,11 +4884,11 @@ int player_360_set_direction_of_view(player_h player, float yaw, float pitch) PLAYER_INSTANCE_CHECK(player); PLAYER_CHECK_CONDITION(yaw >= (float)-M_PI && yaw <= (float)M_PI, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); - PLAYER_CHECK_CONDITION(pitch >= (float)-M_PI/2 && pitch <= (float)M_PI/2, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); + PLAYER_CHECK_CONDITION(pitch >= (float)-M_PI / 2 && pitch <= (float)M_PI / 2, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_DIRECTION_OF_VIEW; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %f %f", yaw, pitch); @@ -4910,7 +4912,7 @@ int player_360_get_direction_of_view(player_h player, float *yaw, float *pitch) PLAYER_NULL_ARG_CHECK(yaw && pitch); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_GET_DIRECTION_OF_VIEW; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; double yaw_val = -1; double pitch_val = -1; char *ret_buf = NULL; @@ -4950,7 +4952,7 @@ int player_360_set_zoom(player_h player, float level) int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_ZOOM; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %f", level); @@ -4971,7 +4973,7 @@ int player_360_get_zoom(player_h player, float *level) PLAYER_NULL_ARG_CHECK(level); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_GET_ZOOM; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; double zoom = -1; char *ret_buf = NULL; @@ -5006,7 +5008,7 @@ int player_360_set_field_of_view(player_h player, int horizontal_degrees, int ve int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_FIELD_OF_VIEW; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %d %d", horizontal_degrees, vertical_degrees); @@ -5029,7 +5031,7 @@ int player_360_get_field_of_view(player_h player, int *horizontal_degrees, int * PLAYER_NULL_ARG_CHECK(horizontal_degrees && vertical_degrees); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_GET_FIELD_OF_VIEW; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; int h_val = -1; int v_val = -1; char *ret_buf = NULL; @@ -5071,7 +5073,7 @@ int player_360_set_zoom_with_field_of_view(player_h player, float level, int hor int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_360_SET_ZOOM_WITH_FIELD_OF_VIEW; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %f %d %d", level, horizontal_degrees, vertical_degrees); @@ -5091,7 +5093,7 @@ int player_set_replaygain_enabled(player_h player, bool enabled) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_REPLAYGAIN_ENABLED; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int val = (int)enabled; @@ -5108,7 +5110,7 @@ int player_is_replaygain_enabled(player_h player, bool *enabled) PLAYER_NULL_ARG_CHECK(enabled); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_IS_REPLAYGAIN_ENABLED; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int val = -1; @@ -5117,7 +5119,7 @@ int player_is_replaygain_enabled(player_h player, bool *enabled) PLAYER_SEND_MSG(api, pc, ret_buf, ret); if (ret == PLAYER_ERROR_NONE) { player_msg_get(val, ret_buf); - *enabled = (bool) val; + *enabled = (bool)val; } g_free(ret_buf); diff --git a/src/player_internal.c b/src/player_internal.c index 36f1ff4..60b9322 100644 --- a/src/player_internal.c +++ b/src/player_internal.c @@ -32,7 +32,7 @@ int player_set_pcm_extraction_mode(player_h player, bool sync, player_audio_pcm_ 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; muse_player_event_e event = MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME; @@ -55,7 +55,7 @@ int player_set_pcm_spec(player_h player, const char *format, int samplerate, int 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"); @@ -74,7 +74,7 @@ int player_set_streaming_playback_rate(player_h player, float rate) 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"); @@ -89,7 +89,7 @@ int player_set_media_stream_buffer_status_cb_ex(player_h player, player_stream_t 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; muse_player_event_e type; @@ -97,11 +97,11 @@ int player_set_media_stream_buffer_status_cb_ex(player_h player, player_stream_t LOGD("ENTER"); - if (stream_type == PLAYER_STREAM_TYPE_VIDEO) + if (stream_type == PLAYER_STREAM_TYPE_VIDEO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS_WITH_INFO; - else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) + } else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS_WITH_INFO; - else { + } else { LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type); return PLAYER_ERROR_INVALID_PARAMETER; } @@ -118,7 +118,7 @@ int player_set_media_stream_buffer_status_cb_ex(player_h player, player_stream_t return ret; } -static void set_null_user_cb(callback_cb_info_s * cb_info, muse_player_event_e event) +static void set_null_user_cb(callback_cb_info_s *cb_info, muse_player_event_e event) { if (cb_info && event < MUSE_PLAYER_EVENT_TYPE_NUM) { cb_info->user_cb[event] = NULL; @@ -126,7 +126,7 @@ static void set_null_user_cb(callback_cb_info_s * cb_info, muse_player_event_e e } } -static void set_null_user_cb_lock(callback_cb_info_s * cb_info, muse_player_event_e event) +static void set_null_user_cb_lock(callback_cb_info_s *cb_info, muse_player_event_e event) { bool lock = g_thread_self() != cb_info->event_queue.thread; @@ -143,7 +143,7 @@ int player_unset_media_stream_buffer_status_cb_ex(player_h player, player_stream { 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; muse_player_event_e type; @@ -151,11 +151,11 @@ int player_unset_media_stream_buffer_status_cb_ex(player_h player, player_stream LOGD("ENTER"); - if (stream_type == PLAYER_STREAM_TYPE_VIDEO) + if (stream_type == PLAYER_STREAM_TYPE_VIDEO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS_WITH_INFO; - else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) + } else if (stream_type == PLAYER_STREAM_TYPE_AUDIO) { type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS_WITH_INFO; - else { + } else { LOGE("PLAYER_ERROR_INVALID_PARAMETER(type : %d)", stream_type); return PLAYER_ERROR_INVALID_PARAMETER; } @@ -173,7 +173,7 @@ int player_set_media_stream_dynamic_resolution(player_h player, bool drc) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_DYNAMIC_RESOLUTION; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -188,7 +188,7 @@ int player_set_ecore_wl_display(player_h player, player_display_type_e type, voi 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; wl_win_msg_type wl_win; char *wl_win_msg = (char *)&wl_win; @@ -216,11 +216,13 @@ int player_set_ecore_wl_display(player_h player, player_display_type_e type, voi if (wl_surface_id > 0) { wl_win.surface_id = wl_surface_id; wl_win.type = conv_type; - } else return PLAYER_ERROR_INVALID_OPERATION; + } else { + return PLAYER_ERROR_INVALID_OPERATION; + } arr_msg_len = (sizeof(wl_win_msg_type) / sizeof(int) + (sizeof(wl_win_msg_type) % sizeof(int) ? 1 : 0)); PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int*)wl_win_msg); + MUSE_TYPE_ARRAY, "wl_win_msg", arr_msg_len, (int *)wl_win_msg); g_free(ret_buf); return ret; @@ -232,7 +234,7 @@ int player_set_next_uri(player_h player, const char *uri) PLAYER_NULL_ARG_CHECK(uri); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_NEXT_URI; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; char path[MAX_URL_LEN] = {0, }; @@ -253,7 +255,7 @@ int player_get_next_uri(player_h player, char **uri) PLAYER_NULL_ARG_CHECK(uri); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_NEXT_URI; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; char next_uri[MUSE_MSG_MAX_LENGTH] = { 0, }; @@ -282,7 +284,7 @@ int player_set_gapless(player_h player, bool gapless) PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_GAPLESS; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER"); @@ -298,7 +300,7 @@ int player_is_gapless(player_h player, bool *gapless) PLAYER_NULL_ARG_CHECK(gapless); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_IS_GAPLESS; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int value = 0; @@ -317,7 +319,7 @@ int player_enable_tsurf_pool(player_h player, bool enable) { 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; LOGD("ENTER enable:%d", enable); @@ -336,7 +338,7 @@ int player_is_enabled_tsurf_pool(player_h player, bool *enabled) PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(enabled); int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; LOGD("ENTER"); if (pc && pc->cb_info) { @@ -356,7 +358,7 @@ int player_get_media_packet_video_frame_pool_size(player_h player, int *size) int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_PACKET_VIDEO_FRAME_POOL_SIZE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int value = 0; @@ -378,7 +380,7 @@ int player_enable_media_packet_video_frame_decoded_cb(player_h player, bool enab PLAYER_INSTANCE_CHECK(player); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_ENABLE_MEDIA_PACKET_VIDEO_FRAME_DECODED_CB; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER %d", enable); @@ -395,7 +397,7 @@ int player_set_codec_type(player_h player, player_stream_type_e stream_type, pla int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_CODEC_TYPE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; LOGD("ENTER stream: %d, codec: %d", stream_type, codec_type); @@ -417,7 +419,7 @@ int player_get_codec_type(player_h player, player_stream_type_e stream_type, pla int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_TYPE; - player_cli_s *pc = (player_cli_s *) player; + player_cli_s *pc = (player_cli_s *)player; char *ret_buf = NULL; int codec_type = 0; diff --git a/test/event-handler/include/mm_navevent_handler.h b/test/event-handler/include/mm_navevent_handler.h index 99d9510..6e957af 100644 --- a/test/event-handler/include/mm_navevent_handler.h +++ b/test/event-handler/include/mm_navevent_handler.h @@ -115,7 +115,7 @@ typedef enum { * @see mm_navevent_handler_set_cb() * @see mm_navevent_handler_unset_cb() */ -typedef void (*mm_navevent_handler_cb) (enum libinput_event_type ev_t, int x, int y, void* data, float e[3]); +typedef void (*mm_navevent_handler_cb)(enum libinput_event_type ev_t, int x, int y, void *data, float e[3]); /** * @brief Creates an instance of navigation event handler and diff --git a/test/event-handler/src/mm_navevent_handler_internal.c b/test/event-handler/src/mm_navevent_handler_internal.c index 36f5ee4..b36b087 100644 --- a/test/event-handler/src/mm_navevent_handler_internal.c +++ b/test/event-handler/src/mm_navevent_handler_internal.c @@ -77,7 +77,7 @@ static int __mm_navevent_handler_init_input(mm_navevent_handler_s *handler) static void set_initial_coordinates(mm_navevent_handler_s *handler, struct libinput_event *ev) { struct libinput_event_touch *t = libinput_event_get_touch_event(ev); - MM_EH_DEBUG("Got touch down event. Time - %f sec", libinput_event_touch_get_time(t)/1000.0); + MM_EH_DEBUG("Got touch down event. Time - %f sec", libinput_event_touch_get_time(t) / 1000.0); pthread_mutex_lock(&handler->event_lock); @@ -96,7 +96,7 @@ static void set_initial_coordinates(mm_navevent_handler_s *handler, struct libin static void set_final_coordinates(mm_navevent_handler_s *handler, struct libinput_event *ev) { struct libinput_event_touch *t = libinput_event_get_touch_event(ev); - MM_EH_DEBUG("Got touch up event. Time - %f sec", libinput_event_touch_get_time(t)/1000.0); + MM_EH_DEBUG("Got touch up event. Time - %f sec", libinput_event_touch_get_time(t) / 1000.0); pthread_mutex_lock(&handler->event_lock); @@ -170,7 +170,7 @@ static void update_angles(mm_navevent_handler_s *handler) return; } - handler->angles[0] += ((float)handler->fov.width * (x - last_x) / (float)handler->window_size.width) * M_PI / 180.0; + handler->angles[0] += ((float)handler->fov.width * (x - last_x) / (float)handler->window_size.width) * M_PI / 180.0; handler->angles[1] += ((float)handler->fov.height * (y - last_y) / (float)handler->window_size.height) * M_PI / 180.0; /* Fix yaw angle */ diff --git a/test/player_audio_test.c b/test/player_audio_test.c index 0a08a9c..1772b6e 100644 --- a/test/player_audio_test.c +++ b/test/player_audio_test.c @@ -148,7 +148,7 @@ static void prepared_cb(void *user_data) g_print("[Player_Audio_Test] prepared_cb!!!!\n"); } -static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame, void *user_data) +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; @@ -159,9 +159,9 @@ static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame #if DUMP_OUTBUF if (audio_raw->channel_mask == 1 && fp_out1) - fwrite((guint8 *) audio_raw->data, 1, audio_raw->size, fp_out1); + fwrite((guint8 *)audio_raw->data, 1, audio_raw->size, fp_out1); else if (audio_raw->channel_mask == 2 && fp_out2) - fwrite((guint8 *) audio_raw->data, 1, audio_raw->size, fp_out2); + fwrite((guint8 *)audio_raw->data, 1, audio_raw->size, fp_out2); #endif } @@ -252,7 +252,7 @@ static void input_filename(char *filename) if (player_create(&g_player[i]) != PLAYER_ERROR_NONE) g_print("player create is failed\n"); } - strncpy(g_uri, filename, len+1); + strncpy(g_uri, filename, len + 1); #if 0 /* ned(APPSRC_TEST) */ @@ -267,7 +267,7 @@ static void input_filename(char *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); + 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); @@ -296,7 +296,7 @@ static void player_set_memory_buffer_test() 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); + 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); @@ -330,7 +330,7 @@ static void buffer_need_audio_data_cb(unsigned int size, void *user_data) fp = fopen(fname, "rb"); if (fp) { - buff_ptr = (guint8 *) g_malloc0(1048576); + buff_ptr = (guint8 *)g_malloc0(1048576); if (!buff_ptr) { g_print("no free space\n"); fclose(fp); @@ -362,10 +362,10 @@ static void buffer_need_audio_data_cb(unsigned int size, void *user_data) 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) != MEDIA_PACKET_ERROR_NONE) + if (media_packet_set_pts(g_audio_pkt, (uint64_t)audio_pts) != MEDIA_PACKET_ERROR_NONE) goto EXIT; - if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t) real_read_len) != MEDIA_PACKET_ERROR_NONE) + if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE) goto EXIT; memcpy(src, buff_ptr, real_read_len); @@ -375,11 +375,9 @@ static void buffer_need_audio_data_cb(unsigned int size, void *user_data) #endif audio_pts += audio_dur; - EXIT: - if (buff_ptr) { - g_free(buff_ptr); - buff_ptr = NULL; - } + +EXIT: + g_free(buff_ptr); } static void set_content_info(bool is_push_mode) @@ -587,7 +585,7 @@ static void _player_state() g_print(" ==> [Player_Audio_Test] Current Player State : %d\n", state); } -static void set_next_uri(char * uri) +static void set_next_uri(char *uri) { if (TIZEN_TV) { g_print("not support at TV profile"); @@ -636,7 +634,7 @@ static void set_mute(bool mute) 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_Audio_Test] mute = %d\n", *mute); @@ -704,7 +702,7 @@ static void set_sound_stream_info(int type) else g_print("set stream information(%p) success", g_stream_info_h); - END: +END: if (device_list) sound_manager_free_device_list(device_list); return; @@ -863,7 +861,7 @@ static void set_looping(bool looping) } } -static void get_looping(bool * looping) +static void get_looping(bool *looping) { player_is_looping(g_player[0], looping); g_print(" ==> [Player_Audio_Test] looping = %d\n", *looping); @@ -882,9 +880,9 @@ static void get_track_info(int index) } ret = player_get_track_count(g_player[0], index, &count); - if (ret != PLAYER_ERROR_NONE) + if (ret != PLAYER_ERROR_NONE) { g_print("player_get_track_count fail!!!!\n"); - else if (count) { + } else if (count) { int idx = 0; player_get_current_track(g_player[0], index, &cur_index); g_print("total track: %d, curr track: %d\n", count, cur_index); @@ -1320,15 +1318,15 @@ static void interpret(char *cmd) g_timeout_add(100, timeout_menu_display, 0); } -gboolean input(GIOChannel * channel) +gboolean input(GIOChannel *channel) { gchar buf[MAX_STRING_LEN]; ssize_t cnt; memset(buf, 0, MAX_STRING_LEN); - cnt = read(0, (void*)buf, MAX_STRING_LEN); + cnt = read(0, (void *)buf, MAX_STRING_LEN); if (cnt == 0) return TRUE; - buf[cnt-1] = 0; + buf[cnt - 1] = 0; interpret(buf); @@ -1341,7 +1339,7 @@ int main(int argc, char *argv[]) GMainLoop *loop = g_main_loop_new(NULL, 0); stdin_channel = g_io_channel_unix_new(0); g_io_channel_set_flags(stdin_channel, G_IO_FLAG_NONBLOCK, NULL); - g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc) input, NULL); + g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)input, NULL); displaymenu(); diff --git a/test/player_es_push_test.c b/test/player_es_push_test.c index f51d313..ea447fc 100644 --- a/test/player_es_push_test.c +++ b/test/player_es_push_test.c @@ -50,7 +50,7 @@ static int sps_len, pps_len; #define LOG_TAG "PLAYER_TEST" static int app_create(void *data); -static int app_reset(bundle * b, void *data); +static int app_reset(bundle *b, void *data); static int app_resume(void *data); static int app_pause(void *data); static int app_terminate(void *data); @@ -73,7 +73,7 @@ typedef struct appdata { 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(); } @@ -99,7 +99,7 @@ static Eina_Bool keydown_cb(void *data, int type, void *event) return ECORE_CALLBACK_PASS_ON; } -static void win_del(void *data, Evas_Object * obj, void *event) +static void win_del(void *data, Evas_Object *obj, void *event) { elm_exit(); } @@ -124,7 +124,7 @@ static Evas_Object *create_win(const char *name) return eo; } -static Evas_Object *create_render_rect(Evas_Object * pParent) +static Evas_Object *create_render_rect(Evas_Object *pParent) { if (!pParent) return NULL; @@ -143,7 +143,7 @@ static Evas_Object *create_render_rect(Evas_Object * pParent) return pObj; } -static void create_base_gui(appdata_s * ad) +static void create_base_gui(appdata_s *ad) { /* Enable GLES Backened */ elm_config_accel_preference_set("opengl"); @@ -186,7 +186,7 @@ static int app_create(void *data) static int app_pause(void *data) { /* Take necessary actions when application becomes invisible. */ - appdata_s *ad = (appdata_s *) data; + appdata_s *ad = (appdata_s *)data; int ret = PLAYER_ERROR_NONE; LOGD("start"); @@ -249,7 +249,7 @@ static int app_resume(void *data) static void _player_prepared_cb(void *user_data) { int ret = PLAYER_ERROR_NONE; - appdata_s *ad = (appdata_s *) user_data; + appdata_s *ad = (appdata_s *)user_data; LOGD("prepared"); @@ -260,7 +260,7 @@ static void _player_prepared_cb(void *user_data) LOGD("done"); } -int bytestream2nalunit(FILE * fd, unsigned char *nal) +int bytestream2nalunit(FILE *fd, unsigned char *nal) { int nal_length = 0; size_t result; @@ -350,7 +350,7 @@ int bytestream2nalunit(FILE * fd, unsigned char *nal) return nal_length; } -static void feed_eos_data(appdata_s * appdata) +static void feed_eos_data(appdata_s *appdata) { appdata_s *ad = appdata; @@ -371,7 +371,7 @@ static void feed_eos_data(appdata_s * appdata) return; } -static bool feed_video_data(appdata_s * appdata) +static bool feed_video_data(appdata_s *appdata) { bool ret = FALSE; int read = 0; @@ -389,7 +389,7 @@ static bool feed_video_data(appdata_s * appdata) goto ERROR; } - if (media_packet_set_pts(ad->video_pkt, (uint64_t) pts) != MEDIA_PACKET_ERROR_NONE) { + if (media_packet_set_pts(ad->video_pkt, (uint64_t)pts) != MEDIA_PACKET_ERROR_NONE) { LOGE("media_packet_set_pts failed\n"); goto ERROR; } @@ -418,7 +418,7 @@ static bool feed_video_data(appdata_s * appdata) goto ERROR; } - if (media_packet_set_buffer_size(ad->video_pkt, (uint64_t) read) != MEDIA_PACKET_ERROR_NONE) { + if (media_packet_set_buffer_size(ad->video_pkt, (uint64_t)read) != MEDIA_PACKET_ERROR_NONE) { LOGE("media_packet_set_buffer_size failed\n"); goto ERROR; } @@ -428,7 +428,7 @@ static bool feed_video_data(appdata_s * appdata) pts += ES_DEFAULT_VIDEO_PTS_OFFSET; ret = TRUE; - ERROR: +ERROR: /* destroy media packet after use */ media_packet_destroy(ad->video_pkt); ad->video_pkt = NULL; @@ -437,7 +437,7 @@ static bool feed_video_data(appdata_s * appdata) static void feed_video_data_thread_func(void *data) { - appdata_s *ad = (appdata_s *) data; + appdata_s *ad = (appdata_s *)data; while (TRUE) { static int frame_count = 0; @@ -478,10 +478,10 @@ void _audio_seek_data_cb(unsigned long long offset, void *user_data) LOGE("seek offset of audio is %llu", offset); } -static int app_reset(bundle * b, void *data) +static int app_reset(bundle *b, void *data) { /* Take necessary actions when application becomes visible. */ - appdata_s *ad = (appdata_s *) data; + appdata_s *ad = (appdata_s *)data; int ret = PLAYER_ERROR_NONE; LOGD("start"); @@ -555,7 +555,7 @@ static int app_reset(bundle * b, void *data) return 0; - FAILED: +FAILED: if (ad->player_handle) { player_destroy(ad->player_handle); ad->player_handle = NULL; @@ -567,7 +567,7 @@ static int app_reset(bundle * b, void *data) static int app_terminate(void *data) { /* Release all resources. */ - appdata_s *ad = (appdata_s *) data; + appdata_s *ad = (appdata_s *)data; LOGD("start"); diff --git a/test/player_test.c b/test/player_test.c index dfa1158..bd6f2f7 100644 --- a/test/player_test.c +++ b/test/player_test.c @@ -61,7 +61,7 @@ typedef enum { } tizen_profile_t; #ifdef USE_EVENT_HANDLER -static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void * data, float e[3]); +static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void *data, float e[3]); static void event_handler_set_dov_fov(); static void event_handler_set_window_parameters(); mm_navevent_handler_h event_handler; @@ -199,7 +199,7 @@ int g_menu_state = CURRENT_STATUS_MAINMENU; gboolean quit_pushing; sound_stream_info_h g_stream_info_h = NULL; -static void win_del(void *data, Evas_Object * obj, void *event) +static void win_del(void *data, Evas_Object *obj, void *event) { elm_exit(); } @@ -226,7 +226,7 @@ static Evas_Object *create_win(const char *name) return eo; } -static Evas_Object *create_image_object(Evas_Object * eo_parent) +static Evas_Object *create_image_object(Evas_Object *eo_parent) { if (!eo_parent) return NULL; @@ -239,7 +239,7 @@ static Evas_Object *create_image_object(Evas_Object * eo_parent) return eo; } -void create_render_rect_and_bg(Evas_Object * win) +void create_render_rect_and_bg(Evas_Object *win) { if (!win) { g_print("no win"); @@ -306,7 +306,7 @@ int eom_get_output_id(const char *output_name) 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); @@ -329,7 +329,7 @@ static void eom_notify_cb_output_add(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) { @@ -364,7 +364,7 @@ static void eom_notify_cb_output_remove(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) { @@ -378,7 +378,7 @@ static void eom_notify_cb_mode_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; @@ -586,7 +586,7 @@ static void prepared_cb(void *user_data) g_print("[Player_Test] prepared_cb!!!!\n"); } -static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame, void *user_data) +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; @@ -597,9 +597,9 @@ static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame #if DUMP_OUTBUF if (audio_raw->channel_mask == 1 && fp_out1) - fwrite((guint8 *) audio_raw->data, 1, audio_raw->size, fp_out1); + fwrite((guint8 *)audio_raw->data, 1, audio_raw->size, fp_out1); else if (audio_raw->channel_mask == 2 && fp_out2) - fwrite((guint8 *) audio_raw->data, 1, audio_raw->size, fp_out2); + fwrite((guint8 *)audio_raw->data, 1, audio_raw->size, fp_out2); #endif } @@ -737,7 +737,7 @@ static void input_filename(char *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); + 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); @@ -766,7 +766,7 @@ static void player_set_memory_buffer_test() 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); + 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); @@ -815,7 +815,7 @@ static void buffer_need_video_data_cb(unsigned int size, void *user_data) fp = fopen(fname, "rb"); if (fp) { - buff_ptr = (guint8 *) g_malloc0(1048576); + buff_ptr = (guint8 *)g_malloc0(1048576); if (!buff_ptr) { g_print("no free space\n"); fclose(fp); @@ -846,10 +846,10 @@ static void buffer_need_video_data_cb(unsigned int size, void *user_data) 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) != MEDIA_PACKET_ERROR_NONE) + if (media_packet_set_pts(g_video_pkt, (uint64_t)pts) != MEDIA_PACKET_ERROR_NONE) goto EXIT; - if (media_packet_set_buffer_size(g_video_pkt, (uint64_t) real_read_len) != MEDIA_PACKET_ERROR_NONE) + if (media_packet_set_buffer_size(g_video_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE) goto EXIT; memcpy(src, buff_ptr, real_read_len); @@ -858,11 +858,8 @@ static void buffer_need_video_data_cb(unsigned int size, void *user_data) player_push_media_stream(g_player[0], g_video_pkt); #endif - EXIT: - if (buff_ptr) { - g_free(buff_ptr); - buff_ptr = NULL; - } +EXIT: + g_free(buff_ptr); } int audio_packet_count = 0; @@ -892,7 +889,7 @@ static void buffer_need_audio_data_cb(unsigned int size, void *user_data) fp = fopen(fname, "rb"); if (fp) { - buff_ptr = (guint8 *) g_malloc0(1048576); + buff_ptr = (guint8 *)g_malloc0(1048576); if (!buff_ptr) { g_print("no free space\n"); fclose(fp); @@ -924,10 +921,10 @@ static void buffer_need_audio_data_cb(unsigned int size, void *user_data) 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) != MEDIA_PACKET_ERROR_NONE) + if (media_packet_set_pts(g_audio_pkt, (uint64_t)audio_pts) != MEDIA_PACKET_ERROR_NONE) goto EXIT; - if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t) real_read_len) != MEDIA_PACKET_ERROR_NONE) + if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE) goto EXIT; memcpy(src, buff_ptr, real_read_len); @@ -937,11 +934,9 @@ static void buffer_need_audio_data_cb(unsigned int size, void *user_data) #endif audio_pts += audio_dur; - EXIT: - if (buff_ptr) { - g_free(buff_ptr); - buff_ptr = NULL; - } + +EXIT: + g_free(buff_ptr); } static void set_content_info(bool is_push_mode) @@ -1288,7 +1283,7 @@ static void _player_enable_tsurf_pool(void) player_enable_tsurf_pool(g_player[0], !enabled); } -static void set_next_uri(char * uri) +static void set_next_uri(char *uri) { if (TIZEN_TV) { g_print("not support at TV profile"); @@ -1337,7 +1332,7 @@ static void set_mute(bool mute) 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); @@ -1405,7 +1400,7 @@ static void set_sound_stream_info(int type) else g_print("set stream information(%p) success", g_stream_info_h); - END: +END: if (device_list) sound_manager_free_device_list(device_list); return; @@ -1621,7 +1616,7 @@ static void set_looping(bool looping) } } -static void get_looping(bool * looping) +static void get_looping(bool *looping) { player_is_looping(g_player[0], looping); g_print(" ==> [Player_Test] looping = %d\n", *looping); @@ -1779,7 +1774,7 @@ static void set_display_visible(bool visible) g_print("failed to player_set_x11_display_visible\n"); } -static void get_display_visible(bool * visible) +static void get_display_visible(bool *visible) { player_is_display_visible(g_player[0], visible); g_print(" ==> [Player_Test] Video Overlay Display Visible = %d\n", *visible); @@ -1823,9 +1818,9 @@ static void get_track_info(int index) } ret = player_get_track_count(g_player[0], index, &count); - if (ret != PLAYER_ERROR_NONE) + if (ret != PLAYER_ERROR_NONE) { g_print("player_get_track_count fail!!!!\n"); - else if (count) { + } else if (count) { int idx = 0; player_get_current_track(g_player[0], index, &cur_index); g_print("total track: %d, curr track: %d\n", count, cur_index); @@ -1900,9 +1895,7 @@ static void set_audio_eq(int value) (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 { + } else { if (player_audio_effect_equalizer_clear(g_player[0]) != PLAYER_ERROR_NONE) g_print("failed to player_audio_effect_equalizer_clear\n"); } @@ -2052,7 +2045,7 @@ static void is_replaygain_enabled(bool *enable) } #ifdef USE_EVENT_HANDLER -static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void * data, float e[3]) +static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void *data, float e[3]) { if (ev_t == LIBINPUT_EVENT_TOUCH_MOTION) if (player_360_set_direction_of_view(g_player[0], e[0], e[1]) != PLAYER_ERROR_NONE) @@ -2085,18 +2078,18 @@ static void event_handler_set_window_parameters() player_get_display_rotation(g_player[0], &window_orientation); elm_win_screen_size_get(selected_win_id, NULL, NULL, &window_size.width, &window_size.height); - image_ratio = (float) image_size.width / (float) image_size.height; + image_ratio = (float)image_size.width / (float)image_size.height; if (window_orientation == PLAYER_DISPLAY_ROTATION_NONE || window_orientation == PLAYER_DISPLAY_ROTATION_180) { - window_size.height = (int)((float) window_size.width / image_ratio); + window_size.height = (int)((float)window_size.width / image_ratio); } else { window_size.height = window_size.width; - window_size.width = (int)((float) window_size.width * image_ratio); + window_size.width = (int)((float)window_size.width * image_ratio); } mm_navevent_handler_set_window_parameters(event_handler, - (mm_navevent_handler_orientation_e) window_orientation, window_size); + (mm_navevent_handler_orientation_e)window_orientation, window_size); } #endif @@ -2210,8 +2203,9 @@ void _interpret_main_menu(char *cmd) if (g_current_surface_type == -1) { g_print("You must set display surface type before setting prepare. please 'pr' after setting display surface type.\n"); g_menu_state = CURRENT_STATUS_DISPLAY_SURFACE_CHANGE; - } else - _player_prepare(TRUE); + } else { + _player_prepare(TRUE); + } } else if (strncmp(cmd, "un", 2) == 0) { _player_unprepare(); } else if (strncmp(cmd, "dt", 2) == 0) { @@ -2285,8 +2279,9 @@ void _interpret_main_menu(char *cmd) } else { g_print("unknown menu \n"); } - } else + } else { g_print("unknown menu \n"); + } } void display_sub_basic() @@ -2794,7 +2789,7 @@ static void interpret(char *cmd) g_timeout_add(100, timeout_menu_display, 0); } -gboolean input(GIOChannel * channel) +gboolean input(GIOChannel *channel) { gchar buf[MAX_STRING_LEN]; gsize read; @@ -2813,7 +2808,7 @@ 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_add_watch(stdin_channel, G_IO_IN, (GIOFunc) input, NULL); + g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)input, NULL); displaymenu(); memset(&ad, 0x0, sizeof(appdata));