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
a3826241
Commit
a3826241
authored
Jun 04, 2019
by
Anton Khirnov
Committed by
James Almer
Mar 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libcodec2: convert to new channel layout API
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
89dc056b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
libcodec2.c
libavcodec/libcodec2.c
+9
-3
No files found.
libavcodec/libcodec2.c
View file @
a3826241
...
...
@@ -85,9 +85,9 @@ libcodec2_init_common_error:
static
av_cold
int
libcodec2_init_decoder
(
AVCodecContext
*
avctx
)
{
avctx
->
sample_rate
=
8000
;
avctx
->
channels
=
1
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
avctx
->
channel_layout
=
AV_CH_LAYOUT_MONO
;
av_channel_layout_uninit
(
&
avctx
->
ch_layout
);
avctx
->
ch_layout
=
(
AVChannelLayout
)
AV_CHANNEL_LAYOUT_MONO
;
if
(
avctx
->
extradata_size
!=
CODEC2_EXTRADATA_SIZE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"must have exactly %i bytes of extradata (got %i)
\n
"
,
...
...
@@ -104,7 +104,7 @@ static av_cold int libcodec2_init_encoder(AVCodecContext *avctx)
//will need to be smarter once we get wideband support
if
(
avctx
->
sample_rate
!=
8000
||
avctx
->
channels
!=
1
||
avctx
->
ch
_layout
.
nb_ch
annels
!=
1
||
avctx
->
sample_fmt
!=
AV_SAMPLE_FMT_S16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"only 8 kHz 16-bit mono allowed
\n
"
);
return
AVERROR
(
EINVAL
);
...
...
@@ -188,7 +188,10 @@ const AVCodec ff_libcodec2_decoder = {
.
capabilities
=
AV_CODEC_CAP_CHANNEL_CONF
,
.
supported_samplerates
=
(
const
int
[]){
8000
,
0
},
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
},
#if FF_API_OLD_CHANNEL_LAYOUT
.
channel_layouts
=
(
const
uint64_t
[])
{
AV_CH_LAYOUT_MONO
,
0
},
#endif
.
ch_layouts
=
(
const
AVChannelLayout
[])
{
AV_CHANNEL_LAYOUT_MONO
,
{
0
}
},
};
const
AVCodec
ff_libcodec2_encoder
=
{
...
...
@@ -203,6 +206,9 @@ const AVCodec ff_libcodec2_encoder = {
.
encode2
=
libcodec2_encode
,
.
supported_samplerates
=
(
const
int
[]){
8000
,
0
},
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
},
#if FF_API_OLD_CHANNEL_LAYOUT
.
channel_layouts
=
(
const
uint64_t
[])
{
AV_CH_LAYOUT_MONO
,
0
},
#endif
.
ch_layouts
=
(
const
AVChannelLayout
[])
{
AV_CHANNEL_LAYOUT_MONO
,
{
0
}
},
.
priv_class
=
&
libcodec2_enc_class
,
};
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