home *** CD-ROM | disk | FTP | other *** search
/ Beginning Direct3D Game Programming / Direct3D.iso / directx / dxf / samples / multimedia / directshow / bda / bdasample / graph.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.3 KB  |  94 lines

  1. //------------------------------------------------------------------------------
  2. // File: Graph.h
  3. //
  4. // Desc: Sample code for BDA graph building.
  5. //
  6. // Copyright (c) 2000, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9. #ifndef GRAPH_H_INCLUDED_
  10. #define GRAPH_H_INCLUDED_
  11.  
  12. #include <streams.h>
  13. #include <mmreg.h>
  14. #include <msacm.h>
  15. #include <fcntl.h>
  16. #include <io.h>
  17. #include <stdio.h>
  18. #include <ks.h>     
  19. #include <ksmedia.h>
  20. #include <bdatypes.h>
  21. #include <bdamedia.h>   
  22. #include <bdaiface.h>
  23. #include <uuids.h>      
  24. #include <tuner.h>      
  25.  
  26. #include "bdasampl.h"
  27. #include "resource.h"
  28.  
  29. class CBDAFilterGraph
  30. {
  31. private:
  32.     ITuningSpace*   m_pITuningSpace;
  33.  
  34.     ITuner*         m_pITuner;
  35.     ITuneRequest*   m_pITuneRequest;
  36.  
  37.     IGraphBuilder*  m_pFilterGraph;         // for current graph
  38.     IMediaControl*  m_pIMediaControl;       // for controlling graph state
  39.     ICreateDevEnum* m_pICreateDevEnum;      // for enumerating system devices
  40.  
  41.     IBaseFilter*    m_pNetworkProvider;     // for network provider filter
  42.     IBaseFilter*    m_pTunerDevice;         // for tuner device filter
  43.     IBaseFilter*    m_pCaptureDevice;       // for capture device filter
  44.     IBaseFilter*    m_pDemux;               // for demux filter
  45.     IBaseFilter*    m_pVideoDecoder;        // for mpeg video decoder filter
  46.     IBaseFilter*    m_pAudioDecoder;        // for mpeg audio decoder filter
  47.     IBaseFilter*    m_pTIF;                 // for transport information filter
  48.     IBaseFilter*    m_pMPE;                 // for multiple protocol encapsulator
  49.     IBaseFilter*    m_pIPSink;              // for ip sink filter
  50.     IBaseFilter*    m_pOVMixer;             // for overlay mixer filter
  51.     IBaseFilter*    m_pVRenderer;           // for video renderer filter
  52.     IBaseFilter*    m_pDDSRenderer;         // for sound renderer filter
  53.     
  54.     HRESULT InitializeGraphBuilder();
  55.     HRESULT LoadTuningSpace();
  56.     HRESULT LoadNetworkProvider();
  57.     HRESULT LoadDemux();
  58.     HRESULT RenderDemux();
  59.     HRESULT LoadFilter(REFCLSID clsid, IBaseFilter** ppFilter, IBaseFilter* pConnectFilter, BOOL fIsUpstream);
  60.     HRESULT ConnectFilters(IBaseFilter* pFilterUpstream, IBaseFilter* pFilterDownstream);
  61.     HRESULT CreateATSCTuneRequest(LONG lMajorChannel, LONG lMinorChannel);
  62.     HRESULT CreateDVBTuneRequest();
  63.  
  64. public:
  65.     LONG            m_MajorChannel;
  66.     LONG            m_MinorChannel;
  67.     BOOL            m_fGraphBuilt;
  68.     BOOL            m_fGraphRunning;
  69.     BOOL            m_fGraphFailure;
  70.     NETWORK_TYPE    m_NetworkType;
  71.  
  72.     CBDAFilterGraph();
  73.     ~CBDAFilterGraph();
  74.  
  75.     HRESULT     BuildGraph(NETWORK_TYPE NetworkType);
  76.     HRESULT     RunGraph();
  77.     HRESULT     StopGraph();
  78.     HRESULT     TearDownGraph();
  79.     HRESULT     SetVideoWindow(HWND hwndMain);
  80.     HRESULT     ChangeChannel(LONG lMajorChannel, LONG lMinorChannel);
  81.     void        Refresh(HWND hDlg);
  82.  };
  83.  
  84. #define SAFE_RELEASE(pObject) if(pObject){ (pObject)->Release(); pObject = NULL;}
  85.  
  86. #define CHANNEL_UP                  10001
  87. #define CHANNEL_DOWN                10002
  88. #define CHANNEL_LOWER_LIMIT         1
  89. #define CHANNEL_UPPER_LIMIT         126
  90. #define MINOR_CHANNEL_LOWER_LIMIT   -2
  91. #define MINOR_CHANNEL_UPPER_LIMIT   126
  92.  
  93. #endif // GRAPH_H_INCLUDED_
  94.