89 int encoded_buf_size = 0;
109 film->
start = metadata;
111 film->
last = metadata;
120 if (encoded_buf_size != pkt->
size && (pkt->
size % encoded_buf_size) != 0) {
170 av_log(format_context,
AV_LOG_ERROR,
"Sega FILM allows a maximum of one audio stream.\n");
175 "Incompatible audio stream format.\n");
183 av_log(format_context,
AV_LOG_ERROR,
"Sega FILM allows a maximum of one video stream.\n");
189 "Incompatible video stream format.\n");
194 "Pixel format must be rgb24.\n");
222 read_buf[1] = buf + shift_size;
230 "write the header\n", format_context->
url);
238 avio_seek(format_context->
pb, shift_size, SEEK_SET);
244 #define READ_BLOCK do { \ 245 read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], shift_size); \ 254 n = read_size[read_buf_id];
257 avio_write(format_context->
pb, read_buf[read_buf_id], n);
259 }
while (pos < pos_end);
269 int64_t sample_table_size, stabsize, headersize;
278 stabsize = 16 + sample_table_size;
356 packet = film->
start;
357 while (packet !=
NULL) {
360 packet = packet->
next;
372 while (packet !=
NULL) {
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
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)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define i(width, name, range_min, range_max)
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.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
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.
static int write_trailer(AVFormatContext *s1)
static int shift_data(AVFormatContext *format_context, int64_t shift_size)
static int film_write_header(AVFormatContext *format_context)
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
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)
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...
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static int film_write_packet_to_header(AVFormatContext *format_context, FILMPacket *pkt)