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
1f94f86a
Commit
1f94f86a
authored
Nov 28, 2012
by
Anton Khirnov
Committed by
Michael Niedermayer
Nov 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_libopencv: switch to filter_frame, this filter did not support slices
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5d170b09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
vf_libopencv.c
libavfilter/vf_libopencv.c
+17
-18
No files found.
libavfilter/vf_libopencv.c
View file @
1f94f86a
...
...
@@ -32,6 +32,7 @@
#include "libavutil/file.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
static
void
fill_iplimage_from_picref
(
IplImage
*
img
,
const
AVFilterBufferRef
*
picref
,
enum
AVPixelFormat
pixfmt
)
...
...
@@ -68,11 +69,6 @@ static int query_formats(AVFilterContext *ctx)
return
0
;
}
static
int
null_draw_slice
(
AVFilterLink
*
link
,
int
y
,
int
h
,
int
slice_dir
)
{
return
0
;
}
typedef
struct
{
const
char
*
name
;
int
(
*
init
)(
AVFilterContext
*
ctx
,
const
char
*
args
);
...
...
@@ -355,33 +351,36 @@ static av_cold void uninit(AVFilterContext *ctx)
memset
(
ocv
,
0
,
sizeof
(
*
ocv
));
}
static
int
end_frame
(
AVFilterLink
*
inlink
)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
in
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
OCVContext
*
ocv
=
ctx
->
priv
;
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
AVFilterBufferRef
*
inpicref
=
inlink
->
cur_buf
;
AVFilterBufferRef
*
outpicref
=
outlink
->
out_buf
;
AVFilterBufferRef
*
out
;
IplImage
inimg
,
outimg
;
int
ret
;
fill_iplimage_from_picref
(
&
inimg
,
inpicref
,
inlink
->
format
);
fill_iplimage_from_picref
(
&
outimg
,
outpicref
,
inlink
->
format
);
out
=
ff_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
{
avfilter_unref_bufferp
(
&
in
);
return
AVERROR
(
ENOMEM
);
}
avfilter_copy_buffer_ref_props
(
out
,
in
);
fill_iplimage_from_picref
(
&
inimg
,
in
,
inlink
->
format
);
fill_iplimage_from_picref
(
&
outimg
,
out
,
inlink
->
format
);
ocv
->
end_frame_filter
(
ctx
,
&
inimg
,
&
outimg
);
fill_picref_from_iplimage
(
out
picref
,
&
outimg
,
inlink
->
format
);
fill_picref_from_iplimage
(
out
,
&
outimg
,
inlink
->
format
);
if
((
ret
=
ff_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
))
<
0
||
(
ret
=
ff_end_frame
(
outlink
))
<
0
)
return
ret
;
return
0
;
avfilter_unref_bufferp
(
&
in
);
return
ff_filter_frame
(
outlink
,
out
);
}
static
const
AVFilterPad
avfilter_vf_ocv_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
draw_slice
=
null_draw_slice
,
.
end_frame
=
end_frame
,
.
filter_frame
=
filter_frame
,
.
min_perms
=
AV_PERM_READ
},
{
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