From 04b632fd7aca5ac6a040984a7438d139256fb1f2 Mon Sep 17 00:00:00 2001 From: Edgard Lima Date: Mon, 9 Oct 2006 15:01:30 +0000 Subject: [PATCH] Added typefind functions to video/x-nuv media. Original commit message from CVS: Added typefind functions to video/x-nuv media. --- ChangeLog | 7 +++++++ common | 2 +- gst/typefind/gsttypefindfunctions.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e3905c0f64..108dbadf29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-10-09 Edgard Lima + + Patch by: Renato Filho + + * gst/typefind/gsttypefindfunctions.c: + Added typefind functions to video/x-nuv media. + 2006-10-08 Tim-Philipp Müller * gst-libs/gst/interfaces/xoverlay.c: diff --git a/common b/common index 83b08805d0..efcacf2625 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 83b08805d0c109b6dbdcfca0a8b9659b1c556480 +Subproject commit efcacf2625da231fbee99b68e0f5db6816cf6fad diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 3736e8f6d3..f783b40d1a 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -2238,6 +2238,29 @@ au_type_find (GstTypeFind * tf, gpointer unused) } } + +/*** video/x-nuv ***/ + +/* NOTE: we cannot replace this function with TYPE_FIND_REGISTER_START_WITH, + * as it is only possible to register one typefind factory per 'name' + * (which is in this case the caps), and the first one would be replaced by + * the second one. */ +static GstStaticCaps nuv_caps = GST_STATIC_CAPS ("video/x-nuv"); + +#define NUV_CAPS (gst_static_caps_get(&nuv_caps)) +static void +nuv_type_find (GstTypeFind * tf, gpointer unused) +{ + guint8 *data = gst_type_find_peek (tf, 0, 11); + + if (data) { + if (memcmp (data, "MythTVVideo", 11) == 0 + || memcmp (data, "NuppelVideo", 11) == 0) { + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, NUV_CAPS); + } + } +} + /*** audio/x-paris ***/ /* NOTE: do not replace this function with two TYPE_FIND_REGISTER_START_WITH */ static GstStaticCaps paris_caps = GST_STATIC_CAPS ("audio/x-paris"); @@ -2372,6 +2395,8 @@ G_BEGIN_DECLS{ \ } \ }G_END_DECLS + + /*** plugin initialization ***/ #define TYPE_FIND_REGISTER(plugin,name,rank,func,ext,caps,priv,notify) \ @@ -2463,6 +2488,7 @@ plugin_init (GstPlugin * plugin) }; static gchar *flv_exts[] = { "flv", NULL }; static gchar *m4v_exts[] = { "m4v", NULL }; + static gchar *nuv_exts[] = { "nuv", NULL }; GST_DEBUG_CATEGORY_INIT (type_find_debug, "typefindfunctions", GST_DEBUG_FG_GREEN | GST_DEBUG_BG_RED, "generic type find functions"); @@ -2516,6 +2542,8 @@ plugin_init (GstPlugin * plugin) NULL); TYPE_FIND_REGISTER (plugin, "video/mpeg4", GST_RANK_PRIMARY, mpeg4_video_type_find, m4v_exts, MPEG_VIDEO_CAPS, NULL, NULL); + TYPE_FIND_REGISTER (plugin, "video/x-nuv", GST_RANK_SECONDARY, + nuv_type_find, nuv_exts, NUV_CAPS, NULL, NULL); /* ISO formats */ TYPE_FIND_REGISTER (plugin, "audio/x-m4a", GST_RANK_PRIMARY, m4a_type_find,