aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_qsv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-08-10 12:54:31 +0200
committerAnton Khirnov <anton@khirnov.net>2016-11-07 12:47:26 +0100
commitb91ce4860054430d3712deb0d9487cac2fcb7d68 (patch)
treef1bb665cdf385af416f5af540cdec782929c960d /libavutil/hwcontext_qsv.c
parentb115a35ea62b8f479b48d99a601f0e157517301e (diff)
downloadffmpeg-b91ce4860054430d3712deb0d9487cac2fcb7d68.tar.gz
hwcontext_qsv: do not fail when download/upload VPP session creation fails
Certain pixel formats (e.g. P8) might not be supported for download/upload through VPP operations, but can still be used otherwise. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
Diffstat (limited to 'libavutil/hwcontext_qsv.c')
-rw-r--r--libavutil/hwcontext_qsv.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 3679dc01d0..ae4b42739c 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -450,8 +450,10 @@ static int qsv_init_internal_session(AVHWFramesContext *ctx,
err = MFXVideoVPP_Init(*session, &par);
if (err != MFX_ERR_NONE) {
- av_log(ctx, AV_LOG_ERROR, "Error opening the internal VPP session\n");
- return AVERROR_UNKNOWN;
+ av_log(ctx, AV_LOG_VERBOSE, "Error opening the internal VPP session."
+ "Surface upload/download will not be possible\n");
+ MFXClose(*session);
+ *session = NULL;
}
return 0;
@@ -567,6 +569,11 @@ static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
mfxSyncPoint sync = NULL;
mfxStatus err;
+ if (!s->session_download) {
+ av_log(ctx, AV_LOG_ERROR, "Surface download not possible\n");
+ return AVERROR(ENOSYS);
+ }
+
out.Info = in->Info;
out.Data.PitchLow = dst->linesize[0];
out.Data.Y = dst->data[0];
@@ -606,6 +613,11 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
mfxSyncPoint sync = NULL;
mfxStatus err;
+ if (!s->session_upload) {
+ av_log(ctx, AV_LOG_ERROR, "Surface upload not possible\n");
+ return AVERROR(ENOSYS);
+ }
+
in.Info = out->Info;
in.Data.PitchLow = src->linesize[0];
in.Data.Y = src->data[0];