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
f51aa92b
Commit
f51aa92b
authored
Apr 24, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/testsrc: add support for color interactive command
parent
ce322f4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
filters.texi
doc/filters.texi
+10
-0
version.h
libavfilter/version.h
+1
-1
vsrc_testsrc.c
libavfilter/vsrc_testsrc.c
+34
-0
No files found.
doc/filters.texi
View file @
f51aa92b
...
...
@@ -7350,6 +7350,16 @@ the @code{geq} filter:
nullsrc=s=256x256, geq=random(1)*255:128:128
@end example
@subsection Commands
The @code{color} source supports the following commands:
@table @option
@item c, color
Set the color of the created image. Accepts the same syntax of the
corresponding @option{color} option.
@end table
@c man end VIDEO SOURCES
@chapter Video Sinks
...
...
libavfilter/version.h
View file @
f51aa92b
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 63
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vsrc_testsrc.c
View file @
f51aa92b
...
...
@@ -57,6 +57,7 @@ typedef struct {
AVRational
sar
;
///< sample aspect ratio
int
nb_decimals
;
int
draw_once
;
///< draw only the first frame, always put out the same picture
int
draw_once_reset
;
///< draw only the first frame or in case of reset
AVFrame
*
picref
;
///< cached reference containing the painted picture
void
(
*
fill_picture_fn
)(
AVFilterContext
*
ctx
,
AVFrame
*
frame
);
...
...
@@ -166,6 +167,10 @@ static int request_frame(AVFilterLink *outlink)
return
AVERROR_EOF
;
if
(
test
->
draw_once
)
{
if
(
test
->
draw_once_reset
)
{
av_frame_free
(
&
test
->
picref
);
test
->
draw_once_reset
=
0
;
}
if
(
!
test
->
picref
)
{
test
->
picref
=
ff_get_video_buffer
(
outlink
,
test
->
w
,
test
->
h
);
...
...
@@ -241,6 +246,34 @@ static int color_config_props(AVFilterLink *inlink)
return
0
;
}
static
int
color_process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
TestSourceContext
*
test
=
ctx
->
priv
;
int
ret
;
if
(
!
strcmp
(
cmd
,
"color"
)
||
!
strcmp
(
cmd
,
"c"
))
{
char
*
color_str
;
uint8_t
color_rgba
[
4
];
ret
=
av_parse_color
(
color_rgba
,
args
,
-
1
,
ctx
);
if
(
ret
<
0
)
return
ret
;
color_str
=
av_strdup
(
args
);
if
(
!
color_str
)
return
AVERROR
(
ENOMEM
);
av_free
(
test
->
color_str
);
test
->
color_str
=
color_str
;
memcpy
(
test
->
color_rgba
,
color_rgba
,
sizeof
(
color_rgba
));
ff_draw_color
(
&
test
->
draw
,
&
test
->
color
,
test
->
color_rgba
);
test
->
draw_once_reset
=
1
;
return
0
;
}
return
AVERROR
(
ENOSYS
);
}
static
const
AVFilterPad
color_outputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -263,6 +296,7 @@ AVFilter avfilter_vsrc_color = {
.
query_formats
=
color_query_formats
,
.
inputs
=
NULL
,
.
outputs
=
color_outputs
,
.
process_command
=
color_process_command
,
};
#endif
/* CONFIG_COLOR_FILTER */
...
...
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