36 static const int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 };
46 static int mmf_rate_code(
int rate)
49 for (
i = 0;
i < 5;
i++)
56 static void end_tag_be(
AVIOContext *pb, int64_t start)
76 rate = mmf_rate_code(
s->streams[0]->codecpar->sample_rate);
78 av_log(
s,
AV_LOG_ERROR,
"Unsupported sample rate %d, supported are 4000, 8000, 11025, 22050 and 44100\n",
79 s->streams[0]->codecpar->sample_rate);
83 mmf->
stereo =
s->streams[0]->codecpar->channels > 1;
87 "add '-strict %d' if you want to use it.\n",
120 avio_write(pb,
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16);
150 end_tag_be(pb, mmf->
awapos);
151 end_tag_be(pb, mmf->
atrpos);
163 gatetime =
size * 500 /
s->streams[0]->codecpar->sample_rate;
164 put_varlength(pb, gatetime);
167 put_varlength(pb, gatetime);
182 if (p->
buf[0] ==
'M' && p->
buf[1] ==
'M' &&
183 p->
buf[2] ==
'M' && p->
buf[3] ==
'D' &&
184 p->
buf[8] ==
'C' && p->
buf[9] ==
'N' &&
185 p->
buf[10] ==
'T' && p->
buf[11] ==
'I')
202 if (
tag !=
MKTAG(
'M',
'M',
'M',
'D'))
210 if (
tag ==
MKTAG(
'C',
'N',
'T',
'I'))
212 if (
tag ==
MKTAG(
'O',
'P',
'D',
'A'))
218 if ((
tag & 0xffffff) ==
MKTAG(
'M',
'T',
'R', 0)) {
222 if ((
tag & 0xffffff) !=
MKTAG(
'A',
'T',
'R', 0)) {
243 if (
tag ==
MKTAG(
'A',
't',
's',
'q'))
245 if (
tag ==
MKTAG(
'A',
's',
'p',
'I'))
251 if ((
tag & 0xffffff) !=
MKTAG(
'A',
'w',
'a', 0)) {
275 #define MAX_SIZE 4096
297 #if CONFIG_MMF_DEMUXER
313 .mime_type =
"application/vnd.smaf",
static double val(void *priv, double ch)
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
audio channel layout utility functions
#define MKTAG(a, b, c, d)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
static int read_header(FFV1Context *f)
static void write_header(FFV1Context *f)
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_STEREO
@ AV_CODEC_ID_ADPCM_YAMAHA
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int mmf_read_header(AVFormatContext *s)
static int mmf_read_packet(AVFormatContext *s, AVPacket *pkt)
static int mmf_rate(int code)
static int mmf_probe(const AVProbeData *p)
static const int mmf_rates[]
internal header for RIFF based (de)muxers do NOT include this in end user applications
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
uint64_t channel_layout
Audio only.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int write_trailer(AVFormatContext *s1)