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
4cde83c7
Commit
4cde83c7
authored
Apr 14, 2020
by
Anton Khirnov
Committed by
Josh de Kock
Apr 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmdutils: stop using deprecated av_codec_next()
Signed-off-by:
Josh de Kock
<
josh@itanimul.li
>
parent
cacdac81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
cmdutils.c
fftools/cmdutils.c
+19
-14
No files found.
fftools/cmdutils.c
View file @
4cde83c7
...
...
@@ -1500,13 +1500,14 @@ static char get_media_type_char(enum AVMediaType type)
}
}
static
const
AVCodec
*
next_codec_for_id
(
enum
AVCodecID
id
,
const
AVCodec
*
prev
,
static
const
AVCodec
*
next_codec_for_id
(
enum
AVCodecID
id
,
void
**
iter
,
int
encoder
)
{
while
((
prev
=
av_codec_next
(
prev
)))
{
if
(
prev
->
id
==
id
&&
(
encoder
?
av_codec_is_encoder
(
prev
)
:
av_codec_is_decoder
(
prev
)))
return
prev
;
const
AVCodec
*
c
;
while
((
c
=
av_codec_iterate
(
iter
)))
{
if
(
c
->
id
==
id
&&
(
encoder
?
av_codec_is_encoder
(
c
)
:
av_codec_is_decoder
(
c
)))
return
c
;
}
return
NULL
;
}
...
...
@@ -1543,11 +1544,12 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs)
static
void
print_codecs_for_id
(
enum
AVCodecID
id
,
int
encoder
)
{
const
AVCodec
*
codec
=
NULL
;
void
*
iter
=
NULL
;
const
AVCodec
*
codec
;
printf
(
" (%s: "
,
encoder
?
"encoders"
:
"decoders"
);
while
((
codec
=
next_codec_for_id
(
id
,
codec
,
encoder
)))
while
((
codec
=
next_codec_for_id
(
id
,
&
iter
,
encoder
)))
printf
(
"%s "
,
codec
->
name
);
printf
(
")"
);
...
...
@@ -1570,7 +1572,8 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
" -------
\n
"
);
for
(
i
=
0
;
i
<
nb_codecs
;
i
++
)
{
const
AVCodecDescriptor
*
desc
=
codecs
[
i
];
const
AVCodec
*
codec
=
NULL
;
const
AVCodec
*
codec
;
void
*
iter
=
NULL
;
if
(
strstr
(
desc
->
name
,
"_deprecated"
))
continue
;
...
...
@@ -1588,14 +1591,14 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
/* print decoders/encoders when there's more than one or their
* names are different from codec name */
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
codec
,
0
)))
{
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
&
iter
,
0
)))
{
if
(
strcmp
(
codec
->
name
,
desc
->
name
))
{
print_codecs_for_id
(
desc
->
id
,
0
);
break
;
}
}
codec
=
NULL
;
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
codec
,
1
)))
{
iter
=
NULL
;
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
&
iter
,
1
)))
{
if
(
strcmp
(
codec
->
name
,
desc
->
name
))
{
print_codecs_for_id
(
desc
->
id
,
1
);
break
;
...
...
@@ -1626,9 +1629,10 @@ static void print_codecs(int encoder)
encoder
?
"Encoders"
:
"Decoders"
);
for
(
i
=
0
;
i
<
nb_codecs
;
i
++
)
{
const
AVCodecDescriptor
*
desc
=
codecs
[
i
];
const
AVCodec
*
codec
=
NULL
;
const
AVCodec
*
codec
;
void
*
iter
=
NULL
;
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
codec
,
encoder
)))
{
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
&
iter
,
encoder
)))
{
printf
(
" %c"
,
get_media_type_char
(
desc
->
type
));
printf
((
codec
->
capabilities
&
AV_CODEC_CAP_FRAME_THREADS
)
?
"F"
:
"."
);
printf
((
codec
->
capabilities
&
AV_CODEC_CAP_SLICE_THREADS
)
?
"S"
:
"."
);
...
...
@@ -1833,9 +1837,10 @@ static void show_help_codec(const char *name, int encoder)
if
(
codec
)
print_codec
(
codec
);
else
if
((
desc
=
avcodec_descriptor_get_by_name
(
name
)))
{
void
*
iter
=
NULL
;
int
printed
=
0
;
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
codec
,
encoder
)))
{
while
((
codec
=
next_codec_for_id
(
desc
->
id
,
&
iter
,
encoder
)))
{
printed
=
1
;
print_codec
(
codec
);
}
...
...
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