Go to the documentation of this file.
30 #define RPL_SIGNATURE "ARMovie\x0A"
31 #define RPL_SIGNATURE_SIZE 8
34 #define RPL_LINE_LENGTH 256
57 for (
i = 0;
i < bufsize - 1;
i++) {
75 if (
result > (0x7FFFFFFF - 9) / 10)
104 if (num > (INT64_MAX - 9) / 10 || den > INT64_MAX / 10)
106 num = 10 * num + (*
line -
'0');
120 int total_audio_size;
128 int32_t video_format, audio_format, chunk_catalog_offset, number_of_chunks;
180 for (
i = 0;
i < 3;
i++)
202 ast->codecpar->codec_tag = audio_format;
208 ast->codecpar->ch_layout.nb_channels =
channels;
211 if (ast->codecpar->bits_per_coded_sample == 0)
212 ast->codecpar->bits_per_coded_sample = 4;
214 ast->codecpar->bit_rate = ast->codecpar->sample_rate *
215 (int64_t)ast->codecpar->ch_layout.nb_channels;
216 if (ast->codecpar->bit_rate > INT64_MAX / ast->codecpar->bits_per_coded_sample)
218 ast->codecpar->bit_rate *= ast->codecpar->bits_per_coded_sample;
221 switch (audio_format) {
223 if (ast->codecpar->bits_per_coded_sample == 16) {
226 }
else if (ast->codecpar->bits_per_coded_sample == 8) {
243 if (ast->codecpar->bits_per_coded_sample == 8) {
247 }
else if (ast->codecpar->bits_per_coded_sample == 4) {
254 audio_format, audio_codec);
257 for (
i = 0;
i < 3;
i++)
261 if (
s->nb_streams == 0)
267 "Don't know how to split frames for video format %s. "
276 chunk_catalog_offset =
286 avio_seek(pb, chunk_catalog_offset, SEEK_SET);
287 total_audio_size = 0;
288 for (
i = 0; !
error &&
i < number_of_chunks;
i++) {
289 int64_t
offset, video_size, audio_size;
291 if (3 != sscanf(
line,
"%"SCNd64
" , %"SCNd64
" ; %"SCNd64,
292 &
offset, &video_size, &audio_size)) {
301 audio_size, audio_size * 8, 0);
302 total_audio_size += audio_size * 8;
static void error(const char *err)
#define AV_LOG_WARNING
Something somehow does not look correct.
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
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
char * av_stristr(const char *s1, const char *s2)
Locate the first case-independent occurrence in the string haystack of the string needle.
#define AVERROR_EOF
End of file.
#define RPL_SIGNATURE_SIZE
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define RPL_LINE_LENGTH
256 is arbitrary, but should be big enough for any reasonable file.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
int64_t duration
Decoding: duration of the stream, in stream time base.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
static int32_t read_int(const char *line, const char **endptr, int *error)
@ AV_CODEC_ID_ADPCM_IMA_ACORN
static int read_line(AVIOContext *pb, char *line, int bufsize)
static AVRational read_fps(const char *line, int *error)
Parsing for fps, which can be a fraction.
@ AV_CODEC_ID_ADPCM_IMA_EA_SEAD
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
and forward the result(frame or status change) to the corresponding input. If nothing is possible
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
static int rpl_read_header(AVFormatContext *s)
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int avio_r8(AVIOContext *s)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
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...
static int rpl_probe(const AVProbeData *p)
const AVInputFormat ff_rpl_demuxer
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static int32_t read_line_and_int(AVIOContext *pb, int *error)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
#define av_fourcc2str(fourcc)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.