[FFmpeg-devel] [PATCH] qsvenc.c: use query function to catch all kind of setting issues

Sven Dueking sven at nablet.com
Wed Sep 30 16:19:15 CEST 2015


>From 86ddf1095bfd557324f6eeb24d94cbd0a6818c10 Mon Sep 17 00:00:00 2001
From: Sven Dueking <sven at nablet.com>
Date: Wed, 30 Sep 2015 16:06:02 +0200
Subject: [FFmpeg-devel] [PATCH] qsvenc.c: use query function to catch all
kind of setting issues

---
 libavcodec/qsvenc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 1013fe1..55140e1 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -264,6 +264,14 @@ int ff_qsv_enc_init(AVCodecContext *avctx,
QSVEncContext *q)
     if (ret < 0)
         return ret;
 
+    ret = MFXVideoENCODE_Query(q->session, &q->param,&q->param);
+    if (MFX_WRN_PARTIAL_ACCELERATION==ret) {
+        av_log(avctx, AV_LOG_WARNING, "Encoder will work with partial HW
acceleration\n");
+    } else if (ret < 0) {
+        av_log(avctx, AV_LOG_ERROR, "Error %d querying encoder params\n",
ret);
+        return ff_qsv_error(ret);
+    }
+
     ret = MFXVideoENCODE_QueryIOSurf(q->session, &q->param, &q->req);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "Error querying the encoding
parameters\n");
-- 
1.9.5.msysgit.1




More information about the ffmpeg-devel mailing list