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
a17c3c7d
Commit
a17c3c7d
authored
Nov 21, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: add CRI ADX format demuxer
parent
27360ccc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
1 deletion
+117
-1
Changelog
Changelog
+1
-0
general.texi
doc/general.texi
+2
-0
Makefile
libavcodec/Makefile
+1
-0
Makefile
libavformat/Makefile
+1
-0
adxdec.c
libavformat/adxdec.c
+110
-0
allformats.c
libavformat/allformats.c
+1
-0
version.h
libavformat/version.h
+1
-1
No files found.
Changelog
View file @
a17c3c7d
...
...
@@ -102,6 +102,7 @@ easier to use. The changes are:
- Discworld II BMV decoding support
- VBLE Decoder
- OS X Video Decoder Acceleration (VDA) support
- CRI ADX audio format demuxer
version 0.7:
...
...
doc/general.texi
View file @
a17c3c7d
...
...
@@ -67,6 +67,8 @@ library:
@item Brute Force
&
Ignorance @tab @tab X
@tab Used in the game Flash Traffic: City of Angels.
@item BWF @tab X @tab X
@item CRI ADX @tab @tab X
@tab Audio-only format used in console video games.
@item Discworld II BMV @tab @tab X
@item Interplay C93 @tab @tab X
@tab Used in the game Cyberia from Interplay.
...
...
libavcodec/Makefile
View file @
a17c3c7d
...
...
@@ -528,6 +528,7 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
# libavformat dependencies
OBJS-$(CONFIG_ADTS_MUXER)
+=
mpeg4audio.o
OBJS-$(CONFIG_ADX_DEMUXER)
+=
adx.o
OBJS-$(CONFIG_CAF_DEMUXER)
+=
mpeg4audio.o
mpegaudiodata.o
OBJS-$(CONFIG_DV_DEMUXER)
+=
dvdata.o
OBJS-$(CONFIG_DV_MUXER)
+=
dvdata.o
...
...
libavformat/Makefile
View file @
a17c3c7d
...
...
@@ -21,6 +21,7 @@ OBJS-$(CONFIG_A64_MUXER) += a64.o
OBJS-$(CONFIG_AAC_DEMUXER)
+=
aacdec.o
rawdec.o
OBJS-$(CONFIG_AC3_DEMUXER)
+=
ac3dec.o
rawdec.o
OBJS-$(CONFIG_AC3_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_ADX_DEMUXER)
+=
adxdec.o
OBJS-$(CONFIG_ADTS_MUXER)
+=
adtsenc.o
OBJS-$(CONFIG_AEA_DEMUXER)
+=
aea.o
pcm.o
OBJS-$(CONFIG_AIFF_DEMUXER)
+=
aiffdec.o
riff.o
pcm.o
...
...
libavformat/adxdec.c
0 → 100644
View file @
a17c3c7d
/*
* Copyright (c) 2011 Justin Ruggles
*
* 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
*/
/**
* @file
* CRI ADX demuxer
*/
#include "libavutil/intreadwrite.h"
#include "libavcodec/adx.h"
#include "avformat.h"
#define BLOCK_SIZE 18
#define BLOCK_SAMPLES 32
typedef
struct
ADXDemuxerContext
{
int
header_size
;
}
ADXDemuxerContext
;
static
int
adx_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
ADXDemuxerContext
*
c
=
s
->
priv_data
;
AVCodecContext
*
avctx
=
s
->
streams
[
0
]
->
codec
;
int
ret
,
size
;
size
=
BLOCK_SIZE
*
avctx
->
channels
;
pkt
->
pos
=
avio_tell
(
s
->
pb
);
pkt
->
stream_index
=
0
;
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
size
);
if
(
ret
!=
size
)
{
av_free_packet
(
pkt
);
return
ret
<
0
?
ret
:
AVERROR
(
EIO
);
}
if
(
AV_RB16
(
pkt
->
data
)
&
0x8000
)
{
av_free_packet
(
pkt
);
return
AVERROR_EOF
;
}
pkt
->
size
=
size
;
pkt
->
duration
=
1
;
pkt
->
pts
=
(
pkt
->
pos
-
c
->
header_size
)
/
size
;
return
0
;
}
static
int
adx_read_header
(
AVFormatContext
*
s
,
AVFormatParameters
*
ap
)
{
ADXDemuxerContext
*
c
=
s
->
priv_data
;
AVCodecContext
*
avctx
;
int
ret
;
AVStream
*
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
avctx
=
s
->
streams
[
0
]
->
codec
;
if
(
avio_rb16
(
s
->
pb
)
!=
0x8000
)
return
AVERROR_INVALIDDATA
;
c
->
header_size
=
avio_rb16
(
s
->
pb
)
+
4
;
avio_seek
(
s
->
pb
,
-
4
,
SEEK_CUR
);
avctx
->
extradata
=
av_mallocz
(
c
->
header_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
!
avctx
->
extradata
)
return
AVERROR
(
ENOMEM
);
if
(
avio_read
(
s
->
pb
,
avctx
->
extradata
,
c
->
header_size
)
<
c
->
header_size
)
{
av_freep
(
&
avctx
->
extradata
);
return
AVERROR
(
EIO
);
}
avctx
->
extradata_size
=
c
->
header_size
;
ret
=
ff_adx_decode_header
(
avctx
,
avctx
->
extradata
,
avctx
->
extradata_size
,
&
c
->
header_size
,
NULL
);
if
(
ret
)
return
ret
;
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codec
->
codec_id
=
s
->
iformat
->
value
;
av_set_pts_info
(
st
,
64
,
BLOCK_SAMPLES
,
avctx
->
sample_rate
);
return
0
;
}
AVInputFormat
ff_adx_demuxer
=
{
.
name
=
"adx"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"CRI ADX"
),
.
priv_data_size
=
sizeof
(
ADXDemuxerContext
),
.
read_header
=
adx_read_header
,
.
read_packet
=
adx_read_packet
,
.
extensions
=
"adx"
,
.
value
=
CODEC_ID_ADPCM_ADX
,
};
libavformat/allformats.c
View file @
a17c3c7d
...
...
@@ -52,6 +52,7 @@ void av_register_all(void)
REGISTER_DEMUXER
(
AAC
,
aac
);
REGISTER_MUXDEMUX
(
AC3
,
ac3
);
REGISTER_MUXER
(
ADTS
,
adts
);
REGISTER_DEMUXER
(
ADX
,
adx
);
REGISTER_DEMUXER
(
AEA
,
aea
);
REGISTER_MUXDEMUX
(
AIFF
,
aiff
);
REGISTER_MUXDEMUX
(
AMR
,
amr
);
...
...
libavformat/version.h
View file @
a17c3c7d
...
...
@@ -24,7 +24,7 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 53
#define LIBAVFORMAT_VERSION_MINOR 1
5
#define LIBAVFORMAT_VERSION_MINOR 1
6
#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