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
7433feb8
Commit
7433feb8
authored
Oct 31, 2016
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: Make default get_video_buffer work with hardware frames
parent
2025d378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
video.c
libavfilter/video.c
+10
-4
No files found.
libavfilter/video.c
View file @
7433feb8
...
...
@@ -20,6 +20,7 @@
#include <stdio.h>
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
...
...
@@ -43,11 +44,16 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
if
(
!
frame
)
return
NULL
;
frame
->
width
=
w
;
frame
->
height
=
h
;
frame
->
format
=
link
->
format
;
if
(
link
->
hw_frames_ctx
&&
((
AVHWFramesContext
*
)
link
->
hw_frames_ctx
->
data
)
->
format
==
link
->
format
)
{
ret
=
av_hwframe_get_buffer
(
link
->
hw_frames_ctx
,
frame
,
0
);
}
else
{
frame
->
width
=
w
;
frame
->
height
=
h
;
frame
->
format
=
link
->
format
;
ret
=
av_frame_get_buffer
(
frame
,
32
);
ret
=
av_frame_get_buffer
(
frame
,
32
);
}
if
(
ret
<
0
)
av_frame_free
(
&
frame
);
...
...
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