From c75114628d196af563a3d7e9504bd84efe1ce761 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 26 May 2002 21:59:22 +0000 Subject: [PATCH] - Changed plugins for new APIs Original commit message from CVS: - Changed plugins for new APIs - modularized audiofile. - added seeking, query and convert functions for mad, mpeg2dec, avidemux, mpegdemux, mpegparse - sync updates to oss. removed the ossclock for now --- ext/gnomevfs/gstgnomevfssrc.c | 16 ++++++++++------ ext/vorbis/vorbisdec.c | 18 ++++++++++++++---- sys/v4l/gstv4lmjpegsink.c | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index 784afc24cf..a5f0a3c7fa 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.c @@ -556,14 +556,18 @@ gst_gnomevfssrc_srcpad_event (GstPad *pad, GstEvent *event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: - switch (GST_EVENT_SEEK_TYPE (event)) { - case GST_SEEK_BYTEOFFSET_SET: + { + if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) { + return FALSE; + } + switch (GST_EVENT_SEEK_METHOD (event)) { + case GST_SEEK_METHOD_SET: src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event); break; - case GST_SEEK_BYTEOFFSET_CUR: + case GST_SEEK_METHOD_CUR: src->curoffset += GST_EVENT_SEEK_OFFSET (event); break; - case GST_SEEK_BYTEOFFSET_END: + case GST_SEEK_METHOD_END: src->curoffset = src->size - ABS (GST_EVENT_SEEK_OFFSET (event)); break; default: @@ -572,10 +576,10 @@ gst_gnomevfssrc_srcpad_event (GstPad *pad, GstEvent *event) } g_object_notify (G_OBJECT (src), "offset"); src->seek_happened = TRUE; - src->need_flush = GST_EVENT_SEEK_FLUSH(event); - gst_event_free (event); + src->need_flush = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH; /* push a discontinuous event? */ break; + } case GST_EVENT_FLUSH: src->need_flush = TRUE; break; diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 193816c5f8..e4f88d3d96 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -218,8 +218,11 @@ gst_vorbisdec_loop (GstElement * element) /* submit a 4k block to libvorbis' Ogg layer */ buf = gst_vorbisdec_pull (vorbisdec, &oy); - if (!buf) + if (!buf) { + eos = 1; + GST_DEBUG (0, "vorbisdec: pulled NULL"); break; + } bytes = GST_BUFFER_SIZE (buf); buffer = ogg_sync_buffer (&oy, bytes); @@ -446,8 +449,10 @@ gst_vorbisdec_loop (GstElement * element) } } } - if (ogg_page_eos (&og)) + if (ogg_page_eos (&og)) { eos = 1; + GST_DEBUG (0, "vorbisdec: page_eos"); + } } } if (!eos) { @@ -462,17 +467,18 @@ gst_vorbisdec_loop (GstElement * element) ogg_sync_wrote (&oy, bytes); if (bytes == 0) { - gst_pad_push (vorbisdec->srcpad, GST_BUFFER (gst_event_new (GST_EVENT_EOS))); - gst_element_set_eos (GST_ELEMENT (vorbisdec)); eos = 1; + GST_DEBUG (0, "vorbisdec: wrote 0 bytes"); } } else { eos = 1; + GST_DEBUG (0, "vorbisdec: pulled NULL"); } } } + GST_DEBUG (0, "vorbisdec: eos flag set"); /* clean up this logical bitstream; before exit we see if we're followed by another [chained] */ @@ -486,6 +492,10 @@ gst_vorbisdec_loop (GstElement * element) vorbis_info_clear (&vorbisdec->vi); /* must be called last */ } end: + GST_DEBUG (0, "vorbisdec: in end"); + + gst_pad_push (vorbisdec->srcpad, GST_BUFFER (gst_event_new (GST_EVENT_EOS))); + gst_element_set_eos (GST_ELEMENT (vorbisdec)); /* OK, clean up the framer */ ogg_sync_clear (&oy); diff --git a/sys/v4l/gstv4lmjpegsink.c b/sys/v4l/gstv4lmjpegsink.c index 6813b5718f..a91b16861c 100644 --- a/sys/v4l/gstv4lmjpegsink.c +++ b/sys/v4l/gstv4lmjpegsink.c @@ -241,7 +241,7 @@ gst_v4lmjpegsink_chain (GstPad *pad, if (jitter > 500000 || jitter < -500000) GST_DEBUG (0, "jitter: %lld", jitter); - gst_element_clock_wait(GST_ELEMENT(v4lmjpegsink), v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP(buf)); + gst_element_clock_wait(GST_ELEMENT(v4lmjpegsink), v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP(buf), NULL); } /* check size */