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
26d879c1
Commit
26d879c1
authored
Feb 02, 2018
by
Josh de Kock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/bsf: make BSF iteration the same as other iterators
parent
cdc78058
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
15 deletions
+26
-15
cmdutils.c
fftools/cmdutils.c
+1
-1
avcodec.h
libavcodec/avcodec.h
+5
-1
bitstream_filter.c
libavcodec/bitstream_filter.c
+2
-2
bitstream_filters.c
libavcodec/bitstream_filters.c
+18
-11
No files found.
fftools/cmdutils.c
View file @
26d879c1
...
@@ -1586,7 +1586,7 @@ int show_bsfs(void *optctx, const char *opt, const char *arg)
...
@@ -1586,7 +1586,7 @@ int show_bsfs(void *optctx, const char *opt, const char *arg)
void
*
opaque
=
NULL
;
void
*
opaque
=
NULL
;
printf
(
"Bitstream filters:
\n
"
);
printf
(
"Bitstream filters:
\n
"
);
while
((
bsf
=
av_bsf_
next
(
&
opaque
)))
while
((
bsf
=
av_bsf_
iterate
(
&
opaque
)))
printf
(
"%s
\n
"
,
bsf
->
name
);
printf
(
"%s
\n
"
,
bsf
->
name
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
return
0
;
return
0
;
...
...
libavcodec/avcodec.h
View file @
26d879c1
...
@@ -5728,7 +5728,7 @@ attribute_deprecated
...
@@ -5728,7 +5728,7 @@ attribute_deprecated
void
av_bitstream_filter_close
(
AVBitStreamFilterContext
*
bsf
);
void
av_bitstream_filter_close
(
AVBitStreamFilterContext
*
bsf
);
/**
/**
* @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
* @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
* is deprecated. Use av_bsf_
next
() from the new bitstream filtering API (using
* is deprecated. Use av_bsf_
iterate
() from the new bitstream filtering API (using
* AVBSFContext).
* AVBSFContext).
*/
*/
attribute_deprecated
attribute_deprecated
...
@@ -5750,7 +5750,11 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name);
...
@@ -5750,7 +5750,11 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name);
* @return the next registered bitstream filter or NULL when the iteration is
* @return the next registered bitstream filter or NULL when the iteration is
* finished
* finished
*/
*/
const
AVBitStreamFilter
*
av_bsf_iterate
(
void
**
opaque
);
#if FF_API_NEXT
attribute_deprecated
const
AVBitStreamFilter
*
av_bsf_next
(
void
**
opaque
);
const
AVBitStreamFilter
*
av_bsf_next
(
void
**
opaque
);
#endif
/**
/**
* Allocate a context for a given bitstream filter. The caller must fill in the
* Allocate a context for a given bitstream filter. The caller must fill in the
...
...
libavcodec/bitstream_filter.c
View file @
26d879c1
...
@@ -34,9 +34,9 @@ const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f)
...
@@ -34,9 +34,9 @@ const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f)
void
*
opaque
=
NULL
;
void
*
opaque
=
NULL
;
while
(
filter
!=
f
)
while
(
filter
!=
f
)
filter
=
av_bsf_
next
(
&
opaque
);
filter
=
av_bsf_
iterate
(
&
opaque
);
return
av_bsf_
next
(
&
opaque
);
return
av_bsf_
iterate
(
&
opaque
);
}
}
void
av_register_bitstream_filter
(
AVBitStreamFilter
*
bsf
)
void
av_register_bitstream_filter
(
AVBitStreamFilter
*
bsf
)
...
...
libavcodec/bitstream_filters.c
View file @
26d879c1
...
@@ -52,7 +52,7 @@ extern const AVBitStreamFilter ff_vp9_superframe_split_bsf;
...
@@ -52,7 +52,7 @@ extern const AVBitStreamFilter ff_vp9_superframe_split_bsf;
#include "libavcodec/bsf_list.c"
#include "libavcodec/bsf_list.c"
const
AVBitStreamFilter
*
av_bsf_
next
(
void
**
opaque
)
const
AVBitStreamFilter
*
av_bsf_
iterate
(
void
**
opaque
)
{
{
uintptr_t
i
=
(
uintptr_t
)
*
opaque
;
uintptr_t
i
=
(
uintptr_t
)
*
opaque
;
const
AVBitStreamFilter
*
f
=
bitstream_filters
[
i
];
const
AVBitStreamFilter
*
f
=
bitstream_filters
[
i
];
...
@@ -63,12 +63,18 @@ const AVBitStreamFilter *av_bsf_next(void **opaque)
...
@@ -63,12 +63,18 @@ const AVBitStreamFilter *av_bsf_next(void **opaque)
return
f
;
return
f
;
}
}
#if FF_API_NEXT
const
AVBitStreamFilter
*
av_bsf_next
(
void
**
opaque
)
{
return
av_bsf_iterate
(
opaque
);
}
#endif
const
AVBitStreamFilter
*
av_bsf_get_by_name
(
const
char
*
name
)
const
AVBitStreamFilter
*
av_bsf_get_by_name
(
const
char
*
name
)
{
{
int
i
;
const
AVBitStreamFilter
*
f
=
NULL
;
void
*
i
=
0
;
for
(
i
=
0
;
bitstream_filters
[
i
];
i
++
)
{
while
((
f
=
av_bsf_iterate
(
&
i
)))
{
const
AVBitStreamFilter
*
f
=
bitstream_filters
[
i
];
if
(
!
strcmp
(
f
->
name
,
name
))
if
(
!
strcmp
(
f
->
name
,
name
))
return
f
;
return
f
;
}
}
...
@@ -78,19 +84,20 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
...
@@ -78,19 +84,20 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
const
AVClass
*
ff_bsf_child_class_next
(
const
AVClass
*
prev
)
const
AVClass
*
ff_bsf_child_class_next
(
const
AVClass
*
prev
)
{
{
int
i
;
const
AVBitStreamFilter
*
f
=
NULL
;
void
*
i
=
0
;
/* find the filter that corresponds to prev */
/* find the filter that corresponds to prev */
for
(
i
=
0
;
prev
&&
bitstream_filters
[
i
];
i
++
)
{
while
(
prev
&&
(
f
=
av_bsf_iterate
(
&
i
)))
{
if
(
bitstream_filters
[
i
]
->
priv_class
==
prev
)
{
if
(
f
->
priv_class
==
prev
)
{
i
++
;
break
;
break
;
}
}
}
}
/* find next filter with priv options */
/* find next filter with priv options */
for
(;
bitstream_filters
[
i
];
i
++
)
while
((
f
=
av_bsf_iterate
(
&
i
)))
{
if
(
bitstream_filters
[
i
]
->
priv_class
)
if
(
f
->
priv_class
)
return
bitstream_filters
[
i
]
->
priv_class
;
return
f
->
priv_class
;
}
return
NULL
;
return
NULL
;
}
}
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