From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Winamp/vid_d3d.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Src/Winamp/vid_d3d.h (limited to 'Src/Winamp/vid_d3d.h') diff --git a/Src/Winamp/vid_d3d.h b/Src/Winamp/vid_d3d.h new file mode 100644 index 00000000..9bde7919 --- /dev/null +++ b/Src/Winamp/vid_d3d.h @@ -0,0 +1,51 @@ +#pragma once +#include "VideoOutputChild.h" +#include +#include + +typedef HRESULT (WINAPI *D3DXCREATEFONTW)(LPDIRECT3DDEVICE9, INT, UINT, UINT, UINT, BOOL, DWORD, DWORD, DWORD, DWORD, LPCWSTR, LPD3DXFONT *); +extern D3DXCREATEFONTW pCreateFontW; + +class Direct3DVideoOutput +{ +public: + Direct3DVideoOutput(HWND hwnd, VideoAspectAdjuster *_adjuster); + int OpenVideo(int w, int h, unsigned int type, int flipit, double aspectratio); + void OnWindowSize(); + + int onPaint(HWND hwnd); + void displayFrame(const char *buf, int size, int time); + void close(); // hides any output of the video + void timerCallback(); + void setPalette(RGBQUAD *pal); + void drawSubtitle(SubsItem *item); + void resetSubtitle(); + void setVFlip(int on); + void Refresh(); + +private: + HRESULT DoRender(); + bool FindSuitableConversion(UINT adapter, D3DFORMAT output_format); + D3DDEVTYPE GetDeviceType(IDirect3D9 *d3d, UINT display_adapter); + IDirect3D9 *d3d; + IDirect3D9Ex *d3dEx; + IDirect3DDevice9 *device; + IDirect3DDevice9Ex *deviceEx; + IDirect3DSurface9 *surface, *logo_surface; + ID3DXFont *subtitle_font; + D3DFORMAT surface_type; + D3DSWAPEFFECT swap_effect; + int input_type; + int width, height; + VideoAspectAdjuster *adjuster; + HWND hwnd; + RECT last_rect; + int flip; + UINT display_adapter; + SubsItem *current_subtitle; + bool opened, valid_surface; + int need_change; + D3DTEXTUREFILTERTYPE stretch_filter; + + RGBQUAD *m_palette; +}; \ No newline at end of file -- cgit