Go to the documentation of this file.
23 #include "config_components.h"
32 #define AUDIO_FIFO_SIZE 65536
103 int xmin,
int xmax,
int ymin,
int ymax)
116 mask = (1 << nbits) - 1;
139 mask = (1 << nbits) - 1;
145 }
else if (dy == 0) {
159 int a,
int b,
int c,
int d,
int tx,
int ty)
207 for(
i=0;
i<
s->nb_streams;
i++) {
234 av_log(
s,
AV_LOG_ERROR,
"SWF muxer only supports VP6, FLV, Flash Screen Video, PNG and MJPEG\n");
261 if (!strcmp(
"avm2",
s->oformat->name))
279 if ((rate * 256LL) / rate_base >= (1<<16)) {
283 avio_wl16(pb, (rate * 256LL) / rate_base);
344 case 11025: v |= 1 << 2;
break;
345 case 22050: v |= 2 << 2;
break;
346 case 44100: v |= 3 << 2;
break;
349 av_log(
s,
AV_LOG_ERROR,
"swf does not support that sample rate, choose from (44100, 22050, 11025).\n");
485 const uint8_t *buf,
int size)
553 .mime_type =
"application/x-shockwave-flash",
565 #if CONFIG_AVM2_MUXER
569 .mime_type =
"application/x-shockwave-flash",
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
static void max_nbits(int *nbits_ptr, int val)
This struct describes the properties of an encoded stream.
static int swf_write_header(AVFormatContext *s)
static void put_swf_end_tag(AVFormatContext *s)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static int swf_write_audio(AVFormatContext *s, AVCodecParameters *par, const uint8_t *buf, int size)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static void deinit(AVFormatContext *s)
size_t av_fifo_can_read(const AVFifo *f)
@ FLV_FRAME_KEY
key frame (for AVC, a seekable frame)
int nb_channels
Number of channels in this layout.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static void swf_deinit(AVFormatContext *s)
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...
void avio_wl16(AVIOContext *s, unsigned int val)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static double val(void *priv, double ch)
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
static void put_swf_matrix(AVIOContext *pb, int a, int b, int c, int d, int tx, int ty)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const uint16_t mask[17]
@ FLV_FRAME_INTER
inter frame (for AVC, a non-seekable frame)
const AVCodecTag ff_swf_codec_tags[]
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int swf_write_trailer(AVFormatContext *s)
size_t av_fifo_can_write(const AVFifo *f)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
static int write_trailer(AVFormatContext *s1)
void avio_w8(AVIOContext *s, int b)
AVChannelLayout ch_layout
Audio only.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int sample_rate
Audio only.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wb32(AVIOContext *s, unsigned int val)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
void avio_wl32(AVIOContext *s, unsigned int val)
int flags
A combination of AV_PKT_FLAG values.
#define AV_LOG_INFO
Standard information.
int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems)
Feed data from a FIFO into a user-provided callback.
static int swf_write_video(AVFormatContext *s, AVCodecParameters *par, const uint8_t *buf, int size, unsigned pkt_flags)
#define i(width, name, range_min, range_max)
AVFifo * av_fifo_alloc2(size_t nb_elems, size_t elem_size, unsigned int flags)
Allocate and initialize an AVFifo with a given element size.
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecParameters * audio_par
AVCodecParameters * video_par
static void put_swf_rect(AVIOContext *pb, int xmin, int xmax, int ymin, int ymax)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
static uint8_t * put_bits_ptr(PutBitContext *s)
Return the pointer to the byte where the bitstream writer will put the next bit.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
static int fifo_avio_wrapper(void *opaque, void *buf, size_t *nb_elems)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
static void write_header(FFV1Context *f)
static void put_swf_tag(AVFormatContext *s, int tag)