23#include "config_components.h"
33#define AUDIO_FIFO_SIZE 65536
104 int xmin,
int xmax,
int ymin,
int ymax)
117 mask = (1 << nbits) - 1;
140 mask = (1 << nbits) - 1;
146 }
else if (dy == 0) {
160 int a,
int b,
int c,
int d,
int tx,
int ty)
208 for(
i=0;
i<
s->nb_streams;
i++) {
227 av_log(
s,
AV_LOG_ERROR,
"SWF muxer only supports VP6, FLV, Flash Screen Video, PNG and MJPEG\n");
254 if (!strcmp(
"avm2",
s->oformat->name))
272 if ((rate * 256LL) / rate_base >= (1<<16)) {
276 avio_wl16(pb, (rate * 256LL) / rate_base);
337 case 11025: v |= 1 << 2;
break;
338 case 22050: v |= 2 << 2;
break;
339 case 44100: v |= 3 << 2;
break;
342 av_log(
s,
AV_LOG_ERROR,
"swf does not support that sample rate, choose from (44100, 22050, 11025).\n");
478 const uint8_t *buf,
int size)
546 .p.mime_type =
"application/x-shockwave-flash",
547 .p.extensions =
"swf",
564 .p.mime_type =
"application/x-shockwave-flash",
static double val(void *priv, double ch)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
void avio_wl32(AVIOContext *s, unsigned int val)
void avio_wl16(AVIOContext *s, unsigned int val)
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
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)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
@ FLV_FRAME_INTER
inter frame (for AVC, a non-seekable frame)
@ FLV_FRAME_KEY
key frame (for AVC, a seekable frame)
static const uint8_t frame_size[4]
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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.
size_t av_fifo_can_write(const AVFifo *f)
size_t av_fifo_can_read(const AVFifo *f)
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.
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const uint16_t mask[17]
static int fifo_avio_wrapper(void *opaque, void *buf, size_t *nb_elems)
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static int put_bytes_output(const PutBitContext *s)
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
int height
The height of the video frame in pixels.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
AVCodecParameters * video_par
AVCodecParameters * audio_par
const AVCodecTag ff_swf_codec_tags[]
static void swf_deinit(AVFormatContext *s)
static void put_swf_tag(AVFormatContext *s, int tag)
static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
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)
static int swf_write_header(AVFormatContext *s)
static void put_swf_end_tag(AVFormatContext *s)
static void max_nbits(int *nbits_ptr, int val)
static int swf_write_audio(AVFormatContext *s, AVCodecParameters *par, const uint8_t *buf, int size)
static int fifo_avio_wrapper(void *opaque, void *buf, size_t *nb_elems)
static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
static int swf_write_video(AVFormatContext *s, AVCodecParameters *par, const uint8_t *buf, int size, unsigned pkt_flags)
static void put_swf_rect(AVIOContext *pb, int xmin, int xmax, int ymin, int ymax)