MythTV  master
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
MythRenderD3D9 Class Reference

#include <mythrender_d3d9.h>

Inheritance diagram for MythRenderD3D9:
Inheritance graph
[legend]
Collaboration diagram for MythRenderD3D9:
Collaboration graph
[legend]

Public Member Functions

 MythRenderD3D9 ()
 
bool Create (QSize size, HWND window)
 
bool Test (bool &reset)
 
bool ClearBuffer (void)
 
bool Begin (void)
 
bool End (void)
 
void CopyFrame (void *surface, D3D9Image *img)
 
bool StretchRect (IDirect3DTexture9 *texture, IDirect3DSurface9 *surface, bool known_surface=true)
 
bool DrawTexturedQuad (IDirect3DVertexBuffer9 *vertexbuffer)
 
void DrawRect (const QRect &rect, const QColor &color, int alpha)
 
bool Present (HWND win)
 
bool HardwareYUVConversion (void)
 
QRect GetRect (IDirect3DVertexBuffer9 *vertexbuffer)
 
bool SetRenderTarget (IDirect3DTexture9 *texture)
 
IDirect3DTexture9 * CreateTexture (const QSize &size)
 
void DeleteTexture (IDirect3DTexture9 *texture)
 
IDirect3DVertexBuffer9 * CreateVertexBuffer (IDirect3DTexture9 *texture=nullptr)
 
bool UpdateVertexBuffer (IDirect3DVertexBuffer9 *vertexbuffer, const QRect &dvr, const QRect &vr, int alpha=255, bool video=false)
 
void DeleteVertexBuffer (IDirect3DVertexBuffer9 *vertexbuffer)
 
IDirect3DSurface9 * CreateSurface (const QSize &size, bool video=false)
 
bool UpdateSurface (IDirect3DSurface9 *surface, const MythImage *image)
 
void DeleteSurface (IDirect3DSurface9 *surface)
 
uint8_t * GetBuffer (IDirect3DSurface9 *surface, uint &pitch)
 
void ReleaseBuffer (IDirect3DSurface9 *surface)
 
IDirect3DDevice9 * AcquireDevice (void)
 
void ReleaseDevice (void)
 
IDirect3DDeviceManager9 * GetDeviceManager (void)
 
- Public Member Functions inherited from MythRender
 MythRender (RenderType type)
 
bool IsShared (void) const
 Warning: The reference count can be decremented between the call to this function and the use of it's value. More...
 
RenderType Type (void) const
 
bool IsErrored (void) const
 
QSize GetSize (void) const
 
virtual QStringList GetDescription ()
 
virtual void SetViewPort (const QRect, bool=false)
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter (const QString &debugName, bool logDebug=true)
 Creates reference counter with an initial value of 1. More...
 
virtual int IncrRef (void)
 Increments reference count. More...
 
virtual int DecrRef (void)
 Decrements reference count and deletes on 0. More...
 

Static Public Member Functions

static void * ResolveAddress (const char *lib, const char *proc)
 
- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 

Private Member Functions

virtual ~MythRenderD3D9 ()
 
bool SetTexture (IDirect3DDevice9 *dev, IDirect3DTexture9 *texture, int num=0)
 
void DeleteTextures (void)
 
void DeleteVertexBuffers (void)
 
void DeleteSurfaces (void)
 
void Init2DState (void)
 
void EnableBlending (IDirect3DDevice9 *dev, bool enable)
 
void MultiTexturing (IDirect3DDevice9 *dev, bool enable, IDirect3DTexture9 *texture=nullptrptr)
 
void SetTextureVertices (IDirect3DDevice9 *dev, bool enable)
 
void CreateDeviceManager (void)
 
void DestroyDeviceManager (void)
 

Private Attributes

QMap< IDirect3DTexture9 *, QSize > m_textures
 
QMap< IDirect3DVertexBuffer9 *, MythD3DVertexBufferm_vertexbuffers
 
QMap< IDirect3DSurface9 *, MythD3DSurfacem_surfaces
 
IDirect3D9 * m_d3d {nullptr}
 
IDirect3DDevice9 * m_rootD3DDevice {nullptr}
 
D3DFORMAT m_adaptor_fmt {D3DFMT_UNKNOWN}
 
