MythTV  master
mythpainter_vdpau.h
Go to the documentation of this file.
1 #ifndef MYTHPAINTER_VDPAU_H_
2 #define MYTHPAINTER_VDPAU_H_
3 
4 #include <cstdint>
5 
6 #include <QMap>
7 
8 #include "mythpainter.h"
9 #include "mythimage.h"
10 
11 class MythRenderVDPAU;
12 
14 {
15  friend class VideoOutputVDPAU;
16  public:
17  explicit MythVDPAUPainter(MythRenderVDPAU *render = nullptr);
19 
20  void SetTarget(uint target) { m_target = target; }
21  void SetSwapControl(bool swap) { m_swap_control = swap; }
22 
23  QString GetName(void) override // MythPainter
24  { return QString("VDPAU"); }
25  bool SupportsAnimation(void) override // MythPainter
26  { return true; }
27  bool SupportsAlpha(void) override // MythPainter
28  { return true; }
29  bool SupportsClipping(void) override // MythPainter
30  { return false; }
31  void FreeResources(void) override; // MythPainter
32  void Begin(QPaintDevice *parent) override; // MythPainter
33  void End() override; // MythPainter
34 
35  void DrawImage(const QRect &r, MythImage *im, const QRect &src,
36  int alpha) override; // MythPainter
37 
38  protected:
39  MythImage* GetFormatImagePriv(void) override // MythPainter
40  { return new MythImage(this); }
41  void DeleteFormatImagePriv(MythImage *im) override; // MythPainter
42  void Teardown(void) override; // MythPainter
43 
44  bool InitVDPAU(QPaintDevice *parent);
45  void ClearCache(void);
46  void DeleteBitmaps(void);
47  uint GetTextureFromCache(MythImage *im);
48 
50  uint m_target {0};
51  bool m_swap_control {true};
52 
53  QMap<MythImage *, uint32_t> m_ImageBitmapMap;
54  std::list<MythImage *> m_ImageExpireList;
55  std::list<uint32_t> m_bitmapDeleteList;
57 };
58 
59 #endif
60 
static int swap(VideoFrame *frame, int datasize, int offset, int shift)
Definition: filter_vflip.c:24
virtual void Teardown(void)
Definition: mythpainter.cpp:29
std::list< uint32_t > m_bitmapDeleteList
bool SupportsClipping(void) override
unsigned int uint
Definition: compat.h:140
unsigned char r
Definition: ParseText.cpp:329
virtual void End()
Definition: mythpainter.h:51
virtual void FreeResources(void)
Definition: mythpainter.h:49
bool SupportsAlpha(void) override
void SetSwapControl(bool swap)
std::list< MythImage * > m_ImageExpireList
void SetTarget(uint target)
virtual void DeleteFormatImagePriv(MythImage *im)=0
virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src, int alpha)=0
bool SupportsAnimation(void) override
QString GetName(void) override
MythImage * GetFormatImagePriv(void) override
Creates a reference counted image, call DecrRef() to delete.
#define MUI_PUBLIC
Definition: mythuiexp.h:9
QMap< MythImage *, uint32_t > m_ImageBitmapMap
MythRenderVDPAU * m_render
virtual void Begin(QPaintDevice *parent)
Definition: mythpainter.h:50