Commit b060089a authored by Edward Hervey's avatar Edward Hervey
Browse files

gst-libs/gst/riff/riff-media.c: backported updates since branch

Original commit message from CVS:
* gst-libs/gst/riff/riff-media.c:
backported updates since branch
parent 69d36f02
2005-08-08 Edward Hervey <edward@fluendo.com>
* gst-libs/gst/riff/riff-media.c:
backported updates since branch
2005-08-08 Andy Wingo <wingo@pobox.com>
 
* gst-libs/gst/audio/gstbaseaudiosink.c
......
......@@ -94,6 +94,10 @@ gst_riff_create_video_caps (guint32 codec_fcc,
case GST_MAKE_FOURCC ('H', 'F', 'Y', 'U'):
caps = gst_caps_new_simple ("video/x-huffyuv", NULL);
if (strf) {
gst_caps_set_simple (caps, "bpp",
G_TYPE_INT, (int) strf->bit_cnt, NULL);
}
if (codec_name)
*codec_name = g_strdup ("Huffman Lossless Codec");
break;
......@@ -106,7 +110,7 @@ gst_riff_create_video_caps (guint32 codec_fcc,
"systemstream", G_TYPE_BOOLEAN, FALSE,
"mpegversion", G_TYPE_INT, 1, NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG video");
*codec_name = g_strdup ("MPEG-1 video");
break;
case GST_MAKE_FOURCC ('M', 'P', 'G', '2'):
case GST_MAKE_FOURCC ('m', 'p', 'g', '2'):
......@@ -114,7 +118,7 @@ gst_riff_create_video_caps (guint32 codec_fcc,
"systemstream", G_TYPE_BOOLEAN, FALSE,
"mpegversion", G_TYPE_INT, 2, NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG 2 video");
*codec_name = g_strdup ("MPEG-2 video");
break;
case GST_MAKE_FOURCC ('H', '2', '6', '3'):
......@@ -136,6 +140,7 @@ gst_riff_create_video_caps (guint32 codec_fcc,
break;
case GST_MAKE_FOURCC ('M', '2', '6', '3'):
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");
......@@ -159,6 +164,25 @@ gst_riff_create_video_caps (guint32 codec_fcc,
*codec_name = g_strdup ("Xirlink H.263");
break;
/* apparently not standard H.263...? */
case GST_MAKE_FOURCC ('I', '2', '6', '3'):
caps = gst_caps_new_simple ("video/x-intel-h263", NULL);
if (codec_name)
*codec_name = g_strdup ("Intel H.263");
break;
case GST_MAKE_FOURCC ('h', '2', '6', '4'):
caps = gst_caps_new_simple ("video/x-h264", NULL);
if (codec_name)
*codec_name = g_strdup ("ITU H.264");
break;
case GST_MAKE_FOURCC ('V', 'S', 'S', 'H'):
caps = gst_caps_new_simple ("video/x-h264", NULL);
if (codec_name)
*codec_name = g_strdup ("VideoSoft H.264");
break;
case GST_MAKE_FOURCC ('D', 'I', 'V', '3'):
case GST_MAKE_FOURCC ('d', 'i', 'v', '3'):
case GST_MAKE_FOURCC ('D', 'I', 'V', '4'):
......@@ -181,6 +205,13 @@ gst_riff_create_video_caps (guint32 codec_fcc,
*codec_name = g_strdup ("DivX MPEG-4 Version 4");
break;
case GST_MAKE_FOURCC ('B', 'L', 'Z', '0'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 4, NULL);
if (codec_name)
*codec_name = g_strdup ("Blizzard DivX");
break;
case GST_MAKE_FOURCC ('D', 'X', '5', '0'):
caps = gst_caps_new_simple ("video/x-divx",
"divxversion", G_TYPE_INT, 5, NULL);
......@@ -219,6 +250,20 @@ gst_riff_create_video_caps (guint32 codec_fcc,
*codec_name = g_strdup ("Microsoft MPEG-4 4.3");
break;
case GST_MAKE_FOURCC ('M', '4', 'S', '2'):
caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft ISO MPEG-4 1.1");
break;
case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):
caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, NULL);
if (codec_name)
*codec_name = g_strdup ("FFmpeg MPEG-4");
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);
......@@ -238,21 +283,21 @@ gst_riff_create_video_caps (guint32 codec_fcc,
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 1, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft Windows Media 7 (WMV1)");
*codec_name = g_strdup ("Microsoft Windows Media 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 ("Microsoft Windows Media 8 (WMV2)");
*codec_name = g_strdup ("Microsoft Windows Media 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 ("Microsoft Windows Media 9 (WMV3)");
*codec_name = g_strdup ("Microsoft Windows Media 9");
break;
case GST_MAKE_FOURCC ('c', 'v', 'i', 'd'):
......@@ -361,7 +406,7 @@ gst_riff_create_audio_caps (guint16 codec_id,
{
gboolean block_align = FALSE, rate_chan = TRUE;
GstCaps *caps = NULL;
gint rate_min = 8000, rate_max = 96000;
gint rate_min = 1000, rate_max = 96000;
gint channels_max = 2;
switch (codec_id) {
......@@ -369,14 +414,14 @@ gst_riff_create_audio_caps (guint16 codec_id,
caps = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG 1 layer 3");
*codec_name = g_strdup ("MPEG-1 layer 3");
break;
case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */
caps = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 2, NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG 1 layer 2");
*codec_name = g_strdup ("MPEG-1 layer 2");
break;
case GST_RIFF_WAVE_FORMAT_PCM: /* PCM */
......@@ -393,10 +438,12 @@ gst_riff_create_audio_caps (guint16 codec_id,
caps = gst_caps_from_string ("audio/x-raw-int, "
"endianness = (int) LITTLE_ENDIAN, "
"signed = (boolean) { true, false }, "
"width = (int) { 8, 16 }, " "depth = (int) { 8, 16 }");
"width = (int) { 8, 16, 24, 32 }, "
"depth = (int) { 8, 16, 24, 32 }");
}
if (codec_name)
*codec_name = g_strdup ("Uncompressed PCM audio");
if (codec_name && strf)
*codec_name = g_strdup_printf ("Uncompressed %d-bit PCM audio",
strf->size);
break;
case GST_RIFF_WAVE_FORMAT_ADPCM:
......@@ -419,20 +466,38 @@ gst_riff_create_audio_caps (guint16 codec_id,
if (strf != NULL && strf->size != 8) {
GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.",
strf->size);
strf->size = 8;
strf->av_bps = 8;
strf->blockalign = strf->av_bps * strf->channels;
}
if (strf != NULL && (strf->av_bps == 0 || strf->blockalign == 0)) {
GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of mulaw audio",
strf->av_bps, strf->blockalign);
strf->av_bps = strf->size;
strf->blockalign = strf->av_bps * strf->channels;
}
caps = gst_caps_new_simple ("audio/x-mulaw", NULL);
if (codec_name)
*codec_name = g_strdup ("Mulaw");
*codec_name = g_strdup ("Mu-law audio");
break;
case GST_RIFF_WAVE_FORMAT_ALAW:
if (strf != NULL && strf->size != 8) {
GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.",
strf->size);
strf->size = 8;
strf->av_bps = 8;
strf->blockalign = strf->av_bps * strf->channels;
}
if (strf != NULL && (strf->av_bps == 0 || strf->blockalign == 0)) {
GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of alaw audio",
strf->av_bps, strf->blockalign);
strf->av_bps = strf->size;
strf->blockalign = strf->av_bps * strf->channels;
}
caps = gst_caps_new_simple ("audio/x-alaw", NULL);
if (codec_name)
*codec_name = g_strdup ("Alaw");
*codec_name = g_strdup ("A-law audio");
break;
case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */
......@@ -450,7 +515,7 @@ gst_riff_create_audio_caps (guint16 codec_id,
channels_max = 6;
caps = gst_caps_new_simple ("audio/x-ac3", NULL);
if (codec_name)
*codec_name = g_strdup ("AC3");
*codec_name = g_strdup ("AC-3 audio");
break;
case GST_RIFF_WAVE_FORMAT_WMAV1:
case GST_RIFF_WAVE_FORMAT_WMAV2:
......@@ -466,7 +531,7 @@ gst_riff_create_audio_caps (guint16 codec_id,
"wmaversion", G_TYPE_INT, version, NULL);
if (codec_name)
*codec_name = g_strdup_printf ("WMA Version %d", version);
*codec_name = g_strdup_printf ("WMA Version %d", version + 6);
if (strf != NULL) {
gst_caps_set_simple (caps,
......@@ -567,6 +632,8 @@ gst_riff_create_video_template_caps (void)
GST_MAKE_FOURCC ('D', 'I', 'V', '3'),
GST_MAKE_FOURCC ('M', 'P', 'E', 'G'),
GST_MAKE_FOURCC ('H', '2', '6', '3'),
GST_MAKE_FOURCC ('I', '2', '6', '3'),
GST_MAKE_FOURCC ('h', '2', '6', '4'),
GST_MAKE_FOURCC ('D', 'I', 'V', 'X'),
GST_MAKE_FOURCC ('D', 'X', '5', '0'),
GST_MAKE_FOURCC ('X', 'V', 'I', 'D'),
......@@ -577,6 +644,7 @@ gst_riff_create_video_template_caps (void)
GST_MAKE_FOURCC ('D', 'I', 'B', ' '),
GST_MAKE_FOURCC ('X', 'x', 'a', 'n'),
GST_MAKE_FOURCC ('I', 'V', '5', '0'),
GST_MAKE_FOURCC ('M', '4', 'S', '2'),
/* FILL ME */
0
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment