Go to the documentation of this file.
57 0xd79e8283acea4620, 0x7a9762f445afd0d8,
58 0x354d60a60b8c79f1, 0x584e1cde00b07aee,
59 0x1573cd93da7df623, 0x47f98d79620dd535
106 if (!r_val && !n_val)
113 if (r_val != oc->
r_val) {
114 memset(oc->
r_val, 0, 24);
117 memcpy(&oc->
r_val[16], r_val, 8);
120 if (n_val != oc->
n_val) {
121 memset(oc->
n_val, 0, 24);
124 memcpy(&oc->
n_val[16], n_val, 8);
130 #define OMA_RPROBE_M_VAL 48 + 1
137 struct AVDES *av_des;
139 if (!enc_header || !r_val ||
140 size < OMA_ENC_HEADER_SIZE + oc->k_size + oc->
e_size + oc->
i_size ||
165 return memcmp(&enc_header[pos], oc->
sm_val, 8) ? -1 : 0;
173 uint32_t taglen, datalen;
174 struct AVDES *av_des;
176 if (!enc_header || !n_val ||
177 size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
181 if (!memcmp(&enc_header[pos],
"EKB ", 4))
190 taglen =
AV_RB32(&enc_header[pos + 32]);
191 datalen =
AV_RB32(&enc_header[pos + 36]) >> 4;
193 pos += 44LL + taglen;
195 if (pos + (((uint64_t)datalen) << 4) >
size)
203 while (datalen-- > 0) {
228 if (!strcmp(em->
tag,
"GEOB") &&
243 "Invalid GEOB data size: %"PRIu32
"\n", geob->
datasize);
323 if (
ret < packet_size)
342 if (
ret == packet_size)
344 (packet_size >> 3), oc->
iv, 1);
346 memset(oc->
iv, 0, 8);
374 if (
ret < packet_size)
397 int ret, framesize, jsflag, samplerate;
398 uint32_t codec_params, channel_id;
418 if (memcmp(
buf, ((
const uint8_t[]){
'E',
'A',
'3'}), 3) ||
460 if (samplerate != 44100)
463 framesize = (codec_params & 0x3FF) * 8;
466 jsflag = (codec_params >> 17) & 1;
480 AV_WL32(&edata[2], samplerate);
489 channel_id = (codec_params >> 10) & 7;
492 "Invalid ATRAC-X channel id: %"PRIu32
"\n", channel_id);
498 framesize = ((codec_params & 0x3FF) * 8) + 8;
564 unsigned tag_len = 0;
583 int stream_index, int64_t timestamp,
int flags)
600 if ((err =
avio_seek(
s->pb, -8, SEEK_CUR)) < 0)
610 memset(oc->
iv, 0, 8);
624 .extensions =
"oma,omg,aa3",
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt)
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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.
#define AVERROR_EOF
End of file.
void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypts / decrypts using the DES algorithm.
static void hex_log(AVFormatContext *s, int level, const char *name, const uint8_t *value, int len)
const uint16_t ff_oma_srate_tab[8]
#define OMA_ENC_HEADER_SIZE
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
Read an ID3v2 tag, including supported extra metadata.
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).
int buf_size
Size of buf except extra allocated bytes.
static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int rprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *r_val)
#define AV_CH_LAYOUT_STEREO
int(* read_packet)(AVFormatContext *s, AVPacket *pkt)
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *n_val)
void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count)
Calculates CBC-MAC using the DES algorithm.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVStreamParseType need_parsing
int av_log_get_level(void)
Get the current log level.
const AVCodecTag ff_oma_codec_tags[]
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
static int read_packet(AVFormatContext *s, AVPacket *pkt)
This structure contains the data a format has to probe a file.
#define ID3v2_HEADER_SIZE
int sample_rate
Audio only.
AVInputFormat ff_oma_demuxer
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
const int ff_oma_chid_to_num_channels[7]
map ATRAC-X channel id to total number of channels
unsigned int avio_rb24(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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_RB32
#define MKBETAG(a, b, c, d)
static const uint8_t header[24]
static int aal_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
static int kset(AVFormatContext *s, const uint8_t *r_val, const uint8_t *n_val, int len)
int flags
A combination of AV_PKT_FLAG values.
#define AV_LOG_INFO
Standard information.
AVDES * av_des_alloc(void)
Allocate an AVDES context.
static int oma_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...
int block_align
Audio only.
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.
static int oma_read_header(AVFormatContext *s)
int ff_id3v2_tag_len(const uint8_t *buf)
Get the length of an ID3v2 tag.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
#define FF_ARRAY_ELEMS(a)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int oma_read_probe(const AVProbeData *p)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
const uint64_t ff_oma_chid_to_native_layout[7]
map ATRAC-X channel id to internal channel layout
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
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).
static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
#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.
int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
Create chapters for all CHAP tags found in the ID3v2 header.
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
static const uint64_t leaf_table[]
int ff_id3v2_match(const uint8_t *buf, const char *magic)
Detect ID3v2 Header.
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_WB24 unsigned int_TMPL AV_RB16
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.