Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
f40e7eb5
Commit
f40e7eb5
authored
Oct 21, 2011
by
Michael Karcher
Committed by
Anton Khirnov
Dec 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: add OpenMG audio muxer.
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
ee20b332
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
3 deletions
+110
-3
Changelog
Changelog
+1
-0
general.texi
doc/general.texi
+1
-1
Makefile
libavformat/Makefile
+1
-0
allformats.c
libavformat/allformats.c
+1
-1
omaenc.c
libavformat/omaenc.c
+105
-0
version.h
libavformat/version.h
+1
-1
No files found.
Changelog
View file @
f40e7eb5
...
...
@@ -108,6 +108,7 @@ easier to use. The changes are:
- CLJR encoder
- Dxtory capture format decoder
- v410 QuickTime uncompressed 4:4:4 10-bit encoder and decoder
- OpenMG Audio muxer
version 0.7:
...
...
doc/general.texi
View file @
f40e7eb5
...
...
@@ -296,7 +296,7 @@ library:
@tab Used in Sierra CD-ROM games.
@item Smacker @tab @tab X
@tab Multimedia format used by many games.
@item Sony OpenMG (OMA) @tab
@tab X
@item Sony OpenMG (OMA) @tab
X
@tab X
@tab Audio format used in Sony Sonic Stage and Sony Vegas.
@item Sony PlayStation STR @tab @tab X
@item Sony Wave64 (W64) @tab @tab X
...
...
libavformat/Makefile
View file @
f40e7eb5
...
...
@@ -179,6 +179,7 @@ OBJS-$(CONFIG_OGG_DEMUXER) += oggdec.o \
OBJS-$(CONFIG_OGG_MUXER)
+=
oggenc.o
\
vorbiscomment.o
OBJS-$(CONFIG_OMA_DEMUXER)
+=
omadec.o
pcm.o
oma.o
OBJS-$(CONFIG_OMA_MUXER)
+=
omaenc.o
rawenc.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/allformats.c
View file @
f40e7eb5
...
...
@@ -156,7 +156,7 @@ void av_register_all(void)
REGISTER_MUXDEMUX
(
NUT
,
nut
);
REGISTER_DEMUXER
(
NUV
,
nuv
);
REGISTER_MUXDEMUX
(
OGG
,
ogg
);
REGISTER_
DEMUXER
(
OMA
,
oma
);
REGISTER_
MUXDEMUX
(
OMA
,
oma
);
REGISTER_MUXDEMUX
(
PCM_ALAW
,
pcm_alaw
);
REGISTER_MUXDEMUX
(
PCM_MULAW
,
pcm_mulaw
);
REGISTER_MUXDEMUX
(
PCM_F64BE
,
pcm_f64be
);
...
...
libavformat/omaenc.c
0 → 100644
View file @
f40e7eb5
/*
* Sony OpenMG (OMA) muxer
*
* Copyright (c) 2011 Michael Karcher
*
* 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 "avformat.h"
#include "avio_internal.h"
#include "id3v2.h"
#include "internal.h"
#include "oma.h"
#include "rawenc.h"
static
av_cold
int
oma_write_header
(
AVFormatContext
*
s
)
{
int
i
;
AVCodecContext
*
format
;
int
srate_index
;
int
isjointstereo
;
format
=
s
->
streams
[
0
]
->
codec
;
/* check for support of the format first */
for
(
srate_index
=
0
;
;
srate_index
++
)
{
if
(
ff_oma_srate_tab
[
srate_index
]
==
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Sample rate %d not supported in OpenMG audio
\n
"
,
format
->
sample_rate
);
return
AVERROR
(
EINVAL
);
}
if
(
ff_oma_srate_tab
[
srate_index
]
*
100
==
format
->
sample_rate
)
break
;
}
/* Metadata; OpenMG does not support ID3v2.4 */
ff_id3v2_write
(
s
,
3
,
ID3v2_EA3_MAGIC
);
ffio_wfourcc
(
s
->
pb
,
"EA3
\0
"
);
avio_w8
(
s
->
pb
,
EA3_HEADER_SIZE
>>
7
);
avio_w8
(
s
->
pb
,
EA3_HEADER_SIZE
&
0x7F
);
avio_wl16
(
s
->
pb
,
0xFFFF
);
/* not encrypted */
for
(
i
=
0
;
i
<
6
;
i
++
)
avio_wl32
(
s
->
pb
,
0
);
/* Padding + DRM id */
switch
(
format
->
codec_tag
)
{
case
OMA_CODECID_ATRAC3
:
if
(
format
->
channels
!=
2
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"ATRAC3 in OMA is only supported with 2 channels"
);
return
AVERROR
(
EINVAL
);
}
if
(
format
->
extradata_size
==
14
)
/* WAV format extradata */
isjointstereo
=
format
->
extradata
[
6
]
!=
0
;
else
if
(
format
->
extradata_size
==
10
)
/* RM format extradata */
isjointstereo
=
format
->
extradata
[
8
]
==
0x12
;
else
{
av_log
(
s
,
AV_LOG_ERROR
,
"ATRAC3: Unsupported extradata size
\n
"
);
return
AVERROR
(
EINVAL
);
}
avio_wb32
(
s
->
pb
,
(
OMA_CODECID_ATRAC3
<<
24
)
|
(
isjointstereo
<<
17
)
|
(
srate_index
<<
13
)
|
(
format
->
block_align
/
8
));
break
;
case
OMA_CODECID_ATRAC3P
:
avio_wb32
(
s
->
pb
,
(
OMA_CODECID_ATRAC3P
<<
24
)
|
(
srate_index
<<
13
)
|
(
format
->
channels
<<
10
)
|
(
format
->
block_align
/
8
-
1
));
break
;
default:
av_log
(
s
,
AV_LOG_ERROR
,
"OMA: unsupported codec tag %d for write
\n
"
,
format
->
codec_tag
);
}
for
(
i
=
0
;
i
<
(
EA3_HEADER_SIZE
-
36
)
/
4
;
i
++
)
avio_wl32
(
s
->
pb
,
0
);
/* Padding */
return
0
;
}
AVOutputFormat
ff_oma_muxer
=
{
.
name
=
"oma"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Sony OpenMG audio"
),
.
mime_type
=
"audio/x-oma"
,
.
extensions
=
"oma"
,
.
audio_codec
=
CODEC_ID_ATRAC3
,
.
write_header
=
oma_write_header
,
.
write_packet
=
ff_raw_write_packet
,
.
codec_tag
=
(
const
AVCodecTag
*
const
[]){
ff_oma_codec_tags
,
0
},
};
libavformat/version.h
View file @
f40e7eb5
...
...
@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 53
#define LIBAVFORMAT_VERSION_MINOR 1
7
#define LIBAVFORMAT_VERSION_MINOR 1
8
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
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