MythTV master
mythinteropgpu.h
Go to the documentation of this file.
1#ifndef MYTHINTEROPGPU_H
2#define MYTHINTEROPGPU_H
3
4// Qt
5#include <QSize>
6#include <QObject>
7
8// MythTV
10#include "mythframe.h"
11
12// Std
13#include <vector>
14
15class MythRender;
16class MythPlayerUI;
17using FreeAVHWDeviceContext = void (*)(struct AVHWDeviceContext*);
18static constexpr uint64_t DUMMY_INTEROP_ID { 1 };
19
20class MythInteropGPU : public QObject, public ReferenceCounter
21{
22 Q_OBJECT
23
24 public:
25 enum InteropType : std::uint8_t
26 {
39 // used for default free/user_opaque storage
40 DUMMY
41 };
42
43 using InteropTypes = std::vector<InteropType>;
44 using InteropMap = std::map<VideoFrameType,InteropTypes>;
45 static InteropMap GetTypes(MythRender* Render);
46 static QString TypeToString(InteropType Type);
47 static QString TypesToString(const InteropMap& Types);
49
50 MythInteropGPU(MythRender* Context, InteropType Type, MythPlayerUI* Player = nullptr);
51 ~MythInteropGPU() override;
52
55 void SetDefaultFree (FreeAVHWDeviceContext FreeContext);
56 void SetDefaultUserOpaque (void* UserOpaque);
58 void* GetDefaultUserOpaque ();
59
60 protected:
61 MythRender* m_context { nullptr };
63 uint64_t m_discontinuityCounter { 0 };
65 void* m_defaultUserOpaque { nullptr };
66 MythPlayerUI* m_player { nullptr };
68};
69
70#endif
void * GetDefaultUserOpaque()
void SetDefaultFree(FreeAVHWDeviceContext FreeContext)
~MythInteropGPU() override
InteropType GetType()
FreeAVHWDeviceContext m_defaultFree
static QString TypesToString(const InteropMap &Types)
MythPlayerUI * m_player
MythInteropGPU(MythRender *Context, InteropType Type, MythPlayerUI *Player=nullptr)
static QString TypeToString(InteropType Type)
FreeAVHWDeviceContext GetDefaultFree()
void SetDefaultUserOpaque(void *UserOpaque)
uint64_t m_discontinuityCounter
std::vector< InteropType > InteropTypes
InteropType m_type
std::map< VideoFrameType, InteropTypes > InteropMap
MythRender * m_context
static MythInteropGPU * CreateDummy()
static InteropMap GetTypes(MythRender *Render)
MythPlayerUI * GetPlayer()
void * m_defaultUserOpaque
General purpose reference counter.
static constexpr uint64_t DUMMY_INTEROP_ID
void(*)(struct AVHWDeviceContext *) FreeAVHWDeviceContext