From: eunhae1.choi Date: Tue, 27 May 2014 05:23:27 +0000 (+0900) Subject: resolve build break (2) X-Git-Tag: accepted/tizen/ivi/20140604.130045^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_3.0.m14.2_ivi;p=platform%2Fcore%2Fmultimedia%2Flibmm-player.git resolve build break (2) Change-Id: I1412530ec56389d03b2de1cd09e8e5c3d30ec495 --- diff --git a/src/include/mm_player_priv.h b/src/include/mm_player_priv.h old mode 100644 new mode 100755 index 132b3e4..3658b33 --- a/src/include/mm_player_priv.h +++ b/src/include/mm_player_priv.h @@ -127,7 +127,7 @@ enum MMPlayerUriType { MM_PLAYER_URI_TYPE_FILE, /**< Player URI type File */ MM_PLAYER_URI_TYPE_URL, /**< Player URI type URL */ MM_PLAYER_URI_TYPE_BUFF, /**< Player URI type Buffer */ - MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */ + MM_PLAYER_URI_TYPE_HLS, /**< Player URI type http live streaming */ MM_PLAYER_URI_TYPE_TEMP, /**< Player URI type Temp */ }; @@ -165,10 +165,10 @@ enum MainElementID MMPLAYER_M_SRC_2ND_FAKESINK, /* streaming plugin */ - MMPLAYER_M_S_BUFFER, - MMPLAYER_M_S_ADEC, - MMPLAYER_M_S_VDEC, - + MMPLAYER_M_S_BUFFER, + MMPLAYER_M_S_ADEC, + MMPLAYER_M_S_VDEC, + /* FIXIT : if there's really no usage for following IDs. remove it */ MMPLAYER_M_DEC1, MMPLAYER_M_DEC2, @@ -661,6 +661,7 @@ int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_cal int _mmplayer_set_videoframe_render_error_cb(MMHandleType hplayer, mm_player_video_frame_render_error_callback callback, void *user_param); int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent); int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent); +int _mmplayer_get_track_count(MMHandleType hplayer, MMPlayerTrackType track_type, int *count); int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos); /* test API for tuning audio gain. this API should be * deprecated before the day of final release diff --git a/src/include/mm_player_priv_internal.h b/src/include/mm_player_priv_internal.h index 40b9dc4..c6588dc 100755 --- a/src/include/mm_player_priv_internal.h +++ b/src/include/mm_player_priv_internal.h @@ -31,6 +31,7 @@ void __mmplayer_release_signal_connection(mm_player_t* player); gboolean __mmplayer_dump_pipeline_state(mm_player_t* player); int __mmplayer_gst_set_state (mm_player_t* player, GstElement * element, GstState state, gboolean async, gint timeout); +void __mmplayer_cancel_delayed_eos(mm_player_t* player); gboolean __mmplayer_check_subtitle(mm_player_t* player); int __mmplayer_handle_missed_plugin(mm_player_t* player); gboolean __mmplayer_link_decoder(mm_player_t* player, GstPad *srcpad); diff --git a/src/include/mm_player_priv_locl_func.h b/src/include/mm_player_priv_locl_func.h index c63c0ce..972625d 100755 --- a/src/include/mm_player_priv_locl_func.h +++ b/src/include/mm_player_priv_locl_func.h @@ -27,12 +27,27 @@ | LOCAL FUNCTION PROTOTYPES: | ---------------------------------------------------------------------------*/ /* mm_player_priv.c */ -gboolean __mmplayer_eos_timer_cb(gpointer u_data); +gboolean __mmplayer_set_state(mm_player_t* player, int state); void __mmplayer_typefind_have_type( GstElement *tf, guint probability, GstCaps *caps, gpointer data); -GstBusSyncReply __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data); +gboolean __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps); +void __mmplayer_pipeline_complete(GstElement *decodebin, gpointer data); gboolean __mmplayer_update_subtitle( GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data); -void __mmplayer_videoframe_render_error_cb(GstElement *element, void *error_id, gpointer data); +void __mmplayer_release_misc(mm_player_t* player); +gboolean __mmplayer_configure_audio_callback(mm_player_t* player); +void __mmplayer_set_antishock( mm_player_t* player, gboolean disable_by_force); +gboolean _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag); void __mmplayer_videostream_cb(GstElement *element, void *stream, int width, int height, gpointer data); +void __mmplayer_videoframe_render_error_cb(GstElement *element, void *error_id, gpointer data); +void __mmplayer_handle_buffering_message ( mm_player_t* player ); +int __mmplayer_set_pcm_extraction(mm_player_t* player); +gboolean __mmplayer_can_extract_pcm( mm_player_t* player ); +void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time); +void __mmplayer_undo_sound_fadedown(mm_player_t* player); +const gchar * __get_state_name ( int state ); +GstBusSyncReply __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data); +void __mmplayer_post_delayed_eos( mm_player_t* player, int delay_in_ms ); +void __gst_set_async_state_change(mm_player_t* player, gboolean async); +gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param); /* mm_player_priv_wrapper.c */ gboolean __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data); diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index ede7896..0e00372 100755 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -111,10 +111,7 @@ /*--------------------------------------------------------------------------- | LOCAL FUNCTION PROTOTYPES: | ---------------------------------------------------------------------------*/ -static gboolean __mmplayer_set_state(mm_player_t* player, int state); static int __mmplayer_get_state(mm_player_t* player); -static gboolean __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps); -static void __mmplayer_pipeline_complete(GstElement *decodebin, gpointer data); static gboolean __mmplayer_is_midi_type(gchar* str_caps); static gboolean __mmplayer_is_amr_type (gchar *str_caps); static gboolean __mmplayer_is_only_mp3_type (gchar *str_caps); @@ -126,7 +123,6 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer d static gboolean __mmplayer_get_stream_service_type( mm_player_t* player ); static void __mmplayer_init_factories(mm_player_t* player); static void __mmplayer_release_factories(mm_player_t* player); -static void __mmplayer_release_misc(mm_player_t* player); static gboolean __mmplayer_gstreamer_init(void); gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param); @@ -134,22 +130,9 @@ gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype int __mmplayer_switch_audio_sink (mm_player_t* player); static int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command); static gboolean __mmplayer_audio_stream_probe (GstPad *pad, GstBuffer *buffer, gpointer u_data); -static void __mmplayer_post_delayed_eos( mm_player_t* player, int delay_in_ms ); -static void __mmplayer_cancel_delayed_eos( mm_player_t* player ); +static gboolean __mmplayer_eos_timer_cb(gpointer u_data); static int __mmplayer_check_not_supported_codec(mm_player_t* player, gchar* mime); -static gboolean __mmplayer_configure_audio_callback(mm_player_t* player); -static void __mmplayer_set_antishock( mm_player_t* player, gboolean disable_by_force); static gpointer __mmplayer_repeat_thread(gpointer data); -int _mmplayer_get_track_count(MMHandleType hplayer, MMPlayerTrackType track_type, int *count); -static gboolean _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag); -static void __gst_set_async_state_change(mm_player_t* player, gboolean async); -static int __mmplayer_set_pcm_extraction(mm_player_t* player); -static gboolean __mmplayer_can_extract_pcm( mm_player_t* player ); - -/*fadeout */ -static void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time); -static void __mmplayer_undo_sound_fadedown(mm_player_t* player); - static void __mmplayer_add_new_caps(GstPad* pad, GParamSpec* unused, gpointer data); static void __mmplayer_set_unlinked_mime_type(mm_player_t* player, GstCaps *caps); @@ -709,7 +692,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag) return TRUE; } -gint __mmplayer_get_stream_service_type( mm_player_t* player ) +static gint __mmplayer_get_stream_service_type( mm_player_t* player ) { gint streaming_type = STREAMING_SERVICE_NONE; @@ -765,7 +748,7 @@ gint __mmplayer_get_stream_service_type( mm_player_t* player ) /* this function sets the player state and also report * it to applicaton by calling callback function */ -static gboolean +gboolean __mmplayer_set_state(mm_player_t* player, int state) // @ { MMMessageParamType msg = {0, }; @@ -1019,7 +1002,7 @@ __mmplayer_get_state(mm_player_t* player) // @ return state; } -static void +void __gst_set_async_state_change(mm_player_t* player, gboolean async) { //debug_fenter(); @@ -1141,7 +1124,7 @@ static gpointer __mmplayer_repeat_thread(gpointer data) return NULL; } -static void +void __mmplayer_handle_buffering_message ( mm_player_t* player ) { MMPlayerStateType prev_state = MM_PLAYER_STATE_NONE; @@ -2033,7 +2016,7 @@ __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data) return GST_BUS_DROP; } -static void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time) +void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time) { debug_fenter(); @@ -2049,7 +2032,7 @@ static void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time) debug_fleave(); } -static void __mmplayer_undo_sound_fadedown(mm_player_t* player) +void __mmplayer_undo_sound_fadedown(mm_player_t* player) { debug_fenter(); @@ -3588,7 +3571,7 @@ _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, uns return MM_ERROR_NONE; } -static int +int __mmplayer_set_pcm_extraction(mm_player_t* player) { guint64 start_nsec = 0; @@ -4000,7 +3983,7 @@ __mmplayer_warm_up_video_codec( mm_player_t* player, GstElementFactory *factory } /* it will return first created element */ -static gboolean +gboolean __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) // @ { MMPlayerGstElement* mainbin = NULL; @@ -4432,7 +4415,7 @@ DONE: } -static void __mmplayer_pipeline_complete(GstElement *decodebin, gpointer data) // @ +void __mmplayer_pipeline_complete(GstElement *decodebin, gpointer data) // @ { mm_player_t* player = (mm_player_t*)data; @@ -4465,7 +4448,7 @@ static void __mmplayer_pipeline_complete(GstElement *decodebin, gpointer data) MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-complete" ); } -static gboolean __mmplayer_configure_audio_callback(mm_player_t* player) +gboolean __mmplayer_configure_audio_callback(mm_player_t* player) { debug_fenter(); @@ -4559,7 +4542,7 @@ __mmplayer_release_factories(mm_player_t* player) // @ debug_fleave(); } -static void +void __mmplayer_release_misc(mm_player_t* player) { int i; @@ -5477,7 +5460,7 @@ _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume) return error; } -static gboolean +gboolean __mmplayer_can_extract_pcm( mm_player_t* player ) { MMHandleType attrs = 0; @@ -5508,26 +5491,49 @@ __mmplayer_can_extract_pcm( mm_player_t* player ) return TRUE; } -static void -__mmplayer_cancel_delayed_eos( mm_player_t* player ) +void +__mmplayer_post_delayed_eos( mm_player_t* player, int delay_in_ms ) { debug_fenter(); return_if_fail( player ); - if ( player->eos_timer ) + /* cancel if existing */ + __mmplayer_cancel_delayed_eos( player ); + + + /* post now if delay is zero */ + if ( delay_in_ms == 0 || player->is_sound_extraction) { - g_source_remove( player->eos_timer ); + debug_log("eos delay is zero. posting EOS now\n"); + MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL ); + + if ( player->is_sound_extraction ) + __mmplayer_cancel_delayed_eos(player); + + return; } - player->eos_timer = 0; + /* init new timeout */ + /* NOTE : consider give high priority to this timer */ - debug_fleave(); + debug_log("posting EOS message after [%d] msec\n", delay_in_ms); + player->eos_timer = g_timeout_add( delay_in_ms, + __mmplayer_eos_timer_cb, player ); - return; + + /* check timer is valid. if not, send EOS now */ + if ( player->eos_timer == 0 ) + { + debug_warning("creating timer for delayed EOS has failed. sending EOS now\n"); + MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL ); + } + + debug_fleave(); } -gboolean + +static gboolean __mmplayer_eos_timer_cb(gpointer u_data) { mm_player_t* player = NULL; @@ -5549,7 +5555,7 @@ __mmplayer_eos_timer_cb(gpointer u_data) return FALSE; } -static void __mmplayer_set_antishock( mm_player_t* player, gboolean disable_by_force) +void __mmplayer_set_antishock( mm_player_t* player, gboolean disable_by_force) { gint antishock = FALSE; MMHandleType attrs = 0; diff --git a/src/mm_player_priv_internal.c b/src/mm_player_priv_internal.c index c75b6a9..1d86491 100755 --- a/src/mm_player_priv_internal.c +++ b/src/mm_player_priv_internal.c @@ -267,6 +267,25 @@ __mmplayer_gst_set_state (mm_player_t* player, GstElement * element, GstState s return MM_ERROR_NONE; } +void +__mmplayer_cancel_delayed_eos( mm_player_t* player ) +{ + debug_fenter(); + + return_if_fail( player ); + + if ( player->eos_timer ) + { + g_source_remove( player->eos_timer ); + } + + player->eos_timer = 0; + + debug_fleave(); + + return; +} + gboolean __mmplayer_check_subtitle( mm_player_t* player ) { @@ -823,47 +842,6 @@ CODEC_NOT_FOUND: return MM_ERROR_PLAYER_CODEC_NOT_FOUND; } -static void -__mmplayer_post_delayed_eos( mm_player_t* player, int delay_in_ms ) -{ - debug_fenter(); - - return_if_fail( player ); - - /* cancel if existing */ - __mmplayer_cancel_delayed_eos( player ); - - - /* post now if delay is zero */ - if ( delay_in_ms == 0 || player->is_sound_extraction) - { - debug_log("eos delay is zero. posting EOS now\n"); - MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL ); - - if ( player->is_sound_extraction ) - __mmplayer_cancel_delayed_eos(player); - - return; - } - - /* init new timeout */ - /* NOTE : consider give high priority to this timer */ - - debug_log("posting EOS message after [%d] msec\n", delay_in_ms); - player->eos_timer = g_timeout_add( delay_in_ms, - __mmplayer_eos_timer_cb, player ); - - - /* check timer is valid. if not, send EOS now */ - if ( player->eos_timer == 0 ) - { - debug_warning("creating timer for delayed EOS has failed. sending EOS now\n"); - MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL ); - } - - debug_fleave(); -} - gboolean __mmplayer_handle_gst_error ( mm_player_t* player, GstMessage * message, GError* error ) {