omadec.c File Reference

This is a demuxer for Sony OpenMG Music files. More...

#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/des.h"
#include "oma.h"
#include "pcm.h"
#include "id3v2.h"
Include dependency graph for omadec.c:

Go to the source code of this file.

Data Structures

struct  OMAContext
 

Typedefs

typedef struct OMAContext OMAContext
 

Functions

static void hex_log (AVFormatContext *s, int level, const char *name, const uint8_t *value, int len)
 
static int kset (AVFormatContext *s, const uint8_t *r_val, const uint8_t *n_val, int len)
 
static int rprobe (AVFormatContext *s, uint8_t *enc_header, const uint8_t *r_val)
 
static int nprobe (AVFormatContext *s, uint8_t *enc_header, int size, const uint8_t *n_val)
 
static int decrypt_init (AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
 
static int oma_read_header (AVFormatContext *s)
 
static int oma_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int oma_read_probe (AVProbeData *p)
 
static int oma_read_seek (struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 

Variables

static const uint64_t leaf_table []
 
AVInputFormat ff_oma_demuxer
 

Detailed Description

This is a demuxer for Sony OpenMG Music files.

Known file extensions: ".oma", "aa3" The format of such files consists of three parts:

  • "ea3" header carrying overall info and metadata. Except for starting with "ea" instead of "ID", it's an ID3v2 header.
  • "EA3" header is a Sony-specific header containing information about the OpenMG file: codec type (usually ATRAC, can also be MP3 or WMA), codec specific info (packet size, sample rate, channels and so on) and DRM related info (file encryption, content id).
  • Sound data organized in packets follow the EA3 header (can be encrypted using the Sony DRM!).

Definition in file omadec.c.

Typedef Documentation

typedef struct OMAContext OMAContext

Function Documentation

static int decrypt_init ( AVFormatContext s,
ID3v2ExtraMeta em,
uint8_t header 
)
static

Definition at line 178 of file omadec.c.

Referenced by oma_read_header().

static void hex_log ( AVFormatContext s,
int  level,
const char *  name,
const uint8_t value,
int  len 
)
static

Definition at line 76 of file omadec.c.

Referenced by decrypt_init().

static int kset ( AVFormatContext s,
const uint8_t r_val,
const uint8_t n_val,
int  len 
)
static

Definition at line 87 of file omadec.c.

Referenced by decrypt_init(), and nprobe().

static int nprobe ( AVFormatContext s,
uint8_t enc_header,
int  size,
const uint8_t n_val 
)
static

Definition at line 142 of file omadec.c.

Referenced by decrypt_init().

static int oma_read_header ( AVFormatContext s)
static

Definition at line 267 of file omadec.c.

static int oma_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 382 of file omadec.c.

static int oma_read_probe ( AVProbeData p)
static

Definition at line 401 of file omadec.c.

static int oma_read_seek ( struct AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

Definition at line 429 of file omadec.c.

static int rprobe ( AVFormatContext s,
uint8_t enc_header,
const uint8_t r_val 
)
static

Definition at line 115 of file omadec.c.

Referenced by decrypt_init(), and nprobe().

Variable Documentation

AVInputFormat ff_oma_demuxer
Initial value:
= {
.name = "oma",
.long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
.priv_data_size = sizeof(OMAContext),
.extensions = "oma,omg,aa3",
.codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
}
static int oma_read_header(AVFormatContext *s)
Definition: omadec.c:267
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
struct OMAContext OMAContext
static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: omadec.c:382
const AVCodecTag ff_oma_codec_tags[]
Definition: oma.c:27
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int read_probe(AVProbeData *pd)
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:353
static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: omadec.c:429
static int flags
Definition: cpu.c:23
static int oma_read_probe(AVProbeData *p)
Definition: omadec.c:401

Definition at line 451 of file omadec.c.

const uint64_t leaf_table[]
static
Initial value:
= {
0xd79e8283acea4620, 0x7a9762f445afd0d8,
0x354d60a60b8c79f1, 0x584e1cde00b07aee,
0x1573cd93da7df623, 0x47f98d79620dd535
}

Definition at line 52 of file omadec.c.

Referenced by decrypt_init().