gst/: First batch implementing audio and video codec tags in demuxers.

Original commit message from CVS:
2004-02-23  Julien MOUTTE  <julien@moutte.net>

* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps),
(gst_riff_create_audio_caps), (gst_riff_create_iavs_caps),
(gst_riff_create_video_template_caps),
(gst_riff_create_audio_template_caps),
(gst_riff_create_iavs_template_caps):
* gst-libs/gst/riff/riff-media.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_base_init),
(gst_asf_demux_audio_caps), (gst_asf_demux_add_audio_stream),
(gst_asf_demux_video_caps), (gst_asf_demux_add_video_stream):
* gst/avi/gstavidemux.c: (gst_avi_demux_add_stream):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps),
(gst_matroska_demux_plugin_init): First batch implementing audio and
video codec tags in demuxers.
This commit is contained in:
Julien Moutte 2004-02-23 22:16:21 +00:00
parent d4e6be4034
commit 430e217dbd
4 changed files with 222 additions and 34 deletions

View file

@ -1,3 +1,20 @@
2004-02-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps),
(gst_riff_create_audio_caps), (gst_riff_create_iavs_caps),
(gst_riff_create_video_template_caps),
(gst_riff_create_audio_template_caps),
(gst_riff_create_iavs_template_caps):
* gst-libs/gst/riff/riff-media.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_base_init),
(gst_asf_demux_audio_caps), (gst_asf_demux_add_audio_stream),
(gst_asf_demux_video_caps), (gst_asf_demux_add_video_stream):
* gst/avi/gstavidemux.c: (gst_avi_demux_add_stream):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps),
(gst_matroska_demux_plugin_init): First batch implementing audio and
video codec tags in demuxers.
2004-02-22 Benjamin Otte <otte@gnome.org>
* ext/xine/Makefile.am:

View file

