Go to the documentation of this file.
36 #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r')
37 #define DEINT_ID_INT0 MKTAG('I', 'n', 't', '0')
38 #define DEINT_ID_INT4 MKTAG('I', 'n', 't', '4')
39 #define DEINT_ID_SIPR MKTAG('s', 'i', 'p', 'r')
40 #define DEINT_ID_VBRF MKTAG('v', 'b', 'r', 'f')
41 #define DEINT_ID_VBRS MKTAG('v', 'b', 'r', 's')
131 unsigned bytes_per_minute;
138 if ((startpos + header_size) >=
avio_tell(pb) + 2) {
144 if ((startpos + header_size) >
avio_tell(pb))
146 if (bytes_per_minute)
155 int flavor, sub_packet_h, coded_framesize, sub_packet_size;
156 int codecdata_length;
157 unsigned bytes_per_minute;
169 if (bytes_per_minute)
213 codecdata_length = 0;
235 if(sub_packet_size <= 0){
254 if (codecdata_length >= 1) {
311 unsigned int codec_data_size,
const uint8_t *mime)
318 if (codec_data_size > INT_MAX)
320 if (codec_data_size == 0)
327 if (v ==
MKTAG(0xfd,
'a',
'r',
'.')) {
331 }
else if (v ==
MKBETAG(
'L',
'S',
'D',
':')) {
340 }
else if(mime && !strcmp(mime,
"logical-fileinfo")){
341 int stream_count, rule_count, property_count,
i;
352 for(
i=0;
i<property_count;
i++){
394 0x10000, fps, (1 << 30) - 1);
395 #if FF_API_R_FRAME_RATE
407 if (codec_data_size >=
size) {
421 unsigned int size, n_pkts, str_id, next_off, n,
pos,
pts;
434 for (n = 0; n <
s->nb_streams; n++)
435 if (
s->streams[n]->id == str_id) {
439 if (n ==
s->nb_streams) {
441 "Invalid stream index %d for index at pos %"PRId64
"\n",
446 "Nr. of packets in packet index for stream index %d "
447 "exceeds filesize (%"PRId64
" at %"PRId64
" = %"PRId64
")\n",
453 for (n = 0; n < n_pkts; n++) {
463 if (next_off &&
avio_tell(pb) < next_off &&
466 "Non-linear index detected, not supported\n");
496 for (
i = 0;
i<number_of_streams;
i++)
499 if (number_of_mdpr != 1) {
502 for (
i = 0;
i < number_of_mdpr;
i++) {
510 st2->
id = st->
id + (
i<<16);
538 unsigned int data_off = 0, indx_off = 0;
539 char buf[128], mime[128];
546 if (
tag ==
MKTAG(
'.',
'r',
'a', 0xfd)) {
549 }
else if (
tag !=
MKTAG(
'.',
'R',
'M',
'F')) {
564 if (tag_size < 10 &&
tag !=
MKTAG(
'D',
'A',
'T',
'A'))
567 case MKTAG(
'P',
'R',
'O',
'P'):
582 case MKTAG(
'C',
'O',
'N',
'T'):
585 case MKTAG(
'M',
'D',
'P',
'R'):
615 if (v ==
MKBETAG(
'M',
'L',
'T',
'I')) {
628 case MKTAG(
'D',
'A',
'T',
'A'):
646 avio_seek(pb, indx_off, SEEK_SET) >= 0) {
670 return (n << 16) | n1;
675 #define RAW_PACKET_SIZE 1000
681 uint32_t
state=0xFFFFFFFF;
697 int n_pkts, expected_len;
701 expected_len = 20 + n_pkts * 14;
705 else if (
len != expected_len)
707 "Index size %d (%d pkts) is wrong, should be %d.\n",
708 len, n_pkts, expected_len);
715 "DATA tag in middle of chunk, file may be broken.\n");
725 mlti_id = (
avio_r8(pb) >> 1) - 1;
726 mlti_id =
FFMAX(mlti_id, 0) << 16;
729 for(
i=0;
i<
s->nb_streams;
i++) {
731 if (mlti_id + num == st->
id)
734 if (
i ==
s->nb_streams) {
754 int seq = 0, pic_num = 0, len2 = 0,
pos = 0;
799 if((seq & 0x7F) == 1 || vst->
curpic_num != pic_num){
804 vst->
slices = ((hdr & 0x3F) << 1) + 1;
860 FFSWAP(
int, ptr[0], ptr[1]);
869 if (
ret >= 0) memset(dst +
ret, 0, n -
ret);
870 else memset(dst , 0, n);
879 int *seq,
int flags, int64_t timestamp)
888 return ret < 0 ?
ret : -1;
907 for (
x = 0;
x <
h/2;
x++)
1001 int i,
len, res, seq = 1;
1002 int64_t timestamp,
pos;
1022 flags = (seq++ == 1) ? 2 : 0;
1036 &seq,
flags, timestamp);
1039 if((
flags&2) && (seq&0x7F) == 1)
1059 for (
i=0;
i<
s->nb_streams;
i++)
1068 if ((p->
buf[0] ==
'.' && p->
buf[1] ==
'R' &&
1069 p->
buf[2] ==
'M' && p->
buf[3] ==
'F' &&
1070 p->
buf[4] == 0 && p->
buf[5] == 0) ||
1071 (p->
buf[0] ==
'.' && p->
buf[1] ==
'r' &&
1072 p->
buf[2] ==
'a' && p->
buf[3] == 0xfd))
1079 int64_t *ppos, int64_t pos_limit)
1102 st =
s->streams[stream_index2];
1110 if((
flags&2) && (seq&0x7F) == 1){
1112 flags, stream_index2, stream_index, dts, seq);
1114 if(stream_index2 == stream_index)
1158 if (memcmp(p->
buf,
".R1M\x0\x1\x1", 7) &&
1159 memcmp(p->
buf,
".REC", 4))
1176 if (
tag ==
MKTAG(
'.',
'R',
'1',
'M')) {
1209 for (
i = 0;
i < count;
i++) {
1220 }
else if (
type == 4) {
1222 for (j = 0; j <
len; j++) {
1228 }
else if (
len == 4 &&
type == 3 && !strncmp(
key,
"StreamCount", tlen)) {
1230 }
else if (
len == 4 &&
type == 3) {
1251 for (
i = 0;
i < count;
i++) {
1262 }
else if (
type == 4 && !strncmp(
key,
"OpaqueData", tlen)) {
1277 }
else if (
type == 4) {
1281 for (j = 0; j <
len; j++)
1284 }
else if (
len == 4 &&
type == 3 && !strncmp(
key,
"Duration", tlen)) {
1286 }
else if (
len == 4 &&
type == 3) {
1346 if (
index >=
s->nb_streams)
1353 if (size < 1 || size > INT_MAX/4) {
1370 }
else if (opcode == 7) {
1396 .extensions =
"ivr",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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 default minimum maximum flags name is the option name
static int rm_read_index(AVFormatContext *s)
this function assumes that the demuxer has already seeked to the start of the INDX chunk,...
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.
AVInputFormat ff_rdt_demuxer
enum AVMediaType codec_type
General type of the encoded data.
void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
Perform 4-bit block reordering for SIPR data.
#define FFSWAP(type, a, b)
This struct describes the properties of an encoded stream.
static int rm_read_extradata(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, unsigned size)
#define AVERROR_EOF
End of file.
#define MKTAG(a, b, c, d)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
int32_t deint_id
Length of each subpacket.
#define AV_CH_LAYOUT_MONO
AVInputFormat ff_ivr_demuxer
int ff_rm_retrieve_cache(AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *ast, AVPacket *pkt)
Retrieve one cached packet from the rm-context.
AVRational avg_frame_rate
Average framerate.
int videobufpos
position for the next slice in the video buffer
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#define DEINT_ID_SIPR
interleaving for Sipro
#define DEINT_ID_VBRS
VBR case for AAC.
int64_t avio_size(AVIOContext *s)
Get the filesize.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int videobufsize
current assembled frame size
static int readfull(AVFormatContext *s, AVIOContext *pb, uint8_t *dst, int n)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
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.
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static double val(void *priv, double ch)
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 type
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 int get_num(AVIOContext *pb, int *len)
const char *const ff_rm_metadata[4]
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void get_strl(AVIOContext *pb, char *buf, int buf_size, int len)
static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *ast, int read_all)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int rm_probe(const AVProbeData *p)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVStreamParseType need_parsing
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
AVPacket pkt
place to store merged video frame / reordered audio data
int curpic_num
picture number of current frame
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
int64_t pktpos
first slice position in file
int ff_rm_parse_packet(AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *ast, int len, AVPacket *pkt, int *seq, int flags, int64_t timestamp)
Parse one rm-stream packet from the input bytestream.
@ AVDISCARD_ALL
discard all
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
static int ivr_read_header(AVFormatContext *s)
const AVCodecTag ff_rm_codec_tags[]
static int ivr_read_packet(AVFormatContext *s, AVPacket *pkt)
uint64_t avio_rb64(AVIOContext *s)
This structure contains the data a format has to probe a file.
static int rm_read_multi(AVFormatContext *s, AVIOContext *pb, AVStream *st, char *mime)
#define DEINT_ID_GENR
interleaving for Cooker/ATRAC
static void rm_read_metadata(AVFormatContext *s, AVIOContext *pb, int wide)
#define AV_EF_EXPLODE
abort decoding on minor error detection
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
int sample_rate
Audio only.
#define DEINT_ID_INT4
interleaving for 28.8
static int ivr_probe(const AVProbeData *p)
int extradata_size
Size of the extradata content in bytes.
AVInputFormat ff_rm_demuxer
unsigned int avio_rl32(AVIOContext *s)
RMStream * ff_rm_alloc_rmstream(void)
@ AVDISCARD_NONKEY
discard all frames except keyframes
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
static int64_t start_time
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define MKBETAG(a, b, c, d)
static int rm_read_header(AVFormatContext *s)
int avio_r8(AVIOContext *s)
int sub_packet_lengths[16]
Audio frame size from container.
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
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.
int ffio_limit(AVIOContext *s, int size)
static int rm_read_close(AVFormatContext *s)
#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...
#define AV_TIME_BASE
Internal time base represented as integer.
int block_align
Audio only.
#define DEINT_ID_VBRF
VBR case for AAC.
static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos)
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 default value
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int id
Format-specific stream ID.
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.
#define DEINT_ID_INT0
no interleaving needed
unsigned int avio_rb16(AVIOContext *s)
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
#define AV_INPUT_BUFFER_PADDING_SIZE
#define FF_ARRAY_ELEMS(a)
static void rm_ac3_swap_bytes(AVStream *st, AVPacket *pkt)
void ff_rm_free_rmstream(RMStream *rms)
static int64_t rm_read_dts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit)
int index
stream index in AVFormatContext
int coded_framesize
Descrambling parameters from container.
static void get_str8(AVIOContext *pb, char *buf, int buf_size)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
const unsigned char ff_sipr_subpk_size[4]
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
AVRational r_frame_rate
Real base framerate of the stream.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int rm_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
int64_t audiotimestamp
Audio descrambling matrix parameters.
int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *rst, unsigned int codec_data_size, const uint8_t *mime)
Read the MDPR chunk, which contains stream-specific codec initialization parameters.
#define avpriv_request_sample(...)
static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, RMDemuxContext *rm, RMStream *vst, AVPacket *pkt, int len, int *pseq, int64_t *timestamp)
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.
int64_t pos
byte position in stream, -1 if unknown
uint64_t channel_layout
Audio only.
#define flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
static int rm_read_header_old(AVFormatContext *s)
int audio_pkt_cnt
Output packet counter.
#define av_fourcc2str(fourcc)
int audio_stream_num
Stream number for audio packets.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.