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
26ce3a43
Commit
26ce3a43
authored
Dec 20, 2018
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi_encode: Allocate picture-private data in generic code
parent
8ca55a2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
vaapi_encode.c
libavcodec/vaapi_encode.c
+12
-3
vaapi_encode.h
libavcodec/vaapi_encode.h
+4
-0
No files found.
libavcodec/vaapi_encode.c
View file @
26ce3a43
...
...
@@ -570,14 +570,23 @@ static int vaapi_encode_discard(AVCodecContext *avctx,
return
0
;
}
static
VAAPIEncodePicture
*
vaapi_encode_alloc
(
void
)
static
VAAPIEncodePicture
*
vaapi_encode_alloc
(
AVCodecContext
*
avctx
)
{
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
VAAPIEncodePicture
*
pic
;
pic
=
av_mallocz
(
sizeof
(
*
pic
));
if
(
!
pic
)
return
NULL
;
if
(
ctx
->
codec
->
picture_priv_data_size
>
0
)
{
pic
->
priv_data
=
av_mallocz
(
ctx
->
codec
->
picture_priv_data_size
);
if
(
!
pic
->
priv_data
)
{
av_freep
(
&
pic
);
return
NULL
;
}
}
pic
->
input_surface
=
VA_INVALID_ID
;
pic
->
recon_surface
=
VA_INVALID_ID
;
pic
->
output_buffer
=
VA_INVALID_ID
;
...
...
@@ -710,7 +719,7 @@ static int vaapi_encode_get_next(AVCodecContext *avctx,
}
}
pic
=
vaapi_encode_alloc
();
pic
=
vaapi_encode_alloc
(
avctx
);
if
(
!
pic
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -739,7 +748,7 @@ static int vaapi_encode_get_next(AVCodecContext *avctx,
for
(
i
=
0
;
i
<
ctx
->
b_per_p
&&
ctx
->
gop_counter
<
ctx
->
gop_size
;
i
++
)
{
pic
=
vaapi_encode_alloc
();
pic
=
vaapi_encode_alloc
(
avctx
);
if
(
!
pic
)
goto
fail
;
...
...
libavcodec/vaapi_encode.h
View file @
26ce3a43
...
...
@@ -268,6 +268,10 @@ typedef struct VAAPIEncodeType {
// add any necessary global parameters).
int
(
*
configure
)(
AVCodecContext
*
avctx
);
// The size of any private data structure associated with each
// picture (can be zero if not required).
size_t
picture_priv_data_size
;
// The size of the parameter structures:
// sizeof(VAEnc{type}ParameterBuffer{codec}).
size_t
sequence_params_size
;
...
...
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