FFmpeg
Data Structures | Macros | Functions | Variables
omadec.c File Reference
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/des.h"
#include "libavutil/mathematics.h"
#include "oma.h"
#include "pcm.h"
#include "id3v2.h"

Go to the source code of this file.

Data Structures

struct  OMAContext
 

Macros

#define OMA_RPROBE_M_VAL   48 + 1
 

Functions

static int oma_read_close (AVFormatContext *s)
 
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, unsigned size, const uint8_t *r_val)
 
static int nprobe (AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *n_val)
 
static int decrypt_init (AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
 
static int read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int aal_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int oma_read_header (AVFormatContext *s)
 
static int oma_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int oma_read_probe (const 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 []
 
static const uint64_t oma_chid_to_native_layout [7]
 map ATRAC-X channel id to internal channel layout More...
 
static const int oma_chid_to_num_channels [7] = { 1, 2, 3, 4, 6, 7, 8 }
 map ATRAC-X channel id to total number of channels More...
 
const 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:

Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM

Definition in file omadec.c.

Macro Definition Documentation

◆ OMA_RPROBE_M_VAL

#define OMA_RPROBE_M_VAL   48 + 1

Definition at line 144 of file omadec.c.

Function Documentation

◆ oma_read_close()

static int oma_read_close ( AVFormatContext s)
static

Definition at line 96 of file omadec.c.

Referenced by oma_read_header().

◆ hex_log()

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

Definition at line 103 of file omadec.c.

Referenced by decrypt_init().

◆ kset()

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

Definition at line 115 of file omadec.c.

Referenced by decrypt_init(), and nprobe().

◆ rprobe()

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

Definition at line 146 of file omadec.c.

Referenced by decrypt_init(), and nprobe().

◆ nprobe()

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

Definition at line 182 of file omadec.c.

Referenced by decrypt_init().

◆ decrypt_init()

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

Definition at line 231 of file omadec.c.

Referenced by oma_read_header().

◆ read_packet()

static int read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 327 of file omadec.c.

Referenced by oma_read_header().

◆ aal_read_packet()

static int aal_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 365 of file omadec.c.

Referenced by oma_read_header().

◆ oma_read_header()

static int oma_read_header ( AVFormatContext s)
static

Definition at line 408 of file omadec.c.

◆ oma_read_packet()

static int oma_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 568 of file omadec.c.

◆ oma_read_probe()

static int oma_read_probe ( const AVProbeData p)
static

Definition at line 574 of file omadec.c.

◆ oma_read_seek()

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

Definition at line 595 of file omadec.c.

Variable Documentation

◆ leaf_table

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

Definition at line 56 of file omadec.c.

Referenced by decrypt_init().

◆ oma_chid_to_native_layout

const uint64_t oma_chid_to_native_layout[7]
static
Initial value:

map ATRAC-X channel id to internal channel layout

Definition at line 63 of file omadec.c.

Referenced by oma_read_header().

◆ oma_chid_to_num_channels

const int oma_chid_to_num_channels[7] = { 1, 2, 3, 4, 6, 7, 8 }
static

map ATRAC-X channel id to total number of channels

Definition at line 74 of file omadec.c.

Referenced by oma_read_header().

◆ ff_oma_demuxer

const 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 = ff_oma_codec_tags_list,
}

Definition at line 627 of file omadec.c.

ff_oma_codec_tags_list
const AVCodecTag *const ff_oma_codec_tags_list[]
Definition: oma.c:38
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:90
oma_read_seek
static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: omadec.c:595
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
AVFMT_GENERIC_INDEX
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:463
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:91
OMAContext
Definition: omadec.c:76
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
read_packet
static int read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: omadec.c:327
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LAYOUT_5POINT1_BACK
Definition: channel_layout.h:103
oma_read_close
static int oma_read_close(AVFormatContext *s)
Definition: omadec.c:96
AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_7POINT1
Definition: channel_layout.h:112
oma_read_header
static int oma_read_header(AVFormatContext *s)
Definition: omadec.c:408
AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_SURROUND
Definition: channel_layout.h:94
oma_read_probe
static int oma_read_probe(const AVProbeData *p)
Definition: omadec.c:574
AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_4POINT0
Definition: channel_layout.h:96
AV_CH_LAYOUT_6POINT1_BACK
#define AV_CH_LAYOUT_6POINT1_BACK
Definition: channel_layout.h:108
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
oma_read_packet
static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: omadec.c:568