Add typefinder for Mobile XMF. Fixes bug #568707.

This commit is contained in:
Benjamin Gaignard 2009-01-23 10:19:27 +01:00 committed by Sebastian Dröge
parent 16347bfa21
commit 336e1346e4

View file

@ -412,6 +412,33 @@ mid_type_find (GstTypeFind * tf, gpointer unused)
&& data[3] == 'd') && data[3] == 'd')
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, MID_CAPS); gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, MID_CAPS);
} }
/*** audio/mobile-xmf ***/
static GstStaticCaps mxmf_caps = GST_STATIC_CAPS ("audio/mobile-xmf");
#define MXMF_CAPS gst_static_caps_get(&mxmf_caps)
static void
mxmf_type_find (GstTypeFind * tf, gpointer unused)
{
guint8 *data = NULL;
/* Search FileId "XMF_" 4 bytes */
data = gst_type_find_peek (tf, 0, 4);
if (data && data[0] == 'X' && data[1] == 'M' && data[2] == 'F'
&& data[3] == '_') {
/* Search Format version "2.00" 4 bytes */
data = gst_type_find_peek (tf, 4, 4);
if (data && data[0] == '2' && data[1] == '.' && data[2] == '0'
&& data[3] == '0') {
/* Search TypeId 2 1 byte */
data = gst_type_find_peek (tf, 11, 1);
if (data && data[0] == 2 ) {
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, MXMF_CAPS);
}
}
}
}
/*** video/x-fli ***/ /*** video/x-fli ***/
@ -3136,6 +3163,7 @@ plugin_init (GstPlugin * plugin)
static gchar *vivo_exts[] = { "viv", NULL }; static gchar *vivo_exts[] = { "viv", NULL };
static gchar *nsf_exts[] = { "nsf", NULL }; static gchar *nsf_exts[] = { "nsf", NULL };
static gchar *mid_exts[] = { "mid", "midi", NULL }; static gchar *mid_exts[] = { "mid", "midi", NULL };
static gchar *mxmf_exts[] = { "mxmf", NULL };
static gchar *imelody_exts[] = { "imy", "ime", "imelody", NULL }; static gchar *imelody_exts[] = { "imy", "ime", "imelody", NULL };
static gchar *pdf_exts[] = { "pdf", NULL }; static gchar *pdf_exts[] = { "pdf", NULL };
static gchar *mxf_exts[] = { "mxf", NULL }; static gchar *mxf_exts[] = { "mxf", NULL };
@ -3171,6 +3199,8 @@ plugin_init (GstPlugin * plugin)
#endif #endif
TYPE_FIND_REGISTER (plugin, "audio/midi", GST_RANK_PRIMARY, mid_type_find, TYPE_FIND_REGISTER (plugin, "audio/midi", GST_RANK_PRIMARY, mid_type_find,
mid_exts, MID_CAPS, NULL, NULL); mid_exts, MID_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/mobile-xmf", GST_RANK_PRIMARY, mxmf_type_find,
mxmf_exts, MXMF_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "video/x-fli", GST_RANK_MARGINAL, flx_type_find, TYPE_FIND_REGISTER (plugin, "video/x-fli", GST_RANK_MARGINAL, flx_type_find,
flx_exts, FLX_CAPS, NULL, NULL); flx_exts, FLX_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-id3v2", GST_RANK_PRIMARY + 103, TYPE_FIND_REGISTER (plugin, "application/x-id3v2", GST_RANK_PRIMARY + 103,