From 429c753a7bf389386c610c166c871837a8fc6578 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Mon, 26 Dec 2016 20:31:40 +0900 Subject: [PATCH] [v0.2.39] apply tizen coding rule Change-Id: Ia127533abf99a866c951a9229be8672b04e671f0 --- legacy/include/legacy_player.h | 158 +++++++++++++++---------------- legacy/include/legacy_player_internal.h | 10 +- legacy/include/legacy_player_private.h | 28 +++--- legacy/src/legacy_player.c | 16 ++-- legacy/src/legacy_player_internal.c | 28 ++---- legacy/test/legacy_player_es_push_test.c | 12 +-- muse/test/build_verify.c | 3 +- 7 files changed, 120 insertions(+), 135 deletions(-) diff --git a/legacy/include/legacy_player.h b/legacy/include/legacy_player.h index 4e647ec..4b9468b 100644 --- a/legacy/include/legacy_player.h +++ b/legacy/include/legacy_player.h @@ -51,11 +51,11 @@ typedef struct player_s *player_h; * @since_tizen 2.3 */ typedef enum { - PLAYER_STATE_NONE, /**< Player is not created */ - PLAYER_STATE_IDLE, /**< Player is created, but not prepared */ - PLAYER_STATE_READY, /**< Player is ready to play media */ - PLAYER_STATE_PLAYING, /**< Player is playing media */ - PLAYER_STATE_PAUSED, /**< Player is paused while playing media */ + PLAYER_STATE_NONE, /**< Player is not created */ + PLAYER_STATE_IDLE, /**< Player is created, but not prepared */ + PLAYER_STATE_READY, /**< Player is ready to play media */ + PLAYER_STATE_PLAYING, /**< Player is playing media */ + PLAYER_STATE_PAUSED, /**< Player is paused while playing media */ } player_state_e; /** @@ -63,28 +63,28 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ - PLAYER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ - PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ - PLAYER_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */ - PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */ - PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on the device */ - PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */ - PLAYER_ERROR_SEEK_FAILED = PLAYER_ERROR_CLASS | 0x01, /**< Seek operation failure */ - PLAYER_ERROR_INVALID_STATE = PLAYER_ERROR_CLASS | 0x02, /**< Invalid state */ - PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03, /**< File format not supported */ - PLAYER_ERROR_INVALID_URI = PLAYER_ERROR_CLASS | 0x04, /**< Invalid URI */ - PLAYER_ERROR_SOUND_POLICY = PLAYER_ERROR_CLASS | 0x05, /**< Sound policy error */ - PLAYER_ERROR_CONNECTION_FAILED = PLAYER_ERROR_CLASS | 0x06, /**< Streaming connection failed */ - PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failed */ - PLAYER_ERROR_DRM_EXPIRED = PLAYER_ERROR_CLASS | 0x08, /**< Expired license */ - PLAYER_ERROR_DRM_NO_LICENSE = PLAYER_ERROR_CLASS | 0x09, /**< No license */ - PLAYER_ERROR_DRM_FUTURE_USE = PLAYER_ERROR_CLASS | 0x0a, /**< License for future use */ - PLAYER_ERROR_DRM_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b, /**< Format not permitted */ - PLAYER_ERROR_RESOURCE_LIMIT = PLAYER_ERROR_CLASS | 0x0c, /**< Resource limit */ - PLAYER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ - PLAYER_ERROR_SERVICE_DISCONNECTED = PLAYER_ERROR_CLASS | 0x0d, /**< Socket connection lost (Since 3.0) */ - PLAYER_ERROR_BUFFER_SPACE = TIZEN_ERROR_BUFFER_SPACE, /**< No buffer space available (Since 3.0)*/ + PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + PLAYER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + PLAYER_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */ + PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */ + PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on the device */ + PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */ + PLAYER_ERROR_SEEK_FAILED = PLAYER_ERROR_CLASS | 0x01, /**< Seek operation failure */ + PLAYER_ERROR_INVALID_STATE = PLAYER_ERROR_CLASS | 0x02, /**< Invalid state */ + PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03, /**< File format not supported */ + PLAYER_ERROR_INVALID_URI = PLAYER_ERROR_CLASS | 0x04, /**< Invalid URI */ + PLAYER_ERROR_SOUND_POLICY = PLAYER_ERROR_CLASS | 0x05, /**< Sound policy error */ + PLAYER_ERROR_CONNECTION_FAILED = PLAYER_ERROR_CLASS | 0x06, /**< Streaming connection failed */ + PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failed */ + PLAYER_ERROR_DRM_EXPIRED = PLAYER_ERROR_CLASS | 0x08, /**< Expired license */ + PLAYER_ERROR_DRM_NO_LICENSE = PLAYER_ERROR_CLASS | 0x09, /**< No license */ + PLAYER_ERROR_DRM_FUTURE_USE = PLAYER_ERROR_CLASS | 0x0a, /**< License for future use */ + PLAYER_ERROR_DRM_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b, /**< Format not permitted */ + PLAYER_ERROR_RESOURCE_LIMIT = PLAYER_ERROR_CLASS | 0x0c, /**< Resource limit */ + PLAYER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ + PLAYER_ERROR_SERVICE_DISCONNECTED = PLAYER_ERROR_CLASS | 0x0d, /**< Socket connection lost (Since 3.0) */ + PLAYER_ERROR_BUFFER_SPACE = TIZEN_ERROR_BUFFER_SPACE, /**< No buffer space available (Since 3.0)*/ } player_error_e; /** @@ -92,14 +92,14 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed (Deprecated since 3.0)*/ - PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/ - PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call (Deprecated since 3.0)*/ - PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/ - PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */ - PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm (Deprecated since 3.0)*/ - PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency (Deprecated since 3.0)*/ - PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */ + PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency (Deprecated since 3.0)*/ + PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification (Deprecated since 3.0)*/ } player_interrupted_code_e; /** @@ -107,8 +107,8 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - PLAYER_PD_STARTED = 0, /**< Progressive download is started */ - PLAYER_PD_COMPLETED, /**< Progressive download is completed */ + PLAYER_PD_STARTED = 0, /**< Progressive download is started */ + PLAYER_PD_COMPLETED, /**< Progressive download is completed */ } player_pd_message_type_e; /** @@ -116,9 +116,9 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */ - PLAYER_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */ - PLAYER_DISPLAY_TYPE_NONE, /**< This disposes off buffers */ + PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */ + PLAYER_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */ + PLAYER_DISPLAY_TYPE_NONE, /**< This disposes off buffers */ } player_display_type_e; /** @@ -126,9 +126,9 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */ - AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */ - AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */ + AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */ + AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */ + AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */ } audio_latency_mode_e; /** @@ -136,10 +136,10 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - PLAYER_STREAM_TYPE_DEFAULT, /**< Container type */ - PLAYER_STREAM_TYPE_AUDIO, /**< Audio element stream type */ - PLAYER_STREAM_TYPE_VIDEO, /**< Video element stream type */ - PLAYER_STREAM_TYPE_TEXT, /**< Text type */ + PLAYER_STREAM_TYPE_DEFAULT, /**< Container type */ + PLAYER_STREAM_TYPE_AUDIO, /**< Audio element stream type */ + PLAYER_STREAM_TYPE_VIDEO, /**< Video element stream type */ + PLAYER_STREAM_TYPE_TEXT, /**< Text type */ } player_stream_type_e; /** @@ -147,8 +147,8 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN, - PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW, + PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN, + PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW, } player_media_stream_buffer_status_e; /** @@ -179,10 +179,10 @@ typedef void* player_display_h; * @since_tizen 2.3 */ typedef enum { - PLAYER_DISPLAY_ROTATION_NONE, /**< Display is not rotated */ - PLAYER_DISPLAY_ROTATION_90, /**< Display is rotated 90 degrees */ - PLAYER_DISPLAY_ROTATION_180, /**< Display is rotated 180 degrees */ - PLAYER_DISPLAY_ROTATION_270, /**< Display is rotated 270 degrees */ + PLAYER_DISPLAY_ROTATION_NONE, /**< Display is not rotated */ + PLAYER_DISPLAY_ROTATION_90, /**< Display is rotated 90 degrees */ + PLAYER_DISPLAY_ROTATION_180, /**< Display is rotated 180 degrees */ + PLAYER_DISPLAY_ROTATION_270, /**< Display is rotated 270 degrees */ } player_display_rotation_e; /** @@ -190,13 +190,13 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box */ - PLAYER_DISPLAY_MODE_ORIGIN_SIZE, /**< Origin size */ - PLAYER_DISPLAY_MODE_FULL_SCREEN, /**< Full-screen */ - PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */ - PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */ - PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode (Deprecated since [3.0]).*/ - PLAYER_DISPLAY_MODE_NUM + PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box */ + PLAYER_DISPLAY_MODE_ORIGIN_SIZE, /**< Origin size */ + PLAYER_DISPLAY_MODE_FULL_SCREEN, /**< Full-screen */ + PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */ + PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */ + PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode (Deprecated since [3.0]).*/ + PLAYER_DISPLAY_MODE_NUM } player_display_mode_e; /** @@ -213,12 +213,12 @@ typedef enum { * @since_tizen 2.3 */ typedef enum { - PLAYER_CONTENT_INFO_ALBUM, /**< Album */ - PLAYER_CONTENT_INFO_ARTIST, /**< Artist */ - PLAYER_CONTENT_INFO_AUTHOR, /**< Author */ - PLAYER_CONTENT_INFO_GENRE, /**< Genre */ - PLAYER_CONTENT_INFO_TITLE, /**< Title */ - PLAYER_CONTENT_INFO_YEAR, /**< Year */ + PLAYER_CONTENT_INFO_ALBUM, /**< Album */ + PLAYER_CONTENT_INFO_ARTIST, /**< Artist */ + PLAYER_CONTENT_INFO_AUTHOR, /**< Author */ + PLAYER_CONTENT_INFO_GENRE, /**< Genre */ + PLAYER_CONTENT_INFO_TITLE, /**< Title */ + PLAYER_CONTENT_INFO_YEAR, /**< Year */ } player_content_info_e; /** @@ -349,8 +349,8 @@ typedef void (*player_video_captured_cb)(unsigned char *data, int width, int hei * @since_tizen 2.3 * * @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n - * the packet should be released by media_packet_destroy() after use. \n - * Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame. + * the packet should be released by media_packet_destroy() after use. \n + * Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame. * * @param[in] pkt Reference pointer to the media packet * @param[in] user_data The user data passed from the callback registration function @@ -385,7 +385,7 @@ typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *us * @param[in] width The width of the captured image * @param[in] height The height of the captured image * @param[in] fps The frame per second of the video \n - It can be @c 0 if there is no video stream information. + * It can be @c 0 if there is no video stream information. * @param[in] bit_rate The video bit rate [Hz] \n * It can be an invalid value if there is no video stream information. * @param[in] user_data The user data passed from the callback registration function @@ -478,7 +478,7 @@ int legacy_player_prepare(player_h player); * @see legacy_player_unprepare() * @see legacy_player_set_uri() */ -int legacy_player_prepare_async (player_h player, player_prepared_cb callback, void* user_data); +int legacy_player_prepare_async(player_h player, player_prepared_cb callback, void* user_data); /** * @brief Resets the media player. @@ -560,10 +560,10 @@ int legacy_player_get_state(player_h player, player_state_e *state); /** * @brief Sets the player's volume. * @since_tizen 2.3 - * @details Setting this volume adjusts the player's instance volume, not the system volume. - * The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0. + * @details Setting this volume adjusts the player's instance volume, not the system volume. + * The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0. * To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API. - * Finally, it does not support to set other value into each channel currently. + * Finally, it does not support to set other value into each channel currently. * * @param[in] player The handle to the media player * @param[in] left The left volume scalar @@ -941,7 +941,7 @@ int legacy_player_push_media_stream(player_h player, media_packet_h packet); * @remarks AAC can be supported. * @remarks H.264 can be supported. * @remarks This API should be called before calling the legacy_player_prepare() or legacy_player_prepare_async() \n - to reflect the media information when pipeline is created. + * to reflect the media information when pipeline is created. * @param[in] player The handle to media player * @param[in] type The type of target stream * @param[in] format The media format to set audio information @@ -1194,7 +1194,7 @@ int legacy_player_set_display_rotation(player_h player, player_display_rotation_ * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see legacy_player_set_display_rotation() */ -int legacy_player_get_display_rotation( player_h player, player_display_rotation_e *rotation); +int legacy_player_get_display_rotation(player_h player, player_display_rotation_e *rotation); /** * @} @@ -1365,7 +1365,7 @@ int legacy_player_get_duration(player_h player, int *duration); * @see legacy_player_audio_effect_set_equalizer_band_level() * @see legacy_player_audio_effect_set_equalizer_all_bands() */ -int legacy_player_audio_effect_get_equalizer_bands_count (player_h player, int *count); +int legacy_player_audio_effect_get_equalizer_bands_count(player_h player, int *count); /** * @brief Sets the gain set for the given equalizer band. @@ -1810,7 +1810,7 @@ int legacy_player_set_playback_rate(player_h player, float rate); * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. * @pre The path value can be @c NULL for reset when the player state is set to #PLAYER_STATE_IDLE by calling legacy_player_create() or legacy_player_unprepare(). */ -int legacy_player_set_subtitle_path(player_h player,const char *path); +int legacy_player_set_subtitle_path(player_h player, const char *path); /** * @brief Registers a callback function to be invoked when a subtitle updates. @@ -1878,7 +1878,7 @@ int legacy_player_set_subtitle_position_offset(player_h player, int millisecond) * @see legacy_player_unset_video_stream_changed_cb() * @see legacy_player_video_stream_changed_cb() */ -int legacy_player_set_video_stream_changed_cb (player_h player, player_video_stream_changed_cb callback, void *user_data); +int legacy_player_set_video_stream_changed_cb(player_h player, player_video_stream_changed_cb callback, void *user_data); /** * @brief Unregisters the video stream changed callback function. @@ -1891,7 +1891,7 @@ int legacy_player_set_video_stream_changed_cb (player_h player, player_video_str * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see legacy_player_set_video_stream_changed_cb() */ -int legacy_player_unset_video_stream_changed_cb (player_h player); +int legacy_player_unset_video_stream_changed_cb(player_h player); /** * @brief Gets current track index. diff --git a/legacy/include/legacy_player_internal.h b/legacy/include/legacy_player_internal.h index 7ba7458..168679a 100644 --- a/legacy/include/legacy_player_internal.h +++ b/legacy/include/legacy_player_internal.h @@ -177,9 +177,9 @@ int legacy_player_set_media_stream_dynamic_resolution(player_h player, bool drc) * @since_tizen 3.0 * * @details Player will transite the media source as seamlessly as possible after finishing current playback. - * If the function call is successful, the uri will be added at the end of uri list. - * You can add several uris and the set of uris will be played repeatedly if you call the player_set_looping(). - * The first uri in the list is the original uri which is set by player_set_uri(). + * If the function call is successful, the uri will be added at the end of uri list. + * You can add several uris and the set of uris will be played repeatedly if you call the player_set_looping(). + * The first uri in the list is the original uri which is set by player_set_uri(). * * @remarks Uri list will be cleared except first one when the player_unprepare() is called. * If you call the player_set_uri(), you can change the first uri too. @@ -197,7 +197,7 @@ int legacy_player_set_media_stream_dynamic_resolution(player_h player, bool drc) * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. * @see player_set_uri(), player_set_looping() */ -int legacy_player_set_next_uri (player_h player, const char *uri); +int legacy_player_set_next_uri(player_h player, const char *uri); /** * @brief Gets the data source path. @@ -215,7 +215,7 @@ int legacy_player_set_next_uri (player_h player, const char *uri); * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. * @see player_set_uri() */ -int legacy_player_get_next_uri (player_h player, char **uri); +int legacy_player_get_next_uri(player_h player, char **uri); /** * @brief Sets the gapless playback status diff --git a/legacy/include/legacy_player_private.h b/legacy/include/legacy_player_private.h index 7919640..cefba63 100644 --- a/legacy/include/legacy_player_private.h +++ b/legacy/include/legacy_player_private.h @@ -31,31 +31,31 @@ extern "C" { #define LOG_TAG "TIZEN_N_PLAYER" //#define USE_ECORE_FUNCTIONS -#define PLAYER_CHECK_CONDITION(condition,error,msg) \ - if(condition) {} else \ - { LOGE("[%s] %s(0x%08x)",__FUNCTION__, msg,error); return error;}; \ +#define PLAYER_CHECK_CONDITION(condition, error, msg) \ + if (condition) {} else \ + { LOGE("[%s] %s(0x%08x)", __FUNCTION__, msg, error); return error; }; \ #define PLAYER_INSTANCE_CHECK(player) \ - PLAYER_CHECK_CONDITION(player != NULL, PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") + PLAYER_CHECK_CONDITION(player != NULL, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER") -#define PLAYER_STATE_CHECK(player,expected_state) \ - PLAYER_CHECK_CONDITION(player->state == expected_state,PLAYER_ERROR_INVALID_STATE,"PLAYER_ERROR_INVALID_STATE") +#define PLAYER_STATE_CHECK(player, expected_state) \ + PLAYER_CHECK_CONDITION(player->state == expected_state, PLAYER_ERROR_INVALID_STATE, "PLAYER_ERROR_INVALID_STATE") #define PLAYER_NULL_ARG_CHECK(arg) \ - PLAYER_CHECK_CONDITION(arg != NULL,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") + PLAYER_CHECK_CONDITION(arg != NULL, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER") #define PLAYER_RANGE_ARG_CHECK(arg, min, max) \ - PLAYER_CHECK_CONDITION(arg <= max,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") \ - PLAYER_CHECK_CONDITION(arg >= min,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") + PLAYER_CHECK_CONDITION(arg <= max, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER") \ + PLAYER_CHECK_CONDITION(arg >= min, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER") /* user_cb_lock */ -#define LEGACY_PLAYER_USER_CB_LOCK(x_handle,type) \ +#define LEGACY_PLAYER_USER_CB_LOCK(x_handle, type) \ do { \ if (_check_enabled_user_cb_lock(type)) \ g_mutex_lock(&((player_s*)x_handle)->user_cb_lock[type]); \ } while (0) -#define LEGACY_PLAYER_USER_CB_UNLOCK(x_handle,type) \ +#define LEGACY_PLAYER_USER_CB_UNLOCK(x_handle, type) \ do { \ if (_check_enabled_user_cb_lock(type)) \ g_mutex_unlock(&((player_s*)x_handle)->user_cb_lock[type]); \ @@ -66,7 +66,7 @@ extern "C" { #include #define PLAYER_TRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_VIDEO, NAME) #define PLAYER_TRACE_END() traceEnd(TTRACE_TAG_VIDEO) -#define PLAYER_TRACE_ASYNC_BEGIN(NAME, COOKIE) traceAsyncBegin (TTRACE_TAG_VIDEO, COOKIE, NAME); +#define PLAYER_TRACE_ASYNC_BEGIN(NAME, COOKIE) traceAsyncBegin(TTRACE_TAG_VIDEO, COOKIE, NAME); #define PLAYER_TRACE_ASYNC_END(NAME, COOKIE) traceAsyncEnd(TTRACE_TAG_VIDEO, COOKIE, NAME); #else #define PLAYER_TRACE_BEGIN(NAME) @@ -84,10 +84,10 @@ typedef enum { PLAYER_MESSAGE_EOS, PLAYER_MESSAGE_LOOP_EXIT, PLAYER_MESSAGE_MAX -}_player_message_e; +} _player_message_e; #endif -typedef struct _player_s{ +typedef struct _player_s { MMHandleType mm_handle; const void* user_cb[MUSE_PLAYER_EVENT_TYPE_NUM]; void* user_data[MUSE_PLAYER_EVENT_TYPE_NUM]; diff --git a/legacy/src/legacy_player.c b/legacy/src/legacy_player.c index df27e49..4130252 100644 --- a/legacy/src/legacy_player.c +++ b/legacy/src/legacy_player.c @@ -585,11 +585,10 @@ static void __message_cb_loop(void *data) case PLAYER_MESSAGE_ERROR: { LOGW("PLAYER_MESSAGE_ERROR"); - if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR]) { + if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR]) ((player_error_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR])(handle->error_code, handle->user_data[MUSE_PLAYER_EVENT_TYPE_ERROR]); - } else { + else LOGE("null handle in PLAYER_MESSAGE_ERROR"); - } } break; case PLAYER_MESSAGE_SEEK_DONE: @@ -607,11 +606,10 @@ static void __message_cb_loop(void *data) case PLAYER_MESSAGE_EOS: { LOGW("PLAYER_MESSAGE_EOS"); - if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE]) { + if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE]) ((player_completed_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_COMPLETE]); - } else { + else LOGE("null handle in PLAYER_MESSAGE_EOS"); - } } break; case PLAYER_MESSAGE_LOOP_EXIT: @@ -1142,9 +1140,8 @@ int legacy_player_create(player_h *player) handle->is_media_stream = FALSE; for (type = MUSE_PLAYER_EVENT_TYPE_PREPARE; type < MUSE_PLAYER_EVENT_TYPE_NUM; type++) { - if (_check_enabled_user_cb_lock(type)) { + if (_check_enabled_user_cb_lock(type)) g_mutex_init(&handle->user_cb_lock[type]); - } } #ifdef USE_ECORE_FUNCTIONS handle->ecore_jobs = g_hash_table_new_full(g_str_hash, g_str_equal, __job_key_to_remove, __job_value_to_destroy); @@ -1205,9 +1202,8 @@ int legacy_player_destroy(player_h player) handle->state = PLAYER_STATE_NONE; for (type = MUSE_PLAYER_EVENT_TYPE_PREPARE; type < MUSE_PLAYER_EVENT_TYPE_NUM; type++) { - if (_check_enabled_user_cb_lock(type)) { + if (_check_enabled_user_cb_lock(type)) g_mutex_clear(&handle->user_cb_lock[type]); - } } #ifndef USE_ECORE_FUNCTIONS diff --git a/legacy/src/legacy_player_internal.c b/legacy/src/legacy_player_internal.c index d8be583..388cb19 100644 --- a/legacy/src/legacy_player_internal.c +++ b/legacy/src/legacy_player_internal.c @@ -240,47 +240,39 @@ int legacy_player_set_media_stream_dynamic_resolution(player_h player, bool drc) return PLAYER_ERROR_NONE; } -int legacy_player_set_next_uri (player_h player, const char *uri) +int legacy_player_set_next_uri(player_h player, const char *uri) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); + if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) { + LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state); return PLAYER_ERROR_INVALID_STATE; } int ret = mm_player_set_next_uri(handle->mm_handle, uri); - if(ret != MM_ERROR_NONE) - { - return __player_convert_error_code(ret,(char*)__FUNCTION__); - } + if (ret != MM_ERROR_NONE) + return __player_convert_error_code(ret, (char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } -int legacy_player_get_next_uri (player_h player, char **uri) +int legacy_player_get_next_uri(player_h player, char **uri) { PLAYER_INSTANCE_CHECK(player); player_s *handle = (player_s *) player; - if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); + if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) { + LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state); return PLAYER_ERROR_INVALID_STATE; } int ret = mm_player_get_next_uri(handle->mm_handle, uri); /* uri will be free in muse_player.c*/ - if(ret != MM_ERROR_NONE) - { - return __player_convert_error_code(ret,(char*)__FUNCTION__); - } + if (ret != MM_ERROR_NONE) + return __player_convert_error_code(ret, (char*)__FUNCTION__); else - { return PLAYER_ERROR_NONE; - } } int legacy_player_set_gapless(player_h player, bool gapless) diff --git a/legacy/test/legacy_player_es_push_test.c b/legacy/test/legacy_player_es_push_test.c index 13e868f..280fb63 100644 --- a/legacy/test/legacy_player_es_push_test.c +++ b/legacy/test/legacy_player_es_push_test.c @@ -453,22 +453,18 @@ static void feed_video_data_thread_func(void *data) void _video_buffer_status_cb_ex(player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data) { - if (status == PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN) { + if (status == PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN) LOGE("video buffer is underrun state, current level byte = %llu", bytes); - } - else if (status == PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW) { + else if (status == PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW) LOGE("video buffer is overrun state, current level byte = %llu", bytes); - } } void _audio_buffer_status_cb_ex(player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data) { - if (status == PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN) { + if (status == PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN) LOGE("audio buffer is underrun state, current level byte = %llu", bytes); - } - else if (status == PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW) { + else if (status == PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW) LOGE("audio buffer is overrun state, current level byte = %llu", bytes); - } } void _video_seek_data_cb(unsigned long long offset, void *user_data) diff --git a/muse/test/build_verify.c b/muse/test/build_verify.c index 20a888f..28b47b9 100644 --- a/muse/test/build_verify.c +++ b/muse/test/build_verify.c @@ -23,6 +23,7 @@ * Does NOT include package */ -int main(){ +int main() +{ return 0; } -- 2.7.4