summaryrefslogtreecommitdiff
path: root/libavformat/riff.c
diff options
context:
space:
mode:
authorJack Bruienne <jackbruienne@gmail.com>2022-03-07 22:30:24 -0500
committerPaul B Mahol <onemda@gmail.com>2022-03-10 14:11:12 +0100
commite6e3aae294951738a760d2b6907e6e54286d30dd (patch)
treeaeed9717aa227c41d34d4308037b111c972423ca /libavformat/riff.c
parent70fef2371c0bde5dea22889e8eeda03d3cddc5aa (diff)
avformat: add DFPWM WAV container support
This commit adds support for storing DFPWM audio in a WAV container. It uses the WAVEFORMATEXTENSIBLE structure, following these conventions: https://gist.github.com/MCJack123/90c24b64c8e626c7f130b57e9800962c The implementation is very simple: it just adds the GUID to the list of WAV GUIDs, and modifies the WAV muxer to always use WAVEFORMATEXTENSIBLE format with that GUID. This creates a standard container format for DFPWM besides raw data. It will allow users to transfer DFPWM audio in a standard container format, with the sample rate and channel count contained in the file as opposed to being an external parameter as in the raw format. This format is already supported in my AUKit library, which is the CC analog to libav (albeit much smaller). Support in other applications is TBD. Signed-off-by: Jack Bruienne <jackbruienne@gmail.com>
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r--libavformat/riff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 0c19d3f784..f098c1d580 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -587,6 +587,8 @@ const AVCodecTag ff_codec_wav_tags[] = {
{ AV_CODEC_ID_AAC, 0xA106 },
{ AV_CODEC_ID_SPEEX, 0xA109 },
{ AV_CODEC_ID_FLAC, 0xF1AC },
+ /* DFPWM does not have an assigned format tag; it uses a GUID in WAVEFORMATEX instead */
+ { AV_CODEC_ID_DFPWM, 0xFFFE },
{ AV_CODEC_ID_ADPCM_SWF, ('S' << 8) + 'F' },
/* HACK/FIXME: Does Vorbis in WAV/AVI have an (in)official ID? */
{ AV_CODEC_ID_VORBIS, ('V' << 8) + 'o' },
@@ -637,5 +639,6 @@ const AVCodecGuid ff_codec_wav_guids[] = {
{ AV_CODEC_ID_EAC3, { 0xAF, 0x87, 0xFB, 0xA7, 0x02, 0x2D, 0xFB, 0x42, 0xA4, 0xD4, 0x05, 0xCD, 0x93, 0x84, 0x3B, 0xDD } },
{ AV_CODEC_ID_MP2, { 0x2B, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
{ AV_CODEC_ID_ADPCM_AGM,{ 0x82, 0xEC, 0x1F, 0x6A, 0xCA, 0xDB, 0x19, 0x45, 0xBD, 0xE7, 0x56, 0xD3, 0xB3, 0xEF, 0x98, 0x1D } },
+ { AV_CODEC_ID_DFPWM, { 0x3A, 0xC1, 0xFA, 0x38, 0x81, 0x1D, 0x43, 0x61, 0xA4, 0x0D, 0xCE, 0x53, 0xCA, 0x60, 0x7C, 0xD1 } },
{ AV_CODEC_ID_NONE }
};