ext/ffmpeg/gstffmpegcodecmap.c: removee video/x-theora from vp3 decoder, it doesn't handle raw theora streams

Original commit message from CVS:
2004-01-30  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
removee video/x-theora from vp3 decoder, it doesn't handle raw
theora streams
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init):
fix bug with finalizing element that never went to PAUSED
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_query):
length and position queries were swapped
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_from_granulepos), (vorbis_dec_src_query),
(vorbis_dec_src_event):
implement querying time and bytes
This commit is contained in:
Benjamin Otte 2004-01-30 03:51:04 +00:00
parent 03caa97b73
commit ef502795dc
3 changed files with 62 additions and 5 deletions

View file

@ -1,3 +1,17 @@
2004-01-30 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
removee video/x-theora from vp3 decoder, it doesn't handle raw
theora streams
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init):
fix bug with finalizing element that never went to PAUSED
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_query):
length and position queries were swapped
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_from_granulepos), (vorbis_dec_src_query),
(vorbis_dec_src_event):
implement querying time and bytes
2004-01-30 Thomas Vander Stichele <thomas at apestaart dot org>
* just about every source file:

View file

@ -211,6 +211,7 @@ gst_ogg_demux_init (GstOggDemux *ogg)
/* initalize variables */
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_START);
ogg->chains = g_array_new (TRUE, TRUE, sizeof (GstOggChain));
ogg->current_chain = -1;
GST_FLAG_SET (ogg, GST_ELEMENT_EVENT_AWARE);
}
@ -273,14 +274,14 @@ gst_ogg_demux_src_query (GstPad *pad, GstQueryType type,
switch (type) {
case GST_QUERY_TOTAL: {
if (*format == GST_FORMAT_DEFAULT) {
*value = cur->known_offset;
*value = cur->length;
res = TRUE;
}
break;
}
case GST_QUERY_POSITION:
if (*format == GST_FORMAT_DEFAULT && cur->length != 0) {
*value = cur->length;
*value = cur->known_offset;
res = TRUE;
}
break;

View file

@ -78,6 +78,10 @@ static GstElementStateReturn
vorbis_dec_change_state (GstElement * element);
static gboolean vorbis_dec_src_event (GstPad * pad,
GstEvent * event);
static gboolean vorbis_dec_src_query (GstPad * pad,
GstQueryType query,
GstFormat * format,
gint64 * value);
static void
@ -144,11 +148,13 @@ gst_vorbis_dec_init (GstVorbisDec *dec)
gst_pad_set_link_function (dec->srcpad, vorbis_dec_link);
gst_pad_set_getcaps_function (dec->srcpad, vorbis_dec_getcaps);
gst_pad_set_event_function (dec->srcpad, vorbis_dec_src_event);
gst_pad_set_query_function (dec->srcpad, vorbis_dec_src_query);
gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
GST_FLAG_SET (dec, GST_ELEMENT_EVENT_AWARE);
}
/* FIXME: plug this to the pad convert function */
static gboolean
vorbis_dec_to_granulepos (GstVorbisDec *dec, GstFormat format, guint64 from, guint64 *to)
{
@ -169,13 +175,49 @@ vorbis_dec_to_granulepos (GstVorbisDec *dec, GstFormat format, guint64 from, gui
}
}
static gboolean
vorbis_dec_from_granulepos (GstVorbisDec *dec, GstFormat format, guint64 from, guint64 *to)
{
if (dec->packetno < 1) return FALSE;
switch (format) {
case GST_FORMAT_TIME:
*to = from * GST_SECOND / dec->vi.rate;
return TRUE;
case GST_FORMAT_DEFAULT:
*to = from;
return TRUE;
case GST_FORMAT_BYTES:
*to = from * sizeof (float) * dec->vi.channels;
return TRUE;
default:
return FALSE;
}
}
static gboolean
vorbis_dec_src_query (GstPad *pad, GstQueryType query, GstFormat *format, gint64 *value)
{
gint64 granulepos;
GstVorbisDec *dec = GST_VORBIS_DEC (gst_pad_get_parent (pad));
GstFormat my_format = GST_FORMAT_DEFAULT;
if (!gst_pad_query (GST_PAD_PEER (dec->sinkpad), query, &my_format, &granulepos))
return FALSE;
if (!vorbis_dec_from_granulepos (dec, *format, granulepos, value))
return FALSE;
g_print ("peer returned granulepos: %llu - we return %llu\n", granulepos, *value);
return TRUE;
}
static gboolean
vorbis_dec_src_event (GstPad *pad, GstEvent *event)
{
gboolean res = TRUE;
GstVorbisDec *dec;
dec = GST_VORBIS_DEC (gst_pad_get_parent (pad));
GstVorbisDec *dec = GST_VORBIS_DEC (gst_pad_get_parent (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK: {