libavformat/wav.c File Reference

#include "libavutil/avassert.h"
#include "libavutil/dict.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
#include "pcm.h"
#include "riff.h"
#include "avio.h"
#include "metadata.h"

Go to the source code of this file.

Data Structures

struct  WAVContext

Defines

#define OFFSET(x)   offsetof(WAVContext, x)
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
#define MAX_SIZE   4096
#define OFFSET(x)   offsetof(WAVContext, x)
#define DEC   AV_OPT_FLAG_DECODING_PARAM

Functions

static void bwf_write_bext_string (AVFormatContext *s, const char *key, int maxlen)
static void bwf_write_bext_chunk (AVFormatContext *s)
static int wav_write_header (AVFormatContext *s)
static int wav_write_packet (AVFormatContext *s, AVPacket *pkt)
static int wav_write_trailer (AVFormatContext *s)
static int64_t next_tag (AVIOContext *pb, uint32_t *tag)
static int64_t find_tag (AVIOContext *pb, uint32_t tag1)
static int wav_probe (AVProbeData *p)
static int wav_parse_fmt_tag (AVFormatContext *s, int64_t size, AVStream **st)
static int wav_parse_bext_string (AVFormatContext *s, const char *key, int length)
static int wav_parse_bext_tag (AVFormatContext *s, int64_t size)
static int wav_read_header (AVFormatContext *s, AVFormatParameters *ap)
static int64_t find_guid (AVIOContext *pb, const uint8_t guid1[16])
 Find chunk with w64 GUID by skipping over other chunks.
static int wav_read_packet (AVFormatContext *s, AVPacket *pkt)
static int wav_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int w64_probe (AVProbeData *p)
static int w64_read_header (AVFormatContext *s, AVFormatParameters *ap)

Variables

static const AVOption options []
static const AVClass wav_muxer_class
AVOutputFormat ff_wav_muxer
static const AVMetadataConv wav_metadata_conv []
static const uint8_t guid_data [16]
static const AVOption demux_options []
static const AVClass wav_demuxer_class
AVInputFormat ff_wav_demuxer
static const uint8_t guid_riff [16]
static const uint8_t guid_wave [16]
static const uint8_t guid_fmt [16]
AVInputFormat ff_w64_demuxer

Define Documentation

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 684 of file wav.c.

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 203 of file wav.c.

#define MAX_SIZE   4096

Definition at line 570 of file wav.c.

#define OFFSET (   x  )     offsetof(WAVContext, x)

Definition at line 683 of file wav.c.

#define OFFSET (   x  )     offsetof(WAVContext, x)

Definition at line 683 of file wav.c.


Function Documentation

static void bwf_write_bext_chunk ( AVFormatContext s  )  [static]

Definition at line 73 of file wav.c.

Referenced by wav_write_header().

static void bwf_write_bext_string ( AVFormatContext s,
const char *  key,
int  maxlen 
) [inline, static]

Definition at line 59 of file wav.c.

Referenced by bwf_write_bext_chunk().

static int64_t find_guid ( AVIOContext pb,
const uint8_t  guid1[16] 
) [static]

Find chunk with w64 GUID by skipping over other chunks.

Returns:
the size of the found chunk

Definition at line 550 of file wav.c.

Referenced by w64_read_header(), and wav_read_packet().

static int64_t find_tag ( AVIOContext pb,
uint32_t  tag1 
) [static]

Definition at line 242 of file wav.c.

Referenced by wav_read_packet().

static int64_t next_tag ( AVIOContext pb,
uint32_t *  tag 
) [static]

Definition at line 235 of file wav.c.

Referenced by find_tag(), and wav_read_header().

static int w64_probe ( AVProbeData p  )  [static]

Definition at line 721 of file wav.c.

static int w64_read_header ( AVFormatContext s,
AVFormatParameters ap 
) [static]

Definition at line 732 of file wav.c.

static int wav_parse_bext_string ( AVFormatContext s,
const char *  key,
int  length 
) [inline, static]

Definition at line 298 of file wav.c.

Referenced by wav_parse_bext_tag().

static int wav_parse_bext_tag ( AVFormatContext s,
int64_t  size 
) [static]

Definition at line 316 of file wav.c.

Referenced by wav_read_header().

static int wav_parse_fmt_tag ( AVFormatContext s,
int64_t  size,
AVStream **  st 
) [static]

Definition at line 278 of file wav.c.

Referenced by wav_read_header().

static int wav_probe ( AVProbeData p  )  [static]