D3DFORMAT m_videosurface_fmt {D3DFMT_UNKNOWN}
 
D3DFORMAT m_surface_fmt {D3DFMT_UNKNOWN}
 
D3DFORMAT m_texture_fmt {D3DFMT_UNKNOWN}
 
IDirect3DVertexBuffer9 * m_rect_vertexbuffer {nullptr}
 
IDirect3DSurface9 * m_default_surface {nullptr}
 
IDirect3DSurface9 * m_current_surface {nullptr}
 
QRecursiveMutex m_lock
 
bool m_blend {true}
 
bool m_multi_texturing {true}
 
bool m_texture_vertices {true}
 
IDirect3DDeviceManager9 * m_deviceManager {nullptr}
 
HANDLE m_deviceHandle {nullptr}
 
uint m_deviceManagerToken {0}
 

Additional Inherited Members

- Protected Member Functions inherited from MythRender
 ~MythRender () override=default
 
virtual void ReleaseResources (void)
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 
- Protected Attributes inherited from MythRender
RenderType m_type
 
QSize m_size
 
bool m_errored
 
- Protected Attributes inherited from ReferenceCounter
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More...
 
QAtomicInt m_referenceCount {1}
 

Detailed Description

Definition at line 62 of file mythrender_d3d9.h.

Constructor & Destructor Documentation

◆ MythRenderD3D9()

MythRenderD3D9::MythRenderD3D9 ( )
inline

Definition at line 67 of file mythrender_d3d9.h.

◆ ~MythRenderD3D9()

MythRenderD3D9::~MythRenderD3D9 ( )
privatevirtual

Definition at line 183 of file mythrender_d3d9.cpp.

Member Function Documentation

◆ ResolveAddress()

void * MythRenderD3D9::ResolveAddress ( const char *  lib,
const char *  proc 
)
static

◆ Create()

bool MythRenderD3D9::Create ( QSize  size,
HWND  window 
)

Definition at line 247 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::InitD3D9(), and VideoOutputD3D::SetupContext().

◆ Test()

bool MythRenderD3D9::Test ( bool reset)

◆ ClearBuffer()

bool MythRenderD3D9::ClearBuffer ( void  )

Definition at line 448 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::Begin(), and VideoOutputD3D::RenderFrame().

◆ Begin()

bool MythRenderD3D9::Begin ( void  )

Definition at line 465 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::Begin(), and VideoOutputD3D::RenderFrame().

◆ End()

bool MythRenderD3D9::End ( void  )

Definition at line 481 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::End(), and VideoOutputD3D::RenderFrame().

◆ CopyFrame()

void MythRenderD3D9::CopyFrame ( void *  surface,
D3D9Image img 
)

Definition at line 497 of file mythrender_d3d9.cpp.

Referenced by VideoOutputD3D::PrepareFrame().

◆ StretchRect()

bool MythRenderD3D9::StretchRect ( IDirect3DTexture9 *  texture,
IDirect3DSurface9 *  surface,
bool  known_surface = true 
)

Definition at line 503 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::ReleaseBuffer(), and D3D9Image::UpdateImage().

◆ DrawTexturedQuad()

bool MythRenderD3D9::DrawTexturedQuad ( IDirect3DVertexBuffer9 *  vertexbuffer)

Definition at line 535 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::Draw().

◆ DrawRect()

void MythRenderD3D9::DrawRect ( const QRect &  rect,
const QColor &  color,
int  alpha 
)

Definition at line 572 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::DrawRect(), and VideoOutputD3D::RenderFrame().

◆ Present()

bool MythRenderD3D9::Present ( HWND  win)

Definition at line 690 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::End(), and VideoOutputD3D::EndFrame().

◆ HardwareYUVConversion()

bool MythRenderD3D9::HardwareYUVConversion ( void  )

Definition at line 400 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::GetBuffer().

◆ GetRect()

QRect MythRenderD3D9::GetRect ( IDirect3DVertexBuffer9 *  vertexbuffer)

Definition at line 707 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::GetRect().

◆ SetRenderTarget()

bool MythRenderD3D9::SetRenderTarget ( IDirect3DTexture9 *  texture)

Definition at line 714 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::End(), and D3D9Image::SetAsRenderTarget().

◆ CreateTexture()

IDirect3DTexture9 * MythRenderD3D9::CreateTexture ( const QSize &  size)

Definition at line 784 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::D3D9Image().

◆ DeleteTexture()

void MythRenderD3D9::DeleteTexture ( IDirect3DTexture9 *  texture)

Definition at line 815 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::~D3D9Image().

◆ CreateVertexBuffer()

IDirect3DVertexBuffer9 * MythRenderD3D9::CreateVertexBuffer ( IDirect3DTexture9 *  texture = nullptr)

Definition at line 947 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::D3D9Image().

◆ UpdateVertexBuffer()

bool MythRenderD3D9::UpdateVertexBuffer ( IDirect3DVertexBuffer9 *  vertexbuffer,
const QRect &  dvr,
const QRect &  vr,
int  alpha = 255,
bool  video = false 
)

Definition at line 994 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::UpdateVertices().

◆ DeleteVertexBuffer()

void MythRenderD3D9::DeleteVertexBuffer ( IDirect3DVertexBuffer9 *  vertexbuffer)

Definition at line 984 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::~D3D9Image().

◆ CreateSurface()

IDirect3DSurface9 * MythRenderD3D9::CreateSurface ( const QSize &  size,
bool  video = false 
)

Definition at line 825 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::D3D9Image().

◆ UpdateSurface()

bool MythRenderD3D9::UpdateSurface ( IDirect3DSurface9 *  surface,
const MythImage image 
)

Definition at line 852 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::UpdateImage().

◆ DeleteSurface()

void MythRenderD3D9::DeleteSurface ( IDirect3DSurface9 *  surface)

Definition at line 906 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::~D3D9Image().

◆ GetBuffer()

uint8_t * MythRenderD3D9::GetBuffer ( IDirect3DSurface9 *  surface,
uint pitch 
)

Definition at line 916 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::GetBuffer(), and UpdateSurface().

◆ ReleaseBuffer()

void MythRenderD3D9::ReleaseBuffer ( IDirect3DSurface9 *  surface)

Definition at line 936 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::ReleaseBuffer(), and UpdateSurface().

◆ SetTexture()

bool MythRenderD3D9::SetTexture ( IDirect3DDevice9 *  dev,
IDirect3DTexture9 *  texture,
int  num = 0 
)
private

Definition at line 769 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and MultiTexturing().

◆ DeleteTextures()

void MythRenderD3D9::DeleteTextures ( void  )
private

Definition at line 807 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ DeleteVertexBuffers()

void MythRenderD3D9::DeleteVertexBuffers ( void  )
private

Definition at line 973 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ DeleteSurfaces()

void MythRenderD3D9::DeleteSurfaces ( void  )
private

Definition at line 898 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ Init2DState()

void MythRenderD3D9::Init2DState ( void  )
private

Definition at line 1092 of file mythrender_d3d9.cpp.

Referenced by Create().

◆ EnableBlending()

void MythRenderD3D9::EnableBlending ( IDirect3DDevice9 *  dev,
bool  enable 
)
private

Definition at line 1122 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and Init2DState().

◆ MultiTexturing()

void MythRenderD3D9::MultiTexturing ( IDirect3DDevice9 *  dev,
bool  enable,
IDirect3DTexture9 *  texture = nullptrptr 
)
private

Definition at line 654 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and Init2DState().

◆ SetTextureVertices()

void MythRenderD3D9::SetTextureVertices ( IDirect3DDevice9 *  dev,
bool  enable 
)
private

Definition at line 1132 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and Init2DState().

◆ AcquireDevice()

IDirect3DDevice9 * MythRenderD3D9::AcquireDevice ( void  )

Definition at line 1142 of file mythrender_d3d9.cpp.

Referenced by D3D9Locker::Acquire(), and Init2DState().

◆ ReleaseDevice()

void MythRenderD3D9::ReleaseDevice ( void  )

Definition at line 1174 of file mythrender_d3d9.cpp.

Referenced by Init2DState(), and D3D9Locker::~D3D9Locker().

◆ GetDeviceManager()

IDirect3DDeviceManager9* MythRenderD3D9::GetDeviceManager ( void  )
inline

Definition at line 142 of file mythrender_d3d9.h.

