[svn r134] trunk
authorrenatofilho
Tue Nov 28 22:31:47 2006 +0000 (2006-11-28)
branchtrunk
changeset 133ce8246fe60a2
parent 132 c8fd7abae511
child 134 458fb60cd827
[svn r134]
gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c
     1.1 --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c	Tue Nov 28 21:05:25 2006 +0000
     1.2 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c	Tue Nov 28 22:31:47 2006 +0000
     1.3 @@ -349,6 +349,7 @@
     1.4  static void
     1.5  gst_nuv_demux_init (GstNuvDemux * nuv, GstNuvDemuxClass * nuv_class)
     1.6  {
     1.7 +    g_debug ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
     1.8    nuv->priv = GST_NUV_DEMUX_GET_PRIVATE (nuv);
     1.9    nuv->priv->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
    1.10    gst_pad_set_activate_function (nuv->priv->sinkpad, gst_nuv_demux_sink_activate);
    1.11 @@ -365,6 +366,10 @@
    1.12    nuv->priv->new_audio_segment = TRUE;
    1.13    nuv->priv->new_video_segment = TRUE;
    1.14  
    1.15 +  /* creating adapter */
    1.16 +  nuv->priv->mode = NUV_PUSH_MODE;
    1.17 +  nuv->priv->adapter = gst_adapter_new ();
    1.18 +
    1.19    gst_nuv_demux_reset (nuv);
    1.20  }
    1.21  
    1.22 @@ -619,9 +624,9 @@
    1.23  {
    1.24      GstPad *pad = NULL;
    1.25      pad = gst_pad_new_from_static_template (template, name);
    1.26 -    gst_pad_use_fixed_caps (pad);
    1.27      gst_pad_set_caps (pad, caps);
    1.28      gst_pad_set_active (pad, TRUE);
    1.29 +    gst_pad_use_fixed_caps (pad);
    1.30      gst_element_add_pad (GST_ELEMENT (nuv), pad);
    1.31  
    1.32      return pad;
    1.33 @@ -1100,8 +1105,10 @@
    1.34    GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad));
    1.35  
    1.36    if (gst_pad_check_pull_range (sinkpad)) {
    1.37 +      g_debug ("PULL");
    1.38      res = gst_pad_activate_pull (sinkpad, TRUE);
    1.39    } else {
    1.40 +      g_debug ("PUSH");
    1.41      res = gst_pad_activate_push (sinkpad, TRUE);
    1.42    }
    1.43    g_object_unref (nuv);
    1.44 @@ -1113,6 +1120,7 @@
    1.45  {
    1.46    GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad));
    1.47  
    1.48 +  g_debug ("gst_nuv_demux_sink_activate_pull: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx");
    1.49    if (active) {
    1.50      GST_DEBUG_OBJECT (nuv, "activating pull function");
    1.51      nuv->priv->mode = NUV_PULL_MODE;
    1.52 @@ -1136,13 +1144,10 @@
    1.53  {
    1.54    GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (pad));
    1.55  
    1.56 +
    1.57 +  g_debug ("gst_nuv_demux_sink_activate_push: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx");
    1.58 +
    1.59    if (active) {
    1.60 -    nuv->priv->mode = NUV_PUSH_MODE;
    1.61 -    if (nuv->priv->adapter) {
    1.62 -      gst_adapter_clear (nuv->priv->adapter);
    1.63 -    } else {
    1.64 -      nuv->priv->adapter = gst_adapter_new ();
    1.65 -    }
    1.66      GST_DEBUG_OBJECT (nuv, "activating push/chain function");
    1.67    } else {
    1.68      GST_DEBUG_OBJECT (nuv, "deactivating push/chain function");
    1.69 @@ -1191,7 +1196,6 @@
    1.70            &start, &stop, &time);
    1.71  
    1.72        GST_DEBUG_OBJECT (nuv, "got newsegment, start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, start, stop);
    1.73 -      g_debug ("got newsegment, start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, start, stop);
    1.74        nuv->priv->duration_bytes = stop - start;
    1.75        gst_event_unref (event);
    1.76        res = TRUE;
    1.77 @@ -1296,7 +1300,9 @@
    1.78  
    1.79    switch (transition) {
    1.80      case GST_STATE_CHANGE_READY_TO_PAUSED:
    1.81 +      g_debug ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxxxx= RESET");        
    1.82        gst_nuv_demux_reset (GST_NUV_DEMUX (element));
    1.83 +      gst_nuv_demux_destoy_src_pad (GST_NUV_DEMUX (element));
    1.84        break;
    1.85      default:
    1.86        break;