24 #include "libavutil/avassert.h"
52 tag_len = pos - swf->
tag_pos - 2;
83 int xmin,
int xmax,
int ymin,
int ymax)
96 mask = (1 << nbits) - 1;
119 mask = (1 << nbits) - 1;
125 }
else if (dy == 0) {
139 int a,
int b,
int c,
int d,
int tx,
int ty)
318 case 11025: v |= 1 << 2;
break;
319 case 22050: v |= 2 << 2;
break;
320 case 44100: v |= 3 << 2;
break;
323 av_log(s,
AV_LOG_ERROR,
"swf does not support that sample rate, choose from (44100, 22050, 11025).\n");
350 av_log(enc,
AV_LOG_INFO,
"warning: Flash Player limit of 16000 frames reached\n");
454 av_log(enc,
AV_LOG_INFO,
"warning: Flash Player limit of 16000 frames reached\n");
521 .mime_type =
"application/x-shockwave-flash",
532 #if CONFIG_AVM2_MUXER
536 .mime_type =
"application/x-shockwave-flash",
const AVCodecTag ff_swf_codec_tags[]
const char const char void * val
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
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...
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
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_rect(AVIOContext *pb, int xmin, int xmax, int ymin, int ymax)
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
static const uint8_t frame_size[4]
static int swf_write_video(AVFormatContext *s, AVCodecContext *enc, const uint8_t *buf, int size)
#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]
void * priv_data
Format private data.
#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
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.
unsigned int nb_streams
A list of all streams in the file.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
static void put_swf_tag(AVFormatContext *s, int tag)
static void max_nbits(int *nbits_ptr, int val)
static int swf_write_audio(AVFormatContext *s, AVCodecContext *enc, uint8_t *buf, int size)
int width
picture width / height.
static int write_trailer(AVFormatContext *s1)
AVCodecContext * audio_enc
static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
int frame_size
Number of samples per channel in an audio frame.
#define AV_LOG_INFO
Standard information.
static int swf_write_header(AVFormatContext *s)
enum AVMediaType codec_type
int sample_rate
samples per second
main external API structure.
AVIOContext * pb
I/O context.
BYTE int const BYTE int int int height
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
AVCodecContext * video_enc
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.
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.
struct AVOutputFormat * oformat
#define AVERROR_INVALIDDATA
int channels
number of audio channels
static void write_header(FFV1Context *f)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVFifoBuffer * audio_fifo
static int swf_write_trailer(AVFormatContext *s)
static void put_swf_matrix(AVIOContext *pb, int a, int b, int c, int d, int tx, int ty)
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)