Go to the documentation of this file.
90 int encoded_buf_size = 0;
110 film->
start = metadata;
112 film->
last = metadata;
121 if (encoded_buf_size !=
pkt->
size && (
pkt->
size % encoded_buf_size) != 0) {
174 av_log(format_context,
AV_LOG_ERROR,
"Sega FILM allows a maximum of one audio stream.\n");
183 av_log(format_context,
AV_LOG_ERROR,
"Sega FILM allows a maximum of one video stream.\n");
206 int64_t pos, pos_end =
avio_tell(format_context->
pb);
216 read_buf[1] =
buf + shift_size;
224 "write the header\n", format_context->
url);
232 avio_seek(format_context->
pb, shift_size, SEEK_SET);
238 #define READ_BLOCK do { \
239 read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], shift_size); \
248 n = read_size[read_buf_id];
253 }
while (pos < pos_end);
263 int64_t sample_table_size, stabsize, headersize;
274 stabsize = 16 + sample_table_size;
292 if (audio_codec < 0) {
318 switch (
video->codecpar->codec_id) {
370 packet = film->
start;
371 while (packet !=
NULL) {
374 packet = packet->
next;
static av_cold int init(AVCodecContext *avctx)
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 av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
static int film_init(AVFormatContext *format_context)
AVStream ** streams
A list of all streams in the file.
static int film_write_packet_to_header(AVFormatContext *format_context, FILMPacket *pkt)
@ AV_CODEC_ID_PCM_S16BE_PLANAR
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)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int shift_data(AVFormatContext *format_context, int64_t shift_size)
static int get_audio_codec_id(enum AVCodecID codec_id)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static int write_trailer(AVFormatContext *s1)
const char * av_default_item_name(void *ptr)
Return the context name.
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
int sample_rate
Audio only.
AVCodecID
Identify the syntax and semantics of the bitstream.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
static const AVClass film_muxer_class
@ 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.
char * url
input or output URL.
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.
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
#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...
AVOutputFormat ff_segafilm_muxer
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
A Quick Description Of Rate Distortion Theory We want to encode a video
int(* io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
A callback for opening new IO streams.
#define AVIO_FLAG_READ
read-only
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
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)
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.