2019-04-16 08:20:21 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "renderer.h"
|
|
|
|
|
|
|
|
#include <interface/mmal/mmal.h>
|
|
|
|
#include <interface/mmal/util/mmal_util.h>
|
|
|
|
#include <interface/mmal/util/mmal_util_params.h>
|
|
|
|
#include <interface/mmal/util/mmal_default_components.h>
|
|
|
|
|
|
|
|
class MmalRenderer : public IFFmpegRenderer {
|
|
|
|
public:
|
|
|
|
MmalRenderer();
|
|
|
|
virtual ~MmalRenderer() override;
|
|
|
|
virtual bool initialize(PDECODER_PARAMETERS params) override;
|
2020-02-09 01:47:26 +00:00
|
|
|
virtual bool prepareDecoderContext(AVCodecContext* context, AVDictionary** options) override;
|
2019-04-16 08:20:21 +00:00
|
|
|
virtual void renderFrame(AVFrame* frame) override;
|
|
|
|
virtual enum AVPixelFormat getPreferredPixelFormat(int videoFormat) override;
|
2019-04-25 04:31:52 +00:00
|
|
|
virtual bool needsTestFrame() override;
|
2020-02-09 19:35:05 +00:00
|
|
|
virtual int getRendererAttributes() override;
|
2022-01-09 23:04:38 +00:00
|
|
|
virtual int getDecoderColorspace() override;
|
2019-04-16 08:20:21 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void InputPortCallback(MMAL_PORT_T* port, MMAL_BUFFER_HEADER_T* buffer);
|
2022-01-09 22:44:20 +00:00
|
|
|
bool getDtDeviceStatus(QString name, bool ifUnknown);
|
2021-12-20 02:33:48 +00:00
|
|
|
bool isMmalOverlaySupported();
|
2019-04-16 08:20:21 +00:00
|
|
|
|
2020-12-20 03:25:20 +00:00
|
|
|
void setupBackground(PDECODER_PARAMETERS params);
|
2021-02-04 02:57:39 +00:00
|
|
|
void updateDisplayRegion();
|
2020-12-20 03:25:20 +00:00
|
|
|
|
2019-04-16 08:20:21 +00:00
|
|
|
MMAL_COMPONENT_T* m_Renderer;
|
|
|
|
MMAL_PORT_T* m_InputPort;
|
2020-12-20 03:25:20 +00:00
|
|
|
|
|
|
|
SDL_Renderer* m_BackgroundRenderer;
|
2021-02-04 02:57:39 +00:00
|
|
|
SDL_Window* m_Window;
|
|
|
|
int m_VideoWidth, m_VideoHeight;
|
|
|
|
int m_LastWindowPosX, m_LastWindowPosY;
|
2019-04-16 08:20:21 +00:00
|
|
|
};
|
|
|
|
|