Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ee20b332
Commit
ee20b332
authored
Dec 17, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omadec: split data that will be used in the muxer to a separate file.
parent
08f7af0c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
24 deletions
+78
-24
Makefile
libavformat/Makefile
+1
-1
oma.c
libavformat/oma.c
+33
-0
oma.h
libavformat/oma.h
+39
-0
omadec.c
libavformat/omadec.c
+5
-23
No files found.
libavformat/Makefile
View file @
ee20b332
...
...
@@ -178,7 +178,7 @@ OBJS-$(CONFIG_OGG_DEMUXER) += oggdec.o \
vorbiscomment.o
OBJS-$(CONFIG_OGG_MUXER)
+=
oggenc.o
\
vorbiscomment.o
OBJS-$(CONFIG_OMA_DEMUXER)
+=
omadec.o
pcm.o
OBJS-$(CONFIG_OMA_DEMUXER)
+=
omadec.o
pcm.o
oma.o
OBJS-$(CONFIG_PCM_ALAW_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_ALAW_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F32BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
...
...
libavformat/oma.c
0 → 100644
View file @
ee20b332
/*
* Sony OpenMG (OMA) common data
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "internal.h"
#include "oma.h"
#include "libavcodec/avcodec.h"
const
uint16_t
ff_oma_srate_tab
[
6
]
=
{
320
,
441
,
480
,
882
,
960
,
0
};
const
AVCodecTag
ff_oma_codec_tags
[]
=
{
{
CODEC_ID_ATRAC3
,
OMA_CODECID_ATRAC3
},
{
CODEC_ID_ATRAC3P
,
OMA_CODECID_ATRAC3P
},
{
CODEC_ID_MP3
,
OMA_CODECID_MP3
},
{
CODEC_ID_PCM_S16BE
,
OMA_CODECID_LPCM
},
{
0
},
};
libavformat/oma.h
0 → 100644
View file @
ee20b332
/*
* Sony OpenMG (OMA) common data
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFORMAT_OMA_H
#define AVFORMAT_OMA_H
#define EA3_HEADER_SIZE 96
#define ID3v2_EA3_MAGIC "ea3"
#define OMA_ENC_HEADER_SIZE 16
enum
{
OMA_CODECID_ATRAC3
=
0
,
OMA_CODECID_ATRAC3P
=
1
,
OMA_CODECID_MP3
=
3
,
OMA_CODECID_LPCM
=
4
,
OMA_CODECID_WMA
=
5
,
};
extern
const
uint16_t
ff_oma_srate_tab
[
6
];
extern
const
AVCodecTag
ff_oma_codec_tags
[];
#endif
libavformat/omadec.c
View file @
ee20b332
...
...
@@ -44,28 +44,11 @@
#include "internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/des.h"
#include "oma.h"
#include "pcm.h"
#include "riff.h"
#include "id3v2.h"
#define EA3_HEADER_SIZE 96
#define ID3v2_EA3_MAGIC "ea3"
#define OMA_ENC_HEADER_SIZE 16
enum
{
OMA_CODECID_ATRAC3
=
0
,
OMA_CODECID_ATRAC3P
=
1
,
OMA_CODECID_MP3
=
3
,
OMA_CODECID_LPCM
=
4
,
OMA_CODECID_WMA
=
5
,
};
static
const
AVCodecTag
codec_oma_tags
[]
=
{
{
CODEC_ID_ATRAC3
,
OMA_CODECID_ATRAC3
},
{
CODEC_ID_ATRAC3P
,
OMA_CODECID_ATRAC3P
},
{
CODEC_ID_MP3
,
OMA_CODECID_MP3
},
{
CODEC_ID_PCM_S16BE
,
OMA_CODECID_LPCM
},
};
static
const
uint64_t
leaf_table
[]
=
{
0xd79e8283acea4620
,
0x7a9762f445afd0d8
,
...
...
@@ -276,7 +259,6 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
static
int
oma_read_header
(
AVFormatContext
*
s
,
AVFormatParameters
*
ap
)
{
static
const
uint16_t
srate_tab
[
6
]
=
{
320
,
441
,
480
,
882
,
960
,
0
};
int
ret
,
framesize
,
jsflag
,
samplerate
;
uint32_t
codec_params
;
int16_t
eid
;
...
...
@@ -316,11 +298,11 @@ static int oma_read_header(AVFormatContext *s,
st
->
start_time
=
0
;
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codec
->
codec_tag
=
buf
[
32
];
st
->
codec
->
codec_id
=
ff_codec_get_id
(
codec_oma
_tags
,
st
->
codec
->
codec_tag
);
st
->
codec
->
codec_id
=
ff_codec_get_id
(
ff_oma_codec
_tags
,
st
->
codec
->
codec_tag
);
switch
(
buf
[
32
])
{
case
OMA_CODECID_ATRAC3
:
samplerate
=
srate_tab
[(
codec_params
>>
13
)
&
7
]
*
100
;
samplerate
=
ff_oma_
srate_tab
[(
codec_params
>>
13
)
&
7
]
*
100
;
if
(
samplerate
!=
44100
)
av_log_ask_for_sample
(
s
,
"Unsupported sample rate: %d
\n
"
,
samplerate
);
...
...
@@ -350,7 +332,7 @@ static int oma_read_header(AVFormatContext *s,
case
OMA_CODECID_ATRAC3P
:
st
->
codec
->
channels
=
(
codec_params
>>
10
)
&
7
;
framesize
=
((
codec_params
&
0x3FF
)
*
8
)
+
8
;
st
->
codec
->
sample_rate
=
srate_tab
[(
codec_params
>>
13
)
&
7
]
*
100
;
st
->
codec
->
sample_rate
=
ff_oma_
srate_tab
[(
codec_params
>>
13
)
&
7
]
*
100
;
st
->
codec
->
bit_rate
=
st
->
codec
->
sample_rate
*
framesize
*
8
/
1024
;
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
av_log
(
s
,
AV_LOG_ERROR
,
"Unsupported codec ATRAC3+!
\n
"
);
...
...
@@ -459,6 +441,6 @@ AVInputFormat ff_oma_demuxer = {
.
read_seek
=
oma_read_seek
,
.
flags
=
AVFMT_GENERIC_INDEX
,
.
extensions
=
"oma,omg,aa3"
,
.
codec_tag
=
(
const
AVCodecTag
*
const
[]){
codec_oma
_tags
,
0
},
.
codec_tag
=
(
const
AVCodecTag
*
const
[]){
ff_oma_codec
_tags
,
0
},
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment