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
ba6b20df
Commit
ba6b20df
authored
Oct 27, 2019
by
hydra3333
Committed by
Timo Rothenpieler
Oct 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: turn feature check failures into warnings
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
3420e56d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
nvenc.c
libavcodec/nvenc.c
+18
-18
No files found.
libavcodec/nvenc.c
View file @
ba6b20df
...
...
@@ -321,39 +321,39 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
ret
=
nvenc_check_codec_support
(
avctx
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Codec not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Codec not supported
\n
"
);
return
ret
;
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_YUV444_ENCODE
);
if
(
IS_YUV444
(
ctx
->
data_pix_fmt
)
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"YUV444P not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"YUV444P not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_LOSSLESS_ENCODE
);
if
(
ctx
->
preset
>=
PRESET_LOSSLESS_DEFAULT
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Lossless encoding not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Lossless encoding not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_WIDTH_MAX
);
if
(
ret
<
avctx
->
width
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Width %d exceeds %d
\n
"
,
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Width %d exceeds %d
\n
"
,
avctx
->
width
,
ret
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_HEIGHT_MAX
);
if
(
ret
<
avctx
->
height
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Height %d exceeds %d
\n
"
,
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Height %d exceeds %d
\n
"
,
avctx
->
height
,
ret
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_NUM_MAX_BFRAMES
);
if
(
ret
<
avctx
->
max_b_frames
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Max B-frames %d exceed %d
\n
"
,
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Max B-frames %d exceed %d
\n
"
,
avctx
->
max_b_frames
,
ret
);
return
AVERROR
(
ENOSYS
);
...
...
@@ -361,7 +361,7 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_FIELD_ENCODING
);
if
(
ret
<
1
&&
avctx
->
flags
&
AV_CODEC_FLAG_INTERLACED_DCT
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Interlaced encoding is not supported. Supported level: %d
\n
"
,
ret
);
return
AVERROR
(
ENOSYS
);
...
...
@@ -369,46 +369,46 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_10BIT_ENCODE
);
if
(
IS_10BIT
(
ctx
->
data_pix_fmt
)
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"10 bit encode not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"10 bit encode not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_LOOKAHEAD
);
if
(
ctx
->
rc_lookahead
>
0
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"RC lookahead not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"RC lookahead not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_TEMPORAL_AQ
);
if
(
ctx
->
temporal_aq
>
0
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Temporal AQ not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Temporal AQ not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_WEIGHTED_PREDICTION
);
if
(
ctx
->
weighted_pred
>
0
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Weighted Prediction not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Weighted Prediction not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_CABAC
);
if
(
ctx
->
coder
==
NV_ENC_H264_ENTROPY_CODING_MODE_CABAC
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"CABAC entropy coding not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"CABAC entropy coding not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#ifdef NVENC_HAVE_BFRAME_REF_MODE
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE
);
if
(
ctx
->
b_ref_mode
==
NV_ENC_BFRAME_REF_MODE_EACH
&&
ret
!=
1
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Each B frame as reference is not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Each B frame as reference is not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
else
if
(
ctx
->
b_ref_mode
!=
NV_ENC_BFRAME_REF_MODE_DISABLED
&&
ret
==
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"B frames as references are not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"B frames as references are not supported
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#else
if
(
ctx
->
b_ref_mode
!=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"B frames as references need SDK 8.1 at build time
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"B frames as references need SDK 8.1 at build time
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#endif
...
...
@@ -416,12 +416,12 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
ret
=
nvenc_check_cap
(
avctx
,
NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES
);
if
(
avctx
->
refs
!=
NV_ENC_NUM_REF_FRAMES_AUTOSELECT
&&
ret
<=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Multiple reference frames are not supported
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Multiple reference frames are not supported by the device
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#else
if
(
avctx
->
refs
!=
0
)
{
av_log
(
avctx
,
AV_LOG_
VERBOSE
,
"Multiple reference frames need SDK 9.1 at build time
\n
"
);
av_log
(
avctx
,
AV_LOG_
WARNING
,
"Multiple reference frames need SDK 9.1 at build time
\n
"
);
return
AVERROR
(
ENOSYS
);
}
#endif
...
...
@@ -601,7 +601,7 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
return
AVERROR_EXIT
;
if
(
!
dl_fn
->
nvenc_device_count
)
{
av_log
(
avctx
,
AV_LOG_FATAL
,
"No
NVENC
capable devices found
\n
"
);
av_log
(
avctx
,
AV_LOG_FATAL
,
"No capable devices found
\n
"
);
return
AVERROR_EXTERNAL
;
}
...
...
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