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
425e08d5
Commit
425e08d5
authored
Apr 17, 2020
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/bsf: support shorthand options for av_bsf_list_parse_str
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
c96904f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
bsf.c
libavcodec/bsf.c
+26
-27
No files found.
libavcodec/bsf.c
View file @
425e08d5
...
...
@@ -431,7 +431,7 @@ int av_bsf_list_append(AVBSFList *lst, AVBSFContext *bsf)
return
av_dynarray_add_nofree
(
&
lst
->
bsfs
,
&
lst
->
nb_bsfs
,
bsf
);
}
int
av_bsf_list_append2
(
AVBSFList
*
lst
,
const
char
*
bsf_name
,
AVDictionary
**
options
)
static
int
bsf_list_append_internal
(
AVBSFList
*
lst
,
const
char
*
bsf_name
,
const
char
*
options
,
AVDictionary
**
options_dict
)
{
int
ret
;
const
AVBitStreamFilter
*
filter
;
...
...
@@ -445,8 +445,20 @@ int av_bsf_list_append2(AVBSFList *lst, const char *bsf_name, AVDictionary ** op
if
(
ret
<
0
)
return
ret
;
if
(
options
)
{
ret
=
av_opt_set_dict2
(
bsf
,
options
,
AV_OPT_SEARCH_CHILDREN
);
if
(
options
&&
filter
->
priv_class
)
{
const
AVOption
*
opt
=
av_opt_next
(
bsf
->
priv_data
,
NULL
);
const
char
*
shorthand
[
2
]
=
{
NULL
};
if
(
opt
)
shorthand
[
0
]
=
opt
->
name
;
ret
=
av_opt_set_from_string
(
bsf
->
priv_data
,
options
,
shorthand
,
"="
,
":"
);
if
(
ret
<
0
)
goto
end
;
}
if
(
options_dict
)
{
ret
=
av_opt_set_dict2
(
bsf
,
options_dict
,
AV_OPT_SEARCH_CHILDREN
);
if
(
ret
<
0
)
goto
end
;
}
...
...
@@ -460,6 +472,11 @@ end:
return
ret
;
}
int
av_bsf_list_append2
(
AVBSFList
*
lst
,
const
char
*
bsf_name
,
AVDictionary
**
options
)
{
return
bsf_list_append_internal
(
lst
,
bsf_name
,
NULL
,
options
);
}
int
av_bsf_list_finalize
(
AVBSFList
**
lst
,
AVBSFContext
**
bsf
)
{
int
ret
=
0
;
...
...
@@ -486,33 +503,15 @@ end:
return
ret
;
}
static
int
bsf_parse_single
(
c
onst
c
har
*
str
,
AVBSFList
*
bsf_lst
)
static
int
bsf_parse_single
(
char
*
str
,
AVBSFList
*
bsf_lst
)
{
char
*
bsf_name
,
*
bsf_options_str
,
*
buf
;
AVDictionary
*
bsf_options
=
NULL
;
int
ret
=
0
;
char
*
bsf_name
,
*
bsf_options_str
;
if
(
!
(
buf
=
av_strdup
(
str
)))
return
AVERROR
(
ENOMEM
);
bsf_name
=
av_strtok
(
buf
,
"="
,
&
bsf_options_str
);
if
(
!
bsf_name
)
{
ret
=
AVERROR
(
EINVAL
);
goto
end
;
}
if
(
bsf_options_str
)
{
ret
=
av_dict_parse_string
(
&
bsf_options
,
bsf_options_str
,
"="
,
":"
,
0
);
if
(
ret
<
0
)
goto
end
;
}
ret
=
av_bsf_list_append2
(
bsf_lst
,
bsf_name
,
&
bsf_options
);
bsf_name
=
av_strtok
(
str
,
"="
,
&
bsf_options_str
);
if
(
!
bsf_name
)
return
AVERROR
(
EINVAL
);
end:
av_dict_free
(
&
bsf_options
);
av_free
(
buf
);
return
ret
;
return
bsf_list_append_internal
(
bsf_lst
,
bsf_name
,
bsf_options_str
,
NULL
);
}
int
av_bsf_list_parse_str
(
const
char
*
str
,
AVBSFContext
**
bsf_lst
)
...
...
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