diff options
author | Eunhye Choi <eunhae1.choi@samsung.com> | 2019-04-29 17:34:00 +0900 |
---|---|---|
committer | Eunhye Choi <eunhae1.choi@samsung.com> | 2019-04-29 17:34:07 +0900 |
commit | 69d3663fedae65a4f81b5449aabcb957b30270ad (patch) | |
tree | 66e31dbf34f89cac74507e8088f40e3c7cfbfc7a | |
parent | 8286fb6c7d679f39d3d14d4f4fde7a0b5613a7f1 (diff) | |
download | libmm-player-69d3663fedae65a4f81b5449aabcb957b30270ad.tar.gz libmm-player-69d3663fedae65a4f81b5449aabcb957b30270ad.tar.bz2 libmm-player-69d3663fedae65a4f81b5449aabcb957b30270ad.zip |
[0.6.186] apply tizen function naming coding rule
- [R15] Local functions whose scope is limited to the
current source file have ‘static’ keyword and names started with ‘__’
- [R16] Names of protected(global) functions in internal
header are started with '_' character.
Change-Id: Ie2de0d63ae29f409062134bf35e5a912d039d4aa
-rw-r--r-- | packaging/libmm-player.spec | 2 | ||||
-rw-r--r-- | src/include/mm_player_gst.h | 35 | ||||
-rw-r--r-- | src/include/mm_player_priv.h | 41 | ||||
-rw-r--r-- | src/include/mm_player_streaming.h | 16 | ||||
-rw-r--r-- | src/include/mm_player_tracks.h | 8 | ||||
-rw-r--r-- | src/include/mm_player_utils.h | 78 | ||||
-rw-r--r-- | src/mm_player.c | 7 | ||||
-rw-r--r-- | src/mm_player_audioeffect.c | 44 | ||||
-rw-r--r-- | src/mm_player_capture.c | 2 | ||||
-rw-r--r-- | src/mm_player_es.c | 3 | ||||
-rw-r--r-- | src/mm_player_gst.c | 278 | ||||
-rw-r--r-- | src/mm_player_priv.c | 481 | ||||
-rw-r--r-- | src/mm_player_streaming.c | 97 | ||||
-rw-r--r-- | src/mm_player_tracks.c | 8 | ||||
-rw-r--r-- | src/mm_player_utils.c | 51 | ||||
-rw-r--r-- | unittest/gtest_mm_player_priv.cpp | 2 |
16 files changed, 555 insertions, 598 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 9641306..3e66c54 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.185 +Version: 0.6.186 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/include/mm_player_gst.h b/src/include/mm_player_gst.h index 4852c40..f882bc4 100644 --- a/src/include/mm_player_gst.h +++ b/src/include/mm_player_gst.h @@ -55,29 +55,24 @@ extern "C" | GLOBAL FUNCTION PROTOTYPES | ========================================================================================*/ -gint __mmplayer_gst_handle_core_error(mmplayer_t *player, int code); -gint __mmplayer_gst_handle_library_error(mmplayer_t *player, int code); -gint __mmplayer_gst_handle_resource_error(mmplayer_t *player, int code, GstMessage *message); -gint __mmplayer_gst_handle_stream_error(mmplayer_t *player, GError *error, GstMessage *message); +int _mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState state, gboolean async, gint timeout); -gboolean __mmplayer_handle_gst_error(mmplayer_t *player, GstMessage *message, GError *error); -int __mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState state, gboolean async, gint timeout); - -int __mmplayer_gst_start(mmplayer_t *player); -int __mmplayer_gst_stop(mmplayer_t *player); -int __mmplayer_gst_pause(mmplayer_t *player, gboolean async); -int __mmplayer_gst_resume(mmplayer_t *player, gboolean async); -gboolean __mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event); -gboolean __mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate, +int _mmplayer_gst_start(mmplayer_t *player); +int _mmplayer_gst_stop(mmplayer_t *player); +int _mmplayer_gst_pause(mmplayer_t *player, gboolean async); +int _mmplayer_gst_resume(mmplayer_t *player, gboolean async); +gboolean _mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event); +gboolean _mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate, GstFormat format, GstSeekFlags flags, GstSeekType cur_type, gint64 cur, GstSeekType stop_type, gint64 stop); -int __mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean internal_called); -int __mmplayer_gst_get_position(mmplayer_t *player, gint64 *position); -int __mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_pos); -GstElement *__mmplayer_gst_create_source(mmplayer_t *player); -int __mmplayer_gst_build_es_pipeline(mmplayer_t *player); -int __mmplayer_gst_build_pipeline(mmplayer_t *player); -int __mmplayer_gst_add_bus_watch(mmplayer_t *player); +int _mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean internal_called); +int _mmplayer_gst_get_position(mmplayer_t *player, gint64 *position); +int _mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_pos); +GstElement *_mmplayer_gst_create_source(mmplayer_t *player); +int _mmplayer_gst_build_es_pipeline(mmplayer_t *player); +int _mmplayer_gst_build_pipeline(mmplayer_t *player); +int _mmplayer_gst_add_bus_watch(mmplayer_t *player); +void _mmplayer_activate_next_source(mmplayer_t *player, GstState target); #ifdef __cplusplus } diff --git a/src/include/mm_player_priv.h b/src/include/mm_player_priv.h index 662ef0d..26cb28a 100644 --- a/src/include/mm_player_priv.h +++ b/src/include/mm_player_priv.h @@ -839,7 +839,6 @@ int _mmplayer_pause(MMHandleType hplayer); int _mmplayer_abort_pause(MMHandleType hplayer); int _mmplayer_resume(MMHandleType hplayer); int _mmplayer_set_position(MMHandleType hplayer, gint64 pos); -int _mmplayer_get_position(MMHandleType hplayer, gint64 *pos); int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration); int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int pos); int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming); @@ -880,27 +879,25 @@ int _mmplayer_set_video_roi_area(MMHandleType hplayer, double scale_x, double sc int _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scale_y, double *scale_width, double *scale_height); /* internal */ -void __mmplayer_bus_msg_thread_destroy(MMHandleType hplayer); - -void __mmplayer_set_state(mmplayer_t *player, int state); -int __mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command); -gboolean __mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag); -void __mmplayer_cancel_eos_timer(mmplayer_t *player); -void __mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all); -MMStreamingType __mmplayer_get_stream_service_type(mmplayer_t *player); -int __mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientations); -gboolean __mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink); -void __mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data); -void __mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data); -gint __mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data); -gboolean __mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps); -void __mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data); -GstElement *__mmplayer_gst_make_decodebin(mmplayer_t *player); -int __mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket); -int __mmplayer_gst_element_link_bucket(GList *element_bucket); -void __mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data); -int __mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data); - +void _mmplayer_bus_msg_thread_destroy(MMHandleType hplayer); +void _mmplayer_set_state(mmplayer_t *player, int state); +int _mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command); +gboolean _mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag); +void _mmplayer_cancel_eos_timer(mmplayer_t *player); +void _mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all); +MMStreamingType _mmplayer_get_stream_service_type(mmplayer_t *player); +int _mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientations); +gboolean _mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink); +void _mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data); +void _mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data); +gint _mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data); +gboolean _mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps); +void _mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data); +GstElement *_mmplayer_gst_make_decodebin(mmplayer_t *player); +int _mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket); +int _mmplayer_gst_element_link_bucket(GList *element_bucket); +void _mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data); +int _mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data); #ifdef __cplusplus } diff --git a/src/include/mm_player_streaming.h b/src/include/mm_player_streaming.h index dc8965b..2b4d4aa 100644 --- a/src/include/mm_player_streaming.h +++ b/src/include/mm_player_streaming.h @@ -161,22 +161,22 @@ typedef struct { } mmplayer_streaming_t; -mmplayer_streaming_t *__mm_player_streaming_create(void); +mmplayer_streaming_t *_mm_player_streaming_create(void); -void __mm_player_streaming_initialize(mmplayer_streaming_t *streaming_player, gboolean buffer_init); +void _mm_player_streaming_initialize(mmplayer_streaming_t *streaming_player, gboolean buffer_init); -void __mm_player_streaming_destroy(mmplayer_streaming_t *streaming_player); +void _mm_player_streaming_destroy(mmplayer_streaming_t *streaming_player); -void __mm_player_streaming_set_queue2(mmplayer_streaming_t *streamer, GstElement *buffer, +void _mm_player_streaming_set_queue2(mmplayer_streaming_t *streamer, GstElement *buffer, gboolean use_buffering, muxed_buffer_type_e type, guint64 content_size); -void __mm_player_streaming_set_multiqueue(mmplayer_streaming_t *streamer, GstElement *buffer); +void _mm_player_streaming_set_multiqueue(mmplayer_streaming_t *streamer, GstElement *buffer); -void __mm_player_streaming_sync_property(mmplayer_streaming_t *streamer, GstElement *decodebin); +void _mm_player_streaming_sync_property(mmplayer_streaming_t *streamer, GstElement *decodebin); -void __mm_player_streaming_buffering(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, +void _mm_player_streaming_buffering(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, guint64 content_size, gint64 position, gint64 duration); -void __mm_player_streaming_set_content_bitrate(mmplayer_streaming_t *streaming_player, guint max_bitrate, guint avg_bitrate); +void _mm_player_streaming_set_content_bitrate(mmplayer_streaming_t *streaming_player, guint max_bitrate, guint avg_bitrate); #endif diff --git a/src/include/mm_player_tracks.h b/src/include/mm_player_tracks.h index c2e2105..ae29a07 100644 --- a/src/include/mm_player_tracks.h +++ b/src/include/mm_player_tracks.h @@ -31,13 +31,13 @@ #define DEFAULT_TRACK 0 -void __mmplayer_track_initialize(mmplayer_t *player); +void _mmplayer_track_initialize(mmplayer_t *player); -void __mmplayer_track_destroy(mmplayer_t *player); +void _mmplayer_track_destroy(mmplayer_t *player); -void __mmplayer_track_update_selector_info(mmplayer_t *player, mmplayer_track_type_e type, GstPad *sinkpad); +void _mmplayer_track_update_selector_info(mmplayer_t *player, mmplayer_track_type_e type, GstPad *sinkpad); -void __mmplayer_track_update_text_attr_info(mmplayer_t *player, GstMessage *msg); +void _mmplayer_track_update_text_attr_info(mmplayer_t *player, GstMessage *msg); int _mmplayer_get_track_count(MMHandleType hplayer, mmplayer_track_type_e type, int *count); diff --git a/src/include/mm_player_utils.h b/src/include/mm_player_utils.h index 34833cd..af605f0 100644 --- a/src/include/mm_player_utils.h +++ b/src/include/mm_player_utils.h @@ -154,20 +154,20 @@ #define MMPLAYER_POST_MSG(x_player, x_msgtype, x_msg_param) \ do { \ LOGD("[handle: %p] posting %s to application", x_player, #x_msgtype); \ - __mmplayer_post_message(x_player, x_msgtype, x_msg_param); \ + _mmplayer_post_message(x_player, x_msgtype, x_msg_param); \ } while (0) /* setting player state */ #define MMPLAYER_SET_STATE(x_player, x_state) \ do { \ LOGD("[handle: %p] update state machine to %d", x_player, x_state); \ - __mmplayer_set_state(x_player, x_state); \ + _mmplayer_set_state(x_player, x_state); \ } while (0) #define MMPLAYER_CHECK_STATE(x_player, x_command) \ do { \ LOGD("[handle: %p] checking player state before doing %s", x_player, #x_command); \ - switch (__mmplayer_check_state(x_player, x_command)) { \ + switch (_mmplayer_check_state(x_player, x_command)) { \ case MM_ERROR_PLAYER_INVALID_STATE: \ return MM_ERROR_PLAYER_INVALID_STATE; \ break; \ @@ -258,7 +258,7 @@ #define MMPLAYER_CURRENT_STATE(x_player) ((mmplayer_t *)x_player)->state #define MMPLAYER_PENDING_STATE(x_player) ((mmplayer_t *)x_player)->pending_state #define MMPLAYER_TARGET_STATE(x_player) ((mmplayer_t *)x_player)->target_state -#define MMPLAYER_STATE_GET_NAME(state) __get_state_name(state) +#define MMPLAYER_STATE_GET_NAME(state) _mmplayer_get_state_name(state) #define MMPLAYER_PRINT_STATE(x_player) \ do { \ @@ -272,19 +272,19 @@ #define MMPLAYER_STATE_CHANGE_TIMEOUT(x_player) ((mmplayer_t *)x_player)->state_change_timeout /* streaming */ -#define MMPLAYER_IS_STREAMING(x_player) __is_streaming(x_player) -#define MMPLAYER_IS_RTSP_STREAMING(x_player) __is_rtsp_streaming(x_player) -#define MMPLAYER_IS_HTTP_STREAMING(x_player) __is_http_streaming(x_player) -#define MMPLAYER_IS_HTTP_LIVE_STREAMING(x_player) __is_http_live_streaming(x_player) -#define MMPLAYER_IS_LIVE_STREAMING(x_player) __is_live_streaming(x_player) -#define MMPLAYER_IS_DASH_STREAMING(x_player) __is_dash_streaming(x_player) -#define MMPLAYER_IS_SMOOTH_STREAMING(x_player) __is_smooth_streaming(x_player) -#define MMPLAYER_IS_MS_BUFF_SRC(x_player) __is_ms_buff_src(x_player) +#define MMPLAYER_IS_STREAMING(x_player) _mmplayer_is_streaming(x_player) +#define MMPLAYER_IS_RTSP_STREAMING(x_player) _mmplayer_is_rtsp_streaming(x_player) +#define MMPLAYER_IS_HTTP_STREAMING(x_player) _mmplayer_is_http_streaming(x_player) +#define MMPLAYER_IS_HTTP_LIVE_STREAMING(x_player) _mmplayer_is_http_live_streaming(x_player) +#define MMPLAYER_IS_LIVE_STREAMING(x_player) _mmplayer_is_live_streaming(x_player) +#define MMPLAYER_IS_DASH_STREAMING(x_player) _mmplayer_is_dash_streaming(x_player) +#define MMPLAYER_IS_SMOOTH_STREAMING(x_player) _mmplayer_is_smooth_streaming(x_player) +#define MMPLAYER_IS_MS_BUFF_SRC(x_player) _mmplayer_is_ms_buff_src(x_player) -#define MMPLAYER_URL_HAS_DASH_SUFFIX(x_player) __has_suffix(x_player, ".mpd") -#define MMPLAYER_URL_HAS_HLS_SUFFIX(x_player) __has_suffix(x_player, ".m3u8") +#define MMPLAYER_URL_HAS_DASH_SUFFIX(x_player) _mmplayer_has_suffix(x_player, ".mpd") +#define MMPLAYER_URL_HAS_HLS_SUFFIX(x_player) _mmplayer_has_suffix(x_player, ".m3u8") -#define MMPLAYER_STREAM_TYPE_GET_NAME(type) __get_stream_type_name(type) +#define MMPLAYER_STREAM_TYPE_GET_NAME(type) _mmplayer_get_stream_type_name(type) /*=========================================================================================== | | @@ -292,30 +292,30 @@ | | ========================================================================================== */ -const gchar *__get_state_name(int state); -const gchar *__get_stream_type_name(int type); - -gboolean __is_streaming(mmplayer_t *player); -gboolean __is_rtsp_streaming(mmplayer_t *player); -gboolean __is_live_streaming(mmplayer_t *player); -gboolean __is_http_streaming(mmplayer_t *player); -gboolean __is_http_live_streaming(mmplayer_t *player); -gboolean __is_dash_streaming(mmplayer_t *player); -gboolean __is_smooth_streaming(mmplayer_t *player); -gboolean __is_ms_buff_src(mmplayer_t *player); -gboolean __has_suffix(mmplayer_t *player, const gchar *suffix); - -gboolean __mmplayer_post_message(mmplayer_t *player, enum MMMessageType msgtype, MMMessageParamType *param); -gboolean __mmplayer_dump_pipeline_state(mmplayer_t *player); - -bool util_is_sdp_file(const char *path); -int util_exist_file_path(const char *file_path); -char **util_get_cookie_list(const char *cookies); -const char *util_get_charset(const char *file_path); -int util_get_pixtype(unsigned int fourcc); -bool util_get_storage_info(const char *path, mmplayer_storage_info_t *storage_info); - -media_format_mimetype_e util_convert_audio_pcm_str_to_media_format_mime(const gchar *audio_pcm_str); +const gchar *_mmplayer_get_state_name(int state); +const gchar *_mmplayer_get_stream_type_name(int type); + +gboolean _mmplayer_is_streaming(mmplayer_t *player); +gboolean _mmplayer_is_rtsp_streaming(mmplayer_t *player); +gboolean _mmplayer_is_live_streaming(mmplayer_t *player); +gboolean _mmplayer_is_http_streaming(mmplayer_t *player); +gboolean _mmplayer_is_http_live_streaming(mmplayer_t *player); +gboolean _mmplayer_is_dash_streaming(mmplayer_t *player); +gboolean _mmplayer_is_smooth_streaming(mmplayer_t *player); +gboolean _mmplayer_is_ms_buff_src(mmplayer_t *player); +gboolean _mmplayer_has_suffix(mmplayer_t *player, const gchar *suffix); + +gboolean _mmplayer_post_message(mmplayer_t *player, enum MMMessageType msgtype, MMMessageParamType *param); +gboolean _mmplayer_dump_pipeline_state(mmplayer_t *player); + +bool _mmplayer_is_sdp_file(const char *path); +int _mmplayer_exist_file_path(const char *file_path); +char **_mmplayer_get_cookie_list(const char *cookies); +const char *_mmplayer_get_charset(const char *file_path); +int _mmplayer_get_pixtype(unsigned int fourcc); +bool _mmplayer_get_storage_info(const char *path, mmplayer_storage_info_t *storage_info); + +media_format_mimetype_e _mmplayer_convert_audio_pcm_str_to_media_format_mime(const gchar *audio_pcm_str); #ifdef __cplusplus } diff --git a/src/mm_player.c b/src/mm_player.c index 683dddb..991378b 100644 --- a/src/mm_player.c +++ b/src/mm_player.c @@ -36,6 +36,7 @@ #include "mm_player_tracks.h" #include "mm_player_es.h" #include "mm_player_360.h" +#include "mm_player_gst.h" int mm_player_create(MMHandleType *player) { @@ -104,7 +105,7 @@ int mm_player_destroy(MMHandleType player) /* destroy the gst bus msg thread if it is remained. this funct have to be called before getting cmd lock. */ - __mmplayer_bus_msg_thread_destroy(player); + _mmplayer_bus_msg_thread_destroy(player); MMPLAYER_CMD_LOCK(player); @@ -145,7 +146,7 @@ int mm_player_abort_pause(MMHandleType player) MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* destroy the gst bus msg thread not to be blocked in pause(without cmd lock). */ - __mmplayer_bus_msg_thread_destroy(player); + _mmplayer_bus_msg_thread_destroy(player); /* abort the pause operation for preparing(without cmd lock). */ result = _mmplayer_abort_pause(player); @@ -419,7 +420,7 @@ int mm_player_get_position(MMHandleType player, int64_t *pos) MMPLAYER_CMD_LOCK(player); - result = _mmplayer_get_position(player, pos); + result = _mmplayer_gst_get_position((mmplayer_t *)player, pos); MMPLAYER_CMD_UNLOCK(player); diff --git a/src/mm_player_audioeffect.c b/src/mm_player_audioeffect.c index 440236d..0129d25 100644 --- a/src/mm_player_audioeffect.c +++ b/src/mm_player_audioeffect.c @@ -112,7 +112,7 @@ EXIT: } -int +static int __mmplayer_set_harmony_effect(mmplayer_t *player, GstElement *audio_effect_element) { gint *ext_effect_level_list = NULL; @@ -177,7 +177,7 @@ __mmplayer_set_harmony_effect(mmplayer_t *player, GstElement *audio_effect_eleme } -gboolean +static gboolean __mmplayer_is_earphone_only_effect_type(mmplayer_t *player, mm_audio_effect_type_e effect_type, int effect) { gboolean result = FALSE; @@ -214,7 +214,7 @@ __mmplayer_is_earphone_only_effect_type(mmplayer_t *player, mm_audio_effect_type return result; } -int +static int __mmplayer_audio_set_output_type(mmplayer_t *player, mm_audio_effect_type_e effect_type, int effect) { GstElement *audio_effect_element = NULL; @@ -288,8 +288,8 @@ EXIT: return result; } -gboolean -_mmplayer_is_supported_effect_type(mmplayer_t *player, mm_audio_effect_type_e effect_type, int effect) +static gboolean +__mmplayer_is_supported_effect_type(mmplayer_t *player, mm_audio_effect_type_e effect_type, int effect) { gboolean result = TRUE; mm_sound_device_flags_e flags = MM_SOUND_DEVICE_ALL_FLAG; @@ -511,7 +511,7 @@ mm_player_is_supported_preset_effect_type(MMHandleType hplayer, mm_audio_effect_ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_PRESET, effect)) + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_PRESET, effect)) result = MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; MMPLAYER_FLEAVE(); @@ -530,7 +530,7 @@ mm_player_is_supported_custom_effect_type(MMHandleType hplayer, mm_audio_effect_ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, effect)) + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, effect)) result = MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; MMPLAYER_FLEAVE(); @@ -594,8 +594,8 @@ mm_player_audio_effect_bypass(MMHandleType hplayer) } -int -_mmplayer_audio_effect_custom_set_level_ext(mmplayer_t *player, mm_audio_effect_custom_type_e custom_effect_type, int level) +static int +__mmplayer_audio_effect_custom_set_level_ext(mmplayer_t *player, mm_audio_effect_custom_type_e custom_effect_type, int level) { int effect_level_max = 0; int effect_level_min = 0; @@ -608,7 +608,7 @@ _mmplayer_audio_effect_custom_set_level_ext(mmplayer_t *player, mm_audio_effect_ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if EQ is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, custom_effect_type)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, custom_effect_type)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -644,8 +644,8 @@ _mmplayer_audio_effect_custom_set_level_ext(mmplayer_t *player, mm_audio_effect_ } -int -_mmplayer_audio_effect_custom_set_level_eq(mmplayer_t *player, int index, int level) +static int +__mmplayer_audio_effect_custom_set_level_eq(mmplayer_t *player, int index, int level) { gint eq_level_max = 0; gint eq_level_min = 0; @@ -656,7 +656,7 @@ _mmplayer_audio_effect_custom_set_level_eq(mmplayer_t *player, int index, int le MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if EQ is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -696,13 +696,13 @@ mm_player_audio_effect_custom_set_level(MMHandleType hplayer, mm_audio_effect_cu MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if this effect type is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, effect_custom_type)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, effect_custom_type)) { result = MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } else { if (effect_custom_type == MM_AUDIO_EFFECT_CUSTOM_EQ) { - result = _mmplayer_audio_effect_custom_set_level_eq(player, eq_index, level); + result = __mmplayer_audio_effect_custom_set_level_eq(player, eq_index, level); } else if (effect_custom_type > MM_AUDIO_EFFECT_CUSTOM_EQ && effect_custom_type < MM_AUDIO_EFFECT_CUSTOM_NUM) { - result = _mmplayer_audio_effect_custom_set_level_ext(player, effect_custom_type, level); + result = __mmplayer_audio_effect_custom_set_level_ext(player, effect_custom_type, level); } else { LOGE("out of range, effect type(%d)", effect_custom_type); result = MM_ERROR_INVALID_ARGUMENT; @@ -726,7 +726,7 @@ mm_player_audio_effect_custom_get_eq_bands_number(MMHandleType hplayer, int *ban MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if EQ is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -752,7 +752,7 @@ mm_player_audio_effect_custom_get_eq_bands_width(MMHandleType hplayer, int band_ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if EQ is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -785,7 +785,7 @@ mm_player_audio_effect_custom_get_eq_bands_freq(MMHandleType hplayer, int band_i MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if EQ is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -818,7 +818,7 @@ mm_player_audio_effect_custom_get_level(MMHandleType hplayer, mm_audio_effect_cu MMPLAYER_RETURN_VAL_IF_FAIL(level, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if this effect type is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, type)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, type)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -860,7 +860,7 @@ mm_player_audio_effect_custom_get_level_range(MMHandleType hplayer, mm_audio_eff MMPLAYER_RETURN_VAL_IF_FAIL(max, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if this effect type is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, type)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, type)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } @@ -908,7 +908,7 @@ mm_player_audio_effect_custom_set_level_eq_from_list(MMHandleType hplayer, int * MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* check if EQ is supported */ - if (!_mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { + if (!__mmplayer_is_supported_effect_type(player, MM_AUDIO_EFFECT_TYPE_CUSTOM, MM_AUDIO_EFFECT_CUSTOM_EQ)) { MMPLAYER_FLEAVE(); return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } diff --git a/src/mm_player_capture.c b/src/mm_player_capture.c index 0e11f7d..9e9d78d 100644 --- a/src/mm_player_capture.c +++ b/src/mm_player_capture.c @@ -312,7 +312,7 @@ __mmplayer_capture_thread(gpointer data) goto ERROR; } - ret = __mmplayer_get_video_angle((MMHandleType)player, &display_angle, &orientation); + ret = _mmplayer_get_video_angle((MMHandleType)player, &display_angle, &orientation); if (ret != MM_ERROR_NONE) { LOGE("failed to get rotation angle"); goto ERROR; diff --git a/src/mm_player_es.c b/src/mm_player_es.c index d36405c..1ae5921 100644 --- a/src/mm_player_es.c +++ b/src/mm_player_es.c @@ -43,9 +43,6 @@ /*--------------------------------------------------------------------------- | LOCAL FUNCTION PROTOTYPES: | ---------------------------------------------------------------------------*/ -static int __parse_media_format(mmplayer_video_stream_info_t *video, mmplayer_audio_stream_info_t *audio, media_format_h format); -static int __convert_media_format_video_mime_to_str(mmplayer_video_stream_info_t *video, media_format_mimetype_e mime); -static int __convert_media_format_audio_mime_to_str(mmplayer_audio_stream_info_t *audio, media_format_mimetype_e mime); static gboolean __mm_player_is_codec_data_changed(mmplayer_t *player, media_packet_h packet, mmplayer_stream_type_e streamtype); /*=========================================================================================== diff --git a/src/mm_player_gst.c b/src/mm_player_gst.c index eac4eaf..ad60ea5 100644 --- a/src/mm_player_gst.c +++ b/src/mm_player_gst.c @@ -1044,14 +1044,14 @@ __mmplayer_update_buffer_setting(mmplayer_t *player, GstMessage *buffering_msg) MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin); - __mmplayer_gst_get_position(player, &pos_nsec); /* to update player->last_position */ + _mmplayer_gst_get_position(player, &pos_nsec); /* to update player->last_position */ if (MMPLAYER_IS_HTTP_STREAMING(player)) { data_size = player->http_content_size; } - __mm_player_streaming_buffering(player->streamer, buffering_msg, data_size, player->last_position, player->duration); - __mm_player_streaming_sync_property(player->streamer, player->pipeline->mainbin[MMPLAYER_M_AUTOPLUG].gst); + _mm_player_streaming_buffering(player->streamer, buffering_msg, data_size, player->last_position, player->duration); + _mm_player_streaming_sync_property(player->streamer, player->pipeline->mainbin[MMPLAYER_M_AUTOPLUG].gst); return; } @@ -1090,7 +1090,7 @@ __mmplayer_handle_buffering_playback(mmplayer_t *player) { switch (pending_state) { case MM_PLAYER_STATE_PLAYING: - __mmplayer_gst_pause(player, TRUE); + _mmplayer_gst_pause(player, TRUE); break; case MM_PLAYER_STATE_PAUSED: @@ -1113,7 +1113,7 @@ __mmplayer_handle_buffering_playback(mmplayer_t *player) case MM_PLAYER_STATE_NONE: { if (current_state != MM_PLAYER_STATE_PLAYING) - __mmplayer_gst_resume(player, TRUE); + _mmplayer_gst_resume(player, TRUE); } break; @@ -1122,12 +1122,12 @@ __mmplayer_handle_buffering_playback(mmplayer_t *player) * Because, buffering can be completed during autoplugging when pipeline would try to go playing state directly. */ if (current_state == MM_PLAYER_STATE_PLAYING) { - /* NOTE: If the current state is PLAYING, it means, async __mmplayer_gst_pause() is not completed yet. + /* NOTE: If the current state is PLAYING, it means, async _mmplayer_gst_pause() is not completed yet. * The current state should be changed to paused purposely to prevent state conflict. */ MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PAUSED); } - __mmplayer_gst_resume(player, TRUE); + _mmplayer_gst_resume(player, TRUE); break; case MM_PLAYER_STATE_PLAYING: @@ -1161,7 +1161,7 @@ __mmplayer_handle_buffering_playback(mmplayer_t *player) /* rtsp streaming pause makes rtsp server stop sending data. */ if (!MMPLAYER_IS_RTSP_STREAMING(player)) { LOGD("set pause state during buffering"); - __mmplayer_gst_pause(player, TRUE); + _mmplayer_gst_pause(player, TRUE); } } } @@ -1170,7 +1170,7 @@ __mmplayer_handle_buffering_playback(mmplayer_t *player) case MM_PLAYER_STATE_PLAYING: /* rtsp streaming pause makes rtsp server stop sending data. */ if (!MMPLAYER_IS_RTSP_STREAMING(player)) - __mmplayer_gst_pause(player, TRUE); + _mmplayer_gst_pause(player, TRUE); break; case MM_PLAYER_STATE_PAUSED: @@ -1222,7 +1222,7 @@ __mmplayer_gst_handle_duration(mmplayer_t *player, GstMessage *msg) } } else { /* handling audio clip which has vbr. means duration is keep changing */ - __mmplayer_update_content_attrs(player, ATTR_DURATION); + _mmplayer_update_content_attrs(player, ATTR_DURATION); } MMPLAYER_FLEAVE(); @@ -1246,7 +1246,7 @@ __mmplayer_eos_timer_cb(gpointer u_data) if (count == -1) { gint ret_value = 0; - ret_value = __mmplayer_gst_set_position(player, 0, TRUE); + ret_value = _mmplayer_gst_set_position(player, 0, TRUE); if (ret_value != MM_ERROR_NONE) LOGE("seeking to 0 failed in repeat play"); } else { @@ -1269,13 +1269,13 @@ __mmplayer_handle_eos_delay(mmplayer_t *player, int delay_in_ms) MMPLAYER_POST_MSG(player, MM_MESSAGE_END_OF_STREAM, NULL); if (player->audio_decoded_cb) - __mmplayer_cancel_eos_timer(player); + _mmplayer_cancel_eos_timer(player); return; } /* cancel if existing */ - __mmplayer_cancel_eos_timer(player); + _mmplayer_cancel_eos_timer(player); /* init new timeout */ /* NOTE : consider give high priority to this timer */ @@ -1320,7 +1320,7 @@ __mmplayer_gst_pending_seek(mmplayer_t *player) LOGD("trying to play from(%"G_GINT64_FORMAT") pending position", player->pending_seek.pos); - ret = __mmplayer_gst_set_position(player, player->pending_seek.pos, FALSE); + ret = _mmplayer_gst_set_position(player, player->pending_seek.pos, FALSE); if (ret != MM_ERROR_NONE) LOGE("failed to seek pending postion. just keep staying current position."); @@ -1410,7 +1410,7 @@ __mmplayer_gst_handle_eos_message(mmplayer_t *player, GstMessage *msg) __mmplayer_drop_subtitle(player, TRUE); if ((player->audio_decoded_cb) && (player->audio_extract_opt & MM_PLAYER_AUDIO_EXTRACT_NO_SYNC_WITH_CLOCK)) - __mmplayer_audio_stream_clear_buffer(player, TRUE); + _mmplayer_audio_stream_clear_buffer(player, TRUE); /* rewind if repeat count is greater then zero */ /* get play count */ @@ -1471,7 +1471,7 @@ __mmplayer_gst_handle_error_message(mmplayer_t *player, GstMessage *msg) __mmplayer_handle_streaming_error(player, msg); /* dump state of all element */ - __mmplayer_dump_pipeline_state(player); + _mmplayer_dump_pipeline_state(player); } else { /* traslate gst error code to msl error code. then post it * to application if needed @@ -1653,7 +1653,7 @@ __mmplayer_gst_handle_state_message(mmplayer_t *player, GstMessage *msg) int retVal = MM_ERROR_NONE; LOGD("trying to play from (%"G_GINT64_FORMAT") pending position", player->pending_seek.pos); - retVal = __mmplayer_gst_set_position(player, player->pending_seek.pos, TRUE); + retVal = _mmplayer_gst_set_position(player, player->pending_seek.pos, TRUE); if (MM_ERROR_NONE != retVal) LOGE("failed to seek pending postion. just keep staying current position."); @@ -1682,7 +1682,7 @@ __mmplayer_gst_handle_state_message(mmplayer_t *player, GstMessage *msg) MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PAUSED); if (MMPLAYER_IS_STREAMING(player) && (player->streamer)) - __mm_player_streaming_set_content_bitrate(player->streamer, + _mm_player_streaming_set_content_bitrate(player->streamer, player->total_maximum_bitrate, player->total_bitrate); if (player->pending_seek.is_pending) { @@ -1719,7 +1719,7 @@ __mmplayer_gst_handle_state_message(mmplayer_t *player, GstMessage *msg) } if (player->gapless.stream_changed) { - __mmplayer_update_content_attrs(player, ATTR_ALL); + _mmplayer_update_content_attrs(player, ATTR_ALL); player->gapless.stream_changed = FALSE; } @@ -1809,7 +1809,7 @@ __mmplayer_gst_handle_element_message(mmplayer_t *player, GstMessage *msg) } if (!strcmp(structure_name, "Ext_Sub_Language_List")) - __mmplayer_track_update_text_attr_info(player, msg); + _mmplayer_track_update_text_attr_info(player, msg); /* custom message */ if (!strcmp(structure_name, "audio_codec_not_supported")) { @@ -1829,7 +1829,7 @@ __mmplayer_gst_handle_element_message(mmplayer_t *player, GstMessage *msg) gst_structure_get(gst_message_get_structure(msg), "rtsp_duration", G_TYPE_UINT64, &player->duration, NULL); LOGD("rtsp duration : %"G_GINT64_FORMAT" msec", GST_TIME_AS_MSECONDS(player->duration)); - player->streaming_type = __mmplayer_get_stream_service_type(player); + player->streaming_type = _mmplayer_get_stream_service_type(player); gst_structure_get(gst_message_get_structure(msg), "rtsp_audio_codec", G_TYPE_STRING, &audio_codec, NULL); LOGD("rtsp_audio_codec : %s", audio_codec); @@ -2000,8 +2000,8 @@ __mmplayer_gst_bus_msg_callback(GstMessage *msg, gpointer data) if (need_new_clock) { LOGD("Provide clock is TRUE, do pause->resume"); - __mmplayer_gst_pause(player, FALSE); - __mmplayer_gst_resume(player, FALSE); + _mmplayer_gst_pause(player, FALSE); + _mmplayer_gst_resume(player, FALSE); } } break; @@ -2312,17 +2312,17 @@ __mmplayer_gst_create_es_decoder(mmplayer_t *player, mmplayer_stream_type_e type mainbin[elem_id].gst = decodebin; /* raw pad handling signal */ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", - G_CALLBACK(__mmplayer_gst_decode_pad_added), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", + G_CALLBACK(_mmplayer_gst_decode_pad_added), (gpointer)player); /* This signal is emitted whenever decodebin finds a new stream. It is emitted before looking for any elements that can handle that stream.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select", - G_CALLBACK(__mmplayer_gst_decode_autoplug_select), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select", + G_CALLBACK(_mmplayer_gst_decode_autoplug_select), (gpointer)player); /* This signal is emitted when a element is added to the bin.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added", - G_CALLBACK(__mmplayer_gst_element_added), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added", + G_CALLBACK(_mmplayer_gst_element_added), (gpointer)player); if (!gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), decodebin)) { LOGE("failed to add new decodebin"); @@ -2435,11 +2435,11 @@ __mmplayer_gst_create_es_path(mmplayer_t *player, mmplayer_stream_type_e type, G /*Fix Seek External Demuxer: set audio and video appsrc as seekable */ gst_app_src_set_stream_type((GstAppSrc*)G_OBJECT(src), GST_APP_STREAM_TYPE_SEEKABLE); - __mmplayer_add_signal_connection(player, G_OBJECT(src), MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data", + _mmplayer_add_signal_connection(player, G_OBJECT(src), MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data", G_CALLBACK(__mmplayer_gst_appsrc_seek_data), (gpointer)player); - __mmplayer_add_signal_connection(player, G_OBJECT(src), MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data", + _mmplayer_add_signal_connection(player, G_OBJECT(src), MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data", G_CALLBACK(__mmplayer_gst_appsrc_feed_data), (gpointer)player); - __mmplayer_add_signal_connection(player, G_OBJECT(src), MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data", + _mmplayer_add_signal_connection(player, G_OBJECT(src), MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data", G_CALLBACK(__mmplayer_gst_appsrc_enough_data), (gpointer)player); /* create queue */ @@ -2476,7 +2476,7 @@ __mmplayer_gst_create_es_path(mmplayer_t *player, mmplayer_stream_type_e type, G } if (type == MM_PLAYER_STREAM_TYPE_TEXT) { - __mmplayer_gst_create_decoder(player, srcpad, caps); + _mmplayer_gst_create_decoder(player, srcpad, caps); } else { if (!__mmplayer_gst_create_es_decoder(player, type, srcpad)) { LOGE("failed to create decoder"); @@ -2555,7 +2555,7 @@ __mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data) } } - if (!__mmplayer_gst_create_decoder(player, pad, caps)) { + if (!_mmplayer_gst_create_decoder(player, pad, caps)) { LOGE("failed to autoplug for caps"); goto ERROR; } @@ -2643,7 +2643,7 @@ __mmplayer_gst_rtp_no_more_pads(GstElement *element, gpointer data) if (player->num_dynamic_pad == 0) { LOGD("it seems pad caps is directely used for autoplugging. removing fakesink now"); - if (!__mmplayer_gst_remove_fakesink(player, + if (!_mmplayer_gst_remove_fakesink(player, &player->pipeline->mainbin[MMPLAYER_M_SRC_FAKESINK])) /* NOTE : __mmplayer_pipeline_complete() can be called several time. because * signaling mechanism(pad-added, no-more-pad, new-decoded-pad) from various @@ -2694,9 +2694,9 @@ __mmplayer_gst_make_rtsp_src(mmplayer_t *player) if (user_agent) g_object_set(G_OBJECT(element), "user-agent", user_agent, NULL); - __mmplayer_add_signal_connection(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", + _mmplayer_add_signal_connection(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", G_CALLBACK(__mmplayer_gst_rtp_dynamic_pad), (gpointer)player); - __mmplayer_add_signal_connection(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads", + _mmplayer_add_signal_connection(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads", G_CALLBACK(__mmplayer_gst_rtp_no_more_pads), (gpointer)player); MMPLAYER_FLEAVE(); @@ -2749,7 +2749,7 @@ __mmplayer_gst_make_http_src(mmplayer_t *player) "timeout", http_timeout, "blocksize", (unsigned long)(64 * 1024), NULL); /* parsing cookies */ - if ((cookie_list = util_get_cookie_list((const char *)cookies))) { + if ((cookie_list = _mmplayer_get_cookie_list((const char *)cookies))) { g_object_set(G_OBJECT(element), "cookies", cookie_list, NULL); g_strfreev(cookie_list); } @@ -2773,7 +2773,7 @@ __mmplayer_gst_make_file_src(mmplayer_t *player) MMPLAYER_RETURN_VAL_IF_FAIL(player, NULL); LOGD("using filesrc for 'file://' handler"); - if (!util_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD])) { + if (!_mmplayer_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD])) { LOGE("failed to get storage info"); return NULL; } @@ -2873,7 +2873,7 @@ __mmplayer_gst_check_duration(mmplayer_t *player, gint64 position) /* For RTSP Streaming , duration is not returned in READY state. So seek to the previous position does not work properly. * Added a patch to postpone the actual seek when state changes to PLAY. Sending a fake SEEK_COMPLETED event to finish the current request. */ if ((MMPLAYER_IS_RTSP_STREAMING(player)) && - (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { + (_mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { player->pending_seek.is_pending = true; player->pending_seek.pos = position; player->seek_state = MMPLAYER_SEEK_NONE; @@ -2925,7 +2925,7 @@ __mmplayer_gst_check_seekable(mmplayer_t *player) } int -__mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState state, gboolean async, gint timeout) +_mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState state, gboolean async, gint timeout) { GstState element_state = GST_STATE_VOID_PENDING; GstState element_pending_state = GST_STATE_VOID_PENDING; @@ -2944,7 +2944,7 @@ __mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState stat LOGE("failed to set [%s] state", GST_ELEMENT_NAME(element)); /* dump state of all element */ - __mmplayer_dump_pipeline_state(player); + _mmplayer_dump_pipeline_state(player); return MM_ERROR_PLAYER_INTERNAL; } @@ -2968,7 +2968,7 @@ __mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState stat gst_element_state_get_name(element_pending_state)); /* dump state of all element */ - __mmplayer_dump_pipeline_state(player); + _mmplayer_dump_pipeline_state(player); return MM_ERROR_PLAYER_INTERNAL; } @@ -2981,7 +2981,7 @@ __mmplayer_gst_set_state(mmplayer_t *player, GstElement *element, GstState stat } int -__mmplayer_gst_start(mmplayer_t *player) +_mmplayer_gst_start(mmplayer_t *player) { int ret = MM_ERROR_NONE; gboolean async = FALSE; @@ -2996,7 +2996,7 @@ __mmplayer_gst_start(mmplayer_t *player) */ if (player->pending_seek.is_pending && !MMPLAYER_IS_STREAMING(player)) { MMPLAYER_TARGET_STATE(player) = MM_PLAYER_STATE_PAUSED; - ret = __mmplayer_gst_pause(player, FALSE); + ret = _mmplayer_gst_pause(player, FALSE); if (ret != MM_ERROR_NONE) { LOGE("failed to set state to PAUSED for pending seek"); return ret; @@ -3012,7 +3012,7 @@ __mmplayer_gst_start(mmplayer_t *player) MMPLAYER_PRINT_STATE(player); /* set pipeline state to PLAYING */ - ret = __mmplayer_gst_set_state(player, + ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, MMPLAYER_STATE_CHANGE_TIMEOUT(player)); if (ret != MM_ERROR_NONE) { LOGE("failed to set state to PLAYING"); @@ -3030,7 +3030,7 @@ __mmplayer_gst_start(mmplayer_t *player) } int -__mmplayer_gst_stop(mmplayer_t *player) +_mmplayer_gst_stop(mmplayer_t *player) { GstStateChangeReturn change_ret = GST_STATE_CHANGE_SUCCESS; MMHandleType attrs = 0; @@ -3065,7 +3065,7 @@ __mmplayer_gst_stop(mmplayer_t *player) __mmplayer_gst_set_async(player, FALSE, MMPLAYER_SINK_ALL); /* set gst state */ - ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED, FALSE, timeout); + ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED, FALSE, timeout); if (player->es_player_push_mode) { /* enable the async state transition as default operation */ @@ -3080,7 +3080,7 @@ __mmplayer_gst_stop(mmplayer_t *player) /* rewind */ if (rewind) { - if (!__mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate, + if (!_mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) { LOGW("failed to rewind"); @@ -3101,7 +3101,7 @@ __mmplayer_gst_stop(mmplayer_t *player) } else { LOGE("fail to stop player."); ret = MM_ERROR_PLAYER_INTERNAL; - __mmplayer_dump_pipeline_state(player); + _mmplayer_dump_pipeline_state(player); } /* generate dot file if enabled */ @@ -3113,7 +3113,7 @@ __mmplayer_gst_stop(mmplayer_t *player) } int -__mmplayer_gst_pause(mmplayer_t *player, gboolean async) +_mmplayer_gst_pause(mmplayer_t *player, gboolean async) { int ret = MM_ERROR_NONE; @@ -3127,7 +3127,7 @@ __mmplayer_gst_pause(mmplayer_t *player, gboolean async) MMPLAYER_PRINT_STATE(player); /* set pipeline status to PAUSED */ - ret = __mmplayer_gst_set_state(player, + ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED, async, MMPLAYER_STATE_CHANGE_TIMEOUT(player)); if (async) @@ -3213,7 +3213,7 @@ EXIT: } int -__mmplayer_gst_resume(mmplayer_t *player, gboolean async) +_mmplayer_gst_resume(mmplayer_t *player, gboolean async) { int ret = MM_ERROR_NONE; gint timeout = 0; @@ -3233,7 +3233,7 @@ __mmplayer_gst_resume(mmplayer_t *player, gboolean async) /* set pipeline state to PLAYING */ timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player); - ret = __mmplayer_gst_set_state(player, + ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, timeout); if (ret != MM_ERROR_NONE) { LOGE("failed to set state to PLAYING"); @@ -3254,7 +3254,7 @@ EXIT: /* sending event to one of sinkelements */ gboolean -__mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event) +_mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event) { GstEvent *event2 = NULL; GList *sinks = NULL; @@ -3344,7 +3344,7 @@ __mmplayer_gst_send_event_to_sink(mmplayer_t *player, GstEvent *event) } gboolean -__mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate, +_mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate, GstFormat format, GstSeekFlags flags, GstSeekType cur_type, gint64 cur, GstSeekType stop_type, gint64 stop) { @@ -3361,7 +3361,7 @@ __mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate, event = gst_event_new_seek(rate, format, flags, cur_type, cur, stop_type, stop); - result = __mmplayer_gst_send_event_to_sink(player, event); + result = _mmplayer_gst_send_event_to_sink(player, event); MMPLAYER_FLEAVE(); @@ -3369,7 +3369,7 @@ __mmplayer_gst_seek(mmplayer_t *player, GstElement *element, gdouble rate, } int -__mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean internal_called) +_mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean internal_called) { int ret = MM_ERROR_NONE; gint64 pos_nsec = 0; @@ -3401,7 +3401,7 @@ __mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean intern This causes problem is position calculation during normal pause resume scenarios also. Currently during seek , we are sending the current position to rtspsrc module for position saving for later use. */ if ((MMPLAYER_IS_RTSP_STREAMING(player)) && - (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { + (_mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { if (!gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_nsec)) LOGW("getting current position failed in seek"); @@ -3437,7 +3437,7 @@ __mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean intern else seek_flags |= GST_SEEK_FLAG_KEY_UNIT; - if (!__mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate, + if (!_mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate, GST_FORMAT_TIME, seek_flags, GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) { LOGE("failed to set position"); @@ -3480,7 +3480,7 @@ SEEK_ERROR: } int -__mmplayer_gst_get_position(mmplayer_t *player, gint64 *position) +_mmplayer_gst_get_position(mmplayer_t *player, gint64 *position) { #define TRICKPLAY_OFFSET GST_MSECOND @@ -3531,7 +3531,7 @@ __mmplayer_gst_get_position(mmplayer_t *player, gint64 *position) } int -__mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_pos) +_mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_pos) { #define STREAMING_IS_FINISHED 0 #define BUFFERING_MAX_PER 100 @@ -3568,7 +3568,7 @@ __mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_ return MM_ERROR_NONE; } - if (__mmplayer_gst_get_position(player, &position) != MM_ERROR_NONE) { + if (_mmplayer_gst_get_position(player, &position) != MM_ERROR_NONE) { LOGW("fail to get current position"); return MM_ERROR_NONE; } @@ -3661,7 +3661,7 @@ __mmplayer_gst_get_buffer_position(mmplayer_t *player, int *start_pos, int *end_ } GstElement * -__mmplayer_gst_create_source(mmplayer_t *player) +_mmplayer_gst_create_source(mmplayer_t *player) { GstElement *element = NULL; @@ -3693,7 +3693,7 @@ __mmplayer_gst_create_source(mmplayer_t *player) } int -__mmplayer_gst_build_es_pipeline(mmplayer_t *player) +_mmplayer_gst_build_es_pipeline(mmplayer_t *player) { MMHandleType attrs = 0; @@ -3728,7 +3728,7 @@ __mmplayer_gst_build_es_pipeline(mmplayer_t *player) } int -__mmplayer_gst_build_pipeline(mmplayer_t *player) +_mmplayer_gst_build_pipeline(mmplayer_t *player) { mmplayer_gst_element_t *mainbin = NULL; GstElement *src_elem = NULL; @@ -3792,9 +3792,9 @@ __mmplayer_gst_build_pipeline(mmplayer_t *player) g_object_set(src_elem, "stream-type", stream_type, "size", (gint64)player->profile.input_mem.len, "blocksize", 20480, NULL); - __mmplayer_add_signal_connection(player, G_OBJECT(src_elem), MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data", + _mmplayer_add_signal_connection(player, G_OBJECT(src_elem), MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data", G_CALLBACK(__mmplayer_gst_appsrc_seek_data_mem), (gpointer)&player->profile.input_mem); - __mmplayer_add_signal_connection(player, G_OBJECT(src_elem), MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data", + _mmplayer_add_signal_connection(player, G_OBJECT(src_elem), MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data", G_CALLBACK(__mmplayer_gst_appsrc_feed_data_mem), (gpointer)&player->profile.input_mem); } break; @@ -3826,11 +3826,11 @@ __mmplayer_gst_build_pipeline(mmplayer_t *player) goto ERROR; } - __mmplayer_add_signal_connection(player, G_OBJECT(autoplug_elem), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type", - G_CALLBACK(__mmplayer_typefind_have_type), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(autoplug_elem), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type", + G_CALLBACK(_mmplayer_typefind_have_type), (gpointer)player); } else if (!MMPLAYER_IS_RTSP_STREAMING(player)) { autoplug_elem_id = MMPLAYER_M_AUTOPLUG; - autoplug_elem = __mmplayer_gst_make_decodebin(player); + autoplug_elem = _mmplayer_gst_make_decodebin(player); if (!autoplug_elem) { LOGE("failed to create decodebin"); goto ERROR; @@ -3850,13 +3850,13 @@ __mmplayer_gst_build_pipeline(mmplayer_t *player) } /* add elements to pipeline */ - if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element_bucket)) { + if (!_mmplayer_gst_element_add_bucket_to_bin(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element_bucket)) { LOGE("failed to add elements to pipeline"); goto ERROR; } /* linking elements in the bucket by added order. */ - if (__mmplayer_gst_element_link_bucket(element_bucket) == -1) { + if (_mmplayer_gst_element_link_bucket(element_bucket) == -1) { LOGE("failed to link some elements"); goto ERROR; } @@ -3908,7 +3908,7 @@ ERROR: } int -__mmplayer_gst_add_bus_watch(mmplayer_t *player) +_mmplayer_gst_add_bus_watch(mmplayer_t *player) { GstBus *bus = NULL; mmplayer_gst_element_t *mainbin = NULL; @@ -3954,3 +3954,133 @@ __mmplayer_gst_add_bus_watch(mmplayer_t *player) MMPLAYER_FLEAVE(); return MM_ERROR_NONE; } + +void +_mmplayer_activate_next_source(mmplayer_t *player, GstState target) +{ + mmplayer_gst_element_t *mainbin = NULL; + MMMessageParamType msg_param = {0,}; + GstElement *element = NULL; + MMHandleType attrs = 0; + char *uri = NULL; + main_element_id_e elem_idx = MMPLAYER_M_NUM; + + MMPLAYER_FENTER(); + + if (!player || !player->pipeline || !player->pipeline->mainbin) { + LOGE("player is not initialized"); + goto ERROR; + } + + mainbin = player->pipeline->mainbin; + msg_param.code = MM_ERROR_PLAYER_INTERNAL; + + attrs = MMPLAYER_GET_ATTRS(player); + if (!attrs) { + LOGE("fail to get attributes"); + goto ERROR; + } + + mm_attrs_get_string_by_name(attrs, "profile_uri", &uri); + + if (_mmplayer_parse_profile((const char *)uri, NULL, &player->profile) != MM_ERROR_NONE) { + LOGE("failed to parse profile"); + msg_param.code = MM_ERROR_PLAYER_INVALID_URI; + goto ERROR; + } + + if ((MMPLAYER_URL_HAS_DASH_SUFFIX(player)) || + (MMPLAYER_URL_HAS_HLS_SUFFIX(player))) { + LOGE("dash or hls is not supportable"); + msg_param.code = MM_ERROR_PLAYER_INVALID_URI; + goto ERROR; + } + + element = _mmplayer_gst_create_source(player); + if (!element) { + LOGE("no source element was created"); + goto ERROR; + } + + if (gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element) == FALSE) { + LOGE("failed to add source element to pipeline"); + gst_object_unref(GST_OBJECT(element)); + element = NULL; + goto ERROR; + } + + /* take source element */ + mainbin[MMPLAYER_M_SRC].id = MMPLAYER_M_SRC; + mainbin[MMPLAYER_M_SRC].gst = element; + + element = NULL; + + if (MMPLAYER_IS_HTTP_STREAMING(player)) { + if (player->streamer == NULL) { + player->streamer = _mm_player_streaming_create(); + _mm_player_streaming_initialize(player->streamer, TRUE); + } + + elem_idx = MMPLAYER_M_TYPEFIND; + element = gst_element_factory_make("typefind", "typefinder"); + _mmplayer_add_signal_connection(player, G_OBJECT(element), + MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type", G_CALLBACK(_mmplayer_typefind_have_type), (gpointer)player); + } else { + elem_idx = MMPLAYER_M_AUTOPLUG; + element = _mmplayer_gst_make_decodebin(player); + } + + /* check autoplug element is OK */ + if (!element) { + LOGE("can not create element(%d)", elem_idx); + goto ERROR; + } + + if (gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element) == FALSE) { + LOGE("failed to add sinkbin to pipeline"); + gst_object_unref(GST_OBJECT(element)); + element = NULL; + goto ERROR; + } + + mainbin[elem_idx].id = elem_idx; + mainbin[elem_idx].gst = element; + + if (gst_element_link(mainbin[MMPLAYER_M_SRC].gst, mainbin[elem_idx].gst) == FALSE) { + LOGE("Failed to link src - autoplug(or typefind)"); + goto ERROR; + } + + if (gst_element_set_state(mainbin[MMPLAYER_M_SRC].gst, target) == GST_STATE_CHANGE_FAILURE) { + LOGE("Failed to change state of src element"); + goto ERROR; + } + + if (!MMPLAYER_IS_HTTP_STREAMING(player)) { + if (gst_element_set_state(mainbin[MMPLAYER_M_AUTOPLUG].gst, target) == GST_STATE_CHANGE_FAILURE) { + LOGE("Failed to change state of decodebin"); + goto ERROR; + } + } else { + if (gst_element_set_state(mainbin[MMPLAYER_M_TYPEFIND].gst, target) == GST_STATE_CHANGE_FAILURE) { + LOGE("Failed to change state of src element"); + goto ERROR; + } + } + + player->gapless.stream_changed = TRUE; + player->gapless.running = TRUE; + MMPLAYER_FLEAVE(); + return; + +ERROR: + if (player) { + MMPLAYER_PLAYBACK_UNLOCK(player); + + if (!player->msg_posted) { + MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param); + player->msg_posted = TRUE; + } + } + return; +} diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index 6e8c291..2020cbc 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -143,7 +143,6 @@ static int __mmplayer_gst_create_video_sink_bin(mmplayer_t *player, GstCaps *ca static int __mmplayer_gst_create_audio_sink_bin(mmplayer_t *player); static int __mmplayer_gst_create_text_sink_bin(mmplayer_t *player); -static GstPadProbeReturn __mmplayer_gst_selector_blocked(GstPad *pad, GstPadProbeInfo *info, gpointer data); static void __mmplayer_gst_decode_no_more_pads(GstElement *elem, gpointer data); static void __mmplayer_gst_create_sinkbin(GstElement *decodebin, GstPad *pad, gpointer data); static void __mmplayer_gst_decode_unknown_type(GstElement *elem, GstPad *pad, GstCaps *caps, gpointer data); @@ -181,7 +180,6 @@ static int __mmplayer_gst_set_message_callback(mmplayer_t *player, MMMessageCal /* util */ static gboolean __mmplayer_verify_gapless_play_path(mmplayer_t *player); -static void __mmplayer_activate_next_source(mmplayer_t *player, GstState target); static void __mmplayer_check_pipeline(mmplayer_t *player); static gboolean __mmplayer_deactivate_selector(mmplayer_t *player, mmplayer_track_type_e type); static void __mmplayer_deactivate_old_path(mmplayer_t *player); @@ -246,7 +244,7 @@ print_tag(const GstTagList *list, const gchar *tag, gpointer unused) /* This function should be called after the pipeline goes PAUSED or higher state. */ gboolean -__mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag) +_mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag) { static gboolean has_duration = FALSE; static gboolean has_video_attrs = FALSE; @@ -320,7 +318,7 @@ __mmplayer_update_content_attrs(mmplayer_t *player, enum content_attr_flag flag) } MMStreamingType -__mmplayer_get_stream_service_type(mmplayer_t *player) +_mmplayer_get_stream_service_type(mmplayer_t *player) { MMStreamingType streaming_type = STREAMING_SERVICE_NONE; @@ -360,7 +358,7 @@ __mmplayer_get_stream_service_type(mmplayer_t *player) * it to applicaton by calling callback function */ void -__mmplayer_set_state(mmplayer_t *player, int state) +_mmplayer_set_state(mmplayer_t *player, int state) { MMMessageParamType msg = {0, }; @@ -430,7 +428,7 @@ __mmplayer_set_state(mmplayer_t *player, int state) } int -__mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command) +_mmplayer_check_state(mmplayer_t *player, mmplayer_command_state_e command) { mmplayer_state_e current_state = MM_PLAYER_STATE_NUM; mmplayer_state_e pending_state = MM_PLAYER_STATE_NUM; @@ -598,6 +596,64 @@ ALREADY_GOING: return MM_ERROR_PLAYER_NO_OP; } +static void +__mmplayer_initialize_gapless_play(mmplayer_t *player) +{ + int i; + + MMPLAYER_FENTER(); + + player->smooth_streaming = FALSE; + player->videodec_linked = 0; + player->audiodec_linked = 0; + player->textsink_linked = 0; + player->is_external_subtitle_present = FALSE; + player->is_external_subtitle_added_now = FALSE; + player->not_supported_codec = MISSING_PLUGIN_NONE; + player->can_support_codec = FOUND_PLUGIN_NONE; + player->pending_seek.is_pending = false; + player->pending_seek.pos = 0; + player->msg_posted = FALSE; + player->has_many_types = FALSE; + player->no_more_pad = FALSE; + player->not_found_demuxer = 0; + player->seek_state = MMPLAYER_SEEK_NONE; + player->is_subtitle_force_drop = FALSE; + player->play_subtitle = FALSE; + player->adjust_subtitle_pos = 0; + + player->total_bitrate = 0; + player->total_maximum_bitrate = 0; + + _mmplayer_track_initialize(player); + __mmplayer_initialize_storage_info(player, MMPLAYER_PATH_MAX); + + for (i = 0; i < MM_PLAYER_STREAM_COUNT_MAX; i++) { + player->bitrate[i] = 0; + player->maximum_bitrate[i] = 0; + } + + if (player->v_stream_caps) { + gst_caps_unref(player->v_stream_caps); + player->v_stream_caps = NULL; + } + + mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0); + + /* clean found audio decoders */ + if (player->audio_decoders) { + GList *a_dec = player->audio_decoders; + for (; a_dec; a_dec = g_list_next(a_dec)) { + gchar *name = a_dec->data; + MMPLAYER_FREEIF(name); + } + g_list_free(player->audio_decoders); + player->audio_decoders = NULL; + } + + MMPLAYER_FLEAVE(); +} + static gpointer __mmplayer_gapless_play_thread(gpointer data) { @@ -630,7 +686,10 @@ __mmplayer_gapless_play_thread(gpointer data) MMPLAYER_RELEASE_ELEMENT(player, mainbin, MMPLAYER_M_TYPEFIND); MMPLAYER_RELEASE_ELEMENT(player, mainbin, MMPLAYER_M_SRC); - __mmplayer_activate_next_source(player, GST_STATE_PLAYING); + /* Initialize Player values */ + __mmplayer_initialize_gapless_play(player); + + _mmplayer_activate_next_source(player, GST_STATE_PLAYING); } MMPLAYER_GAPLESS_PLAY_THREAD_UNLOCK(player); @@ -654,7 +713,7 @@ __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id) } void -__mmplayer_bus_msg_thread_destroy(MMHandleType hplayer) +_mmplayer_bus_msg_thread_destroy(MMHandleType hplayer) { mmplayer_t *player = (mmplayer_t *)hplayer; GstMessage *msg = NULL; @@ -700,7 +759,7 @@ __mmplayer_bus_msg_thread_destroy(MMHandleType hplayer) } gboolean -__mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink) +_mmplayer_gst_remove_fakesink(mmplayer_t *player, mmplayer_gst_element_t *fakesink) { GstElement *parent = NULL; @@ -1066,7 +1125,7 @@ __mmplayer_gst_make_selector(mmplayer_t *player, main_element_id_e elem_idx, mmp } void -__mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data) +_mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data) { mmplayer_t *player = (mmplayer_t *)data; GstElement *selector = NULL; @@ -1183,7 +1242,7 @@ __mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data) g_object_set(selector, "active-pad", sinkpad, NULL); } - __mmplayer_track_update_selector_info(player, stream_type, sinkpad); + _mmplayer_track_update_selector_info(player, stream_type, sinkpad); DONE: ERROR: @@ -1358,7 +1417,7 @@ __mmplayer_gst_set_queue2_buffering(mmplayer_t *player) /* there is no mq, enable use-buffering on queue2 (ex) wav streaming * use file information was already set on Q2 when it was created. */ - __mm_player_streaming_set_queue2(player->streamer, + _mm_player_streaming_set_queue2(player->streamer, player->pipeline->mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst, TRUE, /* use_buffering */ MUXED_BUFFER_TYPE_MAX, /* use previous buffer type setting */ @@ -1540,7 +1599,7 @@ __mmplayer_gst_create_sinkbin(GstElement *elem, GstPad *pad, gpointer data) reusing = TRUE; sinkbin = player->pipeline->audiobin[MMPLAYER_A_BIN].gst; LOGD("reusing audiobin"); - __mmplayer_update_content_attrs(player, ATTR_AUDIO); + _mmplayer_update_content_attrs(player, ATTR_AUDIO); } } else if (strstr(name, "video")) { /* 1. zero copy is updated at _decode_pad_added() @@ -1582,7 +1641,7 @@ __mmplayer_gst_create_sinkbin(GstElement *elem, GstPad *pad, gpointer data) reusing = TRUE; sinkbin = player->pipeline->videobin[MMPLAYER_V_BIN].gst; LOGD("re-using videobin"); - __mmplayer_update_content_attrs(player, ATTR_VIDEO); + _mmplayer_update_content_attrs(player, ATTR_VIDEO); } } else if (strstr(name, "text")) { if (player->pipeline->textbin == NULL) { @@ -1709,7 +1768,7 @@ __mmplayer_video_param_check_video_sink_bin(mmplayer_t *player) } int -__mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientation) +_mmplayer_get_video_angle(mmplayer_t *player, int *display_angle, int *orientation) { int display_rotation = 0; gchar *org_orient = NULL; @@ -1780,7 +1839,7 @@ __mmplayer_video_param_set_display_rotation(mmplayer_t *player) if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player)) return; - __mmplayer_get_video_angle(player, &display_angle, &orientations); + _mmplayer_get_video_angle(player, &display_angle, &orientations); /* get rotation value to set */ __mmplayer_get_property_value_for_rotation(player, display_angle, orientations, &rotation_value); @@ -2102,7 +2161,7 @@ _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only) } int -__mmplayer_gst_element_link_bucket(GList *element_bucket) +_mmplayer_gst_element_link_bucket(GList *element_bucket) { GList *bucket = element_bucket; mmplayer_gst_element_t *element = NULL; @@ -2159,7 +2218,7 @@ __mmplayer_gst_element_link_bucket(GList *element_bucket) } int -__mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket) +_mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket) { GList *bucket = element_bucket; mmplayer_gst_element_t *element = NULL; @@ -2175,7 +2234,7 @@ __mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket) if (element && element->gst) { if (!gst_bin_add(bin, GST_ELEMENT(element->gst))) { - LOGD("__mmplayer_gst_element_link_bucket : Adding element [%s] to bin [%s] failed", + LOGD("_mmplayer_gst_element_link_bucket : Adding element [%s] to bin [%s] failed", GST_ELEMENT_NAME(GST_ELEMENT(element->gst)), GST_ELEMENT_NAME(GST_ELEMENT(bin))); return 0; @@ -2215,7 +2274,7 @@ __mmplayer_gst_caps_notify_cb(GstPad *pad, GParamSpec *unused, gpointer data) LOGD("name = %s", name); if (strstr(name, "audio")) { - __mmplayer_update_content_attrs(player, ATTR_AUDIO); + _mmplayer_update_content_attrs(player, ATTR_AUDIO); if (player->audio_stream_changed_cb) { LOGE("call the audio stream changed cb"); @@ -2225,7 +2284,7 @@ __mmplayer_gst_caps_notify_cb(GstPad *pad, GParamSpec *unused, gpointer data) if ((name = gst_structure_get_string(str, "format"))) player->set_mode.video_zc = name[0] == 'S'; - __mmplayer_update_content_attrs(player, ATTR_VIDEO); + _mmplayer_update_content_attrs(player, ATTR_VIDEO); if (player->video_stream_changed_cb) { LOGE("call the video stream changed cb"); @@ -2245,7 +2304,7 @@ ERROR: } void -__mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all) +_mmplayer_audio_stream_clear_buffer(mmplayer_t *player, gboolean send_all) { GList *l = NULL; @@ -2378,7 +2437,7 @@ __mmplayer_audio_stream_decoded_render_cb(GstElement *object, GstBuffer *buffer, a_buffer->is_little_endian = (endianness == 1234 ? true : false); a_buffer->channel_mask = channel_mask; a_buffer->data_size = a_size; - a_buffer->pcm_format = util_convert_audio_pcm_str_to_media_format_mime(pcm_format); + a_buffer->pcm_format = _mmplayer_convert_audio_pcm_str_to_media_format_mime(pcm_format); if (player->audio_extract_opt & MM_PLAYER_AUDIO_EXTRACT_NO_SYNC_WITH_CLOCK) { /* If sync is FALSE, use buffer list to reduce the IPC. */ @@ -2457,7 +2516,7 @@ __mmplayer_gst_audio_deinterleave_pad_added(GstElement *elem, GstPad *pad, gpoin gst_element_set_state(sink, GST_STATE_PAUSED); gst_element_set_state(queue, GST_STATE_PAUSED); - __mmplayer_add_signal_connection(player, + _mmplayer_add_signal_connection(player, G_OBJECT(sink), MM_PLAYER_SIGNAL_TYPE_AUDIOBIN, "handoff", @@ -2717,7 +2776,7 @@ __mmplayer_gst_make_audio_playback_sink(mmplayer_t *player, GList **bucket) g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "slave-method", GST_AUDIO_BASE_SINK_SLAVE_NONE, NULL); sink_pad = gst_element_get_static_pad(audiobin[MMPLAYER_A_SINK].gst, "sink"); - __mmplayer_add_signal_connection(player, G_OBJECT(sink_pad), MM_PLAYER_SIGNAL_TYPE_AUDIOBIN, + _mmplayer_add_signal_connection(player, G_OBJECT(sink_pad), MM_PLAYER_SIGNAL_TYPE_AUDIOBIN, "notify::caps", G_CALLBACK(__mmplayer_gst_caps_notify_cb), (gpointer)player); gst_object_unref(GST_OBJECT(sink_pad)); @@ -2826,7 +2885,7 @@ __mmplayer_gst_make_audio_extract_sink(mmplayer_t *player, GList **bucket) dst_format, dst_len, dst_samplerate, dst_channels); /* If there is no enough information, set it to platform default value. */ - if (dst_format == NULL || util_convert_audio_pcm_str_to_media_format_mime(dst_format) == MEDIA_FORMAT_MAX) { + if (dst_format == NULL || _mmplayer_convert_audio_pcm_str_to_media_format_mime(dst_format) == MEDIA_FORMAT_MAX) { LOGD("set platform default format"); dst_format = DEFAULT_PCM_OUT_FORMAT; } @@ -2857,7 +2916,7 @@ __mmplayer_gst_make_audio_extract_sink(mmplayer_t *player, GList **bucket) g_object_set(G_OBJECT(audiobin[MMPLAYER_A_EXTRACT_DEINTERLEAVE].gst), "keep-positions", TRUE, NULL); /* audiosink will be added after getting signal for each channel */ - __mmplayer_add_signal_connection(player, G_OBJECT(audiobin[MMPLAYER_A_EXTRACT_DEINTERLEAVE].gst), + _mmplayer_add_signal_connection(player, G_OBJECT(audiobin[MMPLAYER_A_EXTRACT_DEINTERLEAVE].gst), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", G_CALLBACK(__mmplayer_gst_audio_deinterleave_pad_added), (gpointer)player); } else { /* 4-2. create fakesink to extract interlevaed pcm */ @@ -2867,7 +2926,7 @@ __mmplayer_gst_make_audio_extract_sink(mmplayer_t *player, GList **bucket) g_object_set(G_OBJECT(audiobin[extract_sink_id].gst), "sync", TRUE, NULL); g_object_set(G_OBJECT(audiobin[extract_sink_id].gst), "signal-handoffs", TRUE, NULL); - __mmplayer_add_signal_connection(player, + _mmplayer_add_signal_connection(player, G_OBJECT(audiobin[extract_sink_id].gst), MM_PLAYER_SIGNAL_TYPE_AUDIOBIN, "handoff", @@ -2970,12 +3029,12 @@ __mmplayer_gst_create_audio_sink_bin(mmplayer_t *player) /* adding created elements to bin */ LOGD("adding created elements to bin"); - if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(audiobin[MMPLAYER_A_BIN].gst), element_bucket)) + if (!_mmplayer_gst_element_add_bucket_to_bin(GST_BIN(audiobin[MMPLAYER_A_BIN].gst), element_bucket)) goto ERROR; /* linking elements in the bucket by added order. */ LOGD("Linking elements in the bucket by added order."); - if (__mmplayer_gst_element_link_bucket(element_bucket) == -1) + if (_mmplayer_gst_element_link_bucket(element_bucket) == -1) goto ERROR; /* get first element's sinkpad for creating ghostpad */ @@ -3239,7 +3298,7 @@ __mmplayer_video_stream_decoded_render_cb(GstElement *object, GstBuffer *buffer, return; } - __mmplayer_get_video_angle(player, NULL, &stream->orientation); + _mmplayer_get_video_angle(player, NULL, &stream->orientation); /* set size and timestamp */ mem = gst_buffer_peek_memory(buffer, 0); @@ -3461,14 +3520,14 @@ __mmplayer_gst_set_videosink_property(mmplayer_t *player, MMDisplaySurfaceType s if (enable || (surface_type == MM_DISPLAY_SURFACE_REMOTE) || (surface_type == MM_DISPLAY_SURFACE_NULL)) g_object_set(G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), "signal-handoffs", TRUE, NULL); - __mmplayer_add_signal_connection(player, + _mmplayer_add_signal_connection(player, G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), MM_PLAYER_SIGNAL_TYPE_VIDEOBIN, "handoff", G_CALLBACK(__mmplayer_video_stream_decoded_render_cb), (gpointer)player); - __mmplayer_add_signal_connection(player, + _mmplayer_add_signal_connection(player, G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), MM_PLAYER_SIGNAL_TYPE_VIDEOBIN, "preroll-handoff", @@ -3483,7 +3542,7 @@ __mmplayer_gst_set_videosink_property(mmplayer_t *player, MMDisplaySurfaceType s GstPad *sink_pad = NULL; sink_pad = gst_element_get_static_pad(videobin[MMPLAYER_V_SINK].gst, "sink"); if (sink_pad) { - __mmplayer_add_signal_connection(player, G_OBJECT(sink_pad), MM_PLAYER_SIGNAL_TYPE_VIDEOBIN, + _mmplayer_add_signal_connection(player, G_OBJECT(sink_pad), MM_PLAYER_SIGNAL_TYPE_VIDEOBIN, "notify::caps", G_CALLBACK(__mmplayer_gst_caps_notify_cb), (gpointer)player); gst_object_unref(GST_OBJECT(sink_pad)); } else { @@ -3541,13 +3600,13 @@ __mmplayer_gst_create_video_sink_bin(mmplayer_t *player, GstCaps *caps, MMDispla __mmplayer_add_sink(player, videobin[MMPLAYER_V_SINK].gst); /* adding created elements to bin */ - if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(videobin[MMPLAYER_V_BIN].gst), element_bucket)) { + if (!_mmplayer_gst_element_add_bucket_to_bin(GST_BIN(videobin[MMPLAYER_V_BIN].gst), element_bucket)) { LOGE("failed to add elements"); goto ERROR; } /* Linking elements in the bucket by added order */ - if (__mmplayer_gst_element_link_bucket(element_bucket) == -1) { + if (_mmplayer_gst_element_link_bucket(element_bucket) == -1) { LOGE("failed to link elements"); goto ERROR; } @@ -3610,7 +3669,7 @@ __mmplayer_gst_create_plain_text_elements(mmplayer_t *player) NULL); MMPLAYER_CREATE_ELEMENT(textbin, MMPLAYER_T_FAKE_SINK, "fakesink", "text_fakesink", element_bucket, player); - __mmplayer_add_signal_connection(player, + _mmplayer_add_signal_connection(player, G_OBJECT(textbin[MMPLAYER_T_FAKE_SINK].gst), MM_PLAYER_SIGNAL_TYPE_TEXTBIN, "handoff", @@ -3627,7 +3686,7 @@ __mmplayer_gst_create_plain_text_elements(mmplayer_t *player) /* adding created elements to bin */ LOGD("adding created elements to bin"); - if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(textbin[MMPLAYER_T_BIN].gst), element_bucket)) { + if (!_mmplayer_gst_element_add_bucket_to_bin(GST_BIN(textbin[MMPLAYER_T_BIN].gst), element_bucket)) { LOGE("failed to add elements"); goto ERROR; } @@ -3638,7 +3697,7 @@ __mmplayer_gst_create_plain_text_elements(mmplayer_t *player) /* linking elements in the bucket by added order. */ LOGD("Linking elements in the bucket by added order."); - if (__mmplayer_gst_element_link_bucket(element_bucket) == -1) { + if (_mmplayer_gst_element_link_bucket(element_bucket) == -1) { LOGE("failed to link elements"); goto ERROR; } @@ -3805,7 +3864,7 @@ __mmplayer_gst_create_text_pipeline(mmplayer_t *player) return MM_ERROR_PLAYER_INVALID_URI; } - if (!util_get_storage_info(subtitle_uri, &player->storage_info[MMPLAYER_PATH_TEXT])) { + if (!_mmplayer_get_storage_info(subtitle_uri, &player->storage_info[MMPLAYER_PATH_TEXT])) { LOGE("failed to get storage info of subtitle path"); return MM_ERROR_PLAYER_INVALID_URI; } @@ -3842,7 +3901,7 @@ __mmplayer_gst_create_text_pipeline(mmplayer_t *player) goto ERROR; } - charset = util_get_charset(subtitle_uri); + charset = _mmplayer_get_charset(subtitle_uri); if (charset) { LOGD("detected charset is %s", charset); g_object_set(G_OBJECT(subparse), "subtitle-encoding", charset, NULL); @@ -4123,9 +4182,9 @@ __mmplayer_gst_create_pipeline(mmplayer_t *player) /* create the source and decoder elements */ if (MMPLAYER_IS_MS_BUFF_SRC(player)) - ret = __mmplayer_gst_build_es_pipeline(player); + ret = _mmplayer_gst_build_es_pipeline(player); else - ret = __mmplayer_gst_build_pipeline(player); + ret = _mmplayer_gst_build_pipeline(player); if (ret != MM_ERROR_NONE) { LOGE("failed to create some elements"); @@ -4138,7 +4197,7 @@ __mmplayer_gst_create_pipeline(mmplayer_t *player) LOGE("failed to create text pipeline"); /* add bus watch */ - ret = __mmplayer_gst_add_bus_watch(player); + ret = _mmplayer_gst_add_bus_watch(player); if (ret != MM_ERROR_NONE) { LOGE("failed to add bus watch"); goto INIT_ERROR; @@ -4190,8 +4249,8 @@ __mmplayer_gst_destroy_pipeline(mmplayer_t *player) __mmplayer_reset_gapless_state(player); if (player->streamer) { - __mm_player_streaming_initialize(player->streamer, FALSE); - __mm_player_streaming_destroy(player->streamer); + _mm_player_streaming_initialize(player->streamer, FALSE); + _mm_player_streaming_destroy(player->streamer); player->streamer = NULL; } @@ -4201,7 +4260,7 @@ __mmplayer_gst_destroy_pipeline(mmplayer_t *player) MMPLAYER_FREEIF(player->unlinked_demuxer_mime); /* cleanup running stuffs */ - __mmplayer_cancel_eos_timer(player); + _mmplayer_cancel_eos_timer(player); /* cleanup gst stuffs */ if (player->pipeline) { @@ -4220,7 +4279,7 @@ __mmplayer_gst_destroy_pipeline(mmplayer_t *player) gst_object_unref(bus); timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player); - ret = __mmplayer_gst_set_state(player, mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_NULL, FALSE, timeout); + ret = _mmplayer_gst_set_state(player, mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_NULL, FALSE, timeout); if (ret != MM_ERROR_NONE) { LOGE("fail to change state to NULL"); return MM_ERROR_PLAYER_INTERNAL; @@ -4265,7 +4324,7 @@ __mmplayer_gst_destroy_pipeline(mmplayer_t *player) gst_caps_unref(player->s_stream_caps); player->s_stream_caps = NULL; } - __mmplayer_track_destroy(player); + _mmplayer_track_destroy(player); if (player->sink_elements) g_list_free(player->sink_elements); @@ -4304,7 +4363,7 @@ __mmplayer_gst_realize(mmplayer_t *player) /* set pipeline state to READY */ /* NOTE : state change to READY must be performed sync. */ timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player); - ret = __mmplayer_gst_set_state(player, + ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_READY, FALSE, timeout); if (ret != MM_ERROR_NONE) { @@ -4377,7 +4436,7 @@ __mmplayer_gst_set_message_callback(mmplayer_t *player, MMMessageCallback callba } int -__mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data) +_mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data) { int ret = MM_ERROR_NONE; char *path = NULL; @@ -4499,7 +4558,7 @@ __resource_release_cb(mm_resource_manager_h rm, mm_resource_manager_res_h res, player->interrupted_by_resource = TRUE; /* get last play position */ - if (_mmplayer_get_position((MMHandleType)player, &pos) != MM_ERROR_NONE) { + if (_mmplayer_gst_get_position(player, &pos) != MM_ERROR_NONE) { LOGW("failed to get play position."); } else { msg.union_type = MM_MSG_UNION_TIME; @@ -4847,7 +4906,7 @@ __mmplayer_check_async_state_transition(mmplayer_t *player) gst_element_state_get_name(element_pending_state)); /* dump state of all element */ - __mmplayer_dump_pipeline_state(player); + _mmplayer_dump_pipeline_state(player); return; } @@ -4961,7 +5020,7 @@ _mmplayer_realize(MMHandleType hplayer) mm_attrs_get_data_by_name(attrs, "profile_user_param", ¶m); if (player->profile.uri_type == MM_PLAYER_URI_TYPE_NONE) { - ret = __mmplayer_parse_profile((const char *)uri, param, &player->profile); + ret = _mmplayer_parse_profile((const char *)uri, param, &player->profile); if (ret != MM_ERROR_NONE) { LOGE("failed to parse profile"); @@ -4999,14 +5058,14 @@ _mmplayer_realize(MMHandleType hplayer) player->subtitle_language_list = NULL; player->is_subtitle_force_drop = FALSE; - __mmplayer_track_initialize(player); + _mmplayer_track_initialize(player); __mmplayer_initialize_storage_info(player, MMPLAYER_PATH_MAX); if ((MMPLAYER_IS_STREAMING(player)) && (player->streamer == NULL)) { gint prebuffer_ms = 0, rebuffer_ms = 0; - player->streamer = __mm_player_streaming_create(); - __mm_player_streaming_initialize(player->streamer, TRUE); + player->streamer = _mm_player_streaming_create(); + _mm_player_streaming_initialize(player->streamer, TRUE); mm_attrs_get_int_by_name(player->attrs, MM_PLAYER_PREBUFFER_MS, &prebuffer_ms); mm_attrs_get_int_by_name(player->attrs, MM_PLAYER_REBUFFER_MS, &rebuffer_ms); @@ -5051,7 +5110,7 @@ _mmplayer_unrealize(MMHandleType hplayer) MMPLAYER_CMD_UNLOCK(player); /* destroy the gst bus msg thread which is created during realize. this funct have to be called before getting cmd lock. */ - __mmplayer_bus_msg_thread_destroy(player); + _mmplayer_bus_msg_thread_destroy(player); MMPLAYER_CMD_LOCK(player); /* check current state */ @@ -5342,7 +5401,7 @@ _mmplayer_start(MMHandleType hplayer) MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_START); /* start pipeline */ - ret = __mmplayer_gst_start(player); + ret = _mmplayer_gst_start(player); if (ret != MM_ERROR_NONE) LOGE("failed to start player."); @@ -5482,13 +5541,13 @@ _mmplayer_stop(MMHandleType hplayer) __mmplayer_reset_gapless_state(player); /* NOTE : application should not wait for EOS after calling STOP */ - __mmplayer_cancel_eos_timer(player); + _mmplayer_cancel_eos_timer(player); /* reset */ player->seek_state = MMPLAYER_SEEK_NONE; /* stop pipeline */ - ret = __mmplayer_gst_stop(player); + ret = _mmplayer_gst_stop(player); if (ret != MM_ERROR_NONE) LOGE("failed to stop player."); @@ -5549,7 +5608,7 @@ _mmplayer_pause(MMHandleType hplayer) This causes problem is position calculation during normal pause resume scenarios also. Currently during pause , we are sending the current position to rtspsrc module for position saving. */ if ((MMPLAYER_IS_RTSP_STREAMING(player)) && - (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { + (_mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { g_object_set(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "resume-position", player->last_position, NULL); } } @@ -5562,7 +5621,7 @@ _mmplayer_pause(MMHandleType hplayer) } /* pause pipeline */ - ret = __mmplayer_gst_pause(player, async); + ret = _mmplayer_gst_pause(player, async); if (ret != MM_ERROR_NONE) LOGE("failed to pause player. ret : 0x%x", ret); @@ -5594,7 +5653,7 @@ _mmplayer_abort_pause(MMHandleType hplayer) LOGD("set the pipeline state to READY"); /* set state to READY */ - ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, + ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_READY, FALSE, MMPLAYER_STATE_CHANGE_TIMEOUT(player)); if (ret != MM_ERROR_NONE) { LOGE("fail to change state to READY"); @@ -5630,7 +5689,7 @@ _mmplayer_resume(MMHandleType hplayer) /* check current state */ MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_RESUME); - ret = __mmplayer_gst_resume(player, async); + ret = _mmplayer_gst_resume(player, async); if (ret != MM_ERROR_NONE) LOGE("failed to resume player."); @@ -5694,7 +5753,7 @@ _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming) stop = pos_nsec; } - if (!__mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, + if (!_mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate, GST_FORMAT_TIME, (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE), @@ -5724,7 +5783,7 @@ _mmplayer_set_position(MMHandleType hplayer, gint64 position) /* check pipline building state */ __mmplayer_check_pipeline(player); - ret = __mmplayer_gst_set_position(player, position, FALSE); + ret = _mmplayer_gst_set_position(player, position, FALSE); MMPLAYER_FLEAVE(); @@ -5732,19 +5791,6 @@ _mmplayer_set_position(MMHandleType hplayer, gint64 position) } int -_mmplayer_get_position(MMHandleType hplayer, gint64 *position) -{ - mmplayer_t *player = (mmplayer_t *)hplayer; - int ret = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - ret = __mmplayer_gst_get_position(player, position); - - return ret; -} - -int _mmplayer_get_duration(MMHandleType hplayer, gint64 *duration) { mmplayer_t *player = (mmplayer_t *)hplayer; @@ -5768,7 +5814,7 @@ _mmplayer_get_buffer_position(MMHandleType hplayer, int *start_pos, int *end_pos MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - ret = __mmplayer_gst_get_buffer_position(player, start_pos, end_pos); + ret = _mmplayer_gst_get_buffer_position(player, start_pos, end_pos); return ret; } @@ -5882,7 +5928,7 @@ __mmplayer_update_content_type_info(mmplayer_t *player) } void -__mmplayer_typefind_have_type(GstElement *tf, guint probability, +_mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data) { mmplayer_t *player = (mmplayer_t *)data; @@ -5924,7 +5970,7 @@ __mmplayer_typefind_have_type(GstElement *tf, guint probability, return; } - if (!__mmplayer_gst_create_decoder(player, pad, caps)) { + if (!_mmplayer_gst_create_decoder(player, pad, caps)) { gboolean async = FALSE; LOGE("failed to autoplug %s", player->type); @@ -5943,7 +5989,7 @@ __mmplayer_typefind_have_type(GstElement *tf, guint probability, } GstElement * -__mmplayer_gst_make_decodebin(mmplayer_t *player) +_mmplayer_gst_make_decodebin(mmplayer_t *player) { GstElement *decodebin = NULL; @@ -5958,38 +6004,38 @@ __mmplayer_gst_make_decodebin(mmplayer_t *player) } /* raw pad handling signal */ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", - G_CALLBACK(__mmplayer_gst_decode_pad_added), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added", + G_CALLBACK(_mmplayer_gst_decode_pad_added), (gpointer)player); /* no-more-pad pad handling signal */ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads", + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads", G_CALLBACK(__mmplayer_gst_decode_no_more_pads), (gpointer)player); - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-removed", + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-removed", G_CALLBACK(__mmplayer_gst_decode_pad_removed), (gpointer)player); /* This signal is emitted when a pad for which there is no further possible decoding is added to the decodebin.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "unknown-type", + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "unknown-type", G_CALLBACK(__mmplayer_gst_decode_unknown_type), (gpointer)player); /* This signal is emitted whenever decodebin finds a new stream. It is emitted before looking for any elements that can handle that stream.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-continue", + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-continue", G_CALLBACK(__mmplayer_gst_decode_autoplug_continue), (gpointer)player); /* This signal is emitted whenever decodebin finds a new stream. It is emitted before looking for any elements that can handle that stream.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select", - G_CALLBACK(__mmplayer_gst_decode_autoplug_select), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select", + G_CALLBACK(_mmplayer_gst_decode_autoplug_select), (gpointer)player); /* This signal is emitted once decodebin has finished decoding all the data.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "drained", + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "drained", G_CALLBACK(__mmplayer_gst_decode_drained), (gpointer)player); /* This signal is emitted when a element is added to the bin.*/ - __mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added", - G_CALLBACK(__mmplayer_gst_element_added), (gpointer)player); + _mmplayer_add_signal_connection(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added", + G_CALLBACK(_mmplayer_gst_element_added), (gpointer)player); ERROR: return decodebin; @@ -6030,7 +6076,7 @@ __mmplayer_gst_make_queue2(mmplayer_t *player) dur_bytes = 0; } - __mm_player_streaming_set_queue2(player->streamer, + _mm_player_streaming_set_queue2(player->streamer, queue2, FALSE, type, @@ -6040,7 +6086,7 @@ __mmplayer_gst_make_queue2(mmplayer_t *player) } gboolean -__mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps) +_mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps *caps) { mmplayer_gst_element_t *mainbin = NULL; GstElement *decodebin = NULL; @@ -6094,7 +6140,7 @@ __mmplayer_gst_create_decoder(mmplayer_t *player, GstPad *srcpad, const GstCaps } /* create decodebin */ - decodebin = __mmplayer_gst_make_decodebin(player); + decodebin = _mmplayer_gst_make_decodebin(player); if (!decodebin) { LOGE("failed to make decodebin"); goto ERROR; @@ -6263,7 +6309,7 @@ __mmplayer_pipeline_complete(GstElement *decodebin, gpointer data) MMPLAYER_RETURN_IF_FAIL(player); /* remove fakesink. */ - if (!__mmplayer_gst_remove_fakesink(player, + if (!_mmplayer_gst_remove_fakesink(player, &player->pipeline->mainbin[MMPLAYER_M_SRC_FAKESINK])) { /* NOTE : __mmplayer_pipeline_complete() can be called several time. because * signaling mechanism(pad-added, no-more-pad, new-decoded-pad) from various @@ -6326,7 +6372,7 @@ __mmplayer_get_next_uri(mmplayer_t *player) continue; } - if (__mmplayer_parse_profile((const char *)uri, NULL, &profile) != MM_ERROR_NONE) { + if (_mmplayer_parse_profile((const char *)uri, NULL, &profile) != MM_ERROR_NONE) { LOGE("failed to parse profile"); continue; } @@ -6442,197 +6488,6 @@ ERROR: return FALSE; } -static void -__mmplayer_initialize_gapless_play(mmplayer_t *player) -{ - int i; - - MMPLAYER_FENTER(); - - player->smooth_streaming = FALSE; - player->videodec_linked = 0; - player->audiodec_linked = 0; - player->textsink_linked = 0; - player->is_external_subtitle_present = FALSE; - player->is_external_subtitle_added_now = FALSE; - player->not_supported_codec = MISSING_PLUGIN_NONE; - player->can_support_codec = FOUND_PLUGIN_NONE; - player->pending_seek.is_pending = false; - player->pending_seek.pos = 0; - player->msg_posted = FALSE; - player->has_many_types = FALSE; - player->no_more_pad = FALSE; - player->not_found_demuxer = 0; - player->seek_state = MMPLAYER_SEEK_NONE; - player->is_subtitle_force_drop = FALSE; - player->play_subtitle = FALSE; - player->adjust_subtitle_pos = 0; - - player->total_bitrate = 0; - player->total_maximum_bitrate = 0; - - __mmplayer_track_initialize(player); - __mmplayer_initialize_storage_info(player, MMPLAYER_PATH_MAX); - - for (i = 0; i < MM_PLAYER_STREAM_COUNT_MAX; i++) { - player->bitrate[i] = 0; - player->maximum_bitrate[i] = 0; - } - - if (player->v_stream_caps) { - gst_caps_unref(player->v_stream_caps); - player->v_stream_caps = NULL; - } - - mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0); - - /* clean found audio decoders */ - if (player->audio_decoders) { - GList *a_dec = player->audio_decoders; - for (; a_dec; a_dec = g_list_next(a_dec)) { - gchar *name = a_dec->data; - MMPLAYER_FREEIF(name); - } - g_list_free(player->audio_decoders); - player->audio_decoders = NULL; - } - - MMPLAYER_FLEAVE(); -} - -static void -__mmplayer_activate_next_source(mmplayer_t *player, GstState target) -{ - mmplayer_gst_element_t *mainbin = NULL; - MMMessageParamType msg_param = {0,}; - GstElement *element = NULL; - MMHandleType attrs = 0; - char *uri = NULL; - main_element_id_e elem_idx = MMPLAYER_M_NUM; - - MMPLAYER_FENTER(); - - if (!player || !player->pipeline || !player->pipeline->mainbin) { - LOGE("player is not initialized"); - goto ERROR; - } - - mainbin = player->pipeline->mainbin; - msg_param.code = MM_ERROR_PLAYER_INTERNAL; - - attrs = MMPLAYER_GET_ATTRS(player); - if (!attrs) { - LOGE("fail to get attributes"); - goto ERROR; - } - - /* Initialize Player values */ - __mmplayer_initialize_gapless_play(player); - - mm_attrs_get_string_by_name(attrs, "profile_uri", &uri); - - if (__mmplayer_parse_profile((const char *)uri, NULL, &player->profile) != MM_ERROR_NONE) { - LOGE("failed to parse profile"); - msg_param.code = MM_ERROR_PLAYER_INVALID_URI; - goto ERROR; - } - - if ((MMPLAYER_URL_HAS_DASH_SUFFIX(player)) || - (MMPLAYER_URL_HAS_HLS_SUFFIX(player))) { - LOGE("dash or hls is not supportable"); - msg_param.code = MM_ERROR_PLAYER_INVALID_URI; - goto ERROR; - } - - element = __mmplayer_gst_create_source(player); - if (!element) { - LOGE("no source element was created"); - goto ERROR; - } - - if (gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element) == FALSE) { - LOGE("failed to add source element to pipeline"); - gst_object_unref(GST_OBJECT(element)); - element = NULL; - goto ERROR; - } - - /* take source element */ - mainbin[MMPLAYER_M_SRC].id = MMPLAYER_M_SRC; - mainbin[MMPLAYER_M_SRC].gst = element; - - element = NULL; - - if (MMPLAYER_IS_HTTP_STREAMING(player)) { - if (player->streamer == NULL) { - player->streamer = __mm_player_streaming_create(); - __mm_player_streaming_initialize(player->streamer, TRUE); - } - - elem_idx = MMPLAYER_M_TYPEFIND; - element = gst_element_factory_make("typefind", "typefinder"); - __mmplayer_add_signal_connection(player, G_OBJECT(element), - MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type", G_CALLBACK(__mmplayer_typefind_have_type), (gpointer)player); - } else { - elem_idx = MMPLAYER_M_AUTOPLUG; - element = __mmplayer_gst_make_decodebin(player); - } - - /* check autoplug element is OK */ - if (!element) { - LOGE("can not create element(%d)", elem_idx); - goto ERROR; - } - - if (gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element) == FALSE) { - LOGE("failed to add sinkbin to pipeline"); - gst_object_unref(GST_OBJECT(element)); - element = NULL; - goto ERROR; - } - - mainbin[elem_idx].id = elem_idx; - mainbin[elem_idx].gst = element; - - if (gst_element_link(mainbin[MMPLAYER_M_SRC].gst, mainbin[elem_idx].gst) == FALSE) { - LOGE("Failed to link src - autoplug(or typefind)"); - goto ERROR; - } - - if (gst_element_set_state(mainbin[MMPLAYER_M_SRC].gst, target) == GST_STATE_CHANGE_FAILURE) { - LOGE("Failed to change state of src element"); - goto ERROR; - } - - if (!MMPLAYER_IS_HTTP_STREAMING(player)) { - if (gst_element_set_state(mainbin[MMPLAYER_M_AUTOPLUG].gst, target) == GST_STATE_CHANGE_FAILURE) { - LOGE("Failed to change state of decodebin"); - goto ERROR; - } - } else { - if (gst_element_set_state(mainbin[MMPLAYER_M_TYPEFIND].gst, target) == GST_STATE_CHANGE_FAILURE) { - LOGE("Failed to change state of src element"); - goto ERROR; - } - } - - player->gapless.stream_changed = TRUE; - player->gapless.running = TRUE; - MMPLAYER_FLEAVE(); - return; - -ERROR: - if (player) { - MMPLAYER_PLAYBACK_UNLOCK(player); - - if (!player->msg_posted) { - MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param); - player->msg_posted = TRUE; - } - } - return; -} - static gboolean __mmplayer_deactivate_selector(mmplayer_t *player, mmplayer_track_type_e type) { @@ -6736,12 +6591,12 @@ __mmplayer_deactivate_old_path(mmplayer_t *player) goto ERROR; } - __mmplayer_track_destroy(player); + _mmplayer_track_destroy(player); __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG); if (player->streamer) { - __mm_player_streaming_initialize(player->streamer, FALSE); - __mm_player_streaming_destroy(player->streamer); + _mm_player_streaming_initialize(player->streamer, FALSE); + _mm_player_streaming_destroy(player->streamer); player->streamer = NULL; } @@ -7260,7 +7115,7 @@ DONE: } gint -__mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, +_mmplayer_gst_decode_autoplug_select(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data) { GstAutoplugSelectResult result = GST_AUTOPLUG_SELECT_TRY; @@ -7488,7 +7343,7 @@ __mmplayer_gst_decode_drained(GstElement *bin, gpointer data) } void -__mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data) +_mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data) { mmplayer_t *player = (mmplayer_t *)data; const gchar *klass = NULL; @@ -7560,8 +7415,8 @@ __mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data (MMPLAYER_IS_HTTP_LIVE_STREAMING(player)) || (MMPLAYER_IS_DASH_STREAMING(player))) { /* in case of multiqueue, max bytes size is defined with fixed value in mm_player_streaming.h*/ - __mm_player_streaming_set_multiqueue(player->streamer, element); - __mm_player_streaming_sync_property(player->streamer, player->pipeline->mainbin[MMPLAYER_M_AUTOPLUG].gst); + _mm_player_streaming_set_multiqueue(player->streamer, element); + _mm_player_streaming_sync_property(player->streamer, player->pipeline->mainbin[MMPLAYER_M_AUTOPLUG].gst); } } @@ -7721,7 +7576,7 @@ __mmplayer_release_misc_post(mmplayer_t *player) } /* clear the audio stream buffer list */ - __mmplayer_audio_stream_clear_buffer(player, FALSE); + _mmplayer_audio_stream_clear_buffer(player, FALSE); /* clear the video stream bo list */ __mmplayer_video_stream_destroy_bo_list(player); @@ -7766,7 +7621,7 @@ __mmplayer_check_subtitle(mmplayer_t *player) } void -__mmplayer_cancel_eos_timer(mmplayer_t *player) +_mmplayer_cancel_eos_timer(mmplayer_t *player) { MMPLAYER_RETURN_IF_FAIL(player); @@ -7806,7 +7661,7 @@ __mmplayer_del_sink(mmplayer_t *player, GstElement *sink) } void -__mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, +_mmplayer_add_signal_connection(mmplayer_t *player, GObject *object, mmplayer_signal_type_e type, const gchar *signal, GCallback cb_funct, gpointer u_data) { mmplayer_signal_item_t *item = NULL; @@ -8041,7 +7896,7 @@ _mmplayer_sync_subtitle_pipeline(mmplayer_t *player) LOGD("seek time = %"G_GINT64_FORMAT", rate = %f", time, player->playback_rate); event = gst_event_new_seek(player->playback_rate, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH), GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1); if (event) { - __mmplayer_gst_send_event_to_sink(player, event); + _mmplayer_gst_send_event_to_sink(player, event); } else { result = MM_ERROR_PLAYER_INTERNAL; LOGE("gst_event_new_seek failed"); /* pipeline will got error and can not be recovered */ @@ -8121,7 +7976,7 @@ __mmplayer_change_external_subtitle_language(mmplayer_t *player, const char *fil goto EXIT; } - if (!util_get_storage_info(filepath, &player->storage_info[MMPLAYER_PATH_TEXT])) { + if (!_mmplayer_get_storage_info(filepath, &player->storage_info[MMPLAYER_PATH_TEXT])) { LOGE("failed to get storage info of subtitle path"); result = MM_ERROR_PLAYER_INVALID_URI; goto EXIT; @@ -8171,7 +8026,7 @@ __mmplayer_change_external_subtitle_language(mmplayer_t *player, const char *fil g_object_set(G_OBJECT(mainbin[MMPLAYER_M_SUBSRC].gst), "location", filepath, NULL); - charset = util_get_charset(filepath); + charset = _mmplayer_get_charset(filepath); if (charset) { LOGD("detected charset is %s", charset); g_object_set(G_OBJECT(mainbin[MMPLAYER_M_SUBPARSE].gst), "subtitle-encoding", charset, NULL); @@ -8201,9 +8056,9 @@ _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char *filepath) if (filepath) { /* check file path */ if ((path = strstr(filepath, "file://"))) - result = util_exist_file_path(path + 7); + result = _mmplayer_exist_file_path(path + 7); else - result = util_exist_file_path(filepath); + result = _mmplayer_exist_file_path(filepath); if (result != MM_ERROR_NONE) { LOGE("invalid subtitle path 0x%X", result); @@ -8397,7 +8252,7 @@ _mmplayer_change_track_language(MMHandleType hplayer, mmplayer_track_type_e type (GstSeekFlags)(GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SKIP), GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1); if (event) { - __mmplayer_gst_send_event_to_sink(player, event); + _mmplayer_gst_send_event_to_sink(player, event); } else { result = MM_ERROR_PLAYER_INTERNAL; goto EXIT; @@ -8975,7 +8830,7 @@ __mmplayer_update_duration_value(mmplayer_t *player) } /* update streaming service type */ - player->streaming_type = __mmplayer_get_stream_service_type(player); + player->streaming_type = _mmplayer_get_stream_service_type(player); /* check duration is OK */ if (dur_nsec == 0 && !MMPLAYER_IS_LIVE_STREAMING(player)) @@ -9245,12 +9100,12 @@ __mmplayer_set_file_uri(mmplayer_parse_profile_t *data, const char *uri) path = (location != NULL) ? (location) : ((char *)uri); - ret = util_exist_file_path(path); + ret = _mmplayer_exist_file_path(path); /* if no protocol prefix exist. check file existence and then give file:// as it's prefix */ if (ret == MM_ERROR_NONE) { g_snprintf(data->uri, MM_MAX_URL_LEN, "file://%s", path); - if (util_is_sdp_file(path)) { + if (_mmplayer_is_sdp_file(path)) { LOGD("uri is actually a file but it's sdp file. giving it to rtspsrc"); data->uri_type = MM_PLAYER_URI_TYPE_URL_RTSP; } else { @@ -9294,7 +9149,7 @@ __mmplayer_create_stream_from_pad(GstPad *pad) if (string_format) fourcc = _mmplayer_convert_fourcc_string_to_value(string_format); - format = util_get_pixtype(fourcc); + format = _mmplayer_get_pixtype(fourcc); gst_video_info_from_caps(&info, caps); gst_caps_unref(caps); @@ -9475,7 +9330,7 @@ __mmplayer_set_pause_state(mmplayer_t *player) return; /* it's first time to update all content attrs. */ - __mmplayer_update_content_attrs(player, ATTR_ALL); + _mmplayer_update_content_attrs(player, ATTR_ALL); } static void @@ -9498,7 +9353,7 @@ __mmplayer_set_playing_state(mmplayer_t *player) * c-api since c-api doesn't use _start() anymore. It may not work propery with * legacy mmfw-player api */ - __mmplayer_update_content_attrs(player, ATTR_MISSING_ONLY); + _mmplayer_update_content_attrs(player, ATTR_MISSING_ONLY); if ((player->cmd == MMPLAYER_COMMAND_START) || (player->cmd == MMPLAYER_COMMAND_RESUME)) { diff --git a/src/mm_player_streaming.c b/src/mm_player_streaming.c index 4e567db..6f5cd28 100644 --- a/src/mm_player_streaming.c +++ b/src/mm_player_streaming.c @@ -45,33 +45,14 @@ typedef struct { gdouble high_watermark; } streaming_buffer_info_t; -static void streaming_set_buffer_watermark(mmplayer_streaming_t *streamer, buffer_type_e type, gdouble low_watermark, gdouble high_watermark); -static void streaming_set_queue2_queue_type(mmplayer_streaming_t *streamer, muxed_buffer_type_e type); -static void streaming_set_buffer_size(mmplayer_streaming_t *streamer, buffer_type_e type, guint buffering_bytes, gint buffering_time); -static void streaming_update_buffering_status(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, gint64 position); -static void streaming_get_current_bitrate_info(mmplayer_streaming_t *streamer, - GstMessage *buffering_msg, - streaming_content_info_t content_info, - streaming_bitrate_info_t *bitrate_info); static void -streaming_handle_fixed_buffering_mode(mmplayer_streaming_t *streamer, - gint byte_out_rate, - gint fixed_buffering_time, - streaming_buffer_info_t *buffer_info); -static void -streaming_handle_adaptive_buffering_mode(mmplayer_streaming_t *streamer, - streaming_content_info_t content_info, - streaming_bitrate_info_t bitrate_info, - streaming_buffer_info_t *buffer_info, - gint expected_play_time); -static void -streaming_update_buffer_setting(mmplayer_streaming_t *streamer, +__streaming_update_buffer_setting(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, guint64 content_size, gint64 position, gint64 duration); -mmplayer_streaming_t *__mm_player_streaming_create(void) +mmplayer_streaming_t *_mm_player_streaming_create(void) { mmplayer_streaming_t *streamer = NULL; @@ -88,7 +69,7 @@ mmplayer_streaming_t *__mm_player_streaming_create(void) return streamer; } -static void streaming_buffer_initialize(streaming_buffer_t *buffer_handle, gboolean buffer_init) +static void __streaming_buffer_initialize(streaming_buffer_t *buffer_handle, gboolean buffer_init) { if (buffer_init) buffer_handle->buffer = NULL; @@ -100,15 +81,15 @@ static void streaming_buffer_initialize(streaming_buffer_t *buffer_handle, gbool buffer_handle->is_live = FALSE; } -void __mm_player_streaming_initialize(mmplayer_streaming_t *streamer, gboolean buffer_init) +void _mm_player_streaming_initialize(mmplayer_streaming_t *streamer, gboolean buffer_init) { MMPLAYER_FENTER(); MMPLAYER_RETURN_IF_FAIL(streamer); streamer->streaming_buffer_type = BUFFER_TYPE_DEFAULT; - streaming_buffer_initialize(&(streamer->buffer_handle[BUFFER_TYPE_MUXED]), buffer_init); - streaming_buffer_initialize(&(streamer->buffer_handle[BUFFER_TYPE_DEMUXED]), buffer_init); + __streaming_buffer_initialize(&(streamer->buffer_handle[BUFFER_TYPE_MUXED]), buffer_init); + __streaming_buffer_initialize(&(streamer->buffer_handle[BUFFER_TYPE_DEMUXED]), buffer_init); streamer->buffering_req.mode = MM_PLAYER_BUFFERING_MODE_ADAPTIVE; streamer->buffering_req.is_pre_buffering = TRUE; @@ -133,7 +114,7 @@ void __mm_player_streaming_initialize(mmplayer_streaming_t *streamer, gboolean b return; } -void __mm_player_streaming_destroy(mmplayer_streaming_t *streamer) +void _mm_player_streaming_destroy(mmplayer_streaming_t *streamer) { MMPLAYER_FENTER(); @@ -144,7 +125,7 @@ void __mm_player_streaming_destroy(mmplayer_streaming_t *streamer) return; } -void __mm_player_streaming_set_content_bitrate( +void _mm_player_streaming_set_content_bitrate( mmplayer_streaming_t *streamer, guint max_bitrate, guint avg_bitrate) { gboolean is_update = FALSE; @@ -166,7 +147,7 @@ void __mm_player_streaming_set_content_bitrate( if (streamer->buffering_req.is_pre_buffering) { /* have to recalc queue2 size value after getting bitrate information */ if (IS_MUXED_BUFFERING_MODE(streamer)) - streaming_update_buffer_setting(streamer, NULL, 0, 0, 0); + __streaming_update_buffer_setting(streamer, NULL, 0, 0, 0); } else { streamer->need_update = TRUE; } @@ -176,7 +157,7 @@ void __mm_player_streaming_set_content_bitrate( return; } -static void streaming_calc_watermark(mmplayer_streaming_t *streamer, +static void __streaming_calc_watermark(mmplayer_streaming_t *streamer, guint expected_play_bytes, gint expected_play_time, gdouble *low_wm, gdouble *high_wm) { #define PORTION_OF_HIGH_WM 1.1 /* need to compensate about low level */ @@ -244,7 +225,7 @@ static void streaming_calc_watermark(mmplayer_streaming_t *streamer, LOGD("new watermark value [%f ~ %f]", *low_wm, *high_wm); } -static void streaming_set_buffer_watermark(mmplayer_streaming_t *streamer, +static void __streaming_set_buffer_watermark(mmplayer_streaming_t *streamer, buffer_type_e type, gdouble low_watermark, gdouble high_watermark) { streaming_buffer_t *buffer_handle = NULL; @@ -289,7 +270,7 @@ static void streaming_set_buffer_watermark(mmplayer_streaming_t *streamer, return; } -static void streaming_set_queue2_queue_type(mmplayer_streaming_t *streamer, muxed_buffer_type_e type) +static void __streaming_set_queue2_queue_type(mmplayer_streaming_t *streamer, muxed_buffer_type_e type) { streaming_buffer_t *buffer_handle = NULL; guint64 buffer_size = 0; /* bytes */ @@ -323,7 +304,7 @@ static void streaming_set_queue2_queue_type(mmplayer_streaming_t *streamer, muxe return; } -static void streaming_set_buffer_size(mmplayer_streaming_t *streamer, +static void __streaming_set_buffer_size(mmplayer_streaming_t *streamer, buffer_type_e type, guint buffering_bytes, gint buffering_time) { streaming_buffer_t *buffer_handle = NULL; @@ -376,7 +357,7 @@ static void streaming_set_buffer_size(mmplayer_streaming_t *streamer, return; } -void __mm_player_streaming_set_queue2(mmplayer_streaming_t *streamer, GstElement *buffer, +void _mm_player_streaming_set_queue2(mmplayer_streaming_t *streamer, GstElement *buffer, gboolean use_buffering, muxed_buffer_type_e type, guint64 content_size) { guint queue_size_bytes = 0; @@ -412,21 +393,21 @@ void __mm_player_streaming_set_queue2(mmplayer_streaming_t *streamer, GstElement /* set the simple queue size */ queue_size_bytes = DEFAULT_BUFFER_SIZE_BYTES; - streaming_set_queue2_queue_type(streamer, type); + __streaming_set_queue2_queue_type(streamer, type); queue_size_time = 0; /* set in case of use-buffering */ } g_object_set(G_OBJECT(streamer->buffer_handle[BUFFER_TYPE_MUXED].buffer), "use-buffering", use_buffering, NULL); LOGD("buffer time: %d ms, buffer bytes: %d", queue_size_time, queue_size_bytes); - streaming_set_buffer_size(streamer, BUFFER_TYPE_MUXED, queue_size_bytes, queue_size_time); - streaming_set_buffer_watermark(streamer, BUFFER_TYPE_MUXED, DEFAULT_BUFFER_LOW_WATERMARK, DEFAULT_BUFFER_HIGH_WATERMARK); + __streaming_set_buffer_size(streamer, BUFFER_TYPE_MUXED, queue_size_bytes, queue_size_time); + __streaming_set_buffer_watermark(streamer, BUFFER_TYPE_MUXED, DEFAULT_BUFFER_LOW_WATERMARK, DEFAULT_BUFFER_HIGH_WATERMARK); MMPLAYER_FLEAVE(); return; } -void __mm_player_streaming_sync_property(mmplayer_streaming_t *streamer, GstElement *decodebin) +void _mm_player_streaming_sync_property(mmplayer_streaming_t *streamer, GstElement *decodebin) { streaming_buffer_t *buffer_handle = NULL; @@ -450,7 +431,7 @@ void __mm_player_streaming_sync_property(mmplayer_streaming_t *streamer, GstElem streamer->need_sync = FALSE; } -void __mm_player_streaming_set_multiqueue(mmplayer_streaming_t *streamer, GstElement *buffer) +void _mm_player_streaming_set_multiqueue(mmplayer_streaming_t *streamer, GstElement *buffer) { streaming_buffer_t *buffer_handle = NULL; gdouble high_wm = 0.0, low_wm = 0.0; @@ -470,10 +451,10 @@ void __mm_player_streaming_set_multiqueue(mmplayer_streaming_t *streamer, GstEle streamer->buffering_req.prebuffer_time = DEFAULT_PREBUFFERING_TIME; /* initial setting */ - streaming_set_buffer_size(streamer, BUFFER_TYPE_DEMUXED, MAX_BUFFER_SIZE_BYTES, MAX_BUFFER_SIZE_TIME); + __streaming_set_buffer_size(streamer, BUFFER_TYPE_DEMUXED, MAX_BUFFER_SIZE_BYTES, MAX_BUFFER_SIZE_TIME); - streaming_calc_watermark(streamer, 0, streamer->buffering_req.prebuffer_time, &low_wm, &high_wm); - streaming_set_buffer_watermark(streamer, BUFFER_TYPE_DEMUXED, low_wm, high_wm); + __streaming_calc_watermark(streamer, 0, streamer->buffering_req.prebuffer_time, &low_wm, &high_wm); + __streaming_set_buffer_watermark(streamer, BUFFER_TYPE_DEMUXED, low_wm, high_wm); streamer->need_sync = TRUE; @@ -481,7 +462,7 @@ void __mm_player_streaming_set_multiqueue(mmplayer_streaming_t *streamer, GstEle return; } -static void streaming_get_current_bitrate_info(mmplayer_streaming_t *streamer, +static void __streaming_get_current_bitrate_info(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, streaming_content_info_t content_info, streaming_bitrate_info_t *bitrate_info) { GstQuery *query = NULL; @@ -545,7 +526,7 @@ static void streaming_get_current_bitrate_info(mmplayer_streaming_t *streamer, (*bitrate_info).time_rate = buffer_buffering_time; } -static void streaming_handle_fixed_buffering_mode(mmplayer_streaming_t *streamer, +static void __streaming_handle_fixed_buffering_mode(mmplayer_streaming_t *streamer, gint byte_out_rate, gint expected_play_time, streaming_buffer_info_t *buffer_info) { streaming_buffer_t *buffer_handle = NULL; @@ -568,7 +549,7 @@ static void streaming_handle_fixed_buffering_mode(mmplayer_streaming_t *streamer expected_play_bytes = GET_CURRENT_BUFFERING_BYTE(buffer_handle); } - streaming_calc_watermark(streamer, expected_play_bytes, expected_play_time, &low_wm, &high_wm); + __streaming_calc_watermark(streamer, expected_play_bytes, expected_play_time, &low_wm, &high_wm); (*buffer_info).buffering_bytes = expected_play_bytes; (*buffer_info).buffering_time = expected_play_time; @@ -576,7 +557,7 @@ static void streaming_handle_fixed_buffering_mode(mmplayer_streaming_t *streamer (*buffer_info).low_watermark = low_wm; } -static void streaming_handle_adaptive_buffering_mode(mmplayer_streaming_t *streamer, +static void __streaming_handle_adaptive_buffering_mode(mmplayer_streaming_t *streamer, streaming_content_info_t content_info, streaming_bitrate_info_t bitrate_info, streaming_buffer_info_t *buffer_info, gint expected_play_time) { @@ -647,7 +628,7 @@ static void streaming_handle_adaptive_buffering_mode(mmplayer_streaming_t *strea buffering_bytes = MAX(buffering_bytes, adj_buffering_bytes); } - streaming_calc_watermark(streamer, buffering_bytes, buffer_buffering_time, &low_wm, &high_wm); + __streaming_calc_watermark(streamer, buffering_bytes, buffer_buffering_time, &low_wm, &high_wm); (*buffer_info).buffering_bytes = buffering_bytes; (*buffer_info).buffering_time = buffer_buffering_time; @@ -655,7 +636,7 @@ static void streaming_handle_adaptive_buffering_mode(mmplayer_streaming_t *strea (*buffer_info).low_watermark = low_wm; } -static void streaming_update_buffer_setting(mmplayer_streaming_t *streamer, +static void __streaming_update_buffer_setting(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, guint64 content_size, gint64 position, gint64 duration) { streaming_buffer_t *buffer_handle = NULL; @@ -694,14 +675,14 @@ static void streaming_update_buffer_setting(mmplayer_streaming_t *streamer, content_info.duration = duration; content_info.content_size = content_size; - streaming_get_current_bitrate_info(streamer, buffering_msg, content_info, &bitrate_info); + __streaming_get_current_bitrate_info(streamer, buffering_msg, content_info, &bitrate_info); LOGD("in_r:%d, out_r:%d", bitrate_info.byte_in_rate, bitrate_info.byte_out_rate); if (buffering_mode == MM_PLAYER_BUFFERING_MODE_FIXED) { - streaming_handle_fixed_buffering_mode(streamer, bitrate_info.byte_out_rate, expected_play_time, &buffer_info); + __streaming_handle_fixed_buffering_mode(streamer, bitrate_info.byte_out_rate, expected_play_time, &buffer_info); } else { - streaming_handle_adaptive_buffering_mode(streamer, content_info, bitrate_info, &buffer_info, expected_play_time); + __streaming_handle_adaptive_buffering_mode(streamer, content_info, bitrate_info, &buffer_info, expected_play_time); /* even if new byte size is smaller than the previous one, time need to be updated. */ if (IS_MUXED_BUFFERING_MODE(streamer)) @@ -722,10 +703,10 @@ static void streaming_update_buffer_setting(mmplayer_streaming_t *streamer, if (buffer_info.buffering_time > buffering_time_limit) buffer_info.buffering_time = buffering_time_limit; } - streaming_set_buffer_size(streamer, streamer->streaming_buffer_type, buffer_info.buffering_bytes, buffer_info.buffering_time); + __streaming_set_buffer_size(streamer, streamer->streaming_buffer_type, buffer_info.buffering_bytes, buffer_info.buffering_time); } - streaming_set_buffer_watermark(streamer, streamer->streaming_buffer_type, buffer_info.low_watermark, buffer_info.high_watermark); + __streaming_set_buffer_watermark(streamer, streamer->streaming_buffer_type, buffer_info.low_watermark, buffer_info.high_watermark); LOGD("buffer setting: size %d, time %d, watermark %f", GET_CURRENT_BUFFERING_BYTE(buffer_handle), GET_CURRENT_BUFFERING_TIME(buffer_handle), buffer_handle->buffer_high_watermark); @@ -733,7 +714,7 @@ static void streaming_update_buffer_setting(mmplayer_streaming_t *streamer, streamer->need_sync = TRUE; } -static void streaming_adjust_min_threshold(mmplayer_streaming_t *streamer, gint64 position) +static void __streaming_adjust_min_threshold(mmplayer_streaming_t *streamer, gint64 position) { #define DEFAULT_TIME_PAD 1000 /* ms */ gint playing_time = 0; @@ -767,7 +748,7 @@ static void streaming_adjust_min_threshold(mmplayer_streaming_t *streamer, gint6 streamer->default_val.prev_pos = position; } -static void streaming_update_buffering_status(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, gint64 position) +static void __streaming_update_buffering_status(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, gint64 position) { gint buffer_percent = 0; @@ -785,7 +766,7 @@ static void streaming_update_buffering_status(mmplayer_streaming_t *streamer, Gs if (!streamer->buffering_req.is_pre_buffering) { streamer->need_update = TRUE; - streaming_adjust_min_threshold(streamer, position); + __streaming_adjust_min_threshold(streamer, position); } } @@ -812,7 +793,7 @@ static void streaming_update_buffering_status(mmplayer_streaming_t *streamer, Gs } } -void __mm_player_streaming_buffering(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, +void _mm_player_streaming_buffering(mmplayer_streaming_t *streamer, GstMessage *buffering_msg, guint64 content_size, gint64 position, gint64 duration) { MMPLAYER_FENTER(); @@ -822,14 +803,14 @@ void __mm_player_streaming_buffering(mmplayer_streaming_t *streamer, GstMessage if (position > (gint64)(streamer->buffering_req.prebuffer_time * GST_MSECOND)) streamer->buffering_req.is_pre_buffering = FALSE; - streaming_update_buffering_status(streamer, buffering_msg, position); + __streaming_update_buffering_status(streamer, buffering_msg, position); if (!streamer->need_update) return; } streamer->need_update = FALSE; - streaming_update_buffer_setting(streamer, buffering_msg, content_size, position, duration); + __streaming_update_buffer_setting(streamer, buffering_msg, content_size, position, duration); return; } diff --git a/src/mm_player_tracks.c b/src/mm_player_tracks.c index 7240b65..317d2f5 100644 --- a/src/mm_player_tracks.c +++ b/src/mm_player_tracks.c @@ -268,7 +268,7 @@ EXIT: } void -__mmplayer_track_initialize(mmplayer_t *player) +_mmplayer_track_initialize(mmplayer_t *player) { mmplayer_track_type_e type = MM_PLAYER_TRACK_TYPE_AUDIO; @@ -284,7 +284,7 @@ __mmplayer_track_initialize(mmplayer_t *player) } void -__mmplayer_track_destroy(mmplayer_t *player) +_mmplayer_track_destroy(mmplayer_t *player) { mmplayer_track_type_e type = MM_PLAYER_TRACK_TYPE_AUDIO; MMHandleType attrs = 0; @@ -310,7 +310,7 @@ __mmplayer_track_destroy(mmplayer_t *player) } void -__mmplayer_track_update_selector_info(mmplayer_t *player, mmplayer_track_type_e type, GstPad *sinkpad) +_mmplayer_track_update_selector_info(mmplayer_t *player, mmplayer_track_type_e type, GstPad *sinkpad) { MMPLAYER_FENTER(); @@ -321,7 +321,7 @@ __mmplayer_track_update_selector_info(mmplayer_t *player, mmplayer_track_type_e } void -__mmplayer_track_update_text_attr_info(mmplayer_t *player, GstMessage *msg) +_mmplayer_track_update_text_attr_info(mmplayer_t *player, GstMessage *msg) { MMHandleType attrs = 0; const GValue *lang_list = NULL; diff --git a/src/mm_player_utils.c b/src/mm_player_utils.c index 282b2b4..a88ca2d 100644 --- a/src/mm_player_utils.c +++ b/src/mm_player_utils.c @@ -38,7 +38,7 @@ #define MEDIA_PATH_EXTERNAL tzplatform_getenv(TZ_SYS_STORAGE) /* external storage, sd card, usb */ const gchar * -__get_stream_type_name(int type) +_mmplayer_get_stream_type_name(int type) { switch (type) { case MM_PLAYER_STREAM_TYPE_AUDIO: @@ -55,7 +55,7 @@ __get_stream_type_name(int type) } const gchar * -__get_state_name(int state) +_mmplayer_get_state_name(int state) { switch (state) { case MM_PLAYER_STATE_NULL: @@ -74,7 +74,7 @@ __get_state_name(int state) } gboolean -__is_rtsp_streaming(mmplayer_t *player) +_mmplayer_is_rtsp_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -82,7 +82,7 @@ __is_rtsp_streaming(mmplayer_t *player) } gboolean -__is_http_streaming(mmplayer_t *player) +_mmplayer_is_http_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -90,24 +90,25 @@ __is_http_streaming(mmplayer_t *player) } gboolean -__is_streaming(mmplayer_t *player) +_mmplayer_is_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); - return (__is_rtsp_streaming(player) || __is_http_streaming(player) - || __is_http_live_streaming(player) || __is_dash_streaming(player) || __is_smooth_streaming(player)) ? TRUE : FALSE; + return (_mmplayer_is_rtsp_streaming(player) || _mmplayer_is_http_streaming(player) + || _mmplayer_is_http_live_streaming(player) || _mmplayer_is_dash_streaming(player) + || _mmplayer_is_smooth_streaming(player)) ? TRUE : FALSE; } gboolean -__is_live_streaming(mmplayer_t *player) +_mmplayer_is_live_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); - return (__is_rtsp_streaming(player) && player->streaming_type == STREAMING_SERVICE_LIVE) ? TRUE : FALSE; + return (_mmplayer_is_rtsp_streaming(player) && player->streaming_type == STREAMING_SERVICE_LIVE) ? TRUE : FALSE; } gboolean -__is_http_live_streaming(mmplayer_t *player) +_mmplayer_is_http_live_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -115,7 +116,7 @@ __is_http_live_streaming(mmplayer_t *player) } gboolean -__is_dash_streaming(mmplayer_t *player) +_mmplayer_is_dash_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -123,7 +124,7 @@ __is_dash_streaming(mmplayer_t *player) } gboolean -__is_smooth_streaming(mmplayer_t *player) +_mmplayer_is_smooth_streaming(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -131,7 +132,7 @@ __is_smooth_streaming(mmplayer_t *player) } gboolean -__is_ms_buff_src(mmplayer_t *player) +_mmplayer_is_ms_buff_src(mmplayer_t *player) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -139,7 +140,7 @@ __is_ms_buff_src(mmplayer_t *player) } gboolean -__has_suffix(mmplayer_t *player, const gchar *suffix) +_mmplayer_has_suffix(mmplayer_t *player, const gchar *suffix) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); MMPLAYER_RETURN_VAL_IF_FAIL(suffix, FALSE); @@ -161,7 +162,7 @@ __has_suffix(mmplayer_t *player, const gchar *suffix) } gboolean -__mmplayer_post_message(mmplayer_t *player, enum MMMessageType msgtype, MMMessageParamType *param) +_mmplayer_post_message(mmplayer_t *player, enum MMMessageType msgtype, MMMessageParamType *param) { MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE); @@ -176,7 +177,7 @@ __mmplayer_post_message(mmplayer_t *player, enum MMMessageType msgtype, MMMessag } gboolean -__mmplayer_dump_pipeline_state(mmplayer_t *player) +_mmplayer_dump_pipeline_state(mmplayer_t *player) { GstIterator *iter = NULL; gboolean done = FALSE; @@ -252,7 +253,7 @@ __mmplayer_dump_pipeline_state(mmplayer_t *player) } int -util_exist_file_path(const char *file_path) +_mmplayer_exist_file_path(const char *file_path) { int fd = 0; struct stat stat_results = {0, }; @@ -288,7 +289,7 @@ util_exist_file_path(const char *file_path) } char ** -util_get_cookie_list(const char *cookies) +_mmplayer_get_cookie_list(const char *cookies) { char **cookie_list = NULL; char *temp = NULL; @@ -331,7 +332,7 @@ EXIT: /* check the given path is indicating sdp file */ bool -util_is_sdp_file(const char *path) +_mmplayer_is_sdp_file(const char *path) { gboolean ret = FALSE; gchar *uri = NULL; @@ -369,7 +370,7 @@ util_is_sdp_file(const char *path) } const char * -util_get_charset(const char *file_path) +_mmplayer_get_charset(const char *file_path) { UCharsetDetector *ucsd; const UCharsetMatch *ucm; @@ -440,7 +441,7 @@ done: } int -util_get_pixtype(unsigned int fourcc) +_mmplayer_get_pixtype(unsigned int fourcc) { int pixtype = MM_PIXEL_FORMAT_INVALID; @@ -515,7 +516,7 @@ util_get_pixtype(unsigned int fourcc) } static int -_util_storage_supported_cb(int storage_id, storage_type_e type, +__mmplayer_storage_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data) { mmplayer_storage_info_t *storage_info = (mmplayer_storage_info_t *)user_data; @@ -532,7 +533,7 @@ _util_storage_supported_cb(int storage_id, storage_type_e type, } bool -util_get_storage_info(const char *path, mmplayer_storage_info_t *storage_info) +_mmplayer_get_storage_info(const char *path, mmplayer_storage_info_t *storage_info) { int ret = 0; const char *file_path = path; @@ -548,7 +549,7 @@ util_get_storage_info(const char *path, mmplayer_storage_info_t *storage_info) memset(storage_info->path, 0x00, MM_MAX_URL_LEN); g_snprintf(storage_info->path, MM_MAX_URL_LEN, "%s", file_path); - ret = storage_foreach_device_supported((storage_device_supported_cb)_util_storage_supported_cb, storage_info); + ret = storage_foreach_device_supported((storage_device_supported_cb)__mmplayer_storage_supported_cb, storage_info); if (ret != STORAGE_ERROR_NONE) { LOGE("failed to check supported storage 0x%x", ret); return false; @@ -567,7 +568,7 @@ util_get_storage_info(const char *path, mmplayer_storage_info_t *storage_info) return true; } -media_format_mimetype_e util_convert_audio_pcm_str_to_media_format_mime(const gchar *audio_pcm_str) +media_format_mimetype_e _mmplayer_convert_audio_pcm_str_to_media_format_mime(const gchar *audio_pcm_str) { if (!audio_pcm_str) { LOGW("audio pcm str is NULL"); diff --git a/unittest/gtest_mm_player_priv.cpp b/unittest/gtest_mm_player_priv.cpp index 00c7f4d..cfd830b 100644 --- a/unittest/gtest_mm_player_priv.cpp +++ b/unittest/gtest_mm_player_priv.cpp @@ -144,7 +144,7 @@ int MMPlayerPriv::ParseProfile(const gchar *uri, int *uri_type) memset((void *)&profile, 0, sizeof(mmplayer_parse_profile_t)); - ret = __mmplayer_parse_profile(uri, NULL, &profile); + ret = _mmplayer_parse_profile(uri, NULL, &profile); if (uri_type) *uri_type = profile.uri_type; |