# HG changeset patch # User renatofilho # Date 1164753107 0 # Node ID ce8246fe60a2f767b581d419c63846a6188840d9 # Parent c8fd7abae511dc75bc79c7e10380c7d2c651d068 [svn r134] diff -r c8fd7abae511 -r ce8246fe60a2 gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Tue Nov 28 21:05:25 2006 +0000 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Tue Nov 28 22:31:47 2006 +0000 @@ -349,6 +349,7 @@ static void gst_nuv_demux_init (GstNuvDemux * nuv, GstNuvDemuxClass * nuv_class) { + g_debug ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); nuv->priv = GST_NUV_DEMUX_GET_PRIVATE (nuv); nuv->priv->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_activate_function (nuv->priv->sinkpad, gst_nuv_demux_sink_activate); @@ -365,6 +366,10 @@ nuv->priv->new_audio_segment = TRUE; nuv->priv->new_video_segment = TRUE; + /* creating adapter */ + nuv->priv->mode = NUV_PUSH_MODE; + nuv->priv->adapter = gst_adapter_new (); + gst_nuv_demux_reset (nuv); } @@ -619,9 +624,9 @@ { GstPad *pad = NULL; pad = gst_pad_new_from_static_template (template, name); - gst_pad_use_fixed_caps (pad); gst_pad_set_caps (pad, caps); gst_pad_set_active (pad, TRUE); + gst_pad_use_fixed_caps (pad); gst_element_add_pad (GST_ELEMENT (nuv), pad); return pad; @@ -1100,8 +1105,10 @@ GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad)); if (gst_pad_check_pull_range (sinkpad)) { + g_debug ("PULL"); res = gst_pad_activate_pull (sinkpad, TRUE); } else { + g_debug ("PUSH"); res = gst_pad_activate_push (sinkpad, TRUE); } g_object_unref (nuv); @@ -1113,6 +1120,7 @@ { GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad)); + g_debug ("gst_nuv_demux_sink_activate_pull: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx"); if (active) { GST_DEBUG_OBJECT (nuv, "activating pull function"); nuv->priv->mode = NUV_PULL_MODE; @@ -1136,13 +1144,10 @@ { GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (pad)); + + g_debug ("gst_nuv_demux_sink_activate_push: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx"); + if (active) { - nuv->priv->mode = NUV_PUSH_MODE; - if (nuv->priv->adapter) { - gst_adapter_clear (nuv->priv->adapter); - } else { - nuv->priv->adapter = gst_adapter_new (); - } GST_DEBUG_OBJECT (nuv, "activating push/chain function"); } else { GST_DEBUG_OBJECT (nuv, "deactivating push/chain function"); @@ -1191,7 +1196,6 @@ &start, &stop, &time); GST_DEBUG_OBJECT (nuv, "got newsegment, start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, start, stop); - g_debug ("got newsegment, start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, start, stop); nuv->priv->duration_bytes = stop - start; gst_event_unref (event); res = TRUE; @@ -1296,7 +1300,9 @@ switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: + g_debug ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxxxx= RESET"); gst_nuv_demux_reset (GST_NUV_DEMUX (element)); + gst_nuv_demux_destoy_src_pad (GST_NUV_DEMUX (element)); break; default: break;