00001 #ifndef MYTHPAINTER_VDPAU_H_ 00002 #define MYTHPAINTER_VDPAU_H_ 00003 00004 #include <stdint.h> 00005 00006 #include <QMap> 00007 00008 #include "mythpainter.h" 00009 #include "mythimage.h" 00010 00011 class MythRenderVDPAU; 00012 00013 class MUI_PUBLIC MythVDPAUPainter : public MythPainter 00014 { 00015 public: 00016 MythVDPAUPainter(MythRenderVDPAU *render = NULL); 00017 ~MythVDPAUPainter(); 00018 00019 void SetTarget(uint target) { m_target = target; } 00020 void SetSwapControl(bool swap) { m_swap_control = swap; } 00021 00022 virtual QString GetName(void) { return QString("VDPAU"); } 00023 virtual bool SupportsAnimation(void) { return true; } 00024 virtual bool SupportsAlpha(void) { return true; } 00025 virtual bool SupportsClipping(void) { return false; } 00026 virtual void FreeResources(void); 00027 virtual void Begin(QPaintDevice *parent); 00028 virtual void End(); 00029 00030 virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src, 00031 int alpha); 00032 00033 protected: 00034 virtual MythImage* GetFormatImagePriv(void) { return new MythImage(this); } 00035 virtual void DeleteFormatImagePriv(MythImage *im); 00036 00037 bool InitVDPAU(QPaintDevice *parent); 00038 void Teardown(void); 00039 void ClearCache(void); 00040 void DeleteBitmaps(void); 00041 uint GetTextureFromCache(MythImage *im); 00042 00043 MythRenderVDPAU *m_render; 00044 bool m_created_render; 00045 uint m_target; 00046 bool m_swap_control; 00047 00048 QMap<MythImage *, uint32_t> m_ImageBitmapMap; 00049 std::list<MythImage *> m_ImageExpireList; 00050 std::list<uint32_t> m_bitmapDeleteList; 00051 QMutex m_bitmapDeleteLock; 00052 }; 00053 00054 #endif 00055
1.6.3