Add DRM renderer for Rockchip devices

This commit is contained in:
Cameron Gutman
2019-04-21 05:22:37 +00:00
parent 5c8a1e632b
commit dba479774b
4 changed files with 326 additions and 0 deletions
@@ -0,0 +1,24 @@
#pragma once
#include "renderer.h"
#include <xf86drm.h>
#include <xf86drmMode.h>
class DrmRenderer : public IFFmpegRenderer {
public:
DrmRenderer();
virtual ~DrmRenderer() override;
virtual bool initialize(PDECODER_PARAMETERS params) override;
virtual bool prepareDecoderContext(AVCodecContext* context) override;
virtual void renderFrame(AVFrame* frame) override;
virtual enum AVPixelFormat getPreferredPixelFormat(int videoFormat) override;
private:
int m_DrmFd;
uint32_t m_CrtcId;
uint32_t m_PlaneId;
uint32_t m_CurrentFbId;
SDL_Rect m_OutputRect;
};