Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
be4cde22
Commit
be4cde22
authored
Apr 11, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmdutils: parse options for swr
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c1d404b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
cmdutils.c
cmdutils.c
+15
-3
cmdutils.h
cmdutils.h
+1
-0
No files found.
cmdutils.c
View file @
be4cde22
...
...
@@ -54,6 +54,7 @@
#endif
struct
SwsContext
*
sws_opts
;
SwrContext
*
swr_opts
;
AVDictionary
*
format_opts
,
*
codec_opts
;
const
int
this_year
=
2012
;
...
...
@@ -66,6 +67,7 @@ void init_opts(void)
sws_opts
=
sws_getContext
(
16
,
16
,
0
,
16
,
16
,
0
,
SWS_BICUBIC
,
NULL
,
NULL
,
NULL
);
#endif
swr_opts
=
swr_alloc
();
}
void
uninit_opts
(
void
)
...
...
@@ -74,6 +76,7 @@ void uninit_opts(void)
sws_freeContext
(
sws_opts
);
sws_opts
=
NULL
;
#endif
swr_free
(
&
swr_opts
);
av_dict_free
(
&
format_opts
);
av_dict_free
(
&
codec_opts
);
}
...
...
@@ -415,10 +418,10 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
#define FLAGS(o) ((o)->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
int
opt_default
(
const
char
*
opt
,
const
char
*
arg
)
{
const
AVOption
*
oc
,
*
of
,
*
os
;
const
AVOption
*
oc
,
*
of
,
*
os
,
*
oswr
;
char
opt_stripped
[
128
];
const
char
*
p
;
const
AVClass
*
cc
=
avcodec_get_class
(),
*
fc
=
avformat_get_class
(),
*
sc
;
const
AVClass
*
cc
=
avcodec_get_class
(),
*
fc
=
avformat_get_class
(),
*
sc
,
*
swr_class
;
if
(
!
(
p
=
strchr
(
opt
,
':'
)))
p
=
opt
+
strlen
(
opt
);
...
...
@@ -444,8 +447,17 @@ int opt_default(const char *opt, const char *arg)
}
}
#endif
swr_class
=
swr_get_class
();
if
(
!
oc
&&
!
of
&&
!
os
&&
(
oswr
=
av_opt_find
(
&
swr_class
,
opt
,
NULL
,
0
,
AV_OPT_SEARCH_CHILDREN
|
AV_OPT_SEARCH_FAKE_OBJ
)))
{
int
ret
=
av_opt_set
(
swr_opts
,
opt
,
arg
,
0
);
if
(
ret
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Error setting option %s.
\n
"
,
opt
);
return
ret
;
}
}
if
(
oc
||
of
||
os
)
if
(
oc
||
of
||
os
||
oswr
)
return
0
;
av_log
(
NULL
,
AV_LOG_ERROR
,
"Unrecognized option '%s'
\n
"
,
opt
);
return
AVERROR_OPTION_NOT_FOUND
;
...
...
cmdutils.h
View file @
be4cde22
...
...
@@ -51,6 +51,7 @@ extern const int this_year;
extern
AVCodecContext
*
avcodec_opts
[
AVMEDIA_TYPE_NB
];
extern
AVFormatContext
*
avformat_opts
;
extern
struct
SwsContext
*
sws_opts
;
extern
struct
SwrContext
*
swr_opts
;
extern
AVDictionary
*
format_opts
,
*
codec_opts
;
/**
...
...
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