54 0xd79e8283acea4620, 0x7a9762f445afd0d8,
55 0x354d60a60b8c79f1, 0x584e1cde00b07aee,
56 0x1573cd93da7df623, 0x47f98d79620dd535
85 av_log(s, level,
"%s: %s\n", name, buf);
99 if (r_val != oc->
r_val) {
100 memset(oc->
r_val, 0, 24);
101 memcpy(oc->
r_val, r_val, len);
103 memcpy(&oc->
r_val[16], r_val, 8);
106 if (n_val != oc->
n_val) {
107 memset(oc->
n_val, 0, 24);
108 memcpy(oc->
n_val, n_val, len);
110 memcpy(&oc->
n_val[16], n_val, 8);
116 #define OMA_RPROBE_M_VAL 48 + 1
119 const uint8_t *r_val)
125 if (!enc_header || !r_val ||
126 size < OMA_ENC_HEADER_SIZE + oc->k_size + oc->
e_size + oc->
i_size ||
145 return memcmp(&enc_header[pos], oc->
sm_val, 8) ? -1 : 0;
149 const uint8_t *n_val)
153 uint32_t taglen, datalen;
156 if (!enc_header || !n_val ||
157 size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
161 if (!memcmp(&enc_header[pos],
"EKB ", 4))
170 taglen =
AV_RB32(&enc_header[pos+32]);
171 datalen =
AV_RB32(&enc_header[pos+36]) >> 4;
174 if (size - pos < taglen)
179 if (datalen << 4 > size - pos)
183 while (datalen-- > 0) {
205 if (!strcmp(em->
tag,
"GEOB") &&
237 oc->
rid =
AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
240 memcpy(oc->
iv, &header[0x58], 8);
248 if (!memcmp(oc->
r_val, (
const uint8_t[8]){0}, 8) ||
256 kset(s, buf, buf, 16);
281 int ret, framesize, jsflag, samplerate;
282 uint32_t codec_params;
295 if (memcmp(buf, ((
const uint8_t[]){
'E',
'A',
'3'}),3) || buf[4] != 0 || buf[5] !=
EA3_HEADER_SIZE) {
304 if (eid != -1 && eid != -128 &&
decrypt_init(s, extra_meta, buf) < 0) {
311 codec_params =
AV_RB24(&buf[33]);
329 if (samplerate != 44100)
333 framesize = (codec_params & 0x3FF) * 8;
334 jsflag = (codec_params >> 17) & 1;
347 AV_WL32(&edata[2], samplerate);
357 framesize = ((codec_params & 0x3FF) * 8) + 8;
399 if (ret < packet_size)
410 if (ret == packet_size)
412 (packet_size >> 3), oc->
iv, 1);
414 memset(oc->
iv, 0, 8);
423 unsigned tag_len = 0;
470 memset(oc->
iv, 0, 8);
483 .extensions =
"oma,omg,aa3",
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int rprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *r_val)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
AV_WL32 AV_WL24 AV_WL16 AV_RB32
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, int decrypt)
Initializes an AVDES context.
AVInputFormat ff_oma_demuxer
#define AV_LOG_WARNING
Something somehow does not look correct.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count)
Calculates CBC-MAC using the DES algorithm.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
struct OMAContext OMAContext
#define FF_ARRAY_ELEMS(a)
static int kset(AVFormatContext *s, const uint8_t *r_val, const uint8_t *n_val, int len)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
const AVCodecTag ff_oma_codec_tags[]
#define ID3v2_HEADER_SIZE
int av_log_get_level(void)
enum AVStreamParseType need_parsing
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int read_header(FFV1Context *f)
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
void ff_id3v2_read_all(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta)
Read an ID3v2 tag, including supported extra metadata (currently only GEOB)
int av_get_bits_per_sample(enum CodecID codec_id)
Return codec bits per sample.
enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
int flags
A combination of AV_PKT_FLAG values.
AVCodecContext * codec
codec context
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.
int bit_rate
the average bitrate
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static int read_probe(AVProbeData *p)
static int oma_read_header(AVFormatContext *s, AVFormatParameters *ap)
#define OMA_ENC_HEADER_SIZE
enum AVMediaType codec_type
static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
int sample_rate
samples per second
static void hex_log(AVFormatContext *s, int level, const char *name, const uint8_t *value, int len)
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
static const uint64_t leaf_table[]
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
This structure contains the data a format has to probe a file.
static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
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.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_RB24
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int ff_id3v2_match(const uint8_t *buf, const char *magic)
Detect ID3v2 Header.
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *n_val)
int channels
number of audio channels
int ff_id3v2_tag_len(const uint8_t *buf)
Get the length of an ID3v2 tag.
void * priv_data
Format private data.
const uint16_t ff_oma_srate_tab[8]
static int oma_read_probe(AVProbeData *p)