From d9e4457faa360b470a5ae418e3444fccd6c0a5de Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 1 Oct 2003 13:14:50 +0000 Subject: New typefind system: bytestream is now part of the core all plugins have been modified to use this new typefind syste... Original commit message from CVS: 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 --- gst/festival/gstfestival.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'gst/festival/gstfestival.c') diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index 87416184..4113410a 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -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 @@ gst_festival_init (GstFestival *festival) } 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