AJA NTV2 SDK  17.6.0.2675
NTV2 SDK 17.6.0.2675
winutil.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // File: WinUtil.h
3 //
4 // Desc: DirectShow base classes - defines generic handler classes.
5 //
6 // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
8 
9 
10 // Make sure that you call PrepareWindow to initialise the window after
11 // the object has been constructed. It is a separate method so that
12 // derived classes can override useful methods like MessageLoop. Also
13 // any derived class must call DoneWithWindow in its destructor. If it
14 // doesn't a message may be retrieved and call a derived class member
15 // function while a thread is executing the base class destructor code
16 
17 #ifndef __WINUTIL__
18 #define __WINUTIL__
19 
20 const int DEFWIDTH = 320; // Initial window width
21 const int DEFHEIGHT = 240; // Initial window height
22 const int CAPTION = 256; // Maximum length of caption
23 const int TIMELENGTH = 50; // Maximum length of times
24 const int PROFILESTR = 128; // Normal profile string
25 const WORD PALVERSION = 0x300; // GDI palette version
26 const LONG PALETTE_VERSION = (LONG) 1; // Initial palette version
27 const COLORREF VIDEO_COLOUR = 0; // Defaults to black background
28 const HANDLE hMEMORY = (HANDLE) (-1); // Says to open as memory file
29 
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")
35 
36 class AM_NOVTABLE CBaseWindow
37 {
38 protected:
39 
40  HINSTANCE m_hInstance; // Global module instance handle
41  HWND m_hwnd; // Handle for our window
42  HDC m_hdc; // Device context for the window
43  LONG m_Width; // Client window width
44  LONG m_Height; // Client window height
45  BOOL m_bActivated; // Has the window been activated
46  LPTSTR m_pClassName; // Static string holding class name
47  DWORD m_ClassStyles; // Passed in to our constructor
48  DWORD m_WindowStyles; // Likewise the initial window styles
49  DWORD m_WindowStylesEx; // And the extended window styles
50  UINT m_ShowStageMessage; // Have the window shown with focus
51  UINT m_ShowStageTop; // Makes the window WS_EX_TOPMOST
52  UINT m_RealizePalette; // Makes us realize our new palette
53  HDC m_MemoryDC; // Used for fast BitBlt operations
54  HPALETTE m_hPalette; // Handle to any palette we may have
55  BYTE m_bNoRealize; // Don't realize palette now
56  BYTE m_bBackground; // Should we realise in background
57  BYTE m_bRealizing; // already realizing the palette
58  CCritSec m_WindowLock; // Serialise window object access
59  BOOL m_bDoGetDC; // Should this window get a DC
60  bool m_bDoPostToDestroy; // Use PostMessage to destroy
61  CCritSec m_PaletteLock; // This lock protects m_hPalette.
62  // It should be held anytime the
63  // program use the value of m_hPalette.
64 
65  // Maps windows message procedure into C++ methods
66  friend LRESULT CALLBACK WndProc(HWND hwnd, // Window handle
67  UINT uMsg, // Message ID
68  WPARAM wParam, // First parameter
69  LPARAM lParam); // Other parameter
70 
71  virtual LRESULT OnPaletteChange(HWND hwnd, UINT Message);
72 
73 public:
74 
75  CBaseWindow(BOOL bDoGetDC = TRUE, bool bPostToDestroy = false);
76 
77 #ifdef DEBUG
78  virtual ~CBaseWindow();
79 #endif
80 
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);
90 
91  HRESULT CompleteConnect();
92  HRESULT DoCreateWindow();
93 
94  HRESULT PerformanceAlignWindow();
95  HRESULT DoShowWindow(LONG ShowCmd);
96  void PaintWindow(BOOL bErase);
97  void DoSetWindowForeground(BOOL bFocus);
98  virtual HRESULT SetPalette(HPALETTE hPalette);
99  void SetRealize(BOOL bRealize)
100  {
101  m_bNoRealize = !bRealize;
102  }
103 
104  // Jump over to the window thread to set the current palette
105  HRESULT SetPalette();
106  void UnsetPalette(void);
107  virtual HRESULT DoRealisePalette(BOOL bForceBackground = FALSE);
108 
109  void LockPaletteLock();
110  void UnlockPaletteLock();
111 
112  virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
113  { return FALSE; };
114 
115  // Access our window information
116 
117  bool WindowExists();
118  LONG GetWindowWidth();
119  LONG GetWindowHeight();
120  HWND GetWindowHWND();
121  HDC GetMemoryHDC();
122  HDC GetWindowHDC();
123 
124  #ifdef DEBUG
125  HPALETTE GetPalette();
126  #endif // DEBUG
127 
128  // This is the window procedure the derived object should override
129 
130  virtual LRESULT OnReceiveMessage(HWND hwnd, // Window handle
131  UINT uMsg, // Message ID
132  WPARAM wParam, // First parameter
133  LPARAM lParam); // Other parameter
134 
135  // Must be overriden to return class and window styles
136 
137  virtual LPTSTR GetClassWindowStyles(
138  __out DWORD *pClassStyles, // Class styles
139  __out DWORD *pWindowStyles, // Window styles
140  __out DWORD *pWindowStylesEx) PURE; // Extended styles
141 };
142 
143 
144 // This helper class is entirely subservient to the owning CBaseWindow object
145 // All this object does is to split out the actual drawing operation from the
146 // main object (because it was becoming too large). We have a number of entry
147 // points to set things like the draw device contexts, to implement the actual
148 // drawing and to set the destination rectangle in the client window. We have
149 // no critical section locking in this class because we are used exclusively
150 // by the owning window object which looks after serialising calls into us
151 
152 // If you want to use this class make sure you call NotifyAllocator once the
153 // allocate has been agreed, also call NotifyMediaType with a pointer to a
154 // NON stack based CMediaType once that has been set (we keep a pointer to
155 // the original rather than taking a copy). When the palette changes call
156 // IncrementPaletteVersion (easiest thing to do is to also call this method
157 // in the SetMediaType method most filters implement). Finally before you
158 // start rendering anything call SetDrawContext so that we can get the HDCs
159 // for drawing from the CBaseWindow object we are given during construction
160 
162 {
163 protected:
164 
165  CBaseWindow *m_pBaseWindow; // Owning video window object
166  CRefTime m_StartSample; // Start time for the current sample
167  CRefTime m_EndSample; // And likewise it's end sample time
168  HDC m_hdc; // Main window device context
169  HDC m_MemoryDC; // Offscreen draw device context
170  RECT m_TargetRect; // Target destination rectangle
171  RECT m_SourceRect; // Source image rectangle
172  BOOL m_bStretch; // Do we have to stretch the images
173  BOOL m_bUsingImageAllocator; // Are the samples shared DIBSECTIONs
174  CMediaType *m_pMediaType; // Pointer to the current format
175  int m_perfidRenderTime; // Time taken to render an image
176  LONG m_PaletteVersion; // Current palette version cookie
177 
178  // Draw the video images in the window
179 
180  void SlowRender(IMediaSample *pMediaSample);
181  void FastRender(IMediaSample *pMediaSample);
182  void DisplaySampleTimes(IMediaSample *pSample);
183  void UpdateColourTable(HDC hdc,__in BITMAPINFOHEADER *pbmi);
184  void SetStretchMode();
185 
186 public:
187 
188  // Used to control the image drawing
189 
190  CDrawImage(__inout CBaseWindow *pBaseWindow);
191  BOOL DrawImage(IMediaSample *pMediaSample);
192  BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample,
193  __in LPRECT lprcSrc, __in LPRECT lprcDst);
194  void SetDrawContext();
195  void SetTargetRect(__in RECT *pTargetRect);
196  void SetSourceRect(__in RECT *pSourceRect);
197  void GetTargetRect(__out RECT *pTargetRect);
198  void GetSourceRect(__out RECT *pSourceRect);
199  virtual RECT ScaleSourceRect(const RECT *pSource);
200 
201  // Handle updating palettes as they change
202 
203  LONG GetPaletteVersion();
204  void ResetPaletteVersion();
206 
207  // Tell us media types and allocator assignments
208 
209  void NotifyAllocator(BOOL bUsingImageAllocator);
210  void NotifyMediaType(__in CMediaType *pMediaType);
211  BOOL UsingImageAllocator();
212 
213  // Called when we are about to draw an image
214 
217  };
218 
219  // Called when we complete an image rendering
220 
221  void NotifyEndDraw() {
223  };
224 };
225 
226 
227 // This is the structure used to keep information about each GDI DIB. All the
228 // samples we create from our allocator will have a DIBSECTION allocated to
229 // them. When we receive the sample we know we can BitBlt straight to an HDC
230 
231 typedef struct tagDIBDATA {
232 
233  LONG PaletteVersion; // Current palette version in use
234  DIBSECTION DibSection; // Details of DIB section allocated
235  HBITMAP hBitmap; // Handle to bitmap for drawing
236  HANDLE hMapping; // Handle to shared memory block
237  BYTE *pBase; // Pointer to base memory address
238 
239 } DIBDATA;
240 
241 
242 // This class inherits from CMediaSample and uses all of it's methods but it
243 // overrides the constructor to initialise itself with the DIBDATA structure
244 // When we come to render an IMediaSample we will know if we are using our own
245 // allocator, and if we are, we can cast the IMediaSample to a pointer to one
246 // of these are retrieve the DIB section information and hence the HBITMAP
247 
249 {
250 protected:
251 
252  DIBDATA m_DibData; // Information about the DIBSECTION
253  BOOL m_bInit; // Is the DIB information setup
254 
255 public:
256 
257  // Constructor
258 
259  CImageSample(__inout CBaseAllocator *pAllocator,
260  __in_opt LPCTSTR pName,
261  __inout HRESULT *phr,
262  __in_bcount(length) LPBYTE pBuffer,
263  LONG length);
264 
265  // Maintain the DIB/DirectDraw state
266 
267  void SetDIBData(__in DIBDATA *pDibData);
268  __out DIBDATA *GetDIBData();
269 };
270 
271 
272 // This is an allocator based on the abstract CBaseAllocator base class that
273 // allocates sample buffers in shared memory. The number and size of these
274 // are determined when the output pin calls Prepare on us. The shared memory
275 // blocks are used in subsequent calls to GDI CreateDIBSection, once that
276 // has been done the output pin can fill the buffers with data which will
277 // then be handed to GDI through BitBlt calls and thereby remove one copy
278 
280 {
281 protected:
282 
283  CBaseFilter *m_pFilter; // Delegate reference counts to
284  CMediaType *m_pMediaType; // Pointer to the current format
285 
286  // Used to create and delete samples
287 
288  HRESULT Alloc();
289  void Free();
290 
291  // Manage the shared DIBSECTION and DCI/DirectDraw buffers
292 
293  HRESULT CreateDIB(LONG InSize,DIBDATA &DibData);
294  STDMETHODIMP CheckSizes(__in ALLOCATOR_PROPERTIES *pRequest);
295  virtual CImageSample *CreateImageSample(__in_bcount(Length) LPBYTE pData,LONG Length);
296 
297 public:
298 
299  // Constructor and destructor
300 
301  CImageAllocator(__inout CBaseFilter *pFilter,__in_opt LPCTSTR pName,__inout HRESULT *phr);
302 #ifdef DEBUG
303  ~CImageAllocator();
304 #endif
305 
306  STDMETHODIMP_(ULONG) NonDelegatingAddRef();
307  STDMETHODIMP_(ULONG) NonDelegatingRelease();
308  void NotifyMediaType(__in CMediaType *pMediaType);
309 
310  // Agree the number of buffers to be used and their size
311 
312  STDMETHODIMP SetProperties(
313  __in ALLOCATOR_PROPERTIES *pRequest,
314  __out ALLOCATOR_PROPERTIES *pActual);
315 };
316 
317 
318 // This class is a fairly specialised helper class for image renderers that
319 // have to create and manage palettes. The CBaseWindow class looks after
320 // realising palettes once they have been installed. This class can be used
321 // to create the palette handles from a media format (which must contain a
322 // VIDEOINFO structure in the format block). We try to make the palette an
323 // identity palette to maximise performance and also only change palettes
324 // if actually required to (we compare palette colours before updating).
325 // All the methods are virtual so that they can be overriden if so required
326 
328 {
329 protected:
330 
331  CBaseWindow *m_pBaseWindow; // Window to realise palette in
332  CBaseFilter *m_pFilter; // Media filter to send events
333  CDrawImage *m_pDrawImage; // Object who will be drawing
334  HPALETTE m_hPalette; // The palette handle we own
335 
336 public:
337 
338  CImagePalette(__inout CBaseFilter *pBaseFilter,
339  __inout CBaseWindow *pBaseWindow,
340  __inout CDrawImage *pDrawImage);
341 
342 #ifdef DEBUG
343  virtual ~CImagePalette();
344 #endif
345 
346  static HPALETTE MakePalette(const VIDEOINFOHEADER *pVideoInfo, __in LPSTR szDevice);
347  HRESULT RemovePalette();
348  static HRESULT MakeIdentityPalette(__inout_ecount_full(iColours) PALETTEENTRY *pEntry,INT iColours, __in LPSTR szDevice);
349  HRESULT CopyPalette(const CMediaType *pSrc,__out CMediaType *pDest);
350  BOOL ShouldUpdate(const VIDEOINFOHEADER *pNewInfo,const VIDEOINFOHEADER *pOldInfo);
351  HRESULT PreparePalette(const CMediaType *pmtNew,const CMediaType *pmtOld,__in LPSTR szDevice);
352 
353  BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
354  {
355  return m_pDrawImage->DrawVideoImageHere(hdc, pMediaSample, lprcSrc,lprcDst);
356  }
357 };
358 
359 
360 // Another helper class really for video based renderers. Most such renderers
361 // need to know what the display format is to some degree or another. This
362 // class initialises itself with the display format. The format can be asked
363 // for through GetDisplayFormat and various other accessor functions. If a
364 // filter detects a display format change (perhaps it gets a WM_DEVMODECHANGE
365 // message then it can call RefreshDisplayType to reset that format). Also
366 // many video renderers will want to check formats as they are proposed by
367 // source filters. This class provides methods to check formats and only
368 // accept those video formats that can be efficiently drawn using GDI calls
369 
370 class CImageDisplay : public CCritSec
371 {
372 protected:
373 
374  // This holds the display format; biSize should not be too big, so we can
375  // safely use the VIDEOINFO structure
376  VIDEOINFO m_Display;
377 
378  static DWORD CountSetBits(const DWORD Field);
379  static DWORD CountPrefixBits(const DWORD Field);
380  static BOOL CheckBitFields(const VIDEOINFO *pInput);
381 
382 public:
383 
384  // Constructor and destructor
385 
386  CImageDisplay();
387 
388  // Used to manage BITMAPINFOHEADERs and the display format
389 
390  const VIDEOINFO *GetDisplayFormat();
391  HRESULT RefreshDisplayType(__in_opt LPSTR szDeviceName);
392  static BOOL CheckHeaderValidity(const VIDEOINFO *pInput);
393  static BOOL CheckPaletteHeader(const VIDEOINFO *pInput);
394  BOOL IsPalettised();
395  WORD GetDisplayDepth();
396 
397  // Provide simple video format type checking
398 
399  HRESULT CheckMediaType(const CMediaType *pmtIn);
400  HRESULT CheckVideoType(const VIDEOINFO *pInput);
401  HRESULT UpdateFormat(__inout VIDEOINFO *pVideoInfo);
402  const DWORD *GetBitMasks(const VIDEOINFO *pVideoInfo);
403 
404  BOOL GetColourMask(__out DWORD *pMaskRed,
405  __out DWORD *pMaskGreen,
406  __out DWORD *pMaskBlue);
407 };
408 
409 // Convert a FORMAT_VideoInfo to FORMAT_VideoInfo2
410 STDAPI ConvertVideoInfoToVideoInfo2(__inout AM_MEDIA_TYPE *pmt);
411 
412 // Check a media type containing VIDEOINFOHEADER
413 STDAPI CheckVideoInfoType(const AM_MEDIA_TYPE *pmt);
414 
415 // Check a media type containing VIDEOINFOHEADER
416 STDAPI CheckVideoInfo2Type(const AM_MEDIA_TYPE *pmt);
417 
418 #endif // __WINUTIL__
419 
CDrawImage::GetTargetRect
void GetTargetRect(__out RECT *pTargetRect)
Definition: winutil.cpp:1328
PROFILESTR
const int PROFILESTR
Definition: winutil.h:24
CBaseWindow::m_ClassStyles
DWORD m_ClassStyles
Definition: winutil.h:47
CBaseWindow::SetRealize
void SetRealize(BOOL bRealize)
Definition: winutil.h:99
CImageDisplay::GetDisplayDepth
WORD GetDisplayDepth()
Definition: winutil.cpp:2429
CDrawImage::ScaleSourceRect
virtual RECT ScaleSourceRect(const RECT *pSource)
Definition: winutil.cpp:1009
CBaseWindow::m_ShowStageTop
UINT m_ShowStageTop
Definition: winutil.h:51
CImageAllocator::Alloc
HRESULT Alloc()
Definition: winutil.cpp:1560
CImageAllocator::Free
void Free()
Definition: winutil.cpp:1476
HANDLE
short HANDLE
Definition: ajatypes.h:318
CImageAllocator::CreateDIB
HRESULT CreateDIB(LONG InSize, DIBDATA &DibData)
Definition: winutil.cpp:1636
CImageAllocator::CreateImageSample
virtual CImageSample * CreateImageSample(__in_bcount(Length) LPBYTE pData, LONG Length)
Definition: winutil.cpp:1611
tagDIBDATA::DibSection
DIBSECTION DibSection
Definition: winutil.h:234
DEFWIDTH
const int DEFWIDTH
Definition: winutil.h:20
CDrawImage::NotifyStartDraw
void NotifyStartDraw()
Definition: winutil.h:215
MSR_STOP
#define MSR_STOP(a)
Definition: measure.h:138
CBaseWindow::m_hdc
HDC m_hdc
Definition: winutil.h:42
VIDEO_COLOUR
const COLORREF VIDEO_COLOUR
Definition: winutil.h:27
CDrawImage::NotifyEndDraw
void NotifyEndDraw()
Definition: winutil.h:221
CDrawImage::IncrementPaletteVersion
void IncrementPaletteVersion()
Definition: winutil.cpp:1433
CImageDisplay::CheckVideoType
HRESULT CheckVideoType(const VIDEOINFO *pInput)
Definition: winutil.cpp:2484
CImageDisplay::GetBitMasks
const DWORD * GetBitMasks(const VIDEOINFO *pVideoInfo)
Definition: winutil.cpp:2547
CImageSample
Definition: winutil.h:248
CBaseWindow::m_hPalette
HPALETTE m_hPalette
Definition: winutil.h:54
CAPTION
const int CAPTION
Definition: winutil.h:22
CBaseWindow::m_bActivated
BOOL m_bActivated
Definition: winutil.h:45
CImageAllocator::SetProperties
STDMETHODIMP SetProperties(__in ALLOCATOR_PROPERTIES *pRequest, __out ALLOCATOR_PROPERTIES *pActual)
Definition: winutil.cpp:1536
CImagePalette::MakePalette
static HPALETTE MakePalette(const VIDEOINFOHEADER *pVideoInfo, __in LPSTR szDevice)
Definition: winutil.cpp:2016
CBaseWindow
Definition: winutil.h:36
CImagePalette::CImagePalette
CImagePalette(__inout CBaseFilter *pBaseFilter, __inout CBaseWindow *pBaseWindow, __inout CDrawImage *pDrawImage)
Definition: winutil.cpp:1772
CImageDisplay::CImageDisplay
CImageDisplay()
Definition: winutil.cpp:2150
CImagePalette::m_pFilter
CBaseFilter * m_pFilter
Definition: winutil.h:332
CMediaType
Definition: mtype.h:18
CDrawImage::GetSourceRect
void GetSourceRect(__out RECT *pSourceRect)
Definition: winutil.cpp:1350
CImageAllocator::m_pMediaType
CMediaType * m_pMediaType
Definition: winutil.h:284
CBaseWindow::m_bDoGetDC
BOOL m_bDoGetDC
Definition: winutil.h:59
CBaseWindow::m_PaletteLock
CCritSec m_PaletteLock
Definition: winutil.h:61
CImageDisplay::GetDisplayFormat
const VIDEOINFO * GetDisplayFormat()
Definition: winutil.cpp:2413
CBaseWindow::m_bBackground
BYTE m_bBackground
Definition: winutil.h:56
CImageDisplay::GetColourMask
BOOL GetColourMask(__out DWORD *pMaskRed, __out DWORD *pMaskGreen, __out DWORD *pMaskBlue)
Definition: winutil.cpp:2618
CImageSample::GetDIBData
__out DIBDATA * GetDIBData()
Definition: winutil.cpp:1756
CImageDisplay::m_Display
VIDEOINFO m_Display
Definition: winutil.h:376
CImageSample::m_bInit
BOOL m_bInit
Definition: winutil.h:253
CImagePalette::CopyPalette
HRESULT CopyPalette(const CMediaType *pSrc, __out CMediaType *pDest)
Definition: winutil.cpp:1916
CImageDisplay::RefreshDisplayType
HRESULT RefreshDisplayType(__in_opt LPSTR szDeviceName)
Definition: winutil.cpp:2166
CheckVideoInfoType
STDAPI CheckVideoInfoType(const AM_MEDIA_TYPE *pmt)
Definition: winutil.cpp:2707
CDrawImage::SetSourceRect
void SetSourceRect(__in RECT *pSourceRect)
Definition: winutil.cpp:1340
tagDIBDATA::PaletteVersion
LONG PaletteVersion
Definition: winutil.h:233
MSR_START
#define MSR_START(a)
Definition: measure.h:137
CDrawImage::m_PaletteVersion
LONG m_PaletteVersion
Definition: winutil.h:176
CDrawImage::m_SourceRect
RECT m_SourceRect
Definition: winutil.h:171
CImageDisplay::CountSetBits
static DWORD CountSetBits(const DWORD Field)
Definition: winutil.cpp:2257
tagDIBDATA::hMapping
HANDLE hMapping
Definition: winutil.h:236
CDrawImage::m_perfidRenderTime
int m_perfidRenderTime
Definition: winutil.h:175
CImageDisplay
Definition: winutil.h:370
CImagePalette::ShouldUpdate
BOOL ShouldUpdate(const VIDEOINFOHEADER *pNewInfo, const VIDEOINFOHEADER *pOldInfo)
Definition: winutil.cpp:1802
pName
CHAR * pName
Definition: amvideo.cpp:26
CImagePalette::m_pDrawImage
CDrawImage * m_pDrawImage
Definition: winutil.h:333
WndProc
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: winutil.cpp:416
CBaseWindow::m_Height
LONG m_Height
Definition: winutil.h:44
CDrawImage::DrawVideoImageHere
BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
Definition: winutil.cpp:1244
CDrawImage::m_bStretch
BOOL m_bStretch
Definition: winutil.h:172
CDrawImage::CDrawImage
CDrawImage(__inout CBaseWindow *pBaseWindow)
Definition: winutil.cpp:919
CImageDisplay::CheckPaletteHeader
static BOOL CheckPaletteHeader(const VIDEOINFO *pInput)
Definition: winutil.cpp:2375
CImageAllocator::STDMETHODIMP_
STDMETHODIMP_(ULONG) NonDelegatingAddRef()
CCritSec
Definition: wxutil.h:18
CDrawImage::SetStretchMode
void SetStretchMode()
Definition: winutil.cpp:1362
TIMELENGTH
const int TIMELENGTH
Definition: winutil.h:23
CDrawImage::m_hdc
HDC m_hdc
Definition: winutil.h:168
CDrawImage::m_pMediaType
CMediaType * m_pMediaType
Definition: winutil.h:174
tagDIBDATA::hBitmap
HBITMAP hBitmap
Definition: winutil.h:235
CDrawImage::m_StartSample
CRefTime m_StartSample
Definition: winutil.h:166
CMediaSample
Definition: amfilter.h:1185
CImagePalette::PreparePalette
HRESULT PreparePalette(const CMediaType *pmtNew, const CMediaType *pmtOld, __in LPSTR szDevice)
Definition: winutil.cpp:1845
CImageDisplay::CheckMediaType
HRESULT CheckMediaType(const CMediaType *pmtIn)
Definition: winutil.cpp:2572
CDrawImage
Definition: winutil.h:161
CImageDisplay::CheckBitFields
static BOOL CheckBitFields(const VIDEOINFO *pInput)
Definition: winutil.cpp:2220
CBaseWindow::m_bRealizing
BYTE m_bRealizing
Definition: winutil.h:57
CDrawImage::SetDrawContext
void SetDrawContext()
Definition: winutil.cpp:1307
ConvertVideoInfoToVideoInfo2
STDAPI ConvertVideoInfoToVideoInfo2(__inout AM_MEDIA_TYPE *pmt)
Definition: winutil.cpp:2671
PALVERSION
const WORD PALVERSION
Definition: winutil.h:25
CBaseWindow::PossiblyEatMessage
virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: winutil.h:112
CBaseWindow::m_WindowStylesEx
DWORD m_WindowStylesEx
Definition: winutil.h:49
tagDIBDATA::pBase
BYTE * pBase
Definition: winutil.h:237
CImageAllocator::CImageAllocator
CImageAllocator(__inout CBaseFilter *pFilter, __in_opt LPCTSTR pName, __inout HRESULT *phr)
Definition: winutil.cpp:1450
CDrawImage::m_pBaseWindow
CBaseWindow * m_pBaseWindow
Definition: winutil.h:165
CBaseWindow::m_WindowLock
CCritSec m_WindowLock
Definition: winutil.h:58
CImageSample::SetDIBData
void SetDIBData(__in DIBDATA *pDibData)
Definition: winutil.cpp:1746
CImageAllocator::NotifyMediaType
void NotifyMediaType(__in CMediaType *pMediaType)
Definition: winutil.cpp:1693
CDrawImage::UpdateColourTable
void UpdateColourTable(HDC hdc, __in BITMAPINFOHEADER *pbmi)
Definition: winutil.cpp:991
CRefTime
Definition: reftime.h:49
CImageAllocator::m_pFilter
CBaseFilter * m_pFilter
Definition: winutil.h:283
CImageDisplay::UpdateFormat
HRESULT UpdateFormat(__inout VIDEOINFO *pVideoInfo)
Definition: winutil.cpp:2443
CBaseFilter
Definition: amfilter.h:148
CDrawImage::ResetPaletteVersion
void ResetPaletteVersion()
Definition: winutil.cpp:1425
CDrawImage::DisplaySampleTimes
void DisplaySampleTimes(IMediaSample *pSample)
Definition: winutil.cpp:941
ULONG
ULONG(__stdcall *_RegisterTraceGuids)(__in IN WMIDPREQUEST RequestAddress
CBaseWindow::m_RealizePalette
UINT m_RealizePalette
Definition: winutil.h:52
CBaseWindow::m_bDoPostToDestroy
bool m_bDoPostToDestroy
Definition: winutil.h:60
CImagePalette
Definition: winutil.h:327
CImagePalette::MakeIdentityPalette
static HRESULT MakeIdentityPalette(__inout_ecount_full(iColours) PALETTEENTRY *pEntry, INT iColours, __in LPSTR szDevice)
Definition: winutil.cpp:2070
CImagePalette::RemovePalette
HRESULT RemovePalette()
Definition: winutil.cpp:1977
CBaseWindow::m_hwnd
HWND m_hwnd
Definition: winutil.h:41
CImagePalette::m_hPalette
HPALETTE m_hPalette
Definition: winutil.h:334
CImageAllocator::CheckSizes
STDMETHODIMP CheckSizes(__in ALLOCATOR_PROPERTIES *pRequest)
Definition: winutil.cpp:1497
CDrawImage::m_TargetRect
RECT m_TargetRect
Definition: winutil.h:170
CBaseWindow::m_pClassName
LPTSTR m_pClassName
Definition: winutil.h:46
CImageDisplay::CheckHeaderValidity
static BOOL CheckHeaderValidity(const VIDEOINFO *pInput)
Definition: winutil.cpp:2305
CDrawImage::m_bUsingImageAllocator
BOOL m_bUsingImageAllocator
Definition: winutil.h:173
CBaseWindow::m_ShowStageMessage
UINT m_ShowStageMessage
Definition: winutil.h:50
CDrawImage::NotifyAllocator
void NotifyAllocator(BOOL bUsingImageAllocator)
Definition: winutil.cpp:1387
CBaseAllocator
Definition: amfilter.h:1339
CDrawImage::SetTargetRect
void SetTargetRect(__in RECT *pTargetRect)
Definition: winutil.cpp:1318
CDrawImage::DrawImage
BOOL DrawImage(IMediaSample *pMediaSample)
Definition: winutil.cpp:1217
CDrawImage::GetPaletteVersion
LONG GetPaletteVersion()
Definition: winutil.cpp:1417
CImageSample::CImageSample
CImageSample(__inout CBaseAllocator *pAllocator, __in_opt LPCTSTR pName, __inout HRESULT *phr, __in_bcount(length) LPBYTE pBuffer, LONG length)
Definition: winutil.cpp:1731
PALETTE_VERSION
const LONG PALETTE_VERSION
Definition: winutil.h:26
CBaseWindow::m_hInstance
HINSTANCE m_hInstance
Definition: winutil.h:40
CDrawImage::NotifyMediaType
void NotifyMediaType(__in CMediaType *pMediaType)
Definition: winutil.cpp:1405
CImageDisplay::CountPrefixBits
static DWORD CountPrefixBits(const DWORD Field)
Definition: winutil.cpp:2278
DIBDATA
struct tagDIBDATA DIBDATA
CheckVideoInfo2Type
STDAPI CheckVideoInfo2Type(const AM_MEDIA_TYPE *pmt)
Definition: winutil.cpp:2728
DEFHEIGHT
const int DEFHEIGHT
Definition: winutil.h:21
CImageAllocator
Definition: winutil.h:279
CImageSample::m_DibData
DIBDATA m_DibData
Definition: winutil.h:252
CDrawImage::m_MemoryDC
HDC m_MemoryDC
Definition: winutil.h:169
CDrawImage::FastRender
void FastRender(IMediaSample *pMediaSample)
Definition: winutil.cpp:1023
CBaseWindow::m_WindowStyles
DWORD m_WindowStyles
Definition: winutil.h:48
CDrawImage::SlowRender
void SlowRender(IMediaSample *pMediaSample)
Definition: winutil.cpp:1126
CImagePalette::m_pBaseWindow
CBaseWindow * m_pBaseWindow
Definition: winutil.h:331
tagDIBDATA
Definition: winutil.h:231
CImageDisplay::IsPalettised
BOOL IsPalettised()
Definition: winutil.cpp:2421
CDrawImage::m_EndSample
CRefTime m_EndSample
Definition: winutil.h:167
CBaseWindow::m_MemoryDC
HDC m_MemoryDC
Definition: winutil.h:53
CDrawImage::UsingImageAllocator
BOOL UsingImageAllocator()
Definition: winutil.cpp:1395
CBaseWindow::m_bNoRealize
BYTE m_bNoRealize
Definition: winutil.h:55
CImagePalette::DrawVideoImageHere
BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst)
Definition: winutil.h:353
CBaseWindow::m_Width
LONG m_Width
Definition: winutil.h:43
hMEMORY
const HANDLE hMEMORY
Definition: winutil.h:28