30 #define WIDTH(x) ((*(x)).right - (*(x)).left) 31 #define HEIGHT(x) ((*(x)).bottom - (*(x)).top) 32 #define SHOWSTAGE TEXT("WM_SHOWSTAGE") 33 #define SHOWSTAGETOP TEXT("WM_SHOWSTAGETOP") 34 #define REALIZEPALETTE TEXT("WM_REALIZEPALETTE") 66 friend LRESULT CALLBACK
WndProc(HWND hwnd,
71 virtual LRESULT OnPaletteChange(HWND hwnd, UINT Message);
75 CBaseWindow(BOOL bDoGetDC = TRUE,
bool bPostToDestroy =
false);
81 virtual HRESULT DoneWithWindow();
82 virtual HRESULT PrepareWindow();
83 virtual HRESULT InactivateWindow();
84 virtual HRESULT ActivateWindow();
85 virtual BOOL OnSize(LONG Width, LONG Height);
86 virtual BOOL OnClose();
87 virtual RECT GetDefaultRect();
88 virtual HRESULT UninitialiseWindow();
89 virtual HRESULT InitialiseWindow(HWND hwnd);
91 HRESULT CompleteConnect();
92 HRESULT DoCreateWindow();
94 HRESULT PerformanceAlignWindow();
95 HRESULT DoShowWindow(LONG ShowCmd);
96 void PaintWindow(BOOL bErase);
97 void DoSetWindowForeground(BOOL bFocus);
98 virtual HRESULT SetPalette(HPALETTE hPalette);
101 m_bNoRealize = !bRealize;
105 HRESULT SetPalette();
106 void UnsetPalette(
void);
107 virtual HRESULT DoRealisePalette(BOOL bForceBackground = FALSE);
109 void LockPaletteLock();
110 void UnlockPaletteLock();
118 LONG GetWindowWidth();
119 LONG GetWindowHeight();
120 HWND GetWindowHWND();
125 HPALETTE GetPalette();
130 virtual LRESULT OnReceiveMessage(HWND hwnd,
137 virtual LPTSTR GetClassWindowStyles(
138 __out DWORD *pClassStyles,
139 __out DWORD *pWindowStyles,
140 __out DWORD *pWindowStylesEx) PURE;
191 BOOL
DrawImage(IMediaSample *pMediaSample);
193 __in LPRECT lprcSrc, __in LPRECT lprcDst);
260 __in_opt LPCTSTR
pName,
261 __inout HRESULT *phr,
262 __in_bcount(length) LPBYTE pBuffer,
294 STDMETHODIMP
CheckSizes(__in ALLOCATOR_PROPERTIES *pRequest);
313 __in ALLOCATOR_PROPERTIES *pRequest,
314 __out ALLOCATOR_PROPERTIES *pActual);
346 static HPALETTE
MakePalette(
const VIDEOINFOHEADER *pVideoInfo, __in LPSTR szDevice);
348 static HRESULT
MakeIdentityPalette(__inout_ecount_full(iColours) PALETTEENTRY *pEntry,INT iColours, __in LPSTR szDevice);
350 BOOL
ShouldUpdate(
const VIDEOINFOHEADER *pNewInfo,
const VIDEOINFOHEADER *pOldInfo);
353 BOOL
DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
402 const DWORD *
GetBitMasks(
const VIDEOINFO *pVideoInfo);
405 __out DWORD *pMaskGreen,
406 __out DWORD *pMaskBlue);
418 #endif // __WINUTIL__ HRESULT CopyPalette(const CMediaType *pSrc, __out CMediaType *pDest)
HRESULT PreparePalette(const CMediaType *pmtNew, const CMediaType *pmtOld, __in LPSTR szDevice)
HRESULT RefreshDisplayType(__in_opt LPSTR szDeviceName)
void GetTargetRect(__out RECT *pTargetRect)
void SetRealize(BOOL bRealize)
BOOL ShouldUpdate(const VIDEOINFOHEADER *pNewInfo, const VIDEOINFOHEADER *pOldInfo)
CDrawImage * m_pDrawImage
static DWORD CountSetBits(const DWORD Field)
static DWORD CountPrefixBits(const DWORD Field)
CImageAllocator(__inout CBaseFilter *pFilter, __in_opt LPCTSTR pName, __inout HRESULT *phr)
void SlowRender(IMediaSample *pMediaSample)
void UpdateColourTable(HDC hdc, __in BITMAPINFOHEADER *pbmi)
static BOOL CheckPaletteHeader(const VIDEOINFO *pInput)
STDMETHODIMP CheckSizes(__in ALLOCATOR_PROPERTIES *pRequest)
void IncrementPaletteVersion()
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
ULONG(__stdcall *_RegisterTraceGuids)(__in IN WMIDPREQUEST RequestAddress
static BOOL CheckBitFields(const VIDEOINFO *pInput)
virtual CImageSample * CreateImageSample(__in_bcount(Length) LPBYTE pData, LONG Length)
HRESULT CreateDIB(LONG InSize, DIBDATA &DibData)
BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
const COLORREF VIDEO_COLOUR
void SetSourceRect(__in RECT *pSourceRect)
HRESULT UpdateFormat(__inout VIDEOINFO *pVideoInfo)
virtual RECT ScaleSourceRect(const RECT *pSource)
void SetTargetRect(__in RECT *pTargetRect)
static HRESULT MakeIdentityPalette(__inout_ecount_full(iColours) PALETTEENTRY *pEntry, INT iColours, __in LPSTR szDevice)
BOOL DrawImage(IMediaSample *pMediaSample)
STDAPI CheckVideoInfoType(const AM_MEDIA_TYPE *pmt)
static BOOL CheckHeaderValidity(const VIDEOINFO *pInput)
CBaseWindow * m_pBaseWindow
BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
CDrawImage(__inout CBaseWindow *pBaseWindow)
const DWORD * GetBitMasks(const VIDEOINFO *pVideoInfo)
HRESULT CheckVideoType(const VIDEOINFO *pInput)
void NotifyMediaType(__in CMediaType *pMediaType)
BOOL UsingImageAllocator()
STDAPI ConvertVideoInfoToVideoInfo2(__inout AM_MEDIA_TYPE *pmt)
void SetDIBData(__in DIBDATA *pDibData)
static HPALETTE MakePalette(const VIDEOINFOHEADER *pVideoInfo, __in LPSTR szDevice)
BOOL GetColourMask(__out DWORD *pMaskRed, __out DWORD *pMaskGreen, __out DWORD *pMaskBlue)
BOOL m_bUsingImageAllocator
CMediaType * m_pMediaType
void GetSourceRect(__out RECT *pSourceRect)
CImagePalette(__inout CBaseFilter *pBaseFilter, __inout CBaseWindow *pBaseWindow, __inout CDrawImage *pDrawImage)
CBaseWindow * m_pBaseWindow
CImageSample(__inout CBaseAllocator *pAllocator, __in_opt LPCTSTR pName, __inout HRESULT *phr, __in_bcount(length) LPBYTE pBuffer, LONG length)
void FastRender(IMediaSample *pMediaSample)
void NotifyAllocator(BOOL bUsingImageAllocator)
STDMETHODIMP SetProperties(__in ALLOCATOR_PROPERTIES *pRequest, __out ALLOCATOR_PROPERTIES *pActual)
const LONG PALETTE_VERSION
struct tagDIBDATA DIBDATA
HRESULT CheckMediaType(const CMediaType *pmtIn)
void NotifyMediaType(__in CMediaType *pMediaType)
void DisplaySampleTimes(IMediaSample *pSample)
__out DIBDATA * GetDIBData()
void ResetPaletteVersion()
CMediaType * m_pMediaType
STDAPI CheckVideoInfo2Type(const AM_MEDIA_TYPE *pmt)
const VIDEOINFO * GetDisplayFormat()
STDMETHODIMP_(ULONG) NonDelegatingAddRef()