+2008-08-28 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ Patch by: Mersad Jelacic <mersad at axis dot com>
+
+ * gst/multipart/multipartdemux.c:
+ * gst/multipart/multipartmux.c: (gst_multipart_mux_get_mime):
+ Convert audio/x-adpcm to and from the audio/G726-X in the muxer and
+ demuxer. Fixes #549551.
+
2008-08-27 Edward Hervey <edward.hervey@collabora.co.uk>
* sys/osxaudio/gstosxaudiosink.c:
static const GstNamesMap gstnames[] = {
/* RFC 2046 says audio/basic is mulaw, mono, 8000Hz */
{"audio/basic", "audio/x-mulaw, channels=1, rate=8000"},
+ {"audio/G726-16", "audio/x-adpcm, bitrate=16000"},
+ {"audio/G726-24", "audio/x-adpcm, bitrate=24000"},
+ {"audio/G726-32", "audio/x-adpcm, bitrate=32000"},
+ {"audio/G726-40", "audio/x-adpcm, bitrate=40000"},
{NULL, NULL}
};
const gchar *name;
gint rate;
gint channels;
+ gint bitrate = 0;
klass = GST_MULTIPART_MUX_GET_CLASS (mux);
/* use hashtable to convert to mime type */
mime = g_hash_table_lookup (klass->mimetypes, name);
if (mime == NULL) {
- /* no mime type mapping, use name */
- mime = name;
+ if (!strcmp (name, "audio/x-adpcm"))
+ gst_structure_get_int (s, "bitrate", &bitrate);
+
+ switch (bitrate) {
+ case 16000:
+ mime = "audio/G726-16";
+ break;
+ case 24000:
+ mime = "audio/G726-24";
+ break;
+ case 32000:
+ mime = "audio/G726-32";
+ break;
+ case 40000:
+ mime = "audio/G726-40";
+ break;
+ default:
+ /* no mime type mapping, use name */
+ mime = name;
+ break;
+ }
}
/* RFC2046 requires audio/basic to be mulaw 8000Hz mono */
if (g_ascii_strcasecmp (mime, "audio/basic") == 0) {