Add a GenericHwAccelRenderer for unknown hwaccels

This will get us limited hardware acceleration even for hwaccels
that we don't know about yet.
This commit is contained in:
Cameron Gutman
2024-07-05 22:47:45 -05:00
parent d73df12367
commit 27b173b76b
5 changed files with 226 additions and 114 deletions
@@ -0,0 +1,21 @@
#pragma once
#include "renderer.h"
class GenericHwAccelRenderer : public IFFmpegRenderer
{
public:
GenericHwAccelRenderer(AVHWDeviceType hwDeviceType);
virtual ~GenericHwAccelRenderer() override;
virtual bool initialize(PDECODER_PARAMETERS) override;
virtual bool prepareDecoderContext(AVCodecContext* context, AVDictionary** options) override;
virtual void renderFrame(AVFrame* frame) override;
virtual bool needsTestFrame() override;
virtual bool isDirectRenderingSupported() override;
virtual int getDecoderCapabilities() override;
private:
AVHWDeviceType m_HwDeviceType;
AVBufferRef* m_HwContext;
};