Go to the documentation of this file.
51 uint32_t info1, info2;
61 if (encoded_buf_size !=
pkt->
size && (
pkt->
size % encoded_buf_size) != 0) {
128 av_log(format_context,
AV_LOG_ERROR,
"Sega FILM allows a maximum of one audio stream.\n");
133 "Incompatible audio stream format.\n");
141 av_log(format_context,
AV_LOG_ERROR,
"Sega FILM allows a maximum of one video stream.\n");
147 "Incompatible video stream format.\n");
152 "Pixel format must be rgb24.\n");
171 unsigned header_size)
186 unsigned stabsize, headersize, packet_count;
194 if (headersize < 64) {
198 packet_count = (headersize - 64) / 16;
199 stabsize = 16 + 16 * packet_count;
207 bytestream_put_be32(&ptr,
MKBETAG(
'F',
'I',
'L',
'M'));
208 bytestream_put_be32(&ptr, headersize);
211 bytestream_put_be32(&ptr,
MKBETAG(
'1',
'.',
'0',
'9'));
216 bytestream_put_be32(&ptr,
MKBETAG(
'F',
'D',
'S',
'C'));
217 bytestream_put_be32(&ptr, 0x20);
222 switch (
video->codecpar->codec_id) {
224 bytestream_put_be32(&ptr,
MKBETAG(
'c',
'v',
'i',
'd'));
227 bytestream_put_be32(&ptr,
MKBETAG(
'r',
'a',
'w',
' '));
231 bytestream_put_be32(&ptr,
video->codecpar->height);
232 bytestream_put_be32(&ptr,
video->codecpar->width);
233 bytestream_put_byte(&ptr, 24);
241 bytestream_put_byte(&ptr, audio_codec);
246 ptr += 1 + 1 + 1 + 2;
253 bytestream_put_be32(&ptr,
MKBETAG(
'S',
'T',
'A',
'B'));
254 bytestream_put_be32(&ptr, stabsize);
266 bytestream_put_be32(&ptr, packet_count);
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 int film_init(AVFormatContext *format_context)
AVStream ** streams
A list of all streams in the file.
static void deinit(AVFormatContext *s)
@ AV_CODEC_ID_PCM_S16BE_PLANAR
const AVOutputFormat ff_segafilm_muxer
int error
contains the error code or 0 if no error happened
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
int nb_channels
Number of channels in this layout.
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int get_audio_codec_id(enum AVCodecID codec_id)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size)
Make shift_size amount of space at read_start by shifting data in the output at read_start until the ...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int write_trailer(AVFormatContext *s1)
AVIOContext * pb
I/O context.
void ffio_fill(AVIOContext *s, int b, int64_t count)
AVChannelLayout ch_layout
Audio only.
int sample_rate
Audio only.
static int write_header(AVFormatContext *format_context, uint8_t *header, unsigned header_size)
AVCodecID
Identify the syntax and semantics of the bitstream.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKBETAG(a, b, c, d)
static const uint8_t header[24]
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wb32(AVIOContext *s, unsigned int val)
int flags
A combination of AV_PKT_FLAG values.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
static void film_deinit(AVFormatContext *format_context)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
A Quick Description Of Rate Distortion Theory We want to encode a video
int bits_per_coded_sample
The number of bits per sample in the codedwords.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
@ AV_CODEC_ID_PCM_S8_PLANAR
static int film_write_header(AVFormatContext *format_context)
void avio_wb16(AVIOContext *s, unsigned int val)
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
void * priv_data
Format private data.