From 8ad43c39b0307dd4f89f3ca17e4d6ae5cda95f57 Mon Sep 17 00:00:00 2001 From: rock88 Date: Tue, 12 May 2020 15:58:17 +0300 Subject: [PATCH] Allow hardware decoder setup context --- src/streaming/ffmpeg/FFmpegVideoDecoder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/streaming/ffmpeg/FFmpegVideoDecoder.cpp b/src/streaming/ffmpeg/FFmpegVideoDecoder.cpp index da81fb2..7165b27 100644 --- a/src/streaming/ffmpeg/FFmpegVideoDecoder.cpp +++ b/src/streaming/ffmpeg/FFmpegVideoDecoder.cpp @@ -41,7 +41,6 @@ int FFmpegVideoDecoder::setup(int video_format, int width, int height, int redra int perf_lvl = SLICE_THREADING; - //ffmpeg_decoder = perf_lvl & VAAPI_ACCELERATION ? VAAPI : SOFTWARE; switch (video_format) { case VIDEO_FORMAT_H264: m_decoder = avcodec_find_decoder_by_name("h264"); @@ -109,6 +108,10 @@ int FFmpegVideoDecoder::setup(int video_format, int width, int height, int redra return -1; } + if (m_hardware_video_decoder) { + m_hardware_video_decoder->prepare_decoder_context(m_decoder_context, nullptr); + } + return DR_OK; }