Allow DrmRenderer to act as a non-DRM hwaccel backend

This case basically works like a degenerate case of a DRM hwaccel
without DRM master where we just provide EGL export functionality
except that we don't even need a DRM FD in this case.

There are patches floating around the FFmpeg list for this:
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=12604
This commit is contained in:
Cameron Gutman
2024-08-17 16:51:48 -05:00
parent 8e2aa87c4f
commit 1bb16be183
3 changed files with 77 additions and 47 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ namespace DrmDefs
class DrmRenderer : public IFFmpegRenderer {
public:
DrmRenderer(bool hwaccel = false, IFFmpegRenderer *backendRenderer = nullptr);
DrmRenderer(AVHWDeviceType hwDeviceType = AV_HWDEVICE_TYPE_NONE, IFFmpegRenderer *backendRenderer = nullptr);
virtual ~DrmRenderer() override;
virtual bool initialize(PDECODER_PARAMETERS params) override;
virtual bool prepareDecoderContext(AVCodecContext* context, AVDictionary** options) override;
@@ -80,7 +80,7 @@ private:
IFFmpegRenderer* m_BackendRenderer;
SDL_Window* m_Window;
bool m_DrmPrimeBackend;
bool m_HwAccelBackend;
AVHWDeviceType m_HwDeviceType;
AVBufferRef* m_HwContext;
int m_DrmFd;
bool m_SdlOwnsDrmFd;