57 0xd79e8283acea4620, 0x7a9762f445afd0d8,
58 0x354d60a60b8c79f1, 0x584e1cde00b07aee,
59 0x1573cd93da7df623, 0x47f98d79620dd535
111 buf[
len << 1] =
'\0';
120 if (!r_val && !n_val)
127 if (r_val != oc->
r_val) {
128 memset(oc->
r_val, 0, 24);
131 memcpy(&oc->
r_val[16], r_val, 8);
134 if (n_val != oc->
n_val) {
135 memset(oc->
n_val, 0, 24);
138 memcpy(&oc->
n_val[16], n_val, 8);
144 #define OMA_RPROBE_M_VAL 48 + 1
151 struct AVDES *av_des;
153 if (!enc_header || !r_val ||
154 size < OMA_ENC_HEADER_SIZE + oc->k_size + oc->
e_size + oc->
i_size ||
179 return memcmp(&enc_header[
pos], oc->
sm_val, 8) ? -1 : 0;
187 uint32_t taglen, datalen;
188 struct AVDES *av_des;
190 if (!enc_header || !n_val ||
191 size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
195 if (!memcmp(&enc_header[
pos],
"EKB ", 4))
205 datalen =
AV_RB32(&enc_header[
pos + 36]) >> 4;
207 pos += 44LL + taglen;
209 if (
pos + (((uint64_t)datalen) << 4) >
size)
217 while (datalen-- > 0) {
241 for (; em; em = em->
next) {
242 if (strcmp(em->
tag,
"GEOB"))
256 "Invalid GEOB data size: %"PRIu32
"\n", geob->
datasize);
300 kset(
s, buf, buf, 16);
336 if (ret < packet_size)
355 if (ret == packet_size)
357 (packet_size >> 3), oc->
iv, 1);
359 memset(oc->
iv, 0, 8);
387 if (ret < packet_size)
410 int ret, framesize, jsflag, samplerate;
411 uint32_t codec_params, channel_id;
431 if (memcmp(buf, ((
const uint8_t[]){
'E',
'A',
'3'}), 3) ||
442 if (eid != -1 && eid != -128 &&
decrypt_init(
s, extra_meta, buf) < 0) {
449 codec_params =
AV_RB24(&buf[33]);
473 if (samplerate != 44100)
476 framesize = (codec_params & 0x3FF) * 8;
479 jsflag = (codec_params >> 17) & 1;
493 AV_WL32(&edata[2], samplerate);
502 channel_id = (codec_params >> 10) & 7;
505 "Invalid ATRAC-X channel id: %"PRIu32
"\n", channel_id);
511 framesize = ((codec_params & 0x3FF) * 8) + 8;
577 unsigned tag_len = 0;
613 if ((err =
avio_seek(
s->pb, -8, SEEK_CUR)) < 0)
623 memset(oc->
iv, 0, 8);
637 .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)
#define flags(name, subs,...)
audio channel layout utility functions
#define MKBETAG(a, b, c, d)
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt)
static int read_header(FFV1Context *f)
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_6POINT1_BACK
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_5POINT1_BACK
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 AVCodec *c)
Add a new stream to a media file.
AVDES * av_des_alloc(void)
Allocate an AVDES context.
void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count)
Calculates CBC-MAC using the DES algorithm.
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 *extra_meta)
Create chapters for all CHAP tags found in the ID3v2 header.
#define ID3v2_HEADER_SIZE
common internal API header
#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)
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 const int oma_chid_to_num_channels[7]
map ATRAC-X channel id to total number of channels
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 int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static const uint64_t oma_chid_to_native_layout[7]
map ATRAC-X channel id to internal channel layout
static const uint64_t leaf_table[]
AVInputFormat ff_oma_demuxer
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)
uint64_t channel_layout
Audio only.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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
Audio only.
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
Audio only.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
int64_t pos
byte position in stream, -1 if unknown
This structure contains the data a format has to probe a file.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
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(...)