mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-04 15:36:35 +00:00
ext/divx/: Set category to divx4linux instead of divx (too generic).
Original commit message from CVS: 2004-01-14 Ronald Bultje <rbultje@ronald.bitfreak.net> * 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).
This commit is contained in:
parent
ff09e8e44f
commit
00b0cdf8ff
4 changed files with 32 additions and 36 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
||||||
|
2004-01-14 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* 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 <thaytan@mad.scientist.com>
|
2004-01-14 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* ext/mpeg2dec/gstmpeg2dec.c:
|
* ext/mpeg2dec/gstmpeg2dec.c:
|
||||||
|
|
|
@ -47,7 +47,6 @@ static gboolean gst_wavparse_pad_convert (GstPad *pad,
|
||||||
gint64 *dest_value);
|
gint64 *dest_value);
|
||||||
|
|
||||||
static void gst_wavparse_loop (GstElement *element);
|
static void gst_wavparse_loop (GstElement *element);
|
||||||
static GstCaps * gst_wavparse_getcaps (GstPad *pad);
|
|
||||||
static const GstEventMask*
|
static const GstEventMask*
|
||||||
gst_wavparse_get_event_masks (GstPad *pad);
|
gst_wavparse_get_event_masks (GstPad *pad);
|
||||||
static gboolean gst_wavparse_srcpad_event (GstPad *pad, GstEvent *event);
|
static gboolean gst_wavparse_srcpad_event (GstPad *pad, GstEvent *event);
|
||||||
|
@ -195,6 +194,7 @@ gst_wavparse_init (GstWavParse *wavparse)
|
||||||
|
|
||||||
/* source */
|
/* source */
|
||||||
wavparse->srcpad = gst_pad_new_from_template (gst_static_pad_template_get (&src_template_factory), "src");
|
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_element_add_pad (GST_ELEMENT (wavparse), wavparse->srcpad);
|
||||||
gst_pad_set_formats_function (wavparse->srcpad, gst_wavparse_get_formats);
|
gst_pad_set_formats_function (wavparse->srcpad, gst_wavparse_get_formats);
|
||||||
gst_pad_set_convert_function (wavparse->srcpad, gst_wavparse_pad_convert);
|
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_query_function (wavparse->srcpad, gst_wavparse_pad_query);
|
||||||
gst_pad_set_event_function (wavparse->srcpad, gst_wavparse_srcpad_event);
|
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_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);
|
gst_element_set_loop_function (GST_ELEMENT (wavparse), gst_wavparse_loop);
|
||||||
|
|
||||||
|
@ -598,7 +596,7 @@ gst_wavparse_parse_cues (GstWavParse *wavparse,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_wavparse_parse_fmt (GstWavParse *wavparse)
|
gst_wavparse_parse_fmt (GstWavParse *wavparse, guint size)
|
||||||
{
|
{
|
||||||
GstWavParseFormat *format;
|
GstWavParseFormat *format;
|
||||||
GstCaps *caps = NULL;
|
GstCaps *caps = NULL;
|
||||||
|
@ -610,7 +608,7 @@ gst_wavparse_parse_fmt (GstWavParse *wavparse)
|
||||||
format = (GstWavParseFormat *) fmtdata;
|
format = (GstWavParseFormat *) fmtdata;
|
||||||
|
|
||||||
if (got_bytes == sizeof (GstWavParseFormat)) {
|
if (got_bytes == sizeof (GstWavParseFormat)) {
|
||||||
gst_bytestream_flush (bs, got_bytes);
|
gst_bytestream_flush (bs, size);
|
||||||
wavparse->bps = GUINT16_FROM_LE (format->wBlockAlign);
|
wavparse->bps = GUINT16_FROM_LE (format->wBlockAlign);
|
||||||
wavparse->rate = GUINT32_FROM_LE (format->dwSamplesPerSec);
|
wavparse->rate = GUINT32_FROM_LE (format->dwSamplesPerSec);
|
||||||
wavparse->channels = GUINT16_FROM_LE (format->wChannels);
|
wavparse->channels = GUINT16_FROM_LE (format->wChannels);
|
||||||
|
@ -664,30 +662,14 @@ gst_wavparse_parse_fmt (GstWavParse *wavparse)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wavparse->caps)
|
|
||||||
gst_caps_free (wavparse->caps);
|
|
||||||
wavparse->caps = caps ? gst_caps_copy (caps) : gst_caps_new_empty ();
|
|
||||||
if (caps)
|
if (caps)
|
||||||
gst_pad_try_set_caps (wavparse->srcpad, caps);
|
gst_pad_set_explicit_caps (wavparse->srcpad, caps);
|
||||||
|
|
||||||
GST_DEBUG ("frequency %d, channels %d",
|
GST_DEBUG ("frequency %d, channels %d",
|
||||||
wavparse->rate, wavparse->channels);
|
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
|
static gboolean
|
||||||
gst_wavparse_handle_sink_event (GstWavParse *wavparse)
|
gst_wavparse_handle_sink_event (GstWavParse *wavparse)
|
||||||
{
|
{
|
||||||
|
@ -697,14 +679,12 @@ gst_wavparse_handle_sink_event (GstWavParse *wavparse)
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
|
||||||
gst_bytestream_get_status (wavparse->bs, &remaining, &event);
|
gst_bytestream_get_status (wavparse->bs, &remaining, &event);
|
||||||
g_print ("Handle sink event\n");
|
|
||||||
|
|
||||||
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
||||||
GST_DEBUG ("wavparse: event %p %d", event, type);
|
GST_DEBUG ("wavparse: event %p %d", event, type);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
g_print ("EOS\n");
|
|
||||||
gst_bytestream_flush (wavparse->bs, remaining);
|
gst_bytestream_flush (wavparse->bs, remaining);
|
||||||
gst_pad_event_default (wavparse->sinkpad, event);
|
gst_pad_event_default (wavparse->sinkpad, event);
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
@ -871,7 +851,8 @@ gst_wavparse_loop (GstElement *element)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_RIFF_TAG_fmt:
|
case GST_RIFF_TAG_fmt:
|
||||||
gst_wavparse_parse_fmt (wavparse);
|
gst_wavparse_parse_fmt (wavparse, chunk.size);
|
||||||
|
flush = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_RIFF_TAG_cue:
|
case GST_RIFF_TAG_cue:
|
||||||
|
@ -883,23 +864,26 @@ gst_wavparse_loop (GstElement *element)
|
||||||
switch (chunk.type) {
|
switch (chunk.type) {
|
||||||
case GST_RIFF_LIST_INFO:
|
case GST_RIFF_LIST_INFO:
|
||||||
//gst_wavparse_parse_info (wavparse, chunk.size - 4);
|
//gst_wavparse_parse_info (wavparse, chunk.size - 4);
|
||||||
flush = 0;
|
//flush = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_RIFF_LIST_adtl:
|
case GST_RIFF_LIST_adtl:
|
||||||
//gst_wavparse_parse_adtl (wavparse, chunk.size - 4);
|
//gst_wavparse_parse_adtl (wavparse, chunk.size - 4);
|
||||||
flush = 0;
|
//flush = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
flush = 0;
|
//flush = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
flush = 0;
|
default:
|
||||||
|
GST_DEBUG (" ***** unknown chunkid %08x", chunk.id);
|
||||||
|
//flush = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case GST_WAVPARSE_DATA:
|
case GST_WAVPARSE_DATA:
|
||||||
/* Should have been handled up there ^^^^ */
|
/* Should have been handled up there ^^^^ */
|
||||||
|
@ -908,7 +892,8 @@ gst_wavparse_loop (GstElement *element)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Unknown */
|
/* Unknown */
|
||||||
GST_DEBUG (" ***** unknown chunkid %08x", chunk.id);
|
g_warning ("Unknown state %d\n", wavparse->state);
|
||||||
|
//GST_DEBUG (" ***** unknown chunkid %08x", chunk.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1118,10 +1103,6 @@ gst_wavparse_change_state (GstElement *element)
|
||||||
wavparse->bps = 0;
|
wavparse->bps = 0;
|
||||||
wavparse->seek_pending = FALSE;
|
wavparse->seek_pending = FALSE;
|
||||||
wavparse->seek_offset = 0;
|
wavparse->seek_offset = 0;
|
||||||
if (wavparse->caps) {
|
|
||||||
gst_caps_free (wavparse->caps);
|
|
||||||
wavparse->caps = NULL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -57,7 +57,6 @@ struct _GstWavParse {
|
||||||
GstByteStream *bs;
|
GstByteStream *bs;
|
||||||
/* pads */
|
/* pads */
|
||||||
GstPad *sinkpad,*srcpad;
|
GstPad *sinkpad,*srcpad;
|
||||||
GstCaps *caps;
|
|
||||||
|
|
||||||
/* WAVE decoding state */
|
/* WAVE decoding state */
|
||||||
gint state;
|
gint state;
|
||||||
|
|
|
@ -9,7 +9,7 @@ libgstvideo4linux2_la_SOURCES = \
|
||||||
gstv4l2tuner.c \
|
gstv4l2tuner.c \
|
||||||
gstv4l2xoverlay.c \
|
gstv4l2xoverlay.c \
|
||||||
gstv4l2colorbalance.c
|
gstv4l2colorbalance.c
|
||||||
libgstvideo4linux2_la_CFLAGS = $(GST_CFLAGS)
|
libgstvideo4linux2_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS)
|
||||||
libgstvideo4linux2_la_LIBADD = \
|
libgstvideo4linux2_la_LIBADD = \
|
||||||
$(top_builddir)/gst-libs/gst/libgstinterfaces-@GST_MAJORMINOR@.la
|
$(top_builddir)/gst-libs/gst/libgstinterfaces-@GST_MAJORMINOR@.la
|
||||||
libgstvideo4linux2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstvideo4linux2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
Loading…
Reference in a new issue