34 static const int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 };
38 if ((code < 0) || (code > 4))
44 static int mmf_rate_code(
int rate)
47 for (i = 0; i < 5; i++)
54 static void end_tag_be(
AVIOContext *pb, int64_t start)
89 avio_write(pb,
"VN:libavcodec,",
sizeof(
"VN:libavcodec,") -1);
97 avio_w8(pb, (0 << 7) | (1 << 4) | rate);
106 avio_write(pb,
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16);
125 static void put_varlength(
AVIOContext *pb,
int val)
145 end_tag_be(pb, mmf->
awapos);
146 end_tag_be(pb, mmf->
atrpos);
159 put_varlength(pb, gatetime);
162 put_varlength(pb, gatetime);
179 if (p->
buf[0] ==
'M' && p->
buf[1] ==
'M' &&
180 p->
buf[2] ==
'M' && p->
buf[3] ==
'D' &&
181 p->
buf[8] ==
'C' && p->
buf[9] ==
'N' &&
182 p->
buf[10] ==
'T' && p->
buf[11] ==
'I')
199 if (tag !=
MKTAG(
'M',
'M',
'M',
'D'))
207 if (tag ==
MKTAG(
'C',
'N',
'T',
'I'))
209 if (tag ==
MKTAG(
'O',
'P',
'D',
'A'))
215 if ((tag & 0xffffff) ==
MKTAG(
'M',
'T',
'R', 0)) {
219 if ((tag & 0xffffff) !=
MKTAG(
'A',
'T',
'R', 0)) {
240 if (tag ==
MKTAG(
'A',
't',
's',
'q'))
242 if (tag ==
MKTAG(
'A',
's',
'p',
'I'))
248 if ((tag & 0xffffff) !=
MKTAG(
'A',
'w',
'a', 0)) {
272 #define MAX_SIZE 4096 303 #if CONFIG_MMF_DEMUXER 319 .mime_type =
"application/vnd.smaf",
void av_free_packet(AVPacket *pkt)
Free a packet.
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static int mmf_probe(AVProbeData *p)
static int mmf_rate(int code)
unsigned int avio_rb32(AVIOContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
int void avio_flush(AVIOContext *s)
audio channel layout utility functions
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
static int mmf_read_header(AVFormatContext *s)
This structure contains the data a format has to probe a file.
static const int mmf_rates[]
static int mmf_read_packet(AVFormatContext *s, AVPacket *pkt)
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
void avio_wb32(AVIOContext *s, unsigned int val)
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
This structure stores compressed data.