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
7e2561fa
Commit
7e2561fa
authored
Oct 31, 2016
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: Use ff_get_video_buffer in all filters using hwframes
parent
7433feb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
31 deletions
+11
-31
vf_deinterlace_qsv.c
libavfilter/vf_deinterlace_qsv.c
+4
-6
vf_hwupload.c
libavfilter/vf_hwupload.c
+2
-7
vf_hwupload_cuda.c
libavfilter/vf_hwupload_cuda.c
+1
-5
vf_scale_qsv.c
libavfilter/vf_scale_qsv.c
+1
-5
vf_scale_vaapi.c
libavfilter/vf_scale_vaapi.c
+3
-8
No files found.
libavfilter/vf_deinterlace_qsv.c
View file @
7e2561fa
...
@@ -433,13 +433,11 @@ static int process_frame(AVFilterContext *ctx, const AVFrame *in,
...
@@ -433,13 +433,11 @@ static int process_frame(AVFilterContext *ctx, const AVFrame *in,
mfxStatus
err
;
mfxStatus
err
;
int
ret
,
again
=
0
;
int
ret
,
again
=
0
;
out
=
av_frame_alloc
();
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
if
(
!
out
)
{
return
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
ret
=
av_hwframe_get_buffer
(
s
->
hw_frames_ctx
,
out
,
0
);
if
(
ret
<
0
)
goto
fail
;
goto
fail
;
}
surf_out
=
(
mfxFrameSurface1
*
)
out
->
data
[
3
];
surf_out
=
(
mfxFrameSurface1
*
)
out
->
data
[
3
];
surf_out
->
Info
.
CropW
=
outlink
->
w
;
surf_out
->
Info
.
CropW
=
outlink
->
w
;
...
...
libavfilter/vf_hwupload.c
View file @
7e2561fa
...
@@ -161,15 +161,10 @@ static int hwupload_filter_frame(AVFilterLink *link, AVFrame *input)
...
@@ -161,15 +161,10 @@ static int hwupload_filter_frame(AVFilterLink *link, AVFrame *input)
if
(
input
->
format
==
outlink
->
format
)
if
(
input
->
format
==
outlink
->
format
)
return
ff_filter_frame
(
outlink
,
input
);
return
ff_filter_frame
(
outlink
,
input
);
output
=
av_frame_alloc
(
);
output
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
output
)
{
if
(
!
output
)
{
err
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
err
=
av_hwframe_get_buffer
(
ctx
->
hwframes_ref
,
output
,
0
);
if
(
err
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to allocate frame to upload to.
\n
"
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to allocate frame to upload to.
\n
"
);
err
=
AVERROR
(
ENOMEM
);
goto
fail
;
goto
fail
;
}
}
...
...
libavfilter/vf_hwupload_cuda.c
View file @
7e2561fa
...
@@ -156,16 +156,12 @@ static int cudaupload_filter_frame(AVFilterLink *link, AVFrame *in)
...
@@ -156,16 +156,12 @@ static int cudaupload_filter_frame(AVFilterLink *link, AVFrame *in)
AVFrame
*
out
=
NULL
;
AVFrame
*
out
=
NULL
;
int
ret
;
int
ret
;
out
=
av_frame_alloc
(
);
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
{
if
(
!
out
)
{
ret
=
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
goto
fail
;
}
}
ret
=
av_hwframe_get_buffer
(
s
->
hwframe
,
out
,
0
);
if
(
ret
<
0
)
goto
fail
;
out
->
width
=
in
->
width
;
out
->
width
=
in
->
width
;
out
->
height
=
in
->
height
;
out
->
height
=
in
->
height
;
...
...
libavfilter/vf_scale_qsv.c
View file @
7e2561fa
...
@@ -528,16 +528,12 @@ static int qsvscale_filter_frame(AVFilterLink *link, AVFrame *in)
...
@@ -528,16 +528,12 @@ static int qsvscale_filter_frame(AVFilterLink *link, AVFrame *in)
AVFrame
*
out
=
NULL
;
AVFrame
*
out
=
NULL
;
int
ret
=
0
;
int
ret
=
0
;
out
=
av_frame_alloc
(
);
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
{
if
(
!
out
)
{
ret
=
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
goto
fail
;
}
}
ret
=
av_hwframe_get_buffer
(
s
->
out_frames_ref
,
out
,
0
);
if
(
ret
<
0
)
goto
fail
;
do
{
do
{
err
=
MFXVideoVPP_RunFrameVPPAsync
(
s
->
session
,
err
=
MFXVideoVPP_RunFrameVPPAsync
(
s
->
session
,
(
mfxFrameSurface1
*
)
in
->
data
[
3
],
(
mfxFrameSurface1
*
)
in
->
data
[
3
],
...
...
libavfilter/vf_scale_vaapi.c
View file @
7e2561fa
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "avfilter.h"
#include "avfilter.h"
#include "formats.h"
#include "formats.h"
#include "internal.h"
#include "internal.h"
#include "video.h"
typedef
struct
ScaleVAAPIContext
{
typedef
struct
ScaleVAAPIContext
{
const
AVClass
*
class
;
const
AVClass
*
class
;
...
@@ -274,19 +275,13 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
...
@@ -274,19 +275,13 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
av_log
(
ctx
,
AV_LOG_DEBUG
,
"Using surface %#x for scale input.
\n
"
,
av_log
(
ctx
,
AV_LOG_DEBUG
,
"Using surface %#x for scale input.
\n
"
,
input_surface
);
input_surface
);
output_frame
=
av_frame_alloc
();
output_frame
=
ff_get_video_buffer
(
outlink
,
ctx
->
output_width
,
ctx
->
output_height
);
if
(
!
output_frame
)
{
if
(
!
output_frame
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to allocate output frame."
);
err
=
AVERROR
(
ENOMEM
);
err
=
AVERROR
(
ENOMEM
);
goto
fail
;
goto
fail
;
}
}
err
=
av_hwframe_get_buffer
(
ctx
->
output_frames_ref
,
output_frame
,
0
);
if
(
err
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to get surface for "
"output: %d
\n
."
,
err
);
}
output_surface
=
(
VASurfaceID
)(
uintptr_t
)
output_frame
->
data
[
3
];
output_surface
=
(
VASurfaceID
)(
uintptr_t
)
output_frame
->
data
[
3
];
av_log
(
ctx
,
AV_LOG_DEBUG
,
"Using surface %#x for scale output.
\n
"
,
av_log
(
ctx
,
AV_LOG_DEBUG
,
"Using surface %#x for scale output.
\n
"
,
output_surface
);
output_surface
);
...
...
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