Definition at line 258 of file wav.c.

static int wav_read_header ( AVFormatContext s,
AVFormatParameters ap 
) [static]

Definition at line 390 of file wav.c.

static int wav_read_packet ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 572 of file wav.c.

static int wav_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
) [static]

Definition at line 653 of file wav.c.

static int wav_write_header ( AVFormatContext s  )  [static]

Definition at line 113 of file wav.c.

static int wav_write_packet ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 154 of file wav.c.

static int wav_write_trailer ( AVFormatContext s  )  [static]

Definition at line 168 of file wav.c.


Variable Documentation

const AVOption demux_options[] [static]
Initial value:
 {
    { "ignore_length", "Ignore length", OFFSET(ignore_length), AV_OPT_TYPE_INT, { 0 }, 0, 1, DEC },
    { NULL },
}

Definition at line 685 of file wav.c.

Initial value:
 {
    .name           = "w64",
    .long_name      = NULL_IF_CONFIG_SMALL("Sony Wave64 format"),
    .priv_data_size = sizeof(WAVContext),
    .read_probe     = w64_probe,
    .read_header    = w64_read_header,
    .read_packet    = wav_read_packet,
    .read_seek      = wav_read_seek,
    .flags = AVFMT_GENERIC_INDEX,
    .codec_tag = (const AVCodecTag* const []){ff_codec_wav_tags, 0},
}

Definition at line 785 of file wav.c.

Initial value:
 {
    .name           = "wav",
    .long_name      = NULL_IF_CONFIG_SMALL("WAV format"),
    .priv_data_size = sizeof(WAVContext),
    .read_probe     = wav_probe,
    .read_header    = wav_read_header,
    .read_packet    = wav_read_packet,
    .read_seek      = wav_read_seek,
    .flags= AVFMT_GENERIC_INDEX,
    .codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
    .priv_class     = &wav_demuxer_class,
}

Definition at line 696 of file wav.c.

Initial value:
 {
    .name              = "wav",
    .long_name         = NULL_IF_CONFIG_SMALL("WAV format"),
    .mime_type         = "audio/x-wav",
    .extensions        = "wav",
    .priv_data_size    = sizeof(WAVContext),
    .audio_codec       = CODEC_ID_PCM_S16LE,
    .video_codec       = CODEC_ID_NONE,
    .write_header      = wav_write_header,
    .write_packet      = wav_write_packet,
    .write_trailer     = wav_write_trailer,
    .codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
    .priv_class = &wav_muxer_class,
}

Definition at line 216 of file wav.c.

const uint8_t guid_data[16] [static]
Initial value:
 { 'd', 'a', 't', 'a',
    0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A }

Definition at line 567 of file wav.c.

Referenced by w64_read_header(), and wav_read_packet().

const uint8_t guid_fmt[16] [static]
Initial value:
 { 'f', 'm', 't', ' ',
    0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A }

Definition at line 718 of file wav.c.

Referenced by w64_read_header().

const uint8_t guid_riff[16] [static]
Initial value:
 { 'r', 'i', 'f', 'f',
    0x2E, 0x91, 0xCF, 0x11, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 }

Definition at line 712 of file wav.c.

Referenced by w64_probe(), and w64_read_header().

const uint8_t guid_wave[16] [static]
Initial value:
 { 'w', 'a', 'v', 'e',
    0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A }

Definition at line 715 of file wav.c.

Referenced by w64_probe(), and w64_read_header().

const AVOption options[] [static]
Initial value:
 {
    { "write_bext", "Write BEXT chunk.", OFFSET(write_bext), AV_OPT_TYPE_INT, { 0 }, 0, 1, ENC },
    { NULL },
}

Definition at line 204 of file wav.c.

const AVClass wav_demuxer_class [static]
Initial value:
 {
    .class_name = "WAV demuxer",
    .item_name  = av_default_item_name,
    .option     = demux_options,
    .version    = LIBAVUTIL_VERSION_INT,
}

Definition at line 690 of file wav.c.

Initial value:
 {
    {"description",      "comment"      },
    {"originator",       "encoded_by"   },
    {"origination_date", "date"         },
    {"origination_time", "creation_time"},
    {0},
}

Definition at line 381 of file wav.c.

const AVClass wav_muxer_class [static]
Initial value:
 {
    .class_name = "WAV muxer",
    .item_name  = av_default_item_name,
    .option     = options,
    .version    = LIBAVUTIL_VERSION_INT,
}

Definition at line 209 of file wav.c.