From 7e11de332c61f536dce6c7de465af929eef1c985 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Thu, 27 Nov 2003 14:52:45 +0000 Subject: [PATCH] m4a typefind function. Original commit message from CVS: m4a typefind function. We think the mimetype is audio/x-m4a, thats what rhythmbox wants but there's also sources to say it could be audio/mp4 or audio/MP4A-LATM --- gst/typefind/gsttypefindfunctions.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 74ad1e0de9..7c517394fd 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -638,6 +638,18 @@ shn_type_find (GstTypeFind *tf, gpointer unused) } } +/*** audio/x-m4a *********************************************/ + +#define AAC_CAPS GST_CAPS_NEW ("m4a_type_find", "audio/x-m4a", NULL) +static void +m4a_type_find (GstTypeFind *tf, gpointer unused) +{ + guint8 *data = gst_type_find_peek (tf, 4, 8); + if (data && memcmp (data, "ftypM4A ", 8) == 0) { + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, AAC_CAPS); + } +} + /*** audio/x-mod *********************************************/ #define MOD_CAPS gst_caps_new ("mod_type_find", "audio/x-mod", NULL) @@ -1003,6 +1015,7 @@ plugin_init (GstPlugin *plugin) static gchar * gz_exts[] = {"gz", NULL}; static gchar * zip_exts[] = {"zip", NULL}; static gchar * compress_exts[] = {"Z", NULL}; + static gchar * m4a_exts[] = {"m4a", NULL}; GST_DEBUG_CATEGORY_INIT (type_find_debug, "typefindfunctions", GST_DEBUG_FG_GREEN | GST_DEBUG_BG_RED, "generic type find functions"); @@ -1083,6 +1096,8 @@ plugin_init (GstPlugin *plugin) compress_exts, "\037\235", 2, GST_TYPE_FIND_LIKELY); TYPE_FIND_REGISTER (plugin, "audio/x-vorbis", GST_RANK_PRIMARY, vorbis_type_find, NULL, VORBIS_CAPS, NULL); + TYPE_FIND_REGISTER (plugin, "audio/x-m4a", GST_RANK_PRIMARY, + m4a_type_find, m4a_exts, AAC_CAPS, NULL); return TRUE; }