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
| 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
}
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);
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
}
} 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
#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);
#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; \
#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 { \
#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)
/*===========================================================================================
| |
| |
========================================================================================== */
-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
}
#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)
{
/* 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);
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);
MMPLAYER_CMD_LOCK(player);
- result = _mmplayer_get_position(player, pos);
+ result = _mmplayer_gst_get_position((mmplayer_t *)player, pos);
MMPLAYER_CMD_UNLOCK(player);
}
-int
+static int
__mmplayer_set_harmony_effect(mmplayer_t *player, GstElement *audio_effect_element)
{
gint *ext_effect_level_list = NULL;
}
-gboolean
+static gboolean
__mmplayer_is_earphone_only_effect_type(mmplayer_t *player, mm_audio_effect_type_e effect_type, int effect)
{
gboolean result = FALSE;
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;
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;
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();
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();
}
-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;
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;
}
}
-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;
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
/*---------------------------------------------------------------------------
| 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);
/*===========================================================================================
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;
}
{
switch (pending_state) {
case MM_PLAYER_STATE_PLAYING:
- __mmplayer_gst_pause(player, TRUE);
+ _mmplayer_gst_pause(player, TRUE);
break;
case MM_PLAYER_STATE_PAUSED:
case MM_PLAYER_STATE_NONE:
{
if (current_state != MM_PLAYER_STATE_PLAYING)
- __mmplayer_gst_resume(player, TRUE);
+ _mmplayer_gst_resume(player, TRUE);
}
break;
* 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:
/* 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);
}
}
}
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:
}
} 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();
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 {
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 */
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.");
__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 */
__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
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.");
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) {
}
if (player->gapless.stream_changed) {
- __mmplayer_update_content_attrs(player, ATTR_ALL);
+ _mmplayer_update_content_attrs(player, ATTR_ALL);
player->gapless.stream_changed = FALSE;
}
}
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")) {
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);
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;
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");
/*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 */
}
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");
}
}
- if (!__mmplayer_gst_create_decoder(player, pad, caps)) {
+ if (!_mmplayer_gst_create_decoder(player, pad, caps)) {
LOGE("failed to autoplug for caps");
goto ERROR;
}
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
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();
"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);
}
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;
}
/* 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;
}
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;
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;
}
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;
}
}
int
-__mmplayer_gst_start(mmplayer_t *player)
+_mmplayer_gst_start(mmplayer_t *player)
{
int ret = MM_ERROR_NONE;
gboolean async = FALSE;
*/
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;
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");
}
int
-__mmplayer_gst_stop(mmplayer_t *player)
+_mmplayer_gst_stop(mmplayer_t *player)
{
GstStateChangeReturn change_ret = GST_STATE_CHANGE_SUCCESS;
MMHandleType attrs = 0;
__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 */
/* 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");
} 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 */
}
int
-__mmplayer_gst_pause(mmplayer_t *player, gboolean async)
+_mmplayer_gst_pause(mmplayer_t *player, gboolean async)
{
int ret = MM_ERROR_NONE;
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)
}
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;
/* 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");
/* 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;
}
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)
{
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();
}
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;
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");
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");
}
int
-__mmplayer_gst_get_position(mmplayer_t *player, gint64 *position)
+_mmplayer_gst_get_position(mmplayer_t *player, gint64 *position)
{
#define TRICKPLAY_OFFSET GST_MSECOND
}
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
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;
}
}
GstElement *
-__mmplayer_gst_create_source(mmplayer_t *player)
+_mmplayer_gst_create_source(mmplayer_t *player)
{
GstElement *element = NULL;
}
int
-__mmplayer_gst_build_es_pipeline(mmplayer_t *player)
+_mmplayer_gst_build_es_pipeline(mmplayer_t *player)
{
MMHandleType attrs = 0;
}
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;
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;
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;
}
/* 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;
}
}
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;
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;
+}
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);
/* 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);
/* 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;
}
MMStreamingType
-__mmplayer_get_stream_service_type(mmplayer_t *player)
+_mmplayer_get_stream_service_type(mmplayer_t *player)
{
MMStreamingType streaming_type = STREAMING_SERVICE_NONE;
* 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, };
}
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;
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)
{
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);
}
void
-__mmplayer_bus_msg_thread_destroy(MMHandleType hplayer)
+_mmplayer_bus_msg_thread_destroy(MMHandleType hplayer)
{
mmplayer_t *player = (mmplayer_t *)hplayer;
GstMessage *msg = NULL;
}
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;
}
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;
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:
/* 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 */
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()
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) {
}
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;
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);
}
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;
}
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;
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;
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");
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");
}
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;
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. */
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",
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));
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;
}
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 */
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",
/* 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 */
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);
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",
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 {
__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;
}
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",
/* 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;
}
/* 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;
}
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;
}
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);
/* 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");
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;
__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;
}
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) {
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;
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);
/* 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) {
}
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;
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;
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_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");
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);
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 */
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.");
__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.");
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);
}
}
}
/* 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);
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");
/* 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.");
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),
/* 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();
}
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;
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;
}
}
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;
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);
}
GstElement *
-__mmplayer_gst_make_decodebin(mmplayer_t *player)
+_mmplayer_gst_make_decodebin(mmplayer_t *player)
{
GstElement *decodebin = NULL;
}
/* 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;
dur_bytes = 0;
}
- __mm_player_streaming_set_queue2(player->streamer,
+ _mm_player_streaming_set_queue2(player->streamer,
queue2,
FALSE,
type,
}
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;
}
/* create decodebin */
- decodebin = __mmplayer_gst_make_decodebin(player);
+ decodebin = _mmplayer_gst_make_decodebin(player);
if (!decodebin) {
LOGE("failed to make decodebin");
goto ERROR;
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
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;
}
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)
{
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;
}
}
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;
}
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;
(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);
}
}
}
/* 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);
}
void
-__mmplayer_cancel_eos_timer(mmplayer_t *player)
+_mmplayer_cancel_eos_timer(mmplayer_t *player)
{
MMPLAYER_RETURN_IF_FAIL(player);
}
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;
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 */
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;
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);
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);
(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;
}
/* 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))
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 {
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);
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
* 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)) {
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;
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;
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;
return;
}
-void __mm_player_streaming_destroy(mmplayer_streaming_t *streamer)
+void _mm_player_streaming_destroy(mmplayer_streaming_t *streamer)
{
MMPLAYER_FENTER();
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;
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;
}
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 */
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;
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 */
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;
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;
/* 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;
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;
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;
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;
(*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;
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;
(*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)
{
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;
(*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;
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))
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);
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;
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;
if (!streamer->buffering_req.is_pre_buffering) {
streamer->need_update = TRUE;
- streaming_adjust_min_threshold(streamer, position);
+ __streaming_adjust_min_threshold(streamer, position);
}
}
}
}
-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();
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;
}
}
void
-__mmplayer_track_initialize(mmplayer_t *player)
+_mmplayer_track_initialize(mmplayer_t *player)
{
mmplayer_track_type_e type = MM_PLAYER_TRACK_TYPE_AUDIO;
}
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;
}
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();
}
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;
#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:
}
const gchar *
-__get_state_name(int state)
+_mmplayer_get_state_name(int state)
{
switch (state) {
case MM_PLAYER_STATE_NULL:
}
gboolean
-__is_rtsp_streaming(mmplayer_t *player)
+_mmplayer_is_rtsp_streaming(mmplayer_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_http_streaming(mmplayer_t *player)
+_mmplayer_is_http_streaming(mmplayer_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
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);
}
gboolean
-__is_dash_streaming(mmplayer_t *player)
+_mmplayer_is_dash_streaming(mmplayer_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_smooth_streaming(mmplayer_t *player)
+_mmplayer_is_smooth_streaming(mmplayer_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_ms_buff_src(mmplayer_t *player)
+_mmplayer_is_ms_buff_src(mmplayer_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
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);
}
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);
}
gboolean
-__mmplayer_dump_pipeline_state(mmplayer_t *player)
+_mmplayer_dump_pipeline_state(mmplayer_t *player)
{
GstIterator *iter = NULL;
gboolean done = FALSE;
}
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, };
}
char **
-util_get_cookie_list(const char *cookies)
+_mmplayer_get_cookie_list(const char *cookies)
{
char **cookie_list = NULL;
char *temp = NULL;
/* 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;
}
const char *
-util_get_charset(const char *file_path)
+_mmplayer_get_charset(const char *file_path)
{
UCharsetDetector *ucsd;
const UCharsetMatch *ucm;
}
int
-util_get_pixtype(unsigned int fourcc)
+_mmplayer_get_pixtype(unsigned int fourcc)
{
int pixtype = MM_PIXEL_FORMAT_INVALID;
}
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;
}
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;
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;
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");
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;