diff --git a/ChangeLog b/ChangeLog index 28a9a312d1..8b41f7f1e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-28 Sebastian Dröge + + * gst/typefind/gsttypefindfunctions.c: (celt_type_find), + (plugin_init): + Add simple typefinder for the CELT codec (www.celt-codec.org). + 2008-07-27 Sebastian Dröge Patch by: Jan Gerber diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index e624c59886..e903a565e9 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -2530,6 +2530,26 @@ speex_type_find (GstTypeFind * tf, gpointer private) } } +/*** audio/x-celt ***/ + +static GstStaticCaps celt_caps = GST_STATIC_CAPS ("audio/x-celt"); + +#define CELT_CAPS (gst_static_caps_get(&celt_caps)) +static void +celt_type_find (GstTypeFind * tf, gpointer private) +{ + guint8 *data = gst_type_find_peek (tf, 0, 8); + + if (data) { + /* 8 byte string "CELT " */ + if (memcmp (data, "CELT ", 8) != 0) + return; + + /* TODO: Check other values of the CELT header */ + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, CELT_CAPS); + } +} + /*** application/x-ogg-skeleton ***/ static GstStaticCaps ogg_skeleton_caps = GST_STATIC_CAPS ("application/x-ogg-skeleton, parsed=(boolean)FALSE"); @@ -3166,6 +3186,8 @@ plugin_init (GstPlugin * plugin) ogmtext_type_find, NULL, OGMTEXT_CAPS, NULL, NULL); TYPE_FIND_REGISTER (plugin, "audio/x-speex", GST_RANK_PRIMARY, speex_type_find, NULL, SPEEX_CAPS, NULL, NULL); + TYPE_FIND_REGISTER (plugin, "audio/x-celt", GST_RANK_PRIMARY, + celt_type_find, NULL, CELT_CAPS, NULL, NULL); TYPE_FIND_REGISTER (plugin, "application/x-ogg-skeleton", GST_RANK_PRIMARY, oggskel_type_find, NULL, OGG_SKELETON_CAPS, NULL, NULL); TYPE_FIND_REGISTER (plugin, "text/x-cmml", GST_RANK_PRIMARY, cmml_type_find,