63 if ((p->
buf[0] ==
'F' || p->
buf[0] ==
'C') && p->
buf[1] ==
'W' &&
71 static int zlib_refill(
void *opaque,
uint8_t *buf,
int buf_size)
75 z_stream *z = &swf->zstream;
83 z->next_in = swf->zbuf_in;
88 z->avail_out = buf_size;
90 ret = inflate(z, Z_NO_FLUSH);
91 if (ret != Z_OK && ret != Z_STREAM_END) {
96 if (buf_size - z->avail_out == 0)
99 return buf_size - z->avail_out;
112 if (tag ==
MKBETAG(
'C',
'W',
'S', 0)) {
115 if (inflateInit(&swf->zstream) != Z_OK) {
123 if (!swf->zbuf_in || !swf->zbuf_out || !swf->zpb) {
129 swf->zpb->seekable = 0;
135 }
else if (tag !=
MKBETAG(
'F',
'W',
'S', 0))
139 len = (4 * nbits - 3 + 7) / 8;
154 int tag,
len, i, frame, v, res;
195 int sample_rate_code;
211 ast->codecpar->channels = 2;
214 ast->codecpar->channels = 1;
218 ast->codecpar->codec_id =
ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
220 sample_rate_code= (v>>2) & 3;
221 ast->codecpar->sample_rate = 44100 >> (3 - sample_rate_code);
310 inflateEnd(&s->zstream);
const AVCodecTag ff_swf_codec_tags[]
static int swf_probe(AVProbeData *p)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int get_swf_tag(AVIOContext *pb, int *len_ptr)
int64_t pos
byte position in stream, -1 if unknown
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
#define AV_CH_LAYOUT_STEREO
int ctx_flags
Flags signalling stream properties.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
unsigned int avio_rb32(AVIOContext *s)
int id
Format-specific stream ID.
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_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
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.
AVIOContext * avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
Allocate and initialize an AVIOContext for buffered I/O.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVInputFormat ff_swf_demuxer
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
preferred ID for decoding MPEG audio layer 1, 2 or 3
enum AVMediaType codec_type
General type of the encoded data.
int avio_r8(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
audio channel layout utility functions
static const AVCodecTag swf_audio_codec_tags[]
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int swf_read_header(AVFormatContext *s)
static int read_header(FFV1Context *f)
#define AV_LOG_INFO
Standard information.
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
This structure contains the data a format has to probe a file.
static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
unsigned int avio_rl16(AVIOContext *s)
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define MKBETAG(a, b, c, d)
int eof_reached
true if eof reached
void * priv_data
Format private data.
AVCodecParameters * codecpar
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...