51 tag_len = pos - swf->
tag_pos - 2;
59 assert(tag_len < 0x3f);
65 static inline void max_nbits(
int *nbits_ptr,
int val)
82 int xmin,
int xmax,
int ymin,
int ymax)
95 mask = (1 << nbits) - 1;
118 mask = (1 << nbits) - 1;
124 }
else if (dy == 0) {
138 int a,
int b,
int c,
int d,
int tx,
int ty)
315 case 11025: v |= 1 << 2;
break;
316 case 22050: v |= 2 << 2;
break;
317 case 44100: v |= 3 << 2;
break;
320 av_log(s,
AV_LOG_ERROR,
"swf does not support that sample rate, choose from (44100, 22050, 11025).\n");
515 .mime_type =
"application/x-shockwave-flash",
526 #if CONFIG_AVM2_MUXER 530 .mime_type =
"application/x-shockwave-flash",
const AVCodecTag ff_swf_codec_tags[]
void avio_wl16(AVIOContext *s, unsigned int val)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const uint8_t frame_size[4]
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)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define TAG_FREECHARACTER
This struct describes the properties of an encoded stream.
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
void avio_wl32(AVIOContext *s, unsigned int val)
AVStream ** streams
A list of all streams in the file.
AVCodecParameters * video_par
#define TAG_FILEATTRIBUTES
static void put_swf_rect(AVIOContext *pb, int xmin, int xmax, int ymin, int ymax)
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
struct AVOutputFormat * oformat
The output container format.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static uint8_t * put_bits_ptr(PutBitContext *s)
Return the pointer to the byte where the bitstream writer will put the next bit.
static const uint16_t mask[17]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
preferred ID for decoding MPEG audio layer 1, 2 or 3
enum AVMediaType codec_type
General type of the encoded data.
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int void avio_flush(AVIOContext *s)
static int swf_write_audio(AVFormatContext *s, AVCodecParameters *par, uint8_t *buf, int size)
static void put_swf_tag(AVFormatContext *s, int tag)
static void max_nbits(int *nbits_ptr, int val)
static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
static int swf_write_video(AVFormatContext *s, AVCodecParameters *par, const uint8_t *buf, int size)
#define AV_LOG_INFO
Standard information.
static int swf_write_header(AVFormatContext *s)
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
AVCodecParameters * audio_par
int sample_rate
Audio only.
int av_fifo_size(AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
static void put_swf_end_tag(AVFormatContext *s)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
void avio_wb32(AVIOContext *s, unsigned int val)
AVCodecParameters * codecpar
AVFifoBuffer * audio_fifo
static int swf_write_trailer(AVFormatContext *s)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static void put_swf_matrix(AVIOContext *pb, int a, int b, int c, int d, int tx, int ty)
This structure stores compressed data.