mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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:
parent
03caa97b73
commit
ef502795dc
3 changed files with 62 additions and 5 deletions
14
ChangeLog
14
ChangeLog
|
@ -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>
|
2004-01-30 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* just about every source file:
|
* just about every source file:
|
||||||
|
|
|
@ -211,6 +211,7 @@ gst_ogg_demux_init (GstOggDemux *ogg)
|
||||||
/* initalize variables */
|
/* initalize variables */
|
||||||
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_START);
|
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_START);
|
||||||
ogg->chains = g_array_new (TRUE, TRUE, sizeof (GstOggChain));
|
ogg->chains = g_array_new (TRUE, TRUE, sizeof (GstOggChain));
|
||||||
|
ogg->current_chain = -1;
|
||||||
|
|
||||||
GST_FLAG_SET (ogg, GST_ELEMENT_EVENT_AWARE);
|
GST_FLAG_SET (ogg, GST_ELEMENT_EVENT_AWARE);
|
||||||
}
|
}
|
||||||
|
@ -273,14 +274,14 @@ gst_ogg_demux_src_query (GstPad *pad, GstQueryType type,
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_QUERY_TOTAL: {
|
case GST_QUERY_TOTAL: {
|
||||||
if (*format == GST_FORMAT_DEFAULT) {
|
if (*format == GST_FORMAT_DEFAULT) {
|
||||||
*value = cur->known_offset;
|
*value = cur->length;
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
if (*format == GST_FORMAT_DEFAULT && cur->length != 0) {
|
if (*format == GST_FORMAT_DEFAULT && cur->length != 0) {
|
||||||
*value = cur->length;
|
*value = cur->known_offset;
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -78,6 +78,10 @@ static GstElementStateReturn
|
||||||
vorbis_dec_change_state (GstElement * element);
|
vorbis_dec_change_state (GstElement * element);
|
||||||
static gboolean vorbis_dec_src_event (GstPad * pad,
|
static gboolean vorbis_dec_src_event (GstPad * pad,
|
||||||
GstEvent * event);
|
GstEvent * event);
|
||||||
|
static gboolean vorbis_dec_src_query (GstPad * pad,
|
||||||
|
GstQueryType query,
|
||||||
|
GstFormat * format,
|
||||||
|
gint64 * value);
|
||||||
|
|
||||||
|
|
||||||
static void
|
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_link_function (dec->srcpad, vorbis_dec_link);
|
||||||
gst_pad_set_getcaps_function (dec->srcpad, vorbis_dec_getcaps);
|
gst_pad_set_getcaps_function (dec->srcpad, vorbis_dec_getcaps);
|
||||||
gst_pad_set_event_function (dec->srcpad, vorbis_dec_src_event);
|
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_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
|
||||||
|
|
||||||
GST_FLAG_SET (dec, GST_ELEMENT_EVENT_AWARE);
|
GST_FLAG_SET (dec, GST_ELEMENT_EVENT_AWARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: plug this to the pad convert function */
|
||||||
static gboolean
|
static gboolean
|
||||||
vorbis_dec_to_granulepos (GstVorbisDec *dec, GstFormat format, guint64 from, guint64 *to)
|
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
|
static gboolean
|
||||||
vorbis_dec_src_event (GstPad *pad, GstEvent *event)
|
vorbis_dec_src_event (GstPad *pad, GstEvent *event)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
GstVorbisDec *dec;
|
GstVorbisDec *dec = GST_VORBIS_DEC (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
dec = GST_VORBIS_DEC (gst_pad_get_parent (pad));
|
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK: {
|
case GST_EVENT_SEEK: {
|
||||||
|
|
Loading…
Reference in a new issue