target_state = MMPLAYER_TARGET_STATE(player);
pending_state = MMPLAYER_PENDING_STATE(player);
+ if ( MMPLAYER_IS_RTSP_STREAMING(player) )
+ return;
+
if ( !player->streamer->is_buffering )
{
debug_log( "player state : prev %s, current %s, pending %s, target %s \n",
{
case MM_PLAYER_STATE_PAUSED :
{
- if ( MMPLAYER_IS_RTSP_STREAMING(player) )
- return;
-
switch ( pending_state )
{
case MM_PLAYER_STATE_PLAYING:
case MM_PLAYER_STATE_PLAYING :
{
- if ( MMPLAYER_IS_RTSP_STREAMING(player) )
- {
- __gst_resume ( player, TRUE );
-
- /* now we can overcome 'state-lost' situation */
- player->state_lost = FALSE;
-
- return;
- }
-
switch ( pending_state )
{
case MM_PLAYER_STATE_NONE:
}
else
{
- /* NOTE : in case of rtsp streaming, the src plugin provide the pipeline clock.
- * the src plugin is buffering, the pipeline clock stop automatically.
- * so don't need to pause the player.
- */
- if ( MMPLAYER_IS_RTSP_STREAMING(player) )
- {
- player->state_lost = TRUE;
- return;
- }
-
/* NOTE : during the buffering, pause the player for stopping pipeline clock.
* it's for stopping the pipeline clock to prevent dropping the data in sink element.
*/
player->pipeline->mainbin );
- /* first, check pt type which we are supporting or not */
- if ( MMPLAYER_PT_IS_VIDEO( GST_PAD_NAME( pad ) ) )
- {
- /* video packet */
- debug_log("is video stream. take it.\n");
- element_id = MMPLAYER_M_S_VDEC;
- }
- else if ( MMPLAYER_PT_IS_AUDIO( GST_PAD_NAME( pad ) ) )
- {
- /* audio packet */
- debug_log("is audio stream. take it.\n");
- element_id = MMPLAYER_M_S_ADEC;
- }
- else
- {
- /* FIXIT : application should know this. need one more message type */
- debug_error ("This Payload type is unknown!\n");
- goto ERROR;
- }
-
/* payload type is recognizable. increase num_dynamic and wait for sinkbin creation.
* num_dynamic_pad will decreased after creating a sinkbin.
*/
debug_log("stream count inc : %d\n", player->num_dynamic_pad);
/* perform autoplugging if dump is disabled */
- if ( ! new_element )
+ if ( PLAYER_INI()->rtsp_do_typefinding )
{
- if ( PLAYER_INI()->rtsp_do_typefinding )
+ /* create typefind */
+ new_element = gst_element_factory_make( "typefind", NULL );
+ if ( ! new_element )
{
- /* create autoplugging element */
- if( PLAYER_INI()->use_decodebin )
- {
- /* create decodebin */
- new_element = gst_element_factory_make("decodebin", NULL);
-
- g_object_set(G_OBJECT(new_element), "async-handling", TRUE, NULL);
-
- if ( ! new_element )
- {
- debug_error("failed to create autoplug element\n");
- goto ERROR;
- }
-
- /* set signal handler */
- MMPLAYER_SIGNAL_CONNECT( player,
- G_OBJECT(new_element),
- "new-decoded-pad",
- G_CALLBACK(__mmplayer_gst_decode_callback),
- (gpointer)player );
- }
- else
- {
- /* create typefind */
- new_element = gst_element_factory_make( "typefind", NULL );
- if ( ! new_element )
- {
- debug_error("failed to create typefind\n");
- goto ERROR;
- }
-
- MMPLAYER_SIGNAL_CONNECT( player,
- G_OBJECT(new_element),
- "have-type",
- G_CALLBACK(__mmplayer_typefind_have_type),
- (gpointer)player);
-
- /* FIXIT : try to remove it */
- player->have_dynamic_pad = FALSE;
- }
+ debug_error("failed to create typefind\n");
+ goto ERROR;
}
- else /* NOTE : use pad's caps directely. if enabled. what I am assuming is there's no elemnt has dynamic pad */
- {
- debug_log("using pad caps to autopluging instead of doing typefind\n");
- caps = gst_pad_get_caps( pad );
+ MMPLAYER_SIGNAL_CONNECT( player,
+ G_OBJECT(new_element),
+ "have-type",
+ G_CALLBACK(__mmplayer_typefind_have_type),
+ (gpointer)player);
- MMPLAYER_CHECK_NULL( caps );
+ /* FIXIT : try to remove it */
+ player->have_dynamic_pad = FALSE;
+ }
+ else /* NOTE : use pad's caps directely. if enabled. what I am assuming is there's no elemnt has dynamic pad */
+ {
+ debug_log("using pad caps to autopluging instead of doing typefind\n");
- /* clear previous result*/
- player->have_dynamic_pad = FALSE;
+ caps = gst_pad_get_caps( pad );
- if ( ! __mmplayer_try_to_plug( player, pad, caps ) )
- {
- debug_error("failed to autoplug for caps : %s\n", gst_caps_to_string( caps ) );
- goto ERROR;
- }
+ MMPLAYER_CHECK_NULL( caps );
- /* check if there's dynamic pad*/
- if( player->have_dynamic_pad )
- {
- debug_error("using pad caps assums there's no dynamic pad !\n");
- debug_error("try with enalbing rtsp_do_typefinding\n");
- goto ERROR;
- }
+ /* clear previous result*/
+ player->have_dynamic_pad = FALSE;
- gst_caps_unref( caps );
- caps = NULL;
+ if ( ! __mmplayer_try_to_plug( player, pad, caps ) )
+ {
+ debug_error("failed to autoplug for caps : %s\n", gst_caps_to_string( caps ) );
+ goto ERROR;
}
+
+ /* check if there's dynamic pad*/
+ if( player->have_dynamic_pad )
+ {
+ debug_error("using pad caps assums there's no dynamic pad !\n");
+ debug_error("try with enalbing rtsp_do_typefinding\n");
+ goto ERROR;
+ }
+
+ gst_caps_unref( caps );
+ caps = NULL;
}
/* excute new_element if created*/
if ( ! player->is_sound_extraction )
{
+ GstCaps* caps = NULL;
+
/* for logical volume control */
MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_VOL, "volume", "volume", TRUE);
g_object_set(G_OBJECT (audiobin[MMPLAYER_A_VOL].gst), "volume", player->sound.volume, NULL);
g_object_set(G_OBJECT (audiobin[MMPLAYER_A_VOL].gst), "mute", player->sound.mute, NULL);
}
- /* NOTE : streaming doesn't need capsfilter and sound effect*/
- if ( ! MMPLAYER_IS_RTSP_STREAMING( player ) )
- {
- GstCaps* caps = NULL;
-
- /*capsfilter */
- MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audiocapsfilter", TRUE);
+ /*capsfilter */
+ MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audiocapsfilter", TRUE);
- caps = gst_caps_from_string( "audio/x-raw-int, "
- "endianness = (int) LITTLE_ENDIAN, "
- "signed = (boolean) true, "
- "width = (int) 16, "
- "depth = (int) 16" );
+ caps = gst_caps_from_string( "audio/x-raw-int, "
+ "endianness = (int) LITTLE_ENDIAN, "
+ "signed = (boolean) true, "
+ "width = (int) 16, "
+ "depth = (int) 16" );
- g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
+ g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
- gst_caps_unref( caps );
+ gst_caps_unref( caps );
- /* audio filter. if enabled */
- if ( PLAYER_INI()->use_audio_filter_preset || PLAYER_INI()->use_audio_filter_custom )
- {
- MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_FILTER, "soundalive", "audiofilter", TRUE);
- }
+ /* audio filter. if enabled */
+ if ( PLAYER_INI()->use_audio_filter_preset || PLAYER_INI()->use_audio_filter_custom )
+ {
+ MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_FILTER, "soundalive", "audiofilter", TRUE);
}
+
/* create audio sink */
MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_SINK, PLAYER_INI()->name_of_audiosink,
"audiosink", link_audio_sink_now);
/* sync on */
- if (MMPLAYER_IS_RTSP_STREAMING (player) )
+ if (MMPLAYER_IS_RTSP_STREAMING(player))
g_object_set (G_OBJECT (audiobin[MMPLAYER_A_SINK].gst), "sync", FALSE, NULL); /* sync off */
else
g_object_set (G_OBJECT (audiobin[MMPLAYER_A_SINK].gst), "sync", TRUE, NULL); /* sync on */
* It should be set after player creation through attribute.
* But, it can not be changed during playing.
*/
- mm_attrs_get_int_by_name(attrs, "sound_volume_type", &volume_type);
+ mm_attrs_get_int_by_name(attrs, "sound_volume_type", &volume_type);
mm_attrs_get_int_by_name(attrs, "sound_route", &audio_route);
mm_attrs_get_int_by_name(attrs, "sound_priority", &sound_priority);
mm_attrs_get_int_by_name(attrs, "sound_spk_out_only", &is_spk_out_only);
/* rtsp streamming */
case MM_PLAYER_URI_TYPE_URL_RTSP:
{
- gint udp_timeout, network_bandwidth;
+ gint network_bandwidth;
gchar *user_agent, *wap_profile;
element = gst_element_factory_make(PLAYER_INI()->name_of_rtspsrc, "streaming_source");
debug_log("using streamming source [%s].\n", PLAYER_INI()->name_of_rtspsrc);
/* make it zero */
- udp_timeout = network_bandwidth = 0;
+ network_bandwidth = 0;
user_agent = wap_profile = NULL;
/* get attribute */
- mm_attrs_get_int_by_name ( attrs,"streaming_udp_timeout", &udp_timeout );
mm_attrs_get_string_by_name ( attrs, "streaming_user_agent", &user_agent );
mm_attrs_get_string_by_name ( attrs,"streaming_wap_profile", &wap_profile );
mm_attrs_get_int_by_name ( attrs, "streaming_network_bandwidth", &network_bandwidth );
debug_log("setting streaming source ----------------\n");
- debug_log("udp_timeout : %d\n", udp_timeout);
debug_log("user_agent : %s\n", user_agent);
debug_log("wap_profile : %s\n", wap_profile);
debug_log("network_bandwidth : %d\n", network_bandwidth);
/* setting property to streaming source */
g_object_set(G_OBJECT(element), "location", player->profile.uri, NULL);
- g_object_set(G_OBJECT(element), "timeout", udp_timeout, NULL);
g_object_set(G_OBJECT(element), "bandwidth", network_bandwidth, NULL);
g_object_set(G_OBJECT(element), "buffering_time", PLAYER_INI()->rtsp_buffering_time, NULL);
g_object_set(G_OBJECT(element), "rebuffering_time", PLAYER_INI()->rtsp_rebuffering_time, NULL);
player->v_stream_caps = NULL;
}
- player->state_lost = FALSE;
player->need_update_content_dur = FALSE;
player->pending_seek.is_pending = FALSE;
ret = __mmplayer_gst_set_state(player,
player->pipeline->subtitlebin[MMPLAYER_SUB_PIPE].gst, GST_STATE_PAUSED, async, timeout );
- /* NOTE : here we are setting state PAUSED to streaming source element again. because
- * main pipeline will not set the state of it's all childs if state of the pipeline
- * is already PAUSED for some reason. this situaition can happen when rebuffering or
- * buffering after seeking. in both case streaming source will send flush event and then
- * sink elements will lost it's state and it will set the state to PAUSED by theyself.
- */
- if ( MMPLAYER_IS_RTSP_STREAMING( player ) && player->state_lost )
- {
- debug_log("setting PAUSED to streaming source again.\n");
- gst_element_set_state(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_STATE_PAUSED);
- }
-
if ( ret != MM_ERROR_NONE )
{
debug_error("failed to set state to PAUSED\n");
ret = __mmplayer_gst_set_state(player,
player->pipeline->subtitlebin[MMPLAYER_SUB_PIPE].gst, GST_STATE_PLAYING, async, timeout );
- /* NOTE : same reason when pausing */
- if ( MMPLAYER_IS_RTSP_STREAMING(player) && player->state_lost )
- {
- debug_log("setting PLAYING to streaming source again.\n");
- gst_element_set_state(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_STATE_PLAYING);
- }
-
if (ret != MM_ERROR_NONE)
{
debug_error("failed to set state to PLAYING\n");
return_val_if_fail ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
return_val_if_fail ( !MMPLAYER_IS_LIVE_STREAMING(player), MM_ERROR_PLAYER_NO_OP );
- debug_log(" sent bos = %d", player->sent_bos);
-
if ( MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING
&& MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED )
- {
- debug_log();
- goto PENDING;
- }
-
- debug_log();
+ goto PENDING;
/* check duration */
/* NOTE : duration cannot be zero except live streaming.
#ifdef NO_USE_GST_HLSDEMUX
if ((path = strstr(uri, "m3u")))
{
- debug_log ("++++++++++++++++++++ M3U +++++++++++++++++++++\n");
- debug_log ("\n\n\n\n \t HLS profile \n\n\n");
data->uri_type = MM_PLAYER_URI_TYPE_HLS;
}
else
#ifdef NO_USE_GST_HLSDEMUX
if ((path = strstr(uri, "m3u")))
{
- debug_log ("++++++++++++++++++++ M3U +++++++++++++++++++++\n");
- debug_log ("\n\n\n\n \t HLS profile \n\n\n");
data->uri_type = MM_PLAYER_URI_TYPE_HLS;
}
else
debug_error("failed to autoplug for type : %s\n", player->type);
if ( ( PLAYER_INI()->async_start ) &&
- ( ! MMPLAYER_IS_RTSP_STREAMING ( player ) ) &&
( player->posted_msg == FALSE ) )
{
__mmplayer_post_missed_plugin( player );
/* check factory class for filtering */
klass = gst_element_factory_get_klass(GST_ELEMENT_FACTORY(factory));
- if ( MMPLAYER_IS_RTSP_STREAMING( player ) )
- {
- if ( g_strrstr(klass, "Parse") )
- {
- debug_log("streaming doesn't need any parser. skipping [%s]\n",
- GST_PLUGIN_FEATURE_NAME (factory) );
-
- continue;
- }
- }
-
/* NOTE : msl don't need to use image plugins.
* So, those plugins should be skipped for error handling.
*/
debug_log("mimetype to check: %s\n", mime );
- if ( MMPLAYER_IS_RTSP_STREAMING(player) )
- goto DONE;
-
/* add missing plugin */
/* NOTE : msl should check missing plugin for image mime type.
* Some motion jpeg clips can have playable audio track.
player->pipeline_is_constructed = TRUE;
if ( ( PLAYER_INI()->async_start ) &&
- ( ! MMPLAYER_IS_RTSP_STREAMING ( player ) ) &&
( player->posted_msg == FALSE ) )
{
__mmplayer_post_missed_plugin( player );
result = __gst_send_event_to_sink( player, event );
- /* Note : After sending seek event, the sink elements receive flush event
- * Not only buffering state but after seeking, state_lost needs to be set to TRUE.
- */
- if ( MMPLAYER_IS_RTSP_STREAMING ( player ) && result )
- player->state_lost = TRUE;
-
debug_fleave();
return result;