diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-11-28 18:13:30 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-11-28 18:13:30 +0000 |
commit | e268611ed89350024e42b1ef89601b58dc18e175 (patch) | |
tree | 032310038c79fd718030f4b9eb6be281d47d0ddc /gst/mxf/mxfaes-bwf.c | |
parent | 4215682bf3232ba87108c37782cf1c178a8768a3 (diff) | |
download | gst-plugins-bad-e268611ed89350024e42b1ef89601b58dc18e175.tar.gz gst-plugins-bad-e268611ed89350024e42b1ef89601b58dc18e175.tar.bz2 gst-plugins-bad-e268611ed89350024e42b1ef89601b58dc18e175.zip |
gst/mxf/: Add support for A-Law encoded audio essence (SMPTE 388M and 382M).
Original commit message from CVS:
* gst/mxf/Makefile.am:
* gst/mxf/mxfaes-bwf.c: (mxf_bwf_create_caps):
* gst/mxf/mxfalaw.c: (mxf_is_alaw_audio_essence_track),
(mxf_alaw_handle_essence_element), (mxf_alaw_create_caps):
* gst/mxf/mxfalaw.h:
* gst/mxf/mxfdemux.c:
(gst_mxf_demux_handle_header_metadata_update_streams):
Add support for A-Law encoded audio essence (SMPTE 388M and 382M).
Diffstat (limited to 'gst/mxf/mxfaes-bwf.c')
-rw-r--r-- | gst/mxf/mxfaes-bwf.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gst/mxf/mxfaes-bwf.c b/gst/mxf/mxfaes-bwf.c index c121d57d..ba2bc2ef 100644 --- a/gst/mxf/mxfaes-bwf.c +++ b/gst/mxf/mxfaes-bwf.c @@ -244,6 +244,11 @@ static const MXFUL mxf_sound_essence_compression_aiff = 0x7E, 0x00, 0x00, 0x00} }; +static const MXFUL mxf_sound_essence_compression_alaw = + { {0x06, 0x0E, 0x2B, 0x34, 0x04, 0x01, 0x01, 0x03, 0x04, 0x02, 0x02, 0x02, + 0x03, 0x01, 0x01, 0x00} +}; + static GstCaps * mxf_bwf_create_caps (MXFMetadataGenericPackage * package, MXFMetadataTrack * track, @@ -313,6 +318,19 @@ mxf_bwf_create_caps (MXFMetadataGenericPackage * package, (block_align != 1), "endianness", G_TYPE_INT, G_BIG_ENDIAN, "depth", G_TYPE_INT, (block_align / descriptor->channel_count) * 8, "width", G_TYPE_INT, (block_align / descriptor->channel_count) * 8, NULL); + } else if (mxf_ul_is_equal (&descriptor->sound_essence_compression, + &mxf_sound_essence_compression_alaw)) { + + if (descriptor->audio_sampling_rate.n != 0 || + descriptor->audio_sampling_rate.d != 0 || + descriptor->channel_count != 0) { + GST_ERROR ("Invalid descriptor"); + return NULL; + } + ret = gst_caps_new_simple ("audio/x-alaw", "rate", G_TYPE_INT, + (gint) (((gdouble) descriptor->audio_sampling_rate.n) / + ((gdouble) descriptor->audio_sampling_rate.d) + 0.5), + "channels", G_TYPE_INT, descriptor->channel_count); } else { GST_ERROR ("Unsupported sound essence compression: %s", mxf_ul_to_string (&descriptor->sound_essence_compression, str)); |