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
269cd077
Commit
269cd077
authored
Nov 29, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/colormatrix: switch to filter_frame.
parent
88f8af26
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
34 deletions
+18
-34
vf_colormatrix.c
libavfilter/vf_colormatrix.c
+18
-34
No files found.
libavfilter/vf_colormatrix.c
View file @
269cd077
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <float.h>
#include <float.h>
#include "avfilter.h"
#include "avfilter.h"
#include "formats.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "video.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "libavutil/avstring.h"
...
@@ -60,7 +61,6 @@ typedef struct {
...
@@ -60,7 +61,6 @@ typedef struct {
char
src
[
256
];
char
src
[
256
];
char
dst
[
256
];
char
dst
[
256
];
int
hsub
,
vsub
;
int
hsub
,
vsub
;
AVFilterBufferRef
*
outpicref
;
}
ColorMatrixContext
;
}
ColorMatrixContext
;
#define ma m[0][0]
#define ma m[0][0]
...
@@ -332,53 +332,37 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -332,53 +332,37 @@ static int query_formats(AVFilterContext *ctx)
return
0
;
return
0
;
}
}
static
AVFilterBufferRef
*
get_video_buffer
(
AVFilterLink
*
inlink
,
int
perms
,
int
w
,
int
h
)
static
int
filter_frame
(
AVFilterLink
*
link
,
AVFilterBufferRef
*
in
)
{
AVFilterBufferRef
*
picref
=
ff_get_video_buffer
(
inlink
->
dst
->
outputs
[
0
],
perms
,
w
,
h
);
return
picref
;
}
static
int
start_frame
(
AVFilterLink
*
link
,
AVFilterBufferRef
*
picref
)
{
{
AVFilterContext
*
ctx
=
link
->
dst
;
AVFilterContext
*
ctx
=
link
->
dst
;
ColorMatrixContext
*
color
=
ctx
->
priv
;
ColorMatrixContext
*
color
=
ctx
->
priv
;
AVFilterBufferRef
*
outpicref
=
avfilter_ref_buffer
(
picref
,
~
0
);
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterBufferRef
*
out
;
color
->
outpicref
=
outpicref
;
return
ff_start_frame
(
link
->
dst
->
outputs
[
0
],
outpicref
);
}
static
int
end_frame
(
AVFilterLink
*
link
)
out
=
ff_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
{
if
(
!
out
)
{
AVFilterContext
*
ctx
=
link
->
dst
;
avfilter_unref_bufferp
(
&
in
);
ColorMatrixContext
*
color
=
ctx
->
priv
;
return
AVERROR
(
ENOMEM
);
AVFilterBufferRef
*
out
=
color
->
outpicref
;
}
avfilter_copy_buffer_ref_props
(
out
,
in
);
if
(
link
->
cur_buf
->
format
==
AV_PIX_FMT_YUV422P
)
if
(
in
->
format
==
AV_PIX_FMT_YUV422P
)
process_frame_yuv422p
(
color
,
out
,
link
->
cur_buf
);
process_frame_yuv422p
(
color
,
out
,
in
);
else
if
(
link
->
cur_buf
->
format
==
AV_PIX_FMT_YUV420P
)
else
if
(
in
->
format
==
AV_PIX_FMT_YUV420P
)
process_frame_yuv420p
(
color
,
out
,
link
->
cur_buf
);
process_frame_yuv420p
(
color
,
out
,
in
);
else
else
process_frame_uyvy422
(
color
,
out
,
link
->
cur_buf
);
process_frame_uyvy422
(
color
,
out
,
in
);
ff_draw_slice
(
ctx
->
outputs
[
0
],
0
,
link
->
dst
->
outputs
[
0
]
->
h
,
1
);
return
ff_filter_frame
(
outlink
,
out
);
return
ff_end_frame
(
ctx
->
outputs
[
0
]);
}
}
static
int
null_draw_slice
(
AVFilterLink
*
link
,
int
y
,
int
h
,
int
slice_dir
)
{
return
0
;
}
static
const
AVFilterPad
colormatrix_inputs
[]
=
{
static
const
AVFilterPad
colormatrix_inputs
[]
=
{
{
{
.
name
=
"default"
,
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
config_props
=
config_input
,
.
config_props
=
config_input
,
.
min_perms
=
AV_PERM_READ
|
AV_PERM_WRITE
,
.
min_perms
=
AV_PERM_READ
,
.
start_frame
=
start_frame
,
.
filter_frame
=
filter_frame
,
.
get_video_buffer
=
get_video_buffer
,
.
draw_slice
=
null_draw_slice
,
.
end_frame
=
end_frame
,
},
},
{
NULL
}
{
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