diff options
author | Benjamin Otte <otte@gnome.org> | 2003-10-28 20:52:41 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-10-28 20:52:41 +0000 |
commit | 5bb80c9f5359a446d52ad7824095ae4c67bf3cdf (patch) | |
tree | 389f062ecc5627e362c48b89fda7257d10fa8d8c /gst/festival | |
parent | 680f08e33306ff907e31b3c9db70e132fc9a5158 (diff) | |
download | gstreamer-plugins-bad-5bb80c9f5359a446d52ad7824095ae4c67bf3cdf.tar.gz |
merge TYPEFIND branch. Major changes:
Original commit message from CVS:
merge TYPEFIND branch. Major changes:
- totally reworked type(find) system
- all typefind functions are in gst/typefind now
- more typefind functions then before
- some plugins might fail to compile now because I don't have them installed and they
a) require bytestream or
b) haven't had their typefind fixed.
Please fix those plugins and put the typefind functions into gst/typefind if they don't have dependencies
Diffstat (limited to 'gst/festival')
-rw-r--r-- | gst/festival/gstfestival.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index a0f3b8f60..636f1e12b 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -80,8 +80,6 @@ static void gst_festival_class_init (GstFestivalClass *klass); static void gst_festival_init (GstFestival *festival); -static GstCaps* text_type_find (GstByteStream *bs, gpointer private); - static void gst_festival_chain (GstPad *pad, GstData *_data); static GstElementStateReturn gst_festival_change_state (GstElement *element); @@ -123,17 +121,6 @@ GST_PAD_TEMPLATE_FACTORY (src_template_factory, ) ) -/* typefactory for 'wav' */ -static GstTypeDefinition -textdefinition = -{ - "festival_text/plain", - "text/plain", - ".txt", - text_type_find, -}; - - /* Festival signals and args */ enum { /* FILL ME */ @@ -197,40 +184,6 @@ gst_festival_init (GstFestival *festival) festival->info = festival_default_info(); } -static GstCaps* -text_type_find (GstByteStream *bs, gpointer private) -{ - GstBuffer *buf = NULL; - GstCaps *new = NULL; - -#define TEXT_SIZE 32 - - /* 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') { - goto out; - } - } - - /* well, we found something that looks like text... */ - new = gst_caps_new ("text_type_find", - "text/plain", - NULL); - } -out: - - if (buf != NULL) { - gst_buffer_unref (buf); - } - - return new; -} - - static void gst_festival_chain (GstPad *pad, GstData *_data) { @@ -484,7 +437,6 @@ static gboolean plugin_init (GModule *module, GstPlugin *plugin) { GstElementFactory *factory; - GstTypeFactory *type; /* create an elementfactory for the festival element */ factory = gst_element_factory_new ("festival", GST_TYPE_FESTIVAL, @@ -495,9 +447,7 @@ plugin_init (GModule *module, GstPlugin *plugin) gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_template_factory)); gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (src_template_factory)); - type = gst_type_factory_new (&textdefinition); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type)); return TRUE; } |