Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
6c233910
Commit
6c233910
authored
Sep 19, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: add APAC demuxer
parent
84f46745
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
3 deletions
+91
-3
Changelog
Changelog
+1
-1
Makefile
libavformat/Makefile
+1
-0
allformats.c
libavformat/allformats.c
+1
-0
apac.c
libavformat/apac.c
+86
-0
version.h
libavformat/version.h
+2
-2
No files found.
Changelog
View file @
6c233910
...
...
@@ -14,7 +14,7 @@ version <next>:
- bonk decoder and demuxer
- Micronas SC-4 audio decoder
- LAF demuxer
- APAC decoder
- APAC decoder
and demuxer
version 5.1:
...
...
libavformat/Makefile
View file @
6c233910
...
...
@@ -101,6 +101,7 @@ OBJS-$(CONFIG_AMRNB_DEMUXER) += amr.o rawdec.o
OBJS-$(CONFIG_AMRWB_DEMUXER)
+=
amr.o
rawdec.o
OBJS-$(CONFIG_AMV_MUXER)
+=
amvenc.o
OBJS-$(CONFIG_ANM_DEMUXER)
+=
anm.o
OBJS-$(CONFIG_APAC_DEMUXER)
+=
apac.o
rawdec.o
OBJS-$(CONFIG_APC_DEMUXER)
+=
apc.o
OBJS-$(CONFIG_APE_DEMUXER)
+=
ape.o
apetag.o
img2.o
OBJS-$(CONFIG_APM_DEMUXER)
+=
apm.o
...
...
libavformat/allformats.c
View file @
6c233910
...
...
@@ -52,6 +52,7 @@ extern const AVInputFormat ff_amrnb_demuxer;
extern
const
AVInputFormat
ff_amrwb_demuxer
;
extern
const
AVOutputFormat
ff_amv_muxer
;
extern
const
AVInputFormat
ff_anm_demuxer
;
extern
const
AVInputFormat
ff_apac_demuxer
;
extern
const
AVInputFormat
ff_apc_demuxer
;
extern
const
AVInputFormat
ff_ape_demuxer
;
extern
const
AVInputFormat
ff_apm_demuxer
;
...
...
libavformat/apac.c
0 → 100644
View file @
6c233910
/*
* APAC demuxer
* Copyright (c) 2022 Paul B Mahol
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "rawdec.h"
static
int
apac_probe
(
const
AVProbeData
*
p
)
{
if
(
AV_RB32
(
p
->
buf
)
==
MKBETAG
(
'A'
,
'P'
,
'A'
,
'C'
)
&&
AV_RB32
(
p
->
buf
+
8
)
==
MKBETAG
(
'P'
,
'R'
,
'O'
,
'F'
)
&&
AV_RB32
(
p
->
buf
+
12
)
==
MKBETAG
(
'N'
,
'A'
,
'D'
,
' '
))
return
AVPROBE_SCORE_MAX
;
return
0
;
}
static
int
apac_read_header
(
AVFormatContext
*
s
)
{
AVIOContext
*
pb
=
s
->
pb
;
uint32_t
chunk_size
;
AVStream
*
st
;
int64_t
pos
;
avio_skip
(
pb
,
16
);
chunk_size
=
avio_rl32
(
pb
);
avio_skip
(
pb
,
chunk_size
);
if
(
avio_rb32
(
pb
)
!=
MKBETAG
(
'P'
,
'F'
,
'M'
,
'T'
))
return
AVERROR_INVALIDDATA
;
chunk_size
=
avio_rl32
(
pb
);
pos
=
avio_tell
(
pb
);
avio_skip
(
pb
,
2
);
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
st
->
codecpar
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_APAC
;
st
->
codecpar
->
ch_layout
.
nb_channels
=
avio_rl16
(
pb
);
st
->
codecpar
->
sample_rate
=
avio_rl32
(
pb
);
if
(
st
->
codecpar
->
ch_layout
.
nb_channels
<=
0
||
st
->
codecpar
->
ch_layout
.
nb_channels
>
2
||
st
->
codecpar
->
sample_rate
<=
0
)
return
AVERROR_INVALIDDATA
;
avio_skip
(
pb
,
2
);
st
->
codecpar
->
bits_per_coded_sample
=
avio_rl16
(
pb
);
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codecpar
->
sample_rate
);
avio_skip
(
pb
,
(
chunk_size
+
pos
)
-
avio_tell
(
pb
)
+
(
chunk_size
&
1
));
if
(
avio_rb32
(
pb
)
!=
MKBETAG
(
'P'
,
'A'
,
'D'
,
' '
))
return
AVERROR_INVALIDDATA
;
avio_skip
(
pb
,
4
);
return
0
;
}
const
AVInputFormat
ff_apac_demuxer
=
{
.
name
=
"apac"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw APAC"
),
.
read_probe
=
apac_probe
,
.
read_header
=
apac_read_header
,
.
read_packet
=
ff_raw_read_partial_packet
,
.
extensions
=
"apc"
,
.
flags
=
AVFMT_NOBINSEARCH
|
AVFMT_NOGENSEARCH
|
AVFMT_NO_BYTE_SEEK
|
AVFMT_NOTIMESTAMPS
,
.
raw_codec_id
=
AV_CODEC_ID_APAC
,
.
priv_data_size
=
sizeof
(
FFRawDemuxerContext
),
.
priv_class
=
&
ff_raw_demuxer_class
,
};
libavformat/version.h
View file @
6c233910
...
...
@@ -31,8 +31,8 @@
#include "version_major.h"
#define LIBAVFORMAT_VERSION_MINOR 3
2
#define LIBAVFORMAT_VERSION_MICRO 10
1
#define LIBAVFORMAT_VERSION_MINOR 3
3
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
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