+2004-03-06 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * ext/vorbis/vorbis.c: (plugin_init):
+ * ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
+ (gst_vorbis_dec_init), (vorbis_dec_event):
+ add debug category
+ make vorbisdec handle _BYTE and _TIME queries
+
2004-03-06 Christophe Fergeau <teuf@gnome.org>
* ext/mad/gstmad.c: (gst_mad_chain): send the average bitrate read
#include <string.h>
#include <gst/tag/tag.h>
+GST_DEBUG_CATEGORY_EXTERN (vorbisdec_debug);
+#define GST_CAT_DEFAULT vorbisdec_debug
+
static GstElementDetails vorbis_dec_details = {
"VorbisDec",
"Codec/Decoder/Audio",
GstData * data);
static GstElementStateReturn
vorbis_dec_change_state (GstElement * element);
+static const GstFormat*
+ vorbis_dec_get_formats (GstPad *pad);
+
static gboolean vorbis_dec_src_event (GstPad * pad,
GstEvent * event);
static gboolean vorbis_dec_src_query (GstPad * pad,
gstelement_class->change_state = vorbis_dec_change_state;
}
+static const GstFormat *
+vorbis_dec_get_formats (GstPad *pad)
+{
+ static const GstFormat src_formats[] = {
+ GST_FORMAT_BYTES,
+ GST_FORMAT_DEFAULT,
+ GST_FORMAT_TIME,
+ 0
+ };
+ static const GstFormat sink_formats[] = {
+ GST_FORMAT_BYTES,
+ GST_FORMAT_TIME,
+ 0
+ };
+ return (GST_PAD_IS_SRC (pad) ? src_formats : sink_formats);
+}
+
static GstPadLinkReturn
vorbis_dec_link (GstPad *pad, const GstCaps *caps)
{
dec->sinkpad = gst_pad_new_from_template(
gst_static_pad_template_get (&vorbis_dec_sink_factory), "sink");
gst_pad_set_chain_function (dec->sinkpad, vorbis_dec_chain);
+ gst_pad_set_formats_function (dec->sinkpad, vorbis_dec_get_formats);
gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
dec->srcpad = gst_pad_new_from_template(
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_pad_set_formats_function (dec->srcpad, vorbis_dec_get_formats);
gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
GST_FLAG_SET (dec, GST_ELEMENT_EVENT_AWARE);
case GST_EVENT_DISCONTINUOUS:
if (gst_event_discont_get_value (event, GST_FORMAT_DEFAULT, &value)) {
dec->granulepos = value;
- GST_DEBUG_OBJECT (dec, "setting granuleposition to %"G_GUINT64_FORMAT" after discont\n", value);
+ GST_DEBUG_OBJECT (dec, "setting granuleposition to %"G_GUINT64_FORMAT" after discont", value);
} else {
GST_WARNING_OBJECT (dec,
"discont event didn't include offset, we might set it wrong now");