Go to the documentation of this file.
38 const char *buf,
int *
offset,
45 switch (data_type & 0xff) {
108 #define SPDIF_MAX_OFFSET 16384
120 const uint8_t *expected_code = buf + 7;
123 int consecutive_codes = 0;
126 for (; buf < probe_end; buf++) {
133 if (buf == expected_code) {
134 if (++consecutive_codes >= 2)
137 consecutive_codes = 0;
147 &buf[5], &
offset, codec)) {
148 if (buf +
offset >= p_buf + buf_size)
150 expected_code = buf +
offset;
151 buf = expected_code - 7;
190 if (pkt_size_bits % 16)
213 if (!
s->nb_streams) {
221 }
else if (
codec_id !=
s->streams[0]->codecpar->codec_id) {
226 if (!
s->bit_rate &&
s->streams[0]->codecpar->sample_rate)
229 s->bit_rate = 2 * 16 *
s->streams[0]->codecpar->sample_rate;
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_spdif_demuxer
enum AVMediaType codec_type
General type of the encoded data.
#define AVERROR_EOF
End of file.
#define AV_AAC_ADTS_HEADER_SIZE
@ IEC61937_MPEG2_LAYER1_LSF
MPEG-2, layer-1 low sampling frequency.
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 samples
int buf_size
Size of buf except extra allocated bytes.
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples, uint8_t *frames)
Extract the number of samples and frames from AAC data.
int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
if it could not because there are no more frames
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
unsigned int avio_rl16(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w)
@ IEC61937_MPEG2_EXT
MPEG-2 data with extension.
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.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
This structure contains the data a format has to probe a file.
AVCodecID
Identify the syntax and semantics of the bitstream.
@ IEC61937_DTS3
DTS type III (2048 samples)
static int spdif_get_offset_and_codec(AVFormatContext *s, enum IEC61937DataType data_type, const char *buf, int *offset, enum AVCodecID *codec)
@ IEC61937_MPEG1_LAYER23
MPEG-1 layer 2 or 3 data or MPEG-2 without extension.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ IEC61937_DTS2
DTS type II (1024 samples)
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
@ IEC61937_DTS1
DTS type I (512 samples)
int ff_spdif_probe(const uint8_t *p_buf, int buf_size, enum AVCodecID *codec)
@ IEC61937_MPEG1_LAYER1
MPEG-1 layer 1.
static int spdif_probe(const AVProbeData *p)
#define BURST_HEADER_SIZE
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
@ IEC61937_MPEG2_LAYER2_LSF
MPEG-2, layer-2 low sampling frequency.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
static int spdif_read_header(AVFormatContext *s)
@ IEC61937_MPEG2_AAC
MPEG-2 AAC ADTS.
static const uint16_t spdif_mpeg_pkt_offset[2][3]
@ IEC61937_MPEG2_LAYER3_LSF
MPEG-2, layer-3 low sampling frequency.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.