59 0xd79e8283acea4620, 0x7a9762f445afd0d8,
60 0x354d60a60b8c79f1, 0x584e1cde00b07aee,
61 0x1573cd93da7df623, 0x47f98d79620dd535
118 if (!r_val && !n_val)
125 if (r_val != oc->
r_val) {
126 memset(oc->
r_val, 0, 24);
129 memcpy(&oc->
r_val[16], r_val, 8);
132 if (n_val != oc->
n_val) {
133 memset(oc->
n_val, 0, 24);
136 memcpy(&oc->
n_val[16], n_val, 8);
142#define OMA_RPROBE_M_VAL 48 + 1
145 const uint8_t *r_val)
149 struct AVDES *av_des;
151 if (!enc_header || !r_val ||
177 return memcmp(&enc_header[
pos], oc->
sm_val, 8) ? -1 : 0;
181 const uint8_t *n_val)
185 uint32_t taglen, datalen;
186 struct AVDES *av_des;
188 if (!enc_header || !n_val ||
193 if (!memcmp(&enc_header[
pos],
"EKB ", 4))
203 datalen =
AV_RB32(&enc_header[
pos + 36]) >> 4;
205 pos += 44LL + taglen;
207 if (
pos + (((uint64_t)datalen) << 4) >
size)
215 while (datalen-- > 0) {
239 for (; em; em = em->
next) {
240 if (strcmp(em->
tag,
"GEOB"))
254 "Invalid GEOB data size: %"PRIu32
"\n", geob->
datasize);
290 if (!memcmp(oc->
r_val, (
const uint8_t[8]){0}, 8) ||
298 kset(
s, buf, buf, 16);
334 if (ret < packet_size)
342 pkt->stream_index = 0;
353 if (ret == packet_size)
355 (packet_size >> 3), oc->
iv, 1);
357 memset(oc->
iv, 0, 8);
385 if (ret < packet_size)
393 pkt->stream_index = 0;
396 pkt->duration = 1024;
399 pkt->duration = 2048;
408 int ret, framesize, jsflag, samplerate;
409 uint32_t codec_params, channel_id;
429 if (memcmp(buf, ((
const uint8_t[]){
'E',
'A',
'3'}), 3) ||
440 if (eid != -1 && eid != -128 &&
decrypt_init(
s, extra_meta, buf) < 0) {
447 codec_params =
AV_RB24(&buf[33]);
468 if (samplerate != 44100)
471 framesize = (codec_params & 0x3FF) * 8;
474 jsflag = (codec_params >> 17) & 1;
487 AV_WL32(&edata[2], samplerate);
496 channel_id = (codec_params >> 10) & 7;
499 "Invalid ATRAC-X channel id: %"PRIu32
"\n", channel_id);
504 framesize = ((codec_params & 0x3FF) * 8) + 8;
562 const uint8_t *buf = p->buf;
563 unsigned tag_len = 0;
569 if (p->buf_size < tag_len + 5)
599 if ((err =
avio_seek(
s->pb, -8, SEEK_CUR)) < 0)
609 memset(oc->
iv, 0, 8);
617 .p.extensions =
"oma,omg,aa3",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rb24(AVIOContext *s)
unsigned int avio_rb32(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt)
static int read_header(FFV1Context *f, RangeCoder *c)
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AV_CHANNEL_LAYOUT_4POINT0
#define AV_CHANNEL_LAYOUT_5POINT1_BACK
#define AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_6POINT1_BACK
#define AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_SURROUND
#define AV_CHANNEL_LAYOUT_7POINT1
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count)
Calculates CBC-MAC using the DES algorithm.
AVDES * av_des_alloc(void)
Allocate an AVDES context.
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.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_log_get_level(void)
Get the current log level.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
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.
int ff_id3v2_tag_len(const uint8_t *buf)
Get the length of an ID3v2 tag.
int ff_id3v2_match(const uint8_t *buf, const char *magic)
Detect ID3v2 Header.
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *cur)
Create chapters for all CHAP tags found in the ID3v2 header.
#define ID3v2_HEADER_SIZE
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
#define MKBETAG(a, b, c, d)
Memory handling functions.
const AVCodecTag *const ff_oma_codec_tags_list[]
const uint16_t ff_oma_srate_tab[8]
const AVCodecTag ff_oma_codec_tags[]
#define OMA_ENC_HEADER_SIZE
static int rprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *r_val)
static int oma_read_probe(const AVProbeData *p)
static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
static void hex_log(AVFormatContext *s, int level, const char *name, const uint8_t *value, int len)
static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
static int read_packet(AVFormatContext *s, AVPacket *pkt)
static int aal_read_packet(AVFormatContext *s, AVPacket *pkt)
static int oma_read_close(AVFormatContext *s)
static int oma_read_header(AVFormatContext *s)
static int kset(AVFormatContext *s, const uint8_t *r_val, const uint8_t *n_val, int len)
static const AVChannelLayout oma_chid_to_native_layout[7]
map ATRAC-X channel id to internal channel layout
static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static const uint64_t leaf_table[]
static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *n_val)
static const uint8_t header[24]
#define FF_ARRAY_ELEMS(a)
An AVChannelLayout holds information about the channel layout of audio data.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
enum AVStreamParseType need_parsing
int(* read_packet)(AVFormatContext *s, AVPacket *pkt)
#define avpriv_request_sample(...)