- 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
This commit is contained in:
Wim Taymans 2002-05-26 21:59:22 +00:00
parent dd54b67104
commit c75114628d
3 changed files with 25 additions and 11 deletions

View file

@ -556,14 +556,18 @@ gst_gnomevfssrc_srcpad_event (GstPad *pad, GstEvent *event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK: 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); src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
break; break;
case GST_SEEK_BYTEOFFSET_CUR: case GST_SEEK_METHOD_CUR:
src->curoffset += GST_EVENT_SEEK_OFFSET (event); src->curoffset += GST_EVENT_SEEK_OFFSET (event);
break; break;
case GST_SEEK_BYTEOFFSET_END: case GST_SEEK_METHOD_END:
src->curoffset = src->size - ABS (GST_EVENT_SEEK_OFFSET (event)); src->curoffset = src->size - ABS (GST_EVENT_SEEK_OFFSET (event));
break; break;
default: default:
@ -572,10 +576,10 @@ gst_gnomevfssrc_srcpad_event (GstPad *pad, GstEvent *event)
} }
g_object_notify (G_OBJECT (src), "offset"); g_object_notify (G_OBJECT (src), "offset");
src->seek_happened = TRUE; src->seek_happened = TRUE;
src->need_flush = GST_EVENT_SEEK_FLUSH(event); src->need_flush = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH;
gst_event_free (event);
/* push a discontinuous event? */ /* push a discontinuous event? */
break; break;
}
case GST_EVENT_FLUSH: case GST_EVENT_FLUSH:
src->need_flush = TRUE; src->need_flush = TRUE;
break; break;

View file

@ -218,8 +218,11 @@ gst_vorbisdec_loop (GstElement * element)
/* submit a 4k block to libvorbis' Ogg layer */ /* submit a 4k block to libvorbis' Ogg layer */
buf = gst_vorbisdec_pull (vorbisdec, &oy); buf = gst_vorbisdec_pull (vorbisdec, &oy);
if (!buf) if (!buf) {
eos = 1;
GST_DEBUG (0, "vorbisdec: pulled NULL");
break; break;
}
bytes = GST_BUFFER_SIZE (buf); bytes = GST_BUFFER_SIZE (buf);
buffer = ogg_sync_buffer (&oy, bytes); 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; eos = 1;
GST_DEBUG (0, "vorbisdec: page_eos");
}
} }
} }
if (!eos) { if (!eos) {
@ -462,17 +467,18 @@ gst_vorbisdec_loop (GstElement * element)
ogg_sync_wrote (&oy, bytes); ogg_sync_wrote (&oy, bytes);
if (bytes == 0) { 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; eos = 1;
GST_DEBUG (0, "vorbisdec: wrote 0 bytes");
} }
} }
else { else {
eos = 1; 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 /* clean up this logical bitstream; before exit we see if we're
followed by another [chained] */ followed by another [chained] */
@ -486,6 +492,10 @@ gst_vorbisdec_loop (GstElement * element)
vorbis_info_clear (&vorbisdec->vi); /* must be called last */ vorbis_info_clear (&vorbisdec->vi); /* must be called last */
} }
end: 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 */ /* OK, clean up the framer */
ogg_sync_clear (&oy); ogg_sync_clear (&oy);

View file

@ -241,7 +241,7 @@ gst_v4lmjpegsink_chain (GstPad *pad,
if (jitter > 500000 || jitter < -500000) if (jitter > 500000 || jitter < -500000)
GST_DEBUG (0, "jitter: %lld", jitter); 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 */ /* check size */