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
b7b3302f
Commit
b7b3302f
authored
Feb 25, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsrc_nullsrc: switch to an AVOptions-based system.
parent
7bc1a883
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
21 deletions
+20
-21
vsrc_nullsrc.c
libavfilter/vsrc_nullsrc.c
+20
-21
No files found.
libavfilter/vsrc_nullsrc.c
View file @
b7b3302f
...
...
@@ -27,6 +27,7 @@
#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
#include "formats.h"
...
...
@@ -49,30 +50,12 @@ enum var_name {
};
typedef
struct
{
const
AVClass
*
class
;
int
w
,
h
;
char
tb_expr
[
256
]
;
char
*
tb_expr
;
double
var_values
[
VAR_VARS_NB
];
}
NullContext
;
static
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
NullContext
*
priv
=
ctx
->
priv
;
priv
->
w
=
352
;
priv
->
h
=
288
;
av_strlcpy
(
priv
->
tb_expr
,
"AVTB"
,
sizeof
(
priv
->
tb_expr
));
if
(
args
)
sscanf
(
args
,
"%d:%d:%255[^:]"
,
&
priv
->
w
,
&
priv
->
h
,
priv
->
tb_expr
);
if
(
priv
->
w
<=
0
||
priv
->
h
<=
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Non-positive size values are not acceptable.
\n
"
);
return
AVERROR
(
EINVAL
);
}
return
0
;
}
static
int
config_props
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
...
...
@@ -114,6 +97,22 @@ static int request_frame(AVFilterLink *link)
return
-
1
;
}
#define OFFSET(x) offsetof(NullContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"width"
,
NULL
,
OFFSET
(
w
),
AV_OPT_TYPE_INT
,
{
.
i64
=
352
},
1
,
INT_MAX
,
FLAGS
},
{
"height"
,
NULL
,
OFFSET
(
h
),
AV_OPT_TYPE_INT
,
{
.
i64
=
288
},
1
,
INT_MAX
,
FLAGS
},
{
"timebase"
,
NULL
,
OFFSET
(
tb_expr
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"AVTB"
},
0
,
0
,
FLAGS
},
{
NULL
},
};
static
const
AVClass
nullsrc_class
=
{
.
class_name
=
"nullsrc"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vsrc_nullsrc_outputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -128,8 +127,8 @@ AVFilter avfilter_vsrc_nullsrc = {
.
name
=
"nullsrc"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Null video source, never return images."
),
.
init
=
init
,
.
priv_size
=
sizeof
(
NullContext
),
.
priv_class
=
&
nullsrc_class
,
.
inputs
=
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