gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c
branchtrunk
changeset 79 108aa689d2e5
parent 78 ac7e49c234d8
child 80 fe9a9dca8f18
     1.1 --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c	Fri Nov 10 19:35:39 2006 +0000
     1.2 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c	Mon Nov 13 18:36:14 2006 +0000
     1.3 @@ -87,7 +87,6 @@
     1.4      GST_PAD_SOMETIMES,
     1.5      GST_STATIC_CAPS_ANY);
     1.6  
     1.7 -/* NUV Demux plug-in time-line functions */
     1.8  static void gst_nuv_demux_finalize (GObject * object);
     1.9  static GstStateChangeReturn gst_nuv_demux_change_state (GstElement * element,
    1.10      GstStateChange transition);
    1.11 @@ -371,6 +370,7 @@
    1.12    return res;
    1.13  }
    1.14  
    1.15 +//TODO: create a function to control events and send to src pads
    1.16  static void
    1.17  gst_nuv_demux_create_pads (GstNuvDemux * nuv)
    1.18  {
    1.19 @@ -438,6 +438,7 @@
    1.20    return ret;
    1.21  }
    1.22  
    1.23 +//TODO: send a new segment event before the firts data
    1.24  static GstFlowReturn
    1.25  gst_nuv_demux_stream_data (GstNuvDemux * nuv)
    1.26  {
    1.27 @@ -762,6 +763,7 @@
    1.28      gst_pad_push_event (nuv->src_audio_pad, gst_event_new_eos ());
    1.29  }
    1.30  
    1.31 +//TODO: try use "gst_pad_alloc_buffer" function
    1.32  static GstFlowReturn
    1.33  gst_nuv_demux_read_bytes (GstNuvDemux * nuv, guint64 size, gboolean move,
    1.34      GstBuffer ** buffer)
    1.35 @@ -813,12 +815,6 @@
    1.36    GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad));
    1.37  
    1.38    if (gst_pad_check_pull_range (sinkpad)) {
    1.39 -    nuv->mode = 0;
    1.40 -    if (nuv->adapter) {
    1.41 -      gst_adapter_clear (nuv->adapter);
    1.42 -      g_object_unref (nuv->adapter);
    1.43 -      nuv->adapter = NULL;
    1.44 -    }
    1.45      res = gst_pad_activate_pull (sinkpad, TRUE);
    1.46    } else {
    1.47      nuv->mode = 1;
    1.48 @@ -839,6 +835,12 @@
    1.49    GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad));
    1.50  
    1.51    if (active) {
    1.52 +    nuv->mode = 0;
    1.53 +    if (nuv->adapter) {
    1.54 +      gst_adapter_clear (nuv->adapter);
    1.55 +      g_object_unref (nuv->adapter);
    1.56 +      nuv->adapter = NULL;
    1.57 +    }
    1.58      gst_pad_start_task (sinkpad, (GstTaskFunction) gst_nuv_demux_loop, sinkpad);
    1.59    } else {
    1.60      gst_pad_stop_task (sinkpad);