From 00b0cdf8ffdeba94ce837f1f71d5677fa7756806 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 14 Jan 2004 10:48:18 +0000 Subject: [PATCH] ext/divx/: Set category to divx4linux instead of divx (too generic). Original commit message from CVS: 2004-01-14 Ronald Bultje * ext/divx/gstdivxdec.c: * ext/divx/gstdivxenc.c: Set category to divx4linux instead of divx (too generic). * gst/wavparse/gstwavparse.c: (gst_wavparse_init), (gst_wavparse_parse_fmt), (gst_wavparse_handle_sink_event), (gst_wavparse_loop), (gst_wavparse_change_state): * gst/wavparse/gstwavparse.h: fix parsing of WAV files with non-standard fmt-tag size and fix skipping of unrecognized chunks... Someone please fix this thing to use rifflib so all this is automated. * sys/v4l/Makefile.am: * sys/v4l2/Makefile.am: Add X_CFLAGS because we depend on X (for overlay). --- ChangeLog | 16 +++++++++++++++ gst/wavparse/gstwavparse.c | 49 ++++++++++++++-------------------------------- gst/wavparse/gstwavparse.h | 1 - sys/v4l2/Makefile.am | 2 +- 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f75df0..bef180a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2004-01-14 Ronald Bultje + + * ext/divx/gstdivxdec.c: + * ext/divx/gstdivxenc.c: + Set category to divx4linux instead of divx (too generic). + * gst/wavparse/gstwavparse.c: (gst_wavparse_init), + (gst_wavparse_parse_fmt), (gst_wavparse_handle_sink_event), + (gst_wavparse_loop), (gst_wavparse_change_state): + * gst/wavparse/gstwavparse.h: + fix parsing of WAV files with non-standard fmt-tag size and fix + skipping of unrecognized chunks... Someone please fix this thing + to use rifflib so all this is automated. + * sys/v4l/Makefile.am: + * sys/v4l2/Makefile.am: + Add X_CFLAGS because we depend on X (for overlay). + 2004-01-14 Jan Schmidt * ext/mpeg2dec/gstmpeg2dec.c: diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 1635508..73468f4 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -47,7 +47,6 @@ static gboolean gst_wavparse_pad_convert (GstPad *pad, gint64 *dest_value); static void gst_wavparse_loop (GstElement *element); -static GstCaps * gst_wavparse_getcaps (GstPad *pad); static const GstEventMask* gst_wavparse_get_event_masks (GstPad *pad); static gboolean gst_wavparse_srcpad_event (GstPad *pad, GstEvent *event); @@ -195,6 +194,7 @@ gst_wavparse_init (GstWavParse *wavparse) /* source */ wavparse->srcpad = gst_pad_new_from_template (gst_static_pad_template_get (&src_template_factory), "src"); + gst_pad_use_explicit_caps (wavparse->srcpad); gst_element_add_pad (GST_ELEMENT (wavparse), wavparse->srcpad); gst_pad_set_formats_function (wavparse->srcpad, gst_wavparse_get_formats); gst_pad_set_convert_function (wavparse->srcpad, gst_wavparse_pad_convert); @@ -203,8 +203,6 @@ gst_wavparse_init (GstWavParse *wavparse) gst_pad_set_query_function (wavparse->srcpad, gst_wavparse_pad_query); gst_pad_set_event_function (wavparse->srcpad, gst_wavparse_srcpad_event); gst_pad_set_event_mask_function (wavparse->srcpad, gst_wavparse_get_event_masks); - gst_pad_set_getcaps_function (wavparse->srcpad, gst_wavparse_getcaps); - wavparse->caps = NULL; gst_element_set_loop_function (GST_ELEMENT (wavparse), gst_wavparse_loop); @@ -598,7 +596,7 @@ gst_wavparse_parse_cues (GstWavParse *wavparse, #endif static void -gst_wavparse_parse_fmt (GstWavParse *wavparse) +gst_wavparse_parse_fmt (GstWavParse *wavparse, guint size) { GstWavParseFormat *format; GstCaps *caps = NULL; @@ -610,7 +608,7 @@ gst_wavparse_parse_fmt (GstWavParse *wavparse) format = (GstWavParseFormat *) fmtdata; if (got_bytes == sizeof (GstWavParseFormat)) { - gst_bytestream_flush (bs, got_bytes); + gst_bytestream_flush (bs, size); wavparse->bps = GUINT16_FROM_LE (format->wBlockAlign); wavparse->rate = GUINT32_FROM_LE (format->dwSamplesPerSec); wavparse->channels = GUINT16_FROM_LE (format->wChannels); @@ -664,30 +662,14 @@ gst_wavparse_parse_fmt (GstWavParse *wavparse) return; } - if (wavparse->caps) - gst_caps_free (wavparse->caps); - wavparse->caps = caps ? gst_caps_copy (caps) : gst_caps_new_empty (); if (caps) - gst_pad_try_set_caps (wavparse->srcpad, caps); + gst_pad_set_explicit_caps (wavparse->srcpad, caps); GST_DEBUG ("frequency %d, channels %d", wavparse->rate, wavparse->channels); } } -static GstCaps * -gst_wavparse_getcaps (GstPad *pad) -{ - GstWavParse *wavparse = GST_WAVPARSE (gst_pad_get_parent (pad)); - GstPadTemplate *templ; - - if (wavparse->caps) - return gst_caps_copy (wavparse->caps); - - templ = gst_static_pad_template_get (&src_template_factory); - return gst_caps_copy (gst_pad_template_get_caps (templ)); -} - static gboolean gst_wavparse_handle_sink_event (GstWavParse *wavparse) { @@ -697,14 +679,12 @@ gst_wavparse_handle_sink_event (GstWavParse *wavparse) gboolean res = TRUE; gst_bytestream_get_status (wavparse->bs, &remaining, &event); -g_print ("Handle sink event\n"); type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN; GST_DEBUG ("wavparse: event %p %d", event, type); switch (type) { case GST_EVENT_EOS: -g_print ("EOS\n"); gst_bytestream_flush (wavparse->bs, remaining); gst_pad_event_default (wavparse->sinkpad, event); res = FALSE; @@ -871,7 +851,8 @@ gst_wavparse_loop (GstElement *element) break; case GST_RIFF_TAG_fmt: - gst_wavparse_parse_fmt (wavparse); + gst_wavparse_parse_fmt (wavparse, chunk.size); + flush = 0; break; case GST_RIFF_TAG_cue: @@ -883,23 +864,26 @@ gst_wavparse_loop (GstElement *element) switch (chunk.type) { case GST_RIFF_LIST_INFO: //gst_wavparse_parse_info (wavparse, chunk.size - 4); - flush = 0; + //flush = 0; break; case GST_RIFF_LIST_adtl: //gst_wavparse_parse_adtl (wavparse, chunk.size - 4); - flush = 0; + //flush = 0; break; default: - flush = 0; + //flush = 0; break; } - flush = 0; + default: + GST_DEBUG (" ***** unknown chunkid %08x", chunk.id); + //flush = 0; break; } + break; case GST_WAVPARSE_DATA: /* Should have been handled up there ^^^^ */ @@ -908,7 +892,8 @@ gst_wavparse_loop (GstElement *element) default: /* Unknown */ - GST_DEBUG (" ***** unknown chunkid %08x", chunk.id); + g_warning ("Unknown state %d\n", wavparse->state); + //GST_DEBUG (" ***** unknown chunkid %08x", chunk.id); break; } @@ -1118,10 +1103,6 @@ gst_wavparse_change_state (GstElement *element) wavparse->bps = 0; wavparse->seek_pending = FALSE; wavparse->seek_offset = 0; - if (wavparse->caps) { - gst_caps_free (wavparse->caps); - wavparse->caps = NULL; - } break; case GST_STATE_READY_TO_NULL: break; diff --git a/gst/wavparse/gstwavparse.h b/gst/wavparse/gstwavparse.h index 802ecee..3893a29 100644 --- a/gst/wavparse/gstwavparse.h +++ b/gst/wavparse/gstwavparse.h @@ -57,7 +57,6 @@ struct _GstWavParse { GstByteStream *bs; /* pads */ GstPad *sinkpad,*srcpad; - GstCaps *caps; /* WAVE decoding state */ gint state; diff --git a/sys/v4l2/Makefile.am b/sys/v4l2/Makefile.am index 5d3e380..b242b34 100644 --- a/sys/v4l2/Makefile.am +++ b/sys/v4l2/Makefile.am @@ -9,7 +9,7 @@ libgstvideo4linux2_la_SOURCES = \ gstv4l2tuner.c \ gstv4l2xoverlay.c \ gstv4l2colorbalance.c -libgstvideo4linux2_la_CFLAGS = $(GST_CFLAGS) +libgstvideo4linux2_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS) libgstvideo4linux2_la_LIBADD = \ $(top_builddir)/gst-libs/gst/libgstinterfaces-@GST_MAJORMINOR@.la libgstvideo4linux2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -- 2.7.4