22 #include "libavutil/intreadwrite.h"
59 int bom, major, minor, codec, chunk;
60 int64_t pos, h1offset, toffset;
73 if (bom != 0xFEFF && bom != 0xFFFE) {
193 case MKTAG(
'A',
'D',
'P',
'C'):
215 case MKTAG(
'D',
'A',
'T',
'A'):
223 if (major != 1 || minor)
244 uint32_t samples,
size;
252 samples = size / (8 * codec->
channels) * 14;
266 bytestream_put_be32(&dst, size);
267 bytestream_put_be32(&dst, samples);
296 .extensions =
"brstm",
#define AVERROR_PATCHWELCOME
void av_free_packet(AVPacket *pkt)
Free a packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
AVCodecContext * codec
Codec context associated with this stream.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static int probe(AVProbeData *p)
uint32_t samples_per_block
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
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.
uint32_t last_block_used_bytes
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
int sample_rate
samples per second
main external API structure.
AVIOContext * pb
I/O context.
#define MKTAG(a, b, c, d)
This structure contains the data a format has to probe a file.
AVInputFormat ff_brstm_demuxer
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
static int read_header(AVFormatContext *s)
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define AVERROR_INVALIDDATA
int channels
number of audio channels
static int read_packet(AVFormatContext *s, AVPacket *pkt)
static int read_close(AVFormatContext *s)
This structure stores compressed data.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...