50 int encoded_buf_size,
size = pkt->
size;
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)
174 int64_t
pos, pos_end;
185 read_size[1] = header_size;
193 "write the header\n", format_context->
url);
200 pos_end =
avio_tell(format_context->
pb) + header_size;
209 read_size[read_buf_id] =
avio_read(read_pb, read_buf[read_buf_id],
212 n = read_size[read_buf_id];
215 avio_write(format_context->
pb, read_buf[read_buf_id], n);
217 }
while (pos < pos_end);
227 unsigned stabsize, headersize, packet_count;
235 if (headersize < 64) {
239 packet_count = (headersize - 64) / 16;
240 stabsize = 16 + 16 * packet_count;
248 bytestream_put_be32(&ptr,
MKBETAG(
'F',
'I',
'L',
'M'));
249 bytestream_put_be32(&ptr, headersize);
252 bytestream_put_be32(&ptr,
MKBETAG(
'1',
'.',
'0',
'9'));
257 bytestream_put_be32(&ptr,
MKBETAG(
'F',
'D',
'S',
'C'));
258 bytestream_put_be32(&ptr, 0x20);
265 bytestream_put_be32(&ptr,
MKBETAG(
'c',
'v',
'i',
'd'));
268 bytestream_put_be32(&ptr,
MKBETAG(
'r',
'a',
'w',
' '));
274 bytestream_put_byte(&ptr, 24);
282 bytestream_put_byte(&ptr, audio_codec);
287 ptr += 1 + 1 + 1 + 2;
294 bytestream_put_be32(&ptr,
MKBETAG(
'S',
'T',
'A',
'B'));
295 bytestream_put_be32(&ptr, stabsize);
307 bytestream_put_be32(&ptr, packet_count);
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
int(* io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
A callback for opening new IO streams.
packed RGB 8:8:8, 24bpp, RGBRGB...
static av_cold int init(AVCodecContext *avctx)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_FLAG_READ
read-only
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
AVOutputFormat ff_segafilm_muxer
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVStream ** streams
A list of all streams in the file.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
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)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
char * url
input or output URL.
static int film_init(AVFormatContext *format_context)
enum AVMediaType codec_type
General type of the encoded data.
simple assert() macros that are a bit more flexible than ISO C assert().
int flags
A combination of AV_PKT_FLAG values.
static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
void ffio_fill(AVIOContext *s, int b, int count)
static int write_trailer(AVFormatContext *s1)
static int film_write_header(AVFormatContext *format_context)
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
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
AVIOContext * pb
I/O context.
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
int error
contains the error code or 0 if no error happened
void avio_wb16(AVIOContext *s, unsigned int val)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int sample_rate
Audio only.
static int get_audio_codec_id(enum AVCodecID codec_id)
#define MKBETAG(a, b, c, d)
A Quick Description Of Rate Distortion Theory We want to encode a video
static int write_header(AVFormatContext *format_context, uint8_t *header, unsigned header_size)
void * priv_data
Format private data.
static void film_deinit(AVFormatContext *format_context)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
void avio_wb32(AVIOContext *s, unsigned int val)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
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
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.