[FFmpeg-devel] libavcodec/nvenc.c: add test for Temporal AQ support

Submitted by Sven C. Dack on Oct. 14, 2016, 3:02 p.m.

Details

Message ID 3da76371-6feb-52f8-05a3-2b4b251fe5b0@sky.com
State New
Headers show

Commit Message

Sven C. Dack Oct. 14, 2016, 3:02 p.m.
Adds a check to see if the hardware supports temporal aq.

Patch hide | download patch | download mbox

From a68d7b359d53a4d858a25a146489f24a39f4dad0 Mon Sep 17 00:00:00 2001
From: "Sven C. Dack" <sven.c.dack@sky.com>
Date: Fri, 14 Oct 2016 15:12:27 +0100
Subject: [PATCH] libavcodec/nvenc.c: add test for Temporal AQ support

---
 libavcodec/nvenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index e6c1c94..2505c3d 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -356,6 +356,12 @@  static int nvenc_check_capabilities(AVCodecContext *avctx)
         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");
+        return AVERROR(ENOSYS);
+    }
+
     return 0;
 }
 
-- 
2.9.3