From 08c7f88376fc2e79c265a654fa36ba90a5d19f38 Mon Sep 17 00:00:00 2001 From: eisneinechse <42617957+eisneinechse@users.noreply.github.com> Date: Fri, 14 Sep 2018 14:40:29 -0700 Subject: [PATCH] The part of the code that should get the config that is used to get the constraints of the GPU is now inside a #if . One can enable it by setting the constant in line 33 of FFmpegReader.cpp to 1. Do not enable that part unless you want to fid a way that works as it also needs the package libva-dev (Ubuntu) to be installed. --- src/FFmpegReader.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index f8c5f4af..3b508f23 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -30,13 +30,15 @@ #include "../include/FFmpegReader.h" +#define PRAYFORAWONDER 0 + #if IS_FFMPEG_3_2 -//#include "libavutil/hwcontext_vaapi.h" - - #define MAX_SUPPORTED_WIDTH 1950 #define MAX_SUPPORTED_HEIGHT 1100 -/* + +#if PRAYFORAWONDER +#include "libavutil/hwcontext_vaapi.h" + typedef struct VAAPIDecodeContext { VAProfile va_profile; VAEntrypoint va_entrypoint; @@ -60,7 +62,8 @@ typedef struct VAAPIDecodeContext { enum AVPixelFormat surface_format; int surface_count; } VAAPIDecodeContext; - */ + + #endif #endif @@ -313,7 +316,9 @@ void FFmpegReader::Open() void *hwconfig = NULL; hwconfig = av_hwdevice_hwconfig_alloc(hw_device_ctx); // NOT WORKING needs va_config ! - // ((AVVAAPIHWConfig *)hwconfig)->config_id = ((VAAPIDecodeContext *)(pCodecCtx->priv_data))->va_config; + #if PRAYFORAWONDER + ((AVVAAPIHWConfig *)hwconfig)->config_id = ((VAAPIDecodeContext *)(pCodecCtx->priv_data))->va_config; + #endif constraints = av_hwdevice_get_hwframe_constraints(hw_device_ctx,hwconfig); if (constraints) { if (pCodecCtx->coded_width < constraints->min_width ||