Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
be4cde22
Commit
be4cde22
authored
12 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
cmdutils: parse options for swr
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c1d404b9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmdutils.c
+15
-3
15 additions, 3 deletions
cmdutils.c
cmdutils.h
+1
-0
1 addition, 0 deletions
cmdutils.h
with
16 additions
and
3 deletions
cmdutils.c
+
15
−
3
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
;
...
...
This diff is collapsed.
Click to expand it.
cmdutils.h
+
1
−
0
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
;
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment