| 11 | cycrow | 1 | //-----------------------------------------------------------------------------
 | 
        
           |  |  | 2 | // File: DShowTextures.h
 | 
        
           |  |  | 3 | //
 | 
        
           |  |  | 4 | // Desc: DirectShow sample code - adds support for DirectShow videos playing 
 | 
        
           |  |  | 5 | //       on a DirectX 8.0 texture surface. Turns the D3D texture tutorial into 
 | 
        
           |  |  | 6 | //       a recreation of the VideoTex sample from previous versions of DirectX.
 | 
        
           |  |  | 7 | //
 | 
        
           |  |  | 8 | // Copyright (c) Microsoft Corporation.  All rights reserved.
 | 
        
           |  |  | 9 | //-----------------------------------------------------------------------------
 | 
        
           |  |  | 10 |   | 
        
           |  |  | 11 |   | 
        
           |  |  | 12 | #include <streams.h>
 | 
        
           |  |  | 13 |   | 
        
           |  |  | 14 | //-----------------------------------------------------------------------------
 | 
        
           |  |  | 15 | // Define GUID for Texture Renderer
 | 
        
           |  |  | 16 | // {71771540-2017-11cf-AE26-0020AFD79767}
 | 
        
           |  |  | 17 | //-----------------------------------------------------------------------------
 | 
        
           |  |  | 18 | struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureRenderer;
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 | HRESULT InitDShowTextureRenderer( const char *szVideoFilename, LPDIRECT3DTEXTURE9 texture, LPDIRECT3DDEVICE9 device );
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 | //-----------------------------------------------------------------------------
 | 
        
           |  |  | 23 | // CTextureRenderer Class Declarations
 | 
        
           |  |  | 24 | //-----------------------------------------------------------------------------
 | 
        
           |  |  | 25 | class CTextureRenderer : public CBaseVideoRenderer
 | 
        
           |  |  | 26 | {
 | 
        
           |  |  | 27 | public:
 | 
        
           |  |  | 28 |     CTextureRenderer(LPUNKNOWN pUnk,HRESULT *phr);
 | 
        
           |  |  | 29 |     ~CTextureRenderer();
 | 
        
           |  |  | 30 |   | 
        
           |  |  | 31 | public:
 | 
        
           |  |  | 32 |     HRESULT CheckMediaType(const CMediaType *pmt );     // Format acceptable?
 | 
        
           |  |  | 33 |     HRESULT SetMediaType(const CMediaType *pmt );       // Video format notification
 | 
        
           |  |  | 34 |     HRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sample
 | 
        
           |  |  | 35 |   | 
        
           |  |  | 36 |     BOOL m_bUseDynamicTextures;
 | 
        
           |  |  | 37 |     LONG m_lVidWidth;   // Video width
 | 
        
           |  |  | 38 |     LONG m_lVidHeight;  // Video Height
 | 
        
           |  |  | 39 |     LONG m_lVidPitch;   // Video Pitch
 | 
        
           |  |  | 40 | };
 | 
        
           |  |  | 41 |   | 
        
           |  |  | 42 |   |