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
018eef1a
Commit
018eef1a
authored
Nov 10, 2017
by
Aurelien Jacobs
Committed by
Rostislav Pehlivanov
Nov 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aptx: add raw muxer and demuxer for aptX
parent
a337b36b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
0 deletions
+96
-0
general.texi
doc/general.texi
+1
-0
Makefile
libavformat/Makefile
+2
-0
allformats.c
libavformat/allformats.c
+1
-0
aptxdec.c
libavformat/aptxdec.c
+78
-0
rawenc.c
libavformat/rawenc.c
+13
-0
utils.c
libavformat/utils.c
+1
-0
No files found.
doc/general.texi
View file @
018eef1a
...
...
@@ -441,6 +441,7 @@ library:
@item raw AC-3 @tab X @tab X
@item raw AMR-NB @tab @tab X
@item raw AMR-WB @tab @tab X
@item raw aptX @tab X @tab X
@item raw Chinese AVS video @tab X @tab X
@item raw CRI ADX @tab X @tab X
@item raw Dirac @tab X @tab X
...
...
libavformat/Makefile
View file @
018eef1a
...
...
@@ -94,6 +94,8 @@ OBJS-$(CONFIG_APC_DEMUXER) += apc.o
OBJS-$(CONFIG_APE_DEMUXER)
+=
ape.o
apetag.o
img2.o
OBJS-$(CONFIG_APNG_DEMUXER)
+=
apngdec.o
OBJS-$(CONFIG_APNG_MUXER)
+=
apngenc.o
OBJS-$(CONFIG_APTX_DEMUXER)
+=
aptxdec.o
rawdec.o
OBJS-$(CONFIG_APTX_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_AQTITLE_DEMUXER)
+=
aqtitledec.o
subtitles.o
OBJS-$(CONFIG_ASF_DEMUXER)
+=
asfdec_f.o
asf.o
asfcrypt.o
\
avlanguage.o
...
...
libavformat/allformats.c
View file @
018eef1a
...
...
@@ -69,6 +69,7 @@ static void register_all(void)
REGISTER_DEMUXER
(
APC
,
apc
);
REGISTER_DEMUXER
(
APE
,
ape
);
REGISTER_MUXDEMUX
(
APNG
,
apng
);
REGISTER_MUXDEMUX
(
APTX
,
aptx
);
REGISTER_DEMUXER
(
AQTITLE
,
aqtitle
);
REGISTER_MUXDEMUX
(
ASF
,
asf
);
REGISTER_DEMUXER
(
ASF_O
,
asf_o
);
...
...
libavformat/aptxdec.c
0 → 100644
View file @
018eef1a
/*
* RAW aptX demuxer
*
* Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
*
* 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 "avformat.h"
#include "rawdec.h"
#define APTX_BLOCK_SIZE 4
#define APTX_PACKET_SIZE (256*APTX_BLOCK_SIZE)
typedef
struct
AptXDemuxerContext
{
AVClass
*
class
;
int
sample_rate
;
}
AptXDemuxerContext
;
static
int
aptx_read_header
(
AVFormatContext
*
s
)
{
AptXDemuxerContext
*
s1
=
s
->
priv_data
;
AVStream
*
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_APTX
;
st
->
codecpar
->
format
=
AV_SAMPLE_FMT_S32P
;
st
->
codecpar
->
channels
=
2
;
st
->
codecpar
->
sample_rate
=
s1
->
sample_rate
;
st
->
codecpar
->
bits_per_coded_sample
=
4
;
st
->
codecpar
->
block_align
=
APTX_BLOCK_SIZE
;
st
->
codecpar
->
frame_size
=
APTX_PACKET_SIZE
;
st
->
start_time
=
0
;
return
0
;
}
static
int
aptx_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
return
av_get_packet
(
s
->
pb
,
pkt
,
APTX_PACKET_SIZE
);
}
static
const
AVOption
aptx_options
[]
=
{
{
"sample_rate"
,
""
,
offsetof
(
AptXDemuxerContext
,
sample_rate
),
AV_OPT_TYPE_INT
,
{.
i64
=
48000
},
0
,
INT_MAX
,
AV_OPT_FLAG_DECODING_PARAM
},
{
NULL
},
};
static
const
AVClass
aptx_demuxer_class
=
{
.
class_name
=
"aptx demuxer"
,
.
item_name
=
av_default_item_name
,
.
option
=
aptx_options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVInputFormat
ff_aptx_demuxer
=
{
.
name
=
"aptx"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw aptX"
),
.
extensions
=
"aptx"
,
.
priv_data_size
=
sizeof
(
AptXDemuxerContext
),
.
read_header
=
aptx_read_header
,
.
read_packet
=
aptx_read_packet
,
.
flags
=
AVFMT_GENERIC_INDEX
,
.
priv_class
=
&
aptx_demuxer_class
,
};
libavformat/rawenc.c
View file @
018eef1a
...
...
@@ -91,6 +91,19 @@ AVOutputFormat ff_adx_muxer = {
};
#endif
#if CONFIG_APTX_MUXER
AVOutputFormat
ff_aptx_muxer
=
{
.
name
=
"aptx"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw aptX (Audio Processing Technology for Bluetooth)"
),
.
extensions
=
"aptx"
,
.
audio_codec
=
AV_CODEC_ID_APTX
,
.
video_codec
=
AV_CODEC_ID_NONE
,
.
write_header
=
force_one_stream
,
.
write_packet
=
ff_raw_write_packet
,
.
flags
=
AVFMT_NOTIMESTAMPS
,
};
#endif
#if CONFIG_CAVSVIDEO_MUXER
AVOutputFormat
ff_cavsvideo_muxer
=
{
.
name
=
"cavsvideo"
,
...
...
libavformat/utils.c
View file @
018eef1a
...
...
@@ -324,6 +324,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
}
fmt_id_type
[]
=
{
{
"aac"
,
AV_CODEC_ID_AAC
,
AVMEDIA_TYPE_AUDIO
},
{
"ac3"
,
AV_CODEC_ID_AC3
,
AVMEDIA_TYPE_AUDIO
},
{
"aptx"
,
AV_CODEC_ID_APTX
,
AVMEDIA_TYPE_AUDIO
},
{
"dts"
,
AV_CODEC_ID_DTS
,
AVMEDIA_TYPE_AUDIO
},
{
"dvbsub"
,
AV_CODEC_ID_DVB_SUBTITLE
,
AVMEDIA_TYPE_SUBTITLE
},
{
"dvbtxt"
,
AV_CODEC_ID_DVB_TELETEXT
,
AVMEDIA_TYPE_SUBTITLE
},
...
...
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