CVS Root: /cvsroot/gstreamer
Module: gst-plugins
Changes by: rbultje
Date: Wed Oct 01 2003 06:15:22 PDT
Log message:
New typefind system:
* bytestream is now part of the core
* all plugins have been modified to use this new typefind system
* asf typefinding added
* mpeg video stream typefiding removed because it's broken
* duplicate typefind entries removed
* extra id3 typefinding added, because we've seen 4 types of files
(riff/wav, flac, vorbis, mp3) with id3 headers and each of these needs
to work. Instead, I've added an id3 element and let it redo typefiding
after the id3 header. this needs a hack because spider only typefinds
once. We can remove this hack once spider supports multiple typefinds.
* with all this, mp3 typefinding is semi-rewritten
* id3 typefinding in flac/vorbis is removed, it's no longer needed
* fixed spider and gst-typefind to use this, too.
* Other general cleanups
Modified files:
. : configure.ac
ext : Makefile.am
ext/a52dec : gsta52dec.c gsta52dec.h
ext/alsa : gstalsa.c
ext/audiofile : gstafparse.c gstafparse.h
ext/dv : gstdvdec.c gstdvdec.h
ext/ffmpeg : gstffmpeg.c gstffmpegdemux.c gstffmpegprotocol.c
ext/flac : gstflac.c gstflacdec.h
ext/ivorbis : vorbis.c vorbisfile.c
ext/jack : gstjack.h
ext/ladspa : gstladspa.c gstladspa.h
ext/mad : gstmad.c
ext/matroska : gstmatroska-io.h gstmatroskademux.cpp
gstmatroskademux.h
ext/mplex : gstmplex.h
ext/vorbis : vorbis.c vorbisfile.c
gst/adder : gstadder.c gstadder.h
gst/asfdemux : gstasfdemux.c gstasfdemux.h gstasfmux.c
gst/auparse : gstauparse.c
gst/avi : gstavidemux.c gstavidemux.h
gst/cdxaparse : gstcdxaparse.c gstcdxaparse.h
gst/festival : gstfestival.c
gst/flx : gstflxdec.c gstflxdec.h
gst/intfloat : gstfloat2int.c gstfloat2int.h
gst/mixmatrix : mixmatrix.c
Links:
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/configure.ac.diff?r1=1.296&r2=1.297
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/Makefile.am.diff?r1=1.80&r2=1.81
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/a52dec/gsta52dec.c.diff?r1=1.23&r2=1.24
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/a52dec/gsta52dec.h.diff?r1=1.4&r2=1.5
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/alsa/gstalsa.c.diff?r1=1.69&r2=1.70
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/audiofile/gstafparse.c.diff?r1=1.15&r2=1.16
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/audiofile/gstafparse.h.diff?r1=1.2&r2=1.3
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/dv/gstdvdec.c.diff?r1=1.40&r2=1.41
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/dv/gstdvdec.h.diff?r1=1.8&r2=1.9
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ffmpeg/gstffmpeg.c.diff?r1=1.9&r2=1.10
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ffmpeg/gstffmpegdemux.c.diff?r1=1.10&r2=1.11
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ffmpeg/gstffmpegprotocol.c.diff?r1=1.5&r2=1.6
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/flac/gstflac.c.diff?r1=1.13&r2=1.14
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/flac/gstflacdec.h.diff?r1=1.4&r2=1.5
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ivorbis/vorbis.c.diff?r1=1.5&r2=1.6
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ivorbis/vorbisfile.c.diff?r1=1.8&r2=1.9
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/jack/gstjack.h.diff?r1=1.8&r2=1.9
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ladspa/gstladspa.c.diff?r1=1.37&r2=1.38
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ladspa/gstladspa.h.diff?r1=1.6&r2=1.7
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/mad/gstmad.c.diff?r1=1.70&r2=1.71
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/matroska/gstmatroska-io.h.diff?r1=1.1&r2=1.2
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/matroska/gstmatroskademux.cpp.diff?r1=1.6&r2=1.7
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/matroska/gstmatroskademux.h.diff?r1=1.2&r2=1.3
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/mplex/gstmplex.h.diff?r1=1.3&r2=1.4
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/vorbis/vorbis.c.diff?r1=1.13&r2=1.14
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/vorbis/vorbisfile.c.diff?r1=1.38&r2=1.39
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/adder/gstadder.c.diff?r1=1.34&r2=1.35
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/adder/gstadder.h.diff?r1=1.5&r2=1.6
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/asfdemux/gstasfdemux.c.diff?r1=1.21&r2=1.22
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/asfdemux/gstasfdemux.h.diff?r1=1.6&r2=1.7
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/asfdemux/gstasfmux.c.diff?r1=1.4&r2=1.5
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/auparse/gstauparse.c.diff?r1=1.19&r2=1.20
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/avi/gstavidemux.c.diff?r1=1.78&r2=1.79
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/avi/gstavidemux.h.diff?r1=1.14&r2=1.15
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/cdxaparse/gstcdxaparse.c.diff?r1=1.8&r2=1.9
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/cdxaparse/gstcdxaparse.h.diff?r1=1.1&r2=1.2
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/festival/gstfestival.c.diff?r1=1.6&r2=1.7
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/flx/gstflxdec.c.diff?r1=1.26&r2=1.27
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/flx/gstflxdec.h.diff?r1=1.4&r2=1.5
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/intfloat/gstfloat2int.c.diff?r1=1.43&r2=1.44
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/intfloat/gstfloat2int.h.diff?r1=1.13&r2=1.14
http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/mixmatrix/mixmatrix.c.diff?r1=1.12&r2=1.13
====Begin Diffs====
Index: configure.ac
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/configure.ac,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -d -r1.296 -r1.297
--- configure.ac 30 Sep 2003 21:44:53 -0000 1.296
+++ configure.ac 1 Oct 2003 13:14:40 -0000 1.297
@@ -262,7 +262,7 @@
ac3parse adder audioscale auparse avi \
asfdemux audioconvert cdxaparse chart \
cutter debug deinterlace effectv festival \
- filter flx goom intfloat law level median mixmatrix \
+ filter flx goom id3 intfloat law level median mixmatrix \
mpeg1sys mpeg1videoparse mpeg2enc mpeg2sub \
mpegaudio mpegaudioparse mpegstream mpegtypes \
monoscope oneton overlay passthrough playondemand qtdemux \
@@ -1180,6 +1180,7 @@
gst/filter/Makefile
gst/flx/Makefile
gst/goom/Makefile
+gst/id3/Makefile
gst/intfloat/Makefile
gst/law/Makefile
gst/level/Makefile
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/Makefile.am,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- Makefile.am 27 Jul 2003 05:29:10 -0000 1.80
+++ Makefile.am 1 Oct 2003 13:14:40 -0000 1.81
@@ -278,8 +278,9 @@
$(ARTS_DIR) $(ARTSC_DIR) $(AUDIOFILE_DIR) \
$(CDPARANOIA_DIR) $(DIVX_DIR) \
$(DVDREAD_DIR) $(DVDNAV_DIR) $(ESD_DIR) $(MAS_DIR) \
- $(FFMPEG_DIR) $(FLAC_DIR) $(GDK_PIXBUF_DIR) $(GNOMEVFS_DIR) $(GSM_DIR) \
- $(HERMES_DIR) $(JACK_DIR) $(JPEG_DIR) \
+ $(FFMPEG_DIR) $(FLAC_DIR) $(GDK_PIXBUF_DIR) \
+ $(GNOMEVFS_DIR) $(GSM_DIR) $(HERMES_DIR) \
+ $(JACK_DIR) $(JPEG_DIR) \
$(LADSPA_DIR) $(LAME_DIR) $(LCS_DIR) \
$(LIBDV_DIR) $(LIBFAME_DIR) $(LIBPNG_DIR) \
$(MAD_DIR) $(MATROSKA_DIR) $(MIKMOD_DIR) \
Index: gsta52dec.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/a52dec/gsta52dec.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- gsta52dec.c 16 Sep 2003 09:59:51 -0000 1.23
+++ gsta52dec.c 1 Oct 2003 13:14:40 -0000 1.24
@@ -619,10 +619,6 @@
{
GstElementFactory *factory;
- /* this filter needs the bytestream package */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
-
/* create an elementfactory for the a52dec element */
factory = gst_element_factory_new ("a52dec", GST_TYPE_A52DEC, &gst_a52dec_details);
g_return_val_if_fail (factory != NULL, FALSE);
Index: gsta52dec.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/a52dec/gsta52dec.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gsta52dec.h 18 Jan 2003 17:06:01 -0000 1.4
+++ gsta52dec.h 1 Oct 2003 13:14:41 -0000 1.5
@@ -23,7 +23,7 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
G_BEGIN_DECLS
Index: gstalsa.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/alsa/gstalsa.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- gstalsa.c 16 Sep 2003 09:59:52 -0000 1.69
+++ gstalsa.c 1 Oct 2003 13:14:41 -0000 1.70
@@ -2351,9 +2351,6 @@
{
GstElementFactory *factory;
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
-
factory = gst_element_factory_new ("alsasrc", GST_TYPE_ALSA_SRC, &gst_alsa_src_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, gst_alsa_src_pad_factory ());
Index: gstafparse.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/audiofile/gstafparse.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gstafparse.c 6 Jul 2003 20:49:13 -0000 1.15
+++ gstafparse.c 1 Oct 2003 13:14:42 -0000 1.16
@@ -337,8 +337,7 @@
/* load audio support library */
if (!gst_library_load ("gstaudio"))
return FALSE;
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
+
return TRUE;
}
Index: gstafparse.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/audiofile/gstafparse.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gstafparse.h 26 May 2002 21:59:20 -0000 1.2
+++ gstafparse.h 1 Oct 2003 13:14:42 -0000 1.3
@@ -27,7 +27,7 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include <audiofile.h> /* what else are we to do */
#include <af_vfs.h>
Index: gstdvdec.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/dv/gstdvdec.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- gstdvdec.c 16 Sep 2003 09:59:52 -0000 1.40
+++ gstdvdec.c 1 Oct 2003 13:14:43 -0000 1.41
@@ -159,30 +159,34 @@
/* typefind stuff */
static GstCaps*
-dv_type_find (GstBuffer *buf, gpointer private)
+dv_type_find (GstByteStream *bs, gpointer private)
{
- guint32 head;
+ GstBuffer *buf = NULL;
GstCaps *new = NULL;
- if (GST_BUFFER_SIZE (buf) < 5)
- return NULL;
-
- head = GUINT32_FROM_BE(*((guint32 *)GST_BUFFER_DATA(buf)));
+ if (gst_bytestream_peek (bs, &buf, 5) == 5) {
+ guint32 head = GUINT32_FROM_BE (*((guint32 *) GST_BUFFER_DATA (buf)));
- /* check for DIF and DV flag */
- if ((head & 0xffffff00) == 0x1f070000 && !(GST_BUFFER_DATA(buf)[4] & 0x01)) {
- gchar *format;
+ /* check for DIF and DV flag */
+ if ((head & 0xffffff00) == 0x1f070000 &&
+ !(GST_BUFFER_DATA (buf)[4] & 0x01)) {
+ gchar *format;
- if ((head & 0x000000ff) & 0x80)
- format = "PAL";
- else
- format = "NTSC";
+ if ((head & 0x000000ff) & 0x80)
+ format = "PAL";
+ else
+ format = "NTSC";
- new = GST_CAPS_NEW ("dv_type_find",
- "video/x-dv",
- "systemstream", GST_PROPS_BOOLEAN (TRUE)
- );
+ new = GST_CAPS_NEW ("dv_type_find",
+ "video/x-dv",
+ "systemstream", GST_PROPS_BOOLEAN (TRUE));
+ }
+ }
+
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
}
+
return new;
}
@@ -1001,9 +1005,6 @@
{
GstElementFactory *factory;
GstTypeFactory *type;
-
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
/* We need to create an ElementFactory for each element we provide.
* This consists of the name of the element, the GType identifier,
Index: gstdvdec.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/dv/gstdvdec.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gstdvdec.h 2 Nov 2002 13:34:42 -0000 1.8
+++ gstdvdec.h 1 Oct 2003 13:14:43 -0000 1.9
@@ -29,7 +29,7 @@
#include <libdv/dv.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
/* This is the definition of the element's object structure. */
Index: gstjack.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/jack/gstjack.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gstjack.h 30 Sep 2003 12:56:27 -0000 1.8
+++ gstjack.h 1 Oct 2003 13:14:44 -0000 1.9
@@ -22,7 +22,7 @@
#include <jack/jack.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
//#define JACK_DEBUG(str, a...) g_message (str, ##a)
#define JACK_DEBUG(str, a...)
Index: gstflac.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/flac/gstflac.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gstflac.c 20 Sep 2003 19:34:31 -0000 1.13
+++ gstflac.c 1 Oct 2003 13:14:43 -0000 1.14
@@ -26,7 +26,7 @@
extern GstElementDetails flacenc_details;
extern GstElementDetails flacdec_details;
-static GstCaps* flac_type_find (GstBuffer *buf, gpointer private);
+static GstCaps* flac_type_find (GstByteStream *bs, gpointer private);
GstPadTemplate *gst_flacdec_src_template, *gst_flacdec_sink_template;
GstPadTemplate *gst_flacenc_src_template, *gst_flacenc_sink_template;
@@ -70,37 +70,26 @@
static GstCaps*
-flac_type_find (GstBuffer *buf, gpointer private)
+flac_type_find (GstByteStream *bs, gpointer private)
{
- gint offset;
- guint8 *data;
- gint size;
- guint32 head;
-
- if (GST_BUFFER_SIZE (buf) < 4)
- return NULL;
+ GstBuffer *buf = NULL;
+ GstCaps *new = NULL;
- data = GST_BUFFER_DATA (buf);
- size = GST_BUFFER_SIZE (buf);
-
- head = GUINT32_FROM_BE (*((guint32 *)GST_BUFFER_DATA (buf)));
+ if (gst_bytestream_peek (bs, &buf, 4) == 4) {
+ guint32 head = GUINT32_FROM_BE (*((guint32 *) GST_BUFFER_DATA (buf)));
- if (head == 0x664C6143)
- return gst_caps_new ("flac_type_find", "application/x-flac", NULL);
- else {
- /* checks for existance of flac identification header in case
- * there's an ID3 tag */
- for (offset = 0; offset < size-4; offset++) {
- if (data[offset] == 'f' &&
- data[offset+1] == 'L' &&
- data[offset+2] == 'a' &&
- data[offset+3] == 'C' ) {
- return gst_caps_new ("flac_type_find", "application/x-flac", NULL);
- }
+ if (head == 0x664C6143) {
+ new = GST_CAPS_NEW ("flac_type_find",
+ "application/x-flac",
+ NULL);
}
}
- return NULL;
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
+ return new;
}
@@ -110,10 +99,6 @@
GstElementFactory *enc, *dec;
GstTypeFactory *type;
GstCaps *raw_caps, *flac_caps;
-
- /* this filter needs the bytestream package */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
gst_plugin_set_longname (plugin, "The FLAC Lossless compressor Codec");
Index: gstflacdec.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/flac/gstflacdec.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gstflacdec.h 27 Apr 2003 12:00:41 -0000 1.4
+++ gstflacdec.h 1 Oct 2003 13:14:43 -0000 1.5
@@ -24,7 +24,7 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include <FLAC/all.h>
Index: vorbis.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ivorbis/vorbis.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- vorbis.c 24 Jul 2003 08:49:42 -0000 1.5
+++ vorbis.c 1 Oct 2003 13:14:44 -0000 1.6
@@ -21,7 +21,7 @@
#include <gst/gst.h>
#include <tremor/ivorbiscodec.h>
#include <tremor/ivorbisfile.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
extern GType ivorbisfile_get_type(void);
@@ -131,10 +131,6 @@
gst_element_factory_add_pad_template (file, gst_vorbisdec_src_template);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (file));
-
- /* this filter needs the bytestream package */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
type = gst_type_factory_new (&vorbisdefinition);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type));
Index: vorbisfile.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ivorbis/vorbisfile.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- vorbisfile.c 16 Sep 2003 09:59:54 -0000 1.8
+++ vorbisfile.c 1 Oct 2003 13:14:44 -0000 1.9
@@ -24,7 +24,7 @@
#include <gst/gst.h>
#include <tremor/ivorbiscodec.h>
#include <tremor/ivorbisfile.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#define GST_TYPE_IVORBISFILE \
(ivorbisfile_get_type())
Index: gstffmpeg.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ffmpeg/gstffmpeg.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- gstffmpeg.c 6 Jul 2003 20:49:15 -0000 1.9
+++ gstffmpeg.c 1 Oct 2003 13:14:43 -0000 1.10
@@ -46,9 +46,6 @@
avcodec_register_all ();
av_register_all ();
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
-
gst_ffmpegenc_register (plugin);
gst_ffmpegdec_register (plugin);
/*gst_ffmpegdemux_register (plugin);*/
Index: gstffmpegdemux.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ffmpeg/gstffmpegdemux.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- gstffmpegdemux.c 16 Sep 2003 09:59:53 -0000 1.10
+++ gstffmpegdemux.c 1 Oct 2003 13:14:43 -0000 1.11
@@ -161,24 +161,27 @@
}
static GstCaps*
-gst_ffmpegdemux_typefind (GstBuffer *buffer,
- gpointer priv)
+gst_ffmpegdemux_typefind (GstByteStream *bs,
+ gpointer priv)
{
GstFFMpegDemuxClassParams *params;
AVInputFormat *in_plugin;
gint res = 0;
gint required = AVPROBE_SCORE_MAX * 0.8; /* 80% certainty enough? */
+ gint size_required = 4096;
+ GstBuffer *buf = NULL;
params = g_hash_table_lookup (typefind, priv);
in_plugin = params->in_plugin;
- if (in_plugin->read_probe) {
+ if (in_plugin->read_probe &&
+ gst_bytestream_peek (bs, &buf, size_required) == size_required) {
AVProbeData probe_data;
probe_data.filename = "";
- probe_data.buf = GST_BUFFER_DATA (buffer);
- probe_data.buf_size = GST_BUFFER_SIZE (buffer);
+ probe_data.buf = GST_BUFFER_DATA (buf);
+ probe_data.buf_size = GST_BUFFER_SIZE (buf);
res = in_plugin->read_probe (&probe_data);
if (res >= required) {
@@ -186,10 +189,15 @@
caps = GST_PAD_TEMPLATE_CAPS (params->sinktempl);
/* make sure we still hold a refcount to this caps */
gst_caps_ref (caps);
+ gst_buffer_unref (buf);
return caps;
}
}
-
+
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
return NULL;
}
Index: gstffmpegprotocol.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ffmpeg/gstffmpegprotocol.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gstffmpegprotocol.c 8 Jun 2003 14:35:32 -0000 1.5
+++ gstffmpegprotocol.c 1 Oct 2003 13:14:43 -0000 1.6
@@ -27,7 +27,7 @@
#endif
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
typedef struct _GstProtocolInfo GstProtocolInfo;
Index: gstmad.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/mad/gstmad.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- gstmad.c 16 Sep 2003 09:59:54 -0000 1.70
+++ gstmad.c 1 Oct 2003 13:14:44 -0000 1.71
@@ -139,6 +139,7 @@
"mad_sink",
"audio/mpeg",
/* we don't need channel/rate ... */
+ "mpegversion", GST_PROPS_INT (1),
"layer", GST_PROPS_INT_RANGE (1, 3)
)
)
@@ -1184,15 +1185,13 @@
mad->stream.bufend - mad->stream.this_frame);
if (tagsize > mad->tempsize) {
- GST_INFO (
- "mad: got partial id3 tag in buffer, skipping");
+ GST_INFO ("mad: got partial id3 tag in buffer, skipping");
}
else if (tagsize > 0) {
struct id3_tag *tag;
id3_byte_t const *data;
- GST_INFO (
- "mad: got ID3 tag size %ld", tagsize);
+ GST_INFO ("mad: got ID3 tag size %ld", tagsize);
data = mad->stream.this_frame;
Index: gstladspa.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ladspa/gstladspa.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- gstladspa.c 16 Sep 2003 09:59:54 -0000 1.37
+++ gstladspa.c 1 Oct 2003 13:14:44 -0000 1.38
@@ -993,9 +993,6 @@
LADSPAPluginSearch(ladspa_describe_plugin);
- if (! gst_library_load ("gstbytestream"))
- return FALSE;
-
/* initialize dparam support library */
gst_control_init(NULL,NULL);
Index: gstladspa.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/ladspa/gstladspa.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gstladspa.h 16 Jul 2003 16:08:12 -0000 1.6
+++ gstladspa.h 1 Oct 2003 13:14:44 -0000 1.7
@@ -26,7 +26,7 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include "ladspa.h"
Index: gstmplex.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/mplex/gstmplex.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gstmplex.h 25 Oct 2002 20:46:12 -0000 1.3
+++ gstmplex.h 1 Oct 2003 13:14:45 -0000 1.4
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include "outputstream.hh"
#include "bits.hh"
Index: gstmatroska-io.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/matroska/gstmatroska-io.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gstmatroska-io.h 14 Jul 2003 17:37:05 -0000 1.1
+++ gstmatroska-io.h 1 Oct 2003 13:14:45 -0000 1.2
@@ -21,7 +21,7 @@
#define __GST_MATROSKA_IO_H__
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include <IOCallback.h>
using namespace std;
Index: gstmatroskademux.cpp
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/matroska/gstmatroskademux.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gstmatroskademux.cpp 12 Sep 2003 11:36:24 -0000 1.6
+++ gstmatroskademux.cpp 1 Oct 2003 13:14:45 -0000 1.7
@@ -74,8 +74,8 @@
"(C) 2003",
};
-static GstCaps * gst_matroska_type_find (GstBuffer *buf,
- gpointer priv);
+static GstCaps * gst_matroska_type_find (GstByteStream *bs,
+ gpointer priv);
/* typefactory for 'matroska' */
static GstTypeDefinition matroskadefinition = {
@@ -251,23 +251,28 @@
}
static GstCaps *
-gst_matroska_type_find (GstBuffer *buf,
- gpointer priv)
+gst_matroska_type_find (GstByteStream *bs,
+ gpointer priv)
{
- guint8 header[16] = { 0x1A, 0x45, 0xDF, 0xA3, 0x93, 0x42, 0x82, 0x88,
- 'm', 'a', 't', 'r', 'o', 's', 'k', 'a' };
- GST_DEBUG ("matroska_demux: typefind");
+ GstBuffer *buf = NULL;
+ GstCaps *newc = NULL;
- if (GST_BUFFER_SIZE (buf) >= 16 &&
- memcmp(GST_BUFFER_DATA (buf), header, 16) == 0) {
- GST_DEBUG ("matroska type found!");
- return GST_CAPS_NEW ("matroska_type",
- "video/x-matroska",
- NULL);
+ if (gst_bytestream_peek (bs, &buf, 16) == 16) {
+ guint8 header[16] = { 0x1A, 0x45, 0xDF, 0xA3, 0x93, 0x42, 0x82, 0x88,
+ 'm', 'a', 't', 'r', 'o', 's', 'k', 'a' };
+
+ if (!memcmp(GST_BUFFER_DATA (buf), header, 16)) {
+ newc = GST_CAPS_NEW ("matroska_type",
+ "video/x-matroska",
+ NULL);
+ }
}
- /* nope */
- return NULL;
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
+ return newc;
}
static void
@@ -335,15 +340,18 @@
{
EbmlElement *child = NULL;
- if (demux->last_level != 0) {
- g_assert (demux->last_level > 0);
+ if (demux->last_level > 0) {
+ //g_assert (demux->last_level > 0);
child = demux->last_el;
demux->last_el = NULL;
demux->last_level--;
- } else if (demux->io->eos != TRUE) {
- g_assert (demux->last_el == NULL);
- child = demux->str->FindNextElement (parent->Generic ().Context,
- demux->last_level, ~0, true, 5);
+ } else {
+ demux->last_level = 0;
+ if (demux->io->eos != TRUE) {
+ //g_assert (demux->last_el == NULL);
+ child = demux->str->FindNextElement (parent->Generic ().Context,
+ demux->last_level, ~0, true, 5);
+ }
}
return child;
@@ -1681,7 +1689,8 @@
res = FALSE;
break;
} else if (demux->last_level != 0) {
- g_assert (0); /* cannot happen, this *is* the top level */
+ //g_assert (0); /* cannot happen, this *is* the top level */
+ demux->last_level = 0;
}
/* well, cases don't work here since these aren't constants...
Index: gstmatroskademux.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/matroska/gstmatroskademux.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gstmatroskademux.h 29 Jul 2003 20:55:58 -0000 1.2
+++ gstmatroskademux.h 1 Oct 2003 13:14:45 -0000 1.3
@@ -21,7 +21,7 @@
#define __GST_MATROSKA_DEMUX_H__
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include "gstmatroska-io.h"
using namespace std;
Index: vorbis.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/vorbis/vorbis.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- vorbis.c 19 Jul 2003 23:25:26 -0000 1.13
+++ vorbis.c 1 Oct 2003 13:14:45 -0000 1.14
@@ -25,7 +25,7 @@
extern GstElementDetails vorbisfile_details;
extern GstElementDetails vorbisenc_details;
-static GstCaps* vorbis_type_find (GstBuffer *buf, gpointer private);
+static GstCaps* vorbis_type_find (GstByteStream *bs, gpointer private);
GstPadTemplate *gst_vorbisdec_src_template, *gst_vorbisdec_sink_template;
GstPadTemplate *gst_vorbisenc_src_template, *gst_vorbisenc_sink_template;
@@ -81,40 +81,26 @@
};
static GstCaps*
-vorbis_type_find (GstBuffer *buf, gpointer private)
+vorbis_type_find (GstByteStream *bs, gpointer private)
{
- guint32 head;
- gint offset;
- guint8 *data;
- gint size;
-
- data = GST_BUFFER_DATA (buf);
- size = GST_BUFFER_SIZE (buf);
-
- if (size < sizeof(guint32))
- return NULL;
+ GstBuffer *buf = NULL;
+ GstCaps *new = NULL;
- head = GUINT32_FROM_BE (*((guint32 *)data));
+ if (gst_bytestream_peek (bs, &buf, 4) == 4) {
+ guint32 head = GUINT32_FROM_BE (*((guint32 *) GST_BUFFER_DATA (buf)));
- if (head == 0x4F676753) {
- return gst_caps_new ("vorbis_type_find", "application/ogg", NULL);
- } else {
- /* checks for existance of vorbis identification header in case
- * there's an ID3 tag */
- for (offset = 0; offset < size-7; offset++) {
- if (data[offset] == 0x01 &&
- data[offset+1] == 'v' &&
- data[offset+2] == 'o' &&
- data[offset+3] == 'r' &&
- data[offset+4] == 'b' &&
- data[offset+5] == 'i' &&
- data[offset+6] == 's' ) {
- return gst_caps_new ("vorbis_type_find", "application/ogg", NULL);
- }
+ if (head == 0x4F676753) {
+ new = GST_CAPS_NEW ("vorbis_type_find",
+ "application/ogg",
+ NULL);
}
}
- return NULL;
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
+ return new;
}
@@ -171,10 +157,6 @@
gst_element_factory_add_pad_template (file, gst_vorbisdec_src_template);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (file));
-
- /* this filter needs the bytestream package */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
type = gst_type_factory_new (&vorbisdefinition);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type));
Index: vorbisfile.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/ext/vorbis/vorbisfile.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- vorbisfile.c 16 Sep 2003 09:59:56 -0000 1.38
+++ vorbisfile.c 1 Oct 2003 13:14:45 -0000 1.39
@@ -24,7 +24,7 @@
#include <gst/gst.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#define GST_TYPE_VORBISFILE \
(vorbisfile_get_type())
Index: gstadder.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/adder/gstadder.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- gstadder.c 16 Sep 2003 09:59:56 -0000 1.34
+++ gstadder.c 1 Oct 2003 13:14:45 -0000 1.35
@@ -606,9 +606,6 @@
factory = gst_element_factory_new ("adder", GST_TYPE_ADDER, &adder_details);
g_return_val_if_fail (factory != NULL, FALSE);
- if (! gst_library_load ("gstbytestream"))
- return FALSE;
-
gst_element_factory_add_pad_template (factory,
GST_PAD_TEMPLATE_GET (gst_adder_src_template_factory));
gst_element_factory_add_pad_template (factory,
Index: gstadder.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/adder/gstadder.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gstadder.h 19 Jul 2003 23:16:25 -0000 1.5
+++ gstadder.h 1 Oct 2003 13:14:45 -0000 1.6
@@ -24,7 +24,7 @@
#define __GST_ADDER_H__
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#ifdef __cplusplus
extern "C" {
Index: gstauparse.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/auparse/gstauparse.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- gstauparse.c 16 Sep 2003 09:59:57 -0000 1.19
+++ gstauparse.c 1 Oct 2003 13:14:46 -0000 1.20
@@ -42,16 +42,23 @@
};
static GstCaps*
-au_type_find (GstBuffer *buf, gpointer private)
+au_type_find (GstByteStream *bs, gpointer private)
{
+ GstBuffer *buf = NULL;
GstCaps *new = NULL;
- gulong *head = (gulong *) GST_BUFFER_DATA (buf);
- if (GST_BUFFER_SIZE (buf) < 4)
- return NULL;
+ if (gst_bytestream_peek (bs, &buf, 4) == 4) {
+ guint32 head = * (guint32 *) GST_BUFFER_DATA (buf);
+ if (head == 0x2e736e64 || head == 0x646e732e) {
+ new = gst_caps_new ("au_type_find",
+ "audio/x-au",
+ NULL);
+ }
+ }
- if (*head == 0x2e736e64 || *head == 0x646e732e)
- new = gst_caps_new ("au_type_find", "audio/x-au", NULL);
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
return new;
}
Index: gstasfdemux.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/asfdemux/gstasfdemux.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gstasfdemux.c 16 Sep 2003 09:59:56 -0000 1.21
+++ gstasfdemux.c 1 Oct 2003 13:14:46 -0000 1.22
@@ -35,123 +35,41 @@
"(C) 2002",
};
-static GstCaps* asf_asf_type_find (GstBuffer *buf, gpointer private);
-static GstCaps* asf_wma_type_find (GstBuffer *buf, gpointer private);
-static GstCaps* asf_wax_type_find (GstBuffer *buf, gpointer private);
-static GstCaps* asf_wmv_type_find (GstBuffer *buf, gpointer private);
-static GstCaps* asf_wvx_type_find (GstBuffer *buf, gpointer private);
-static GstCaps* asf_wm_type_find (GstBuffer *buf, gpointer private);
+static GstCaps* asf_type_find (GstByteStream *bs, gpointer private);
/* typefactory for 'asf' */
-static GstTypeDefinition asf_type_definitions[] = {
- { "asfdemux_video/asf",
- "video/x-ms-asf",
- ".asf .asx",
- asf_asf_type_find },
- { "asfdemux_video/wma",
- "video/x-ms-wma",
- ".wma",
- asf_wma_type_find },
- { "asfdemux_video/wax",
- "video/x-ms-wax",
- ".wax",
- asf_wax_type_find },
- { "asfdemux_video/wmv",
- "video/x-ms-wmv",
- ".wmv",
- asf_wmv_type_find },
- { "asfdemux_video/wvx",
- "video/x-ms-wvx",
- ".wvx",
- asf_wvx_type_find },
- { "asfdemux_video/wm",
- "video/x-ms-wm",
- ".wm",
- asf_wm_type_find },
- { NULL, NULL, NULL, NULL }
+static GstTypeDefinition asf_type_definition = {
+ "asfdemux_video/asf",
+ "video/x-ms-asf",
+ /* note: asx/wax/wmx are XML files, we don't handle them */
+ ".asf .wma .wmv .wm",
+ asf_type_find,
};
static GstCaps*
-asf_asf_type_find (GstBuffer *buf, gpointer private)
-{
- GstCaps *new;
-
- new = gst_caps_new (
- "asf_type_find",
- "video/x-ms-asf",
- gst_props_new ("asfversion",
- GST_PROPS_INT (1),
- NULL));
- return new;
-}
-
-static GstCaps*
-asf_wma_type_find (GstBuffer *buf, gpointer private)
-{
- GstCaps *new;
-
- new = gst_caps_new (
- "asf_type_find",
- "video/x-ms-asf",
- gst_props_new ("asfversion",
- GST_PROPS_INT (1),
- NULL));
- return new;
-}
-
-static GstCaps*
-asf_wax_type_find (GstBuffer *buf, gpointer private)
-{
- GstCaps *new;
-
- new = gst_caps_new (
- "asf_type_find",
- "video/x-ms-asf",
- gst_props_new ("asfversion",
- GST_PROPS_INT (1),
- NULL));
- return new;
-}
-
-static GstCaps*
-asf_wmv_type_find (GstBuffer *buf, gpointer private)
+asf_type_find (GstByteStream *bs, gpointer private)
{
- GstCaps *new;
-
- new = gst_caps_new (
- "asf_type_find",
- "video/x-ms-asf",
- gst_props_new ("asfversion",
- GST_PROPS_INT (1),
- NULL));
- return new;
-}
+ GstCaps *new = NULL;
+ GstBuffer *buf = NULL;
-static GstCaps*
-asf_wvx_type_find (GstBuffer *buf, gpointer private)
-{
- GstCaps *new;
+ if (gst_bytestream_peek (bs, &buf, 16) == 16) {
+ guint32 uid1 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[0]),
+ uid2 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[1]),
+ uid3 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[2]),
+ uid4 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[3]);
- new = gst_caps_new (
- "asf_type_find",
- "video/x-ms-asf",
- gst_props_new ("asfversion",
- GST_PROPS_INT (1),
- NULL));
- return new;
-}
+ if (uid1 == 0x75B22630 && uid2 == 0x11CF668E &&
+ uid3 == 0xAA00D9A6 && uid4 == 0x6CCE6200) {
+ new = GST_CAPS_NEW ("asf_type_find",
+ "video/x-ms-asf",
+ NULL);
+ }
+ }
-static GstCaps*
-asf_wm_type_find (GstBuffer *buf, gpointer private)
-{
- GstCaps *new;
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
- new = gst_caps_new (
- "asf_type_find",
- "video/x-ms-asf",
- gst_props_new ("asfversion",
- GST_PROPS_INT (1),
- NULL));
return new;
}
@@ -1644,6 +1562,7 @@
plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
+ GstTypeFactory *type;
gint i = 0;
GstCaps *audcaps = NULL, *vidcaps = NULL, *temp;
guint32 vid_list[] = {
@@ -1670,23 +1589,13 @@
-1 /* end */
};
- /* this filter needs bytestream */
- if (!gst_library_load ("gstbytestream")) {
- GST_INFO ("asfdemux: could not load support library: 'gstbytestream'\n");
- return FALSE;
- }
-
/* create an elementfactory for the asf_demux element */
factory = gst_element_factory_new ("asfdemux",GST_TYPE_ASF_DEMUX,
&gst_asf_demux_details);
- while (asf_type_definitions[i].name) {
- GstTypeFactory *type;
-
- type = gst_type_factory_new (&asf_type_definitions[i]);
- //gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type));
- i++;
- }
+ /* type finding */
+ type = gst_type_factory_new (&asf_type_definition);
+ gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type));
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_NONE);
Index: gstasfdemux.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/asfdemux/gstasfdemux.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gstasfdemux.h 31 Jan 2003 21:41:07 -0000 1.6
+++ gstasfdemux.h 1 Oct 2003 13:14:46 -0000 1.7
@@ -24,7 +24,7 @@
#include <config.h>
#include <gst/gst.h>
#include <gst/riff/riff.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include "asfheaders.h"
G_BEGIN_DECLS
Index: gstasfmux.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/asfdemux/gstasfmux.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gstasfmux.c 9 Sep 2003 20:01:31 -0000 1.4
+++ gstasfmux.c 1 Oct 2003 13:14:46 -0000 1.5
@@ -414,6 +414,7 @@
return GST_PAD_LINK_REFUSED;
done:
+ stream->bitrate = 1024 * 1024;
stream->header.video.format.size = stream->header.video.stream.size;
stream->header.video.format.width = stream->header.video.stream.width;
stream->header.video.format.height = stream->header.video.stream.height;
@@ -465,7 +466,6 @@
stream->header.audio.sample_rate = rate;
stream->header.audio.channels = channels;
- stream->bitrate = 0; /* TODO */
if (!strcmp (mimetype, "audio/x-raw-int")) {
gint block, size;
@@ -507,7 +507,7 @@
}
stream->header.audio.block_align = 1;
- stream->header.audio.byte_rate = 0;
+ stream->header.audio.byte_rate = 8 * 1024;
stream->header.audio.word_size = 16;
stream->header.audio.size = 0;
@@ -521,6 +521,7 @@
return GST_PAD_LINK_REFUSED;
done:
+ stream->bitrate = stream->header.audio.byte_rate * 8;
return GST_PAD_LINK_OK;
}
@@ -632,9 +633,11 @@
const GstEventMask *masks = gst_pad_get_event_masks (GST_PAD_PEER (asfmux->srcpad));
/* this is for stream or file-storage */
- while (masks->type != 0) {
+ while (masks != NULL && masks->type != 0) {
if (masks->type == GST_EVENT_SEEK) {
return TRUE;
+ } else {
+ masks++;
}
}
@@ -724,7 +727,7 @@
guint8 *data,
guint length)
{
- if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) > length) {
+ if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) >= length) {
guint8 *pos = GST_BUFFER_DATA (packet) + GST_BUFFER_SIZE (packet);
memcpy (pos, data, length);
GST_BUFFER_SIZE (packet) += length;
@@ -737,7 +740,7 @@
gst_asfmux_put_byte (GstBuffer *packet,
guint8 data)
{
- if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) > sizeof (data)) {
+ if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) >= sizeof (data)) {
guint8 *pos = GST_BUFFER_DATA (packet) + GST_BUFFER_SIZE (packet);
* (guint8 *) pos = data;
GST_BUFFER_SIZE (packet) += 1;
@@ -750,7 +753,7 @@
gst_asfmux_put_le16 (GstBuffer *packet,
guint16 data)
{
- if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) > sizeof (data)) {
+ if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) >= sizeof (data)) {
guint8 *pos = GST_BUFFER_DATA (packet) + GST_BUFFER_SIZE (packet);
* (guint16 *) pos = GUINT16_TO_LE (data);
GST_BUFFER_SIZE (packet) += 2;
@@ -763,7 +766,7 @@
gst_asfmux_put_le32 (GstBuffer *packet,
guint32 data)
{
- if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) > sizeof (data)) {
+ if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) >= sizeof (data)) {
guint8 *pos = GST_BUFFER_DATA (packet) + GST_BUFFER_SIZE (packet);
* (guint32 *) pos = GUINT32_TO_LE (data);
GST_BUFFER_SIZE (packet) += 4;
@@ -776,7 +779,7 @@
gst_asfmux_put_le64 (GstBuffer *packet,
guint64 data)
{
- if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) > sizeof (data)) {
+ if ((GST_BUFFER_MAXSIZE (packet) - GST_BUFFER_SIZE (packet)) >= sizeof (data)) {
guint8 *pos = GST_BUFFER_DATA (packet) + GST_BUFFER_SIZE (packet);
* (guint64 *) pos = GUINT64_TO_LE (data);
GST_BUFFER_SIZE (packet) += 8;
Index: gstavidemux.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavidemux.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- gstavidemux.c 16 Sep 2003 09:59:57 -0000 1.78
+++ gstavidemux.c 1 Oct 2003 13:14:46 -0000 1.79
@@ -38,7 +38,7 @@
"(C) 1999",
};
-static GstCaps* avi_type_find (GstBuffer *buf, gpointer private);
+static GstCaps* avi_type_find (GstByteStream *bs, gpointer private);
/* typefactory for 'avi' */
static GstTypeDefinition avidefinition = {
@@ -173,25 +173,29 @@
}
static GstCaps*
-avi_type_find (GstBuffer *buf,
- gpointer private)
+avi_type_find (GstByteStream *bs,
+ gpointer private)
{
- gchar *data = GST_BUFFER_DATA (buf);
- GstCaps *new;
+ GstBuffer *buf = NULL;
+ GstCaps *new = NULL;
GST_DEBUG ("avi_demux: typefind");
- if (GST_BUFFER_SIZE (buf) < 12)
- return NULL;
+ if (gst_bytestream_peek (bs, &buf, 12) == 12) {
+ guint32 head1 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[0]),
+ head2 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[2]);
- if (GUINT32_FROM_LE (((guint32 *)data)[0]) != GST_RIFF_TAG_RIFF)
- return NULL;
- if (GUINT32_FROM_LE (((guint32 *)data)[2]) != GST_RIFF_RIFF_AVI)
- return NULL;
+ if (head1 == GST_RIFF_TAG_RIFF && head2 == GST_RIFF_RIFF_AVI) {
+ new = GST_CAPS_NEW ("avi_type_find",
+ "video/avi",
+ NULL);
+ }
+ }
+
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
- new = GST_CAPS_NEW ("avi_type_find",
- "video/avi",
- NULL);
return new;
}
@@ -1960,10 +1964,6 @@
GST_RIFF_WAVE_FORMAT_MULAW,
-1 /* end */
};
-
- /* this filter needs the riff parser */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
if (!gst_library_load ("gstriff"))
return FALSE;
Index: gstavidemux.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavidemux.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gstavidemux.h 31 Jan 2003 19:37:26 -0000 1.14
+++ gstavidemux.h 1 Oct 2003 13:14:47 -0000 1.15
@@ -24,7 +24,7 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include <gst/riff/riff.h>
#ifdef __cplusplus
Index: gstfestival.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/festival/gstfestival.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gstfestival.c 24 Jul 2003 08:49:43 -0000 1.6
+++ gstfestival.c 1 Oct 2003 13:14:47 -0000 1.7
@@ -80,7 +80,7 @@
static void gst_festival_class_init (GstFestivalClass *klass);
static void gst_festival_init (GstFestival *festival);
-static GstCaps* text_type_find (GstBuffer *buf, gpointer private);
+static GstCaps* text_type_find (GstByteStream *bs, gpointer private);
static void gst_festival_chain (GstPad *pad, GstBuffer *buf);
static GstElementStateReturn
@@ -198,21 +198,35 @@
}
static GstCaps*
-text_type_find (GstBuffer *buf, gpointer private)
+text_type_find (GstByteStream *bs, gpointer private)
{
- gchar *data = GST_BUFFER_DATA (buf);
- gint i;
+ GstBuffer *buf = NULL;
+ GstCaps *new = NULL;
- /* 20 is arbitrary. 4 is definitely too small. */
- if (GST_BUFFER_SIZE (buf) < 20)
- return NULL;
+#define TEXT_SIZE 32
- for (i=0; i<GST_BUFFER_SIZE (buf); i++) {
- if (!isprint(data[i]) && data[i]!='\n')
- return NULL;
+ /* read arbitrary number and see if it's textual */
+ if (gst_bytestream_peek (bs, &buf, TEXT_SIZE) == TEXT_SIZE) {
+ gchar *data = GST_BUFFER_DATA (buf);
+ gint i;
+
+ for (i = 0; i < TEXT_SIZE; i++) {
+ if (!isprint (data[i]) && data[i] != '\n') {
+ break;
+ }
+ }
+
+ /* well, we found something that looks like text... */
+ new = gst_caps_new ("text_type_find",
+ "text/plain",
+ NULL);
}
- return gst_caps_new ("text_type_find", "text/plain", NULL);
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
+ return new;
}
Index: gstcdxaparse.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/cdxaparse/gstcdxaparse.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gstcdxaparse.c 24 Jul 2003 08:49:43 -0000 1.8
+++ gstcdxaparse.c 1 Oct 2003 13:14:47 -0000 1.9
@@ -50,7 +50,7 @@
"(C) 2002",
};
-static GstCaps* cdxa_type_find (GstBuffer *buf, gpointer private);
+static GstCaps* cdxa_type_find (GstByteStream *bs, gpointer private);
/* typefactory for 'cdxa' */
static GstTypeDefinition cdxadefinition = {
@@ -159,25 +159,28 @@
}
static GstCaps*
-cdxa_type_find (GstBuffer *buf,
- gpointer private)
+cdxa_type_find (GstByteStream *bs,
+ gpointer private)
{
- gchar *data = GST_BUFFER_DATA (buf);
- GstCaps *new;
+ GstBuffer *buf = NULL;
+ GstCaps *new = NULL;
GST_DEBUG ("cdxa_parse: typefind");
- if (GST_BUFFER_SIZE (buf) < 12)
- return NULL;
+ if (gst_bytestream_peek (bs, &buf, 12) == 12) {
+ guint32 head1 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[0]),
+ head2 = GUINT32_FROM_LE (((guint32 *) GST_BUFFER_DATA (buf))[2]);
- if (GUINT32_FROM_LE (((guint32 *)data)[0]) != GST_RIFF_TAG_RIFF)
- return NULL;
- if (GUINT32_FROM_LE (((guint32 *)data)[2]) != GST_RIFF_RIFF_CDXA)
- return NULL;
+ if (head1 == GST_RIFF_TAG_RIFF && head2 == GST_RIFF_RIFF_CDXA) {
+ new = GST_CAPS_NEW ("cdxa_type_find",
+ "video/x-cdxa",
+ NULL);
+ }
+ }
- new = GST_CAPS_NEW ("cdxa_type_find",
- "video/x-cdxa",
- NULL);
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
return new;
}
@@ -341,10 +344,6 @@
{
GstElementFactory *factory;
GstTypeFactory *type;
-
- /* this filter needs the riff parser */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
/* create an elementfactory for the cdxa_parse element */
factory = gst_element_factory_new ("cdxaparse", GST_TYPE_CDXA_PARSE,
Index: gstcdxaparse.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/cdxaparse/gstcdxaparse.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gstcdxaparse.h 20 Apr 2002 21:42:29 -0000 1.1
+++ gstcdxaparse.h 1 Oct 2003 13:14:47 -0000 1.2
@@ -24,7 +24,7 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#ifdef __cplusplus
extern "C" {
Index: gstflxdec.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/flx/gstflxdec.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- gstflxdec.c 16 Sep 2003 09:59:58 -0000 1.26
+++ gstflxdec.c 1 Oct 2003 13:14:47 -0000 1.27
@@ -28,7 +28,7 @@
#define JIFFIE (GST_SECOND/70)
-static GstCaps* flxdec_type_find(GstBuffer *buf, gpointer private);
+static GstCaps* flxdec_type_find (GstByteStream *bs, gpointer private);
/* flx element information */
static GstElementDetails flxdec_details = {
@@ -113,27 +113,33 @@
static GstElementClass *parent_class = NULL;
static GstCaps*
-flxdec_type_find (GstBuffer *buf, gpointer private)
+flxdec_type_find (GstByteStream *bs, gpointer private)
{
- guchar *data = GST_BUFFER_DATA(buf);
- GstCaps *new;
+ GstBuffer *buf = NULL;
+ GstCaps *new = NULL;
- if (GST_BUFFER_SIZE(buf) < 134){
- return NULL;
- }
+ if (gst_bytestream_peek (bs, &buf, 134) == 134) {
+ guint8 *data = GST_BUFFER_DATA (buf);
- /* check magic */
- if ((data[4] == 0x11 || data[4] == 0x12
- || data[4] == 0x30 || data[4] == 0x44) && data[5] == 0xaf) {
+ /* check magic */
+ if ((data[4] == 0x11 || data[4] == 0x12 ||
+ data[4] == 0x30 || data[4] == 0x44) &&
+ data[5] == 0xaf) {
/* check the frame type of the first frame */
if ((data[132] == 0x00 || data[132] == 0xfa) && data[133] == 0xf1) {
GST_DEBUG ("GstFlxDec: found supported flx format");
- new = gst_caps_new("flxdec_type_find","video/x-fli", NULL);
- return new;
+ new = gst_caps_new ("flxdec_type_find",
+ "video/x-fli",
+ NULL);
}
+ }
}
-
- return NULL;
+
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
+ return new;
}
@@ -683,10 +689,6 @@
{
GstElementFactory *factory;
GstTypeFactory *type;
-
- /* this filter needs the bytestream package */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
factory = gst_element_factory_new("flxdec", GST_TYPE_FLXDEC, &flxdec_details);
g_return_val_if_fail(factory != NULL, FALSE);
Index: gstflxdec.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/flx/gstflxdec.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gstflxdec.h 20 Mar 2002 21:44:50 -0000 1.4
+++ gstflxdec.h 1 Oct 2003 13:14:47 -0000 1.5
@@ -23,7 +23,7 @@
#include <gst/gst.h>
#include "flx_color.h"
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#ifdef __cplusplus
Index: gstfloat2int.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/intfloat/gstfloat2int.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- gstfloat2int.c 30 Sep 2003 12:47:48 -0000 1.43
+++ gstfloat2int.c 1 Oct 2003 13:14:48 -0000 1.44
@@ -522,9 +522,6 @@
{
GstElementFactory *factory;
- if (! gst_library_load ("gstbytestream"))
- return FALSE;
-
factory = gst_element_factory_new ("float2int", GST_TYPE_FLOAT2INT,
&float2int_details);
g_return_val_if_fail(factory != NULL, FALSE);
Index: gstfloat2int.h
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/intfloat/gstfloat2int.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gstfloat2int.h 30 Sep 2003 12:47:48 -0000 1.13
+++ gstfloat2int.h 1 Oct 2003 13:14:48 -0000 1.14
@@ -27,7 +27,6 @@
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
#define GST_TYPE_FLOAT2INT \
Index: mixmatrix.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/gst/mixmatrix/mixmatrix.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- mixmatrix.c 25 Jul 2003 10:50:47 -0000 1.12
+++ mixmatrix.c 1 Oct 2003 13:14:48 -0000 1.13
@@ -22,7 +22,7 @@
#endif
#include <config.h>
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include <gst/audio/audio.h>
#include <string.h>
@@ -499,10 +499,6 @@
plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
-
- /* this filter needs the bytestream package */
- if (!gst_library_load ("gstbytestream"))
- return FALSE;
factory = gst_element_factory_new ("mixmatrix", GST_TYPE_MIXMATRIX,
&mixmatrix_details);
|