diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-01 10:50:57 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-01 10:50:57 +0000 |
commit | 1b6c3e0efa775296d2c814882c3feb2ce35b7539 (patch) | |
tree | 039e6f440780653391016c80214e01bed0312e86 /gst-libs/gst/riff | |
parent | 18d9e0f874ad7ff54c1029006fde8510e3e18271 (diff) | |
download | gst-plugins-bad-1b6c3e0efa775296d2c814882c3feb2ce35b7539.tar.gz gst-plugins-bad-1b6c3e0efa775296d2c814882c3feb2ce35b7539.tar.bz2 gst-plugins-bad-1b6c3e0efa775296d2c814882c3feb2ce35b7539.zip |
gst-libs/gst/riff/riff-media.c: Add codec_data handling (like asfdemux used to do).
Original commit message from CVS:
* gst-libs/gst/riff/riff-media.c:
(gst_riff_create_video_caps_with_data),
(gst_riff_create_audio_caps_with_data):
Add codec_data handling (like asfdemux used to do).
* gst/asfdemux/gstasf.c: (plugin_init):
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_base_init),
(gst_asf_demux_add_audio_stream), (gst_asf_demux_add_video_stream):
Use riff-media for caps creation instead of our own (mostly
broken) copy of its functions.
Diffstat (limited to 'gst-libs/gst/riff')
-rw-r--r-- | gst-libs/gst/riff/riff-media.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index 20f8d0dc..040f203d 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -185,6 +185,7 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc, break; case GST_MAKE_FOURCC ('M', 'P', 'G', '4'): + case GST_MAKE_FOURCC ('M', 'P', '4', 'S'): caps = gst_caps_new_simple ("video/x-msmpeg", "msmpegversion", G_TYPE_INT, 41, NULL); if (codec_name) @@ -284,6 +285,7 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc, "palette_data", &value); g_value_unset (&value); gst_buffer_unref (copy); + strf_data = NULL; /* used */ } if (strf) { gst_caps_set_simple (caps, @@ -320,6 +322,12 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc, "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); } + /* extradata */ + if (strf_data || strd_data) { + gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, + strf_data ? strf_data : strd_data, NULL); + } + return caps; } @@ -431,8 +439,9 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id, break; case GST_RIFF_WAVE_FORMAT_WMAV1: case GST_RIFF_WAVE_FORMAT_WMAV2: + case GST_RIFF_WAVE_FORMAT_WMAV3: { - gint version = codec_id == GST_RIFF_WAVE_FORMAT_WMAV1 ? 1 : 2; + gint version = (codec_id - GST_RIFF_WAVE_FORMAT_WMAV1) + 1; block_align = TRUE; @@ -449,10 +458,6 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id, gst_caps_set_simple (caps, "bitrate", GST_TYPE_INT_RANGE, 0, G_MAXINT, NULL); } - if (strf_data) { - gst_caps_set_simple (caps, - "codec_data", GST_TYPE_BUFFER, strf_data, NULL); - } break; } default: @@ -482,6 +487,12 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id, } } + /* extradata */ + if (strf_data || strd_data) { + gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, + strf_data ? strf_data : strd_data, NULL); + } + return caps; } |