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
909bcedc
Commit
909bcedc
authored
Mar 31, 2019
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi_encode: Warn if input has cropping information
Cropping is not supported by VAAPI encode.
parent
ef2f89bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
vaapi_encode.c
libavcodec/vaapi_encode.c
+19
-0
vaapi_encode.h
libavcodec/vaapi_encode.h
+4
-0
No files found.
libavcodec/vaapi_encode.c
View file @
909bcedc
...
...
@@ -913,6 +913,21 @@ static int vaapi_encode_clear_old(AVCodecContext *avctx)
return
0
;
}
static
int
vaapi_encode_check_frame
(
AVCodecContext
*
avctx
,
const
AVFrame
*
frame
)
{
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
if
((
frame
->
crop_top
||
frame
->
crop_bottom
||
frame
->
crop_left
||
frame
->
crop_right
)
&&
!
ctx
->
crop_warned
)
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Cropping information on input "
"frames ignored due to lack of API support.
\n
"
);
ctx
->
crop_warned
=
1
;
}
return
0
;
}
int
ff_vaapi_encode_send_frame
(
AVCodecContext
*
avctx
,
const
AVFrame
*
frame
)
{
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
...
...
@@ -923,6 +938,10 @@ int ff_vaapi_encode_send_frame(AVCodecContext *avctx, const AVFrame *frame)
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Input frame: %ux%u (%"
PRId64
").
\n
"
,
frame
->
width
,
frame
->
height
,
frame
->
pts
);
err
=
vaapi_encode_check_frame
(
avctx
,
frame
);
if
(
err
<
0
)
return
err
;
pic
=
vaapi_encode_alloc
(
avctx
);
if
(
!
pic
)
return
AVERROR
(
ENOMEM
);
...
...
libavcodec/vaapi_encode.h
View file @
909bcedc
...
...
@@ -314,6 +314,10 @@ typedef struct VAAPIEncodeContext {
int
idr_counter
;
int
gop_counter
;
int
end_of_stream
;
// The encoder does not support cropping information, so warn about
// it the first time we encounter any nonzero crop fields.
int
crop_warned
;
}
VAAPIEncodeContext
;
enum
{
...
...
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