@ -29,89 +29,158 @@
GstCaps *
gst_riff_create_video_caps (guint32 codec_fcc,
gst_riff_strh *strh,
gst_riff_strf_vids *strf)
gst_riff_strf_vids *strf,
char **codec_name)
{
GstCaps *caps = NULL;
switch (codec_fcc) {
case GST_MAKE_FOURCC('I','4','2','0'):
caps = gst_caps_new_simple ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, codec_fcc,
NULL);
if (codec_name)
*codec_name = g_strdup ("Raw, uncompressed I420");
break;
case GST_MAKE_FOURCC('Y','U','Y','2'):
caps = gst_caps_new_simple ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, codec_fcc,
NULL);
if (codec_name)
*codec_name = g_strdup ("Raw, uncompressed YUV 4:2:2");
break;
case GST_MAKE_FOURCC('M','J','P','G'): /* YUY2 MJPEG */
caps = gst_caps_new_simple ("video/x-jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("Motion JPEG");
break;
case GST_MAKE_FOURCC('J','P','E','G'): /* generic (mostly RGB) MJPEG */
caps = gst_caps_new_simple ("video/x-jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("JPEG Still Image");
break;
case GST_MAKE_FOURCC('P','I','X','L'): /* Miro/Pinnacle fourccs */
case GST_MAKE_FOURCC('V','I','X','L'): /* Miro/Pinnacle fourccs */
caps = gst_caps_new_simple ("video/x-jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("Miro/Pinnacle Video XL");
break;
case GST_MAKE_FOURCC('H','F','Y','U'):
caps = gst_caps_new_simple ( "video/x-huffyuv", NULL);
if (codec_name)
*codec_name = g_strdup ("Huffman Lossless Codec");
break;
case GST_MAKE_FOURCC('M','P','E','G'):
case GST_MAKE_FOURCC('M','P','G','I'):
caps = gst_caps_new_simple ("video/mpeg",
"systemstream", G_TYPE_BOOLEAN, FALSE,
"mpegversion", G_TYPE_BOOLEAN, 1,
NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG video");
break;
case GST_MAKE_FOURCC('H','2','6','3'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("ITU H.26n");
break;
case GST_MAKE_FOURCC('i','2','6','3'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("ITU H.263");
break;
case GST_MAKE_FOURCC('L','2','6','3'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("Lead H.263");
break;
case GST_MAKE_FOURCC('M','2','6','3'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft H.263");
break;
case GST_MAKE_FOURCC('V','D','O','W'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("VDOLive");
break;
case GST_MAKE_FOURCC('V','I','V','O'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("Vivo H.263");
break;
case GST_MAKE_FOURCC('x','2','6','3'):
caps = gst_caps_new_simple ("video/x-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("Xirlink H.263");
break;
case GST_MAKE_FOURCC('D','I','V','3'):
case GST_MAKE_FOURCC('D','I','V','4'):
case GST_MAKE_FOURCC('D','I','V','5'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 3,
NULL);
if (codec_name)
*codec_name = g_strdup ("DivX MPEG-4 Version 3");
break;
case GST_MAKE_FOURCC('D','I','V','4'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 4,
NULL);
if (codec_name)
*codec_name = g_strdup ("DivX MPEG-4 Version 4");
break;
case GST_MAKE_FOURCC('d','i','v','x'):
case GST_MAKE_FOURCC('D','I','V','X'):
case GST_MAKE_FOURCC('D','X','5','0'):
case GST_MAKE_FOURCC('D','I','V','5'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 5,
NULL);
if (codec_name)
*codec_name = g_strdup ("DivX MPEG-4 Version 5");
break;
case GST_MAKE_FOURCC('X','V','I','D'):
case GST_MAKE_FOURCC('x','v','i','d'):
caps = gst_caps_new_simple ("video/x-xvid", NULL);
if (codec_name)
*codec_name = g_strdup ("XVID MPEG-4");
break;
case GST_MAKE_FOURCC('M','P','G','4'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 41,
NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.1");
break;
case GST_MAKE_FOURCC('M','P','4','2'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 42,
NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.2");
break;
case GST_MAKE_FOURCC('M','P','4','3'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 43,
NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.3");
break;
case GST_MAKE_FOURCC('3','I','V','1'):
case GST_MAKE_FOURCC('3','I','V','2'):
caps = gst_caps_new_simple ( "video/x-3ivx", NULL);
if (codec_name)
*codec_name = g_strdup ("3ivx");
break;
case GST_MAKE_FOURCC('D','V','S','D'):
@ -119,18 +188,32 @@ gst_riff_create_video_caps (guint32 codec_fcc,
caps = gst_caps_new_simple ("video/x-dv",
"systemstream", G_TYPE_BOOLEAN, FALSE,
NULL);
if (codec_name)
*codec_name = g_strdup ("Generic DV");
break;
case GST_MAKE_FOURCC('W','M','V','1'):
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 1,
NULL);
if (codec_name)
*codec_name = g_strdup ("Windows Media Video 7");
break;
case GST_MAKE_FOURCC('W','M','V','2'):
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 2,
NULL);
if (codec_name)
*codec_name = g_strdup ("Windows Media Video 8");
break;
case GST_MAKE_FOURCC('W','M','V','3'):
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 3,
NULL);
if (codec_name)
*codec_name = g_strdup ("Windows Media Video 9");
break;
default:
@ -167,7 +250,8 @@ gst_riff_create_video_caps (guint32 codec_fcc,
GstCaps *
gst_riff_create_audio_caps (guint16 codec_id,
gst_riff_strh *strh,
gst_riff_strf_auds *strf)
gst_riff_strf_auds *strf,
char **codec_name)
{
GstCaps *caps = NULL;
@ -177,6 +261,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
"mpegversion", G_TYPE_INT, 1,
"layer", G_TYPE_INT, 3,
NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG 1 layer 3");
break;
case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */
@ -184,6 +270,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
"mpegversion", G_TYPE_INT, 1,
"layer", G_TYPE_INT, 2,
NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG 1 layer 2");
break;
case GST_RIFF_WAVE_FORMAT_PCM: /* PCM/wav */
@ -205,6 +293,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
"width = (int) { 8, 16 }, "
"height = (int) { 8, 16 }");
}
if (codec_name)
*codec_name = g_strdup ("PCM WAV");
break;
case GST_RIFF_WAVE_FORMAT_MULAW:
@ -213,6 +303,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
strf->size);
}
caps = gst_caps_new_simple ("audio/x-mulaw", NULL);
if (codec_name)
*codec_name = g_strdup ("Mulaw");
break;
case GST_RIFF_WAVE_FORMAT_ALAW:
@ -221,6 +313,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
strf->size);
}
caps = gst_caps_new_simple ("audio/x-alaw", NULL);
if (codec_name)
*codec_name = g_strdup ("Alaw");
break;
case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */
@ -230,10 +324,14 @@ gst_riff_create_audio_caps (guint16 codec_id,
case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */
case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */
caps = gst_caps_new_simple ("audio/x-vorbis", NULL);
if (codec_name)
*codec_name = g_strdup ("Vorbis");
break;
case GST_RIFF_WAVE_FORMAT_A52:
caps = gst_caps_new_simple ("audio/x-ac3", NULL);
if (codec_name)
*codec_name = g_strdup ("AC3");
break;
default:
@ -260,7 +358,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
GstCaps *
gst_riff_create_iavs_caps (guint32 codec_fcc,
gst_riff_strh *strh,
gst_riff_strf_iavs *strf)
gst_riff_strf_iavs *strf,
char **codec_name)
{
GstCaps *caps = NULL;
@ -270,6 +369,8 @@ gst_riff_create_iavs_caps (guint32 codec_fcc,
case GST_MAKE_FOURCC ('d','v','s','d'):
caps = gst_caps_new_simple ("video/x-dv",
"systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
if (codec_name)
*codec_name = g_strdup ("Generic DV");
default:
GST_WARNING ("Unkown IAVS fourcc " GST_FOURCC_FORMAT,
@ -312,7 +413,7 @@ gst_riff_create_video_template_caps (void)
caps = gst_caps_new_empty ();
for (i = 0; tags[i] != 0; i++) {
one = gst_riff_create_video_caps (tags[i], NULL, NULL);
one = gst_riff_create_video_caps (tags[i], NULL, NULL, NULL);
if (one)
gst_caps_append (caps, one);
}
@ -339,7 +440,7 @@ gst_riff_create_audio_template_caps (void)
caps = gst_caps_new_empty ();
for (i = 0; tags[i] != 0; i++) {
one = gst_riff_create_audio_caps (tags[i], NULL, NULL);
one = gst_riff_create_audio_caps (tags[i], NULL, NULL, NULL);
if (one)
gst_caps_append (caps, one);
}
@ -360,11 +461,10 @@ gst_riff_create_iavs_template_caps (void)
caps = gst_caps_new_empty ();
for (i = 0; tags[i] != 0; i++) {
one = gst_riff_create_iavs_caps (tags[i], NULL, NULL);
one = gst_riff_create_iavs_caps (tags[i], NULL, NULL, NULL);
if (one)
gst_caps_append (caps, one);
}
return caps;
}

View file

@ -34,13 +34,16 @@ G_BEGIN_DECLS
GstCaps *gst_riff_create_video_caps (guint32 codec_fcc,
gst_riff_strh *strh,
gst_riff_strf_vids *strf);
gst_riff_strf_vids *strf,
char **codec_name);
GstCaps *gst_riff_create_audio_caps (guint16 codec_id,
gst_riff_strh *strh,
gst_riff_strf_auds *strf);
gst_riff_strf_auds *strf,
char **codec_name);
GstCaps *gst_riff_create_iavs_caps (guint32 codec_fcc,
gst_riff_strh *strh,
gst_riff_strf_iavs *strf);
gst_riff_strf_iavs *strf,
char **codec_name);
/*
* Create template caps (includes all known types).

View file

@ -86,9 +86,12 @@ static gboolean gst_asf_demux_setup_pad (GstASFDemux *asf_demu
static GstElementStateReturn gst_asf_demux_change_state (GstElement *element);
static GstCaps * gst_asf_demux_video_caps (guint32 codec_fcc,
asf_stream_video_format *video);
asf_stream_video_format *video,
char **codec_name);
static GstCaps * gst_asf_demux_audio_caps (guint16 codec_id,
asf_stream_audio *audio, guint8 *extradata);
asf_stream_audio *audio,
guint8 *extradata,
char **codec_name);
static GstPadTemplate *videosrctempl, *audiosrctempl;
static GstElementClass *parent_class = NULL;
@ -149,7 +152,7 @@ gst_asf_demux_base_init (gpointer g_class)
audcaps = gst_caps_new_empty();
for (i = 0; aud_list[i] != -1; i++) {
temp = gst_asf_demux_audio_caps (aud_list[i], NULL, NULL);
temp = gst_asf_demux_audio_caps (aud_list[i], NULL, NULL, NULL);
gst_caps_append (audcaps, temp);
}
@ -160,7 +163,7 @@ gst_asf_demux_base_init (gpointer g_class)
vidcaps = gst_caps_new_empty();
for (i = 0; vid_list[i] != 0; i++) {
temp = gst_asf_demux_video_caps (vid_list[i], NULL);
temp = gst_asf_demux_video_caps (vid_list[i], NULL, NULL);
gst_caps_append (vidcaps, temp);
}
@ -1310,7 +1313,8 @@ gst_asf_demux_identify_guid (GstASFDemux *asf_demux,
static GstCaps *
gst_asf_demux_audio_caps (guint16 codec_id,
asf_stream_audio *audio, guint8 *extradata)
asf_stream_audio *audio, guint8 *extradata,
char **codec_name)
{
GstCaps *caps;
gint flags1, flags2;
@ -1322,11 +1326,15 @@ gst_asf_demux_audio_caps (guint16 codec_id,
case GST_RIFF_WAVE_FORMAT_MPEGL3: /* mp3 */
caps = gst_caps_from_string ("audio/mpeg, mpegversion = (int) 1, "
"layer = (int) 3");
if (codec_name)
*codec_name = g_strdup ("MPEG 1 layer 3");
break;
case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */
caps = gst_caps_from_string ("audio/mpeg, mpegversion = (int) 1, "
"layer = (int) 2");
if (codec_name)
*codec_name = g_strdup ("MPEG 1 layer 2");
break;
case GST_RIFF_WAVE_FORMAT_PCM: /* PCM/wav */ {
@ -1347,6 +1355,8 @@ gst_asf_demux_audio_caps (guint16 codec_id,
"signed", G_TYPE_BOOLEAN, (ws != 8),
NULL);
}
if (codec_name)
*codec_name = g_strdup ("PCM WAV");
}
break;
@ -1357,10 +1367,14 @@ gst_asf_demux_audio_caps (guint16 codec_id,
case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* vorbis mode 2+ */
case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* vorbis mode 3+ */
caps = gst_caps_from_string("audio/x-vorbis");
if (codec_name)
*codec_name = g_strdup ("Vorbis");
break;
case GST_RIFF_WAVE_FORMAT_A52:
caps = gst_caps_from_string("audio/x-ac3");
if (codec_name)
*codec_name = g_strdup ("AC3");
break;
case GST_RIFF_WAVE_FORMAT_DIVX_WMAV1:
@ -1383,6 +1397,8 @@ gst_asf_demux_audio_caps (guint16 codec_id,
"bitrate", G_TYPE_INT, audio->byte_rate * 8,
NULL);
}
if (codec_name)
*codec_name = g_strdup ("Microsoft WMA V1");
break;
case GST_RIFF_WAVE_FORMAT_DIVX_WMAV2:
@ -1406,11 +1422,15 @@ gst_asf_demux_audio_caps (guint16 codec_id,
"bitrate", G_TYPE_INT, audio->byte_rate * 8,
NULL);
}
if (codec_name)
*codec_name = g_strdup ("Microsoft WMA V2");
break;
case GST_RIFF_WAVE_FORMAT_WMAV9:
caps = gst_caps_from_string("audio/x-wma, "
"wmaversion = (int) 9");
if (codec_name)
*codec_name = g_strdup ("Microsoft WMA V9");
break;
default:
@ -1440,11 +1460,13 @@ gst_asf_demux_add_audio_stream (GstASFDemux *asf_demux,
asf_stream_audio *audio,
guint16 id)
{
GstPad *src_pad;
GstCaps *caps;
gchar *name = NULL;
guint16 size_left = 0;
GstPad *src_pad;
GstCaps *caps;
gchar *name = NULL;
guint16 size_left = 0;
char *codec_name = NULL;
GstTagList *list = gst_tag_list_new ();
size_left = audio->size;
/* Create the audio pad */
@ -1461,12 +1483,21 @@ gst_asf_demux_add_audio_stream (GstASFDemux *asf_demux,
GST_WARNING_OBJECT (asf_demux, "asfdemux: Audio header contains %d bytes of surplus data", size_left);
gst_bytestream_peek_bytes (asf_demux->bs, &extradata, size_left);
caps = gst_asf_demux_audio_caps (audio->codec_tag, audio, extradata);
caps = gst_asf_demux_audio_caps (audio->codec_tag, audio, extradata,
&codec_name);
gst_bytestream_flush (asf_demux->bs, size_left);
} else {
caps = gst_asf_demux_audio_caps (audio->codec_tag, audio, NULL);
caps = gst_asf_demux_audio_caps (audio->codec_tag, audio, NULL,
&codec_name);
}
/* Informing about that audio format we just added */
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, GST_TAG_AUDIO_CODEC,
codec_name, NULL);
gst_element_found_tags (GST_ELEMENT (asf_demux), list);
gst_tag_list_free (list);
if (codec_name) g_free (codec_name);
GST_INFO ("Adding audio stream %u codec %u (0x%x)",
asf_demux->num_video_streams,
audio->codec_tag,
@ -1479,7 +1510,8 @@ gst_asf_demux_add_audio_stream (GstASFDemux *asf_demux,
static GstCaps *
gst_asf_demux_video_caps (guint32 codec_fcc,
asf_stream_video_format *video)
asf_stream_video_format *video,
char **codec_name)
{
GstCaps *caps = NULL;
gint width = 0, height = 0;
@ -1491,47 +1523,73 @@ gst_asf_demux_video_caps (guint32 codec_fcc,
switch (codec_fcc) {
case GST_MAKE_FOURCC('I','4','2','0'):
caps = gst_caps_new_simple ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, codec_fcc, NULL);
if (codec_name)
*codec_name = g_strdup ("Raw, uncompressed I420");
case GST_MAKE_FOURCC('Y','U','Y','2'):
caps = gst_caps_new_simple ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, codec_fcc, NULL);
if (codec_name)
*codec_name = g_strdup ("Raw, uncompressed YUV 4:2:2");
break;
case GST_MAKE_FOURCC('M','J','P','G'):
caps = gst_caps_new_simple ("video/x-jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("Motion JPEG");
case GST_MAKE_FOURCC('J','P','E','G'):
caps = gst_caps_new_simple ("video/x-jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("JPEG Still Image");
case GST_MAKE_FOURCC('P','I','X','L'):
case GST_MAKE_FOURCC('V','I','X','L'):
caps = gst_caps_new_simple ("video/x-jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("Miro/Pinnacle Video XL");
break;
case GST_MAKE_FOURCC('D','V','S','D'):
case GST_MAKE_FOURCC('d','v','s','d'):
caps = gst_caps_new_simple ("video/x-dv",
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
if (codec_name)
*codec_name = g_strdup ("Generic DV");
break;
case GST_MAKE_FOURCC('W','M','V','1'):
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 1, NULL);
if (codec_name)
*codec_name = g_strdup ("Windows Media Video 7");
break;
case GST_MAKE_FOURCC('W','M','V','2'):
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 2, NULL);
if (codec_name)
*codec_name = g_strdup ("Windows Media Video 8");
break;
case GST_MAKE_FOURCC('M','P','G','4'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 41, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.1");
break;
case GST_MAKE_FOURCC('M','P','4','2'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 42, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.2");
break;
case GST_MAKE_FOURCC('M','P','4','3'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 43, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.3");
break;
case GST_MAKE_FOURCC('D','I','V','3'):
@ -1539,6 +1597,8 @@ gst_asf_demux_video_caps (guint32 codec_fcc,
case GST_MAKE_FOURCC('D','I','V','5'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 3, NULL);
if (codec_name)
*codec_name = g_strdup ("DivX MPEG-4 Version 3");
break;
case GST_MAKE_FOURCC('D','I','V','X'):
@ -1546,6 +1606,8 @@ gst_asf_demux_video_caps (guint32 codec_fcc,
case GST_MAKE_FOURCC('D','X','5','0'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 5, NULL);
if (codec_name)
*codec_name = g_strdup ("DivX MPEG-4 Version 5");
break;
default:
@ -1575,18 +1637,24 @@ static gboolean
gst_asf_demux_add_video_stream (GstASFDemux *asf_demux,
asf_stream_video_format *video,
guint16 id) {
GstPad *src_pad;
GstCaps *caps;
gchar *name = NULL;
GstPad *src_pad;
GstCaps *caps;
gchar *name = NULL;
char *codec_name = NULL;
GstTagList *list = gst_tag_list_new ();
/* Create the audio pad */
name = g_strdup_printf ("video_%02d", asf_demux->num_video_streams);
src_pad = gst_pad_new_from_template (videosrctempl, name);
g_free (name);
/* Now try some gstreamer formatted MIME types (from gst_avi_demux_strf_vids) */
caps = gst_asf_demux_video_caps (video->tag, video);
caps = gst_asf_demux_video_caps (video->tag, video, &codec_name);
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC,
codec_name, NULL);
gst_element_found_tags (GST_ELEMENT (asf_demux), list);
gst_tag_list_free (list);
if (codec_name) g_free (codec_name);
GST_INFO ("Adding video stream %u codec " GST_FOURCC_FORMAT " (0x%08x)",
asf_demux->num_video_streams,
GST_FOURCC_ARGS(video->tag),