Referenced by DXVA2Decoder::CreateVideoService().

◆ CreateDeviceManager()

void MythRenderD3D9::CreateDeviceManager ( void  )
private

Definition at line 1192 of file mythrender_d3d9.cpp.

Referenced by Create().

◆ DestroyDeviceManager()

void MythRenderD3D9::DestroyDeviceManager ( void  )
private

Definition at line 1235 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

Member Data Documentation

◆ m_textures

QMap<IDirect3DTexture9*, QSize> MythRenderD3D9::m_textures
private

◆ m_vertexbuffers

QMap<IDirect3DVertexBuffer9*, MythD3DVertexBuffer> MythRenderD3D9::m_vertexbuffers
private

◆ m_surfaces

QMap<IDirect3DSurface9*, MythD3DSurface> MythRenderD3D9::m_surfaces
private

◆ m_d3d

IDirect3D9* MythRenderD3D9::m_d3d {nullptr}
private

Definition at line 120 of file mythrender_d3d9.h.

Referenced by Create(), and ~MythRenderD3D9().

◆ m_rootD3DDevice

IDirect3DDevice9* MythRenderD3D9::m_rootD3DDevice {nullptr}
private

Definition at line 121 of file mythrender_d3d9.h.

Referenced by AcquireDevice(), Create(), CreateDeviceManager(), and ~MythRenderD3D9().

◆ m_adaptor_fmt

D3DFORMAT MythRenderD3D9::m_adaptor_fmt {D3DFMT_UNKNOWN}
private

Definition at line 122 of file mythrender_d3d9.h.

Referenced by Create().

◆ m_videosurface_fmt

D3DFORMAT MythRenderD3D9::m_videosurface_fmt {D3DFMT_UNKNOWN}
private

Definition at line 123 of file mythrender_d3d9.h.

Referenced by Create(), CreateSurface(), and HardwareYUVConversion().

◆ m_surface_fmt

D3DFORMAT MythRenderD3D9::m_surface_fmt {D3DFMT_UNKNOWN}
private

Definition at line 124 of file mythrender_d3d9.h.

Referenced by Create(), and CreateSurface().

◆ m_texture_fmt

D3DFORMAT MythRenderD3D9::m_texture_fmt {D3DFMT_UNKNOWN}
private

Definition at line 125 of file mythrender_d3d9.h.

Referenced by Create(), and CreateTexture().

◆ m_rect_vertexbuffer

IDirect3DVertexBuffer9* MythRenderD3D9::m_rect_vertexbuffer {nullptr}
private

Definition at line 126 of file mythrender_d3d9.h.

Referenced by DrawRect(), and ~MythRenderD3D9().

◆ m_default_surface

IDirect3DSurface9* MythRenderD3D9::m_default_surface {nullptr}
private

Definition at line 127 of file mythrender_d3d9.h.

Referenced by SetRenderTarget(), and ~MythRenderD3D9().

◆ m_current_surface

IDirect3DSurface9* MythRenderD3D9::m_current_surface {nullptr}
private

Definition at line 128 of file mythrender_d3d9.h.

Referenced by SetRenderTarget(), and ~MythRenderD3D9().

◆ m_lock

QRecursiveMutex MythRenderD3D9::m_lock
private

◆ m_blend

bool MythRenderD3D9::m_blend {true}
private

Definition at line 135 of file mythrender_d3d9.h.

Referenced by EnableBlending().

◆ m_multi_texturing

bool MythRenderD3D9::m_multi_texturing {true}
private

Definition at line 136 of file mythrender_d3d9.h.

Referenced by MultiTexturing().

◆ m_texture_vertices

bool MythRenderD3D9::m_texture_vertices {true}
private

Definition at line 137 of file mythrender_d3d9.h.

Referenced by SetTextureVertices().

◆ m_deviceManager

IDirect3DDeviceManager9* MythRenderD3D9::m_deviceManager {nullptr}
private

◆ m_deviceHandle

HANDLE MythRenderD3D9::m_deviceHandle {nullptr}
private

◆ m_deviceManagerToken

uint MythRenderD3D9::m_deviceManagerToken {0}
private

Definition at line 151 of file mythrender_d3d9.h.

Referenced by CreateDeviceManager().


The documentation for this class was generated from the following files: