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) {
91 info2 =
pkt->duration;
129 "Incompatible audio stream format.\n");
139 "Incompatible video stream format.\n");
144 "Pixel format must be rgb24.\n");
163 unsigned header_size)
178 unsigned stabsize, headersize, packet_count;
186 if (headersize < 64) {
190 packet_count = (headersize - 64) / 16;
191 stabsize = 16 + 16 * packet_count;
199 bytestream_put_be32(&ptr,
MKBETAG(
'F',
'I',
'L',
'M'));
200 bytestream_put_be32(&ptr, headersize);
203 bytestream_put_be32(&ptr,
MKBETAG(
'1',
'.',
'0',
'9'));
208 bytestream_put_be32(&ptr,
MKBETAG(
'F',
'D',
'S',
'C'));
209 bytestream_put_be32(&ptr, 0x20);
216 bytestream_put_be32(&ptr,
MKBETAG(
'c',
'v',
'i',
'd'));
219 bytestream_put_be32(&ptr,
MKBETAG(
'r',
'a',
'w',
' '));
225 bytestream_put_byte(&ptr, 24);
233 bytestream_put_byte(&ptr, audio_codec);
238 ptr += 1 + 1 + 1 + 2;
245 bytestream_put_be32(&ptr,
MKBETAG(
'S',
'T',
'A',
'B'));
246 bytestream_put_be32(&ptr, stabsize);
258 bytestream_put_be32(&ptr, packet_count);
276 .p.name =
"film_cpk",
278 .p.extensions =
"cpk",
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
void avio_wb32(AVIOContext *s, unsigned int val)
void avio_wb16(AVIOContext *s, unsigned int val)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
void ffio_fill(AVIOContext *s, int b, int64_t count)
#define i(width, name, range_min, range_max)
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_PCM_S16BE_PLANAR
@ AV_CODEC_ID_PCM_S8_PLANAR
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKBETAG(a, b, c, d)
#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....
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 ...
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
static const uint8_t header[24]
static void film_deinit(AVFormatContext *format_context)
static int get_audio_codec_id(enum AVCodecID codec_id)
static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
static int film_write_header(AVFormatContext *format_context)
static int film_init(AVFormatContext *format_context)
static int write_header(AVFormatContext *format_context, uint8_t *header, unsigned header_size)
int nb_channels
Number of channels in this layout.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
AVIOContext * pb
I/O context.
void * priv_data
Format private data.
AVStream ** streams
A list of all streams in the file.
int error
contains the error code or 0 if no error happened
This structure stores compressed data.
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.