DirectShowHelper.h

Go to the documentation of this file.
00001 
00034 #pragma once
00035 
00036 #pragma warning(push)     // disable for this header only
00037 #pragma warning(disable:4312)
00038 // DirectShow
00039 #include <streams.h>
00040 #pragma warning(pop)      // restore original warning level
00041 
00042 #include <vector>
00043 #include <string>
00044 
00045 typedef std::vector<std::string> FILTER_NAME_LIST ;
00046 
00047 class CDirectShowHelper
00048 {
00049 public:
00050         CDirectShowHelper();
00051 
00052         // Find an unconnected pin on a filter
00053         // This too is stolen from the DX9 SDK
00054         static HRESULT GetUnconnectedPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, IPin **ppPin);
00055 
00056 
00057         // Connect two filters together with the filter graph manager
00058         // Stolen from the DX9 SDK
00059         // This is the base version
00060         static HRESULT ConnectFilters(IGraphBuilder *pGraph, IPin *pOut, IBaseFilter *pDest);
00061 
00062         // Connect two filters together with the filter graph manager
00063         // Again, stolen from the DX9 SDK
00064         // This is an overloaded version
00065         static HRESULT ConnectFilters(IGraphBuilder *pGraph, IBaseFilter *pSrc, IBaseFilter *pDest);
00066 
00067         //Helper function to retrieve filters of a certain type
00068         static HRESULT GetFilterByCategory(IBaseFilter** gottaFilter, LPCWSTR matchName, GUID Category);
00069         
00070         static HRESULT GetFilterByCategory(IBaseFilter** gottaFilter, std::string sMatchName, GUID Category);
00071 
00072         // This code was also brazenly stolen from the DX9 SDK
00073         // Pass it a file name in wszPath, and it will save the filter graph to that file.
00074         static HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath);
00075 
00076         // A very useful bit of code 
00077         // Stolen from the DX9 SDK
00078         static HRESULT AddFilterByCLSID(IGraphBuilder *pGraph, const GUID& clsid, LPCWSTR wszName, IBaseFilter **ppF);
00079         //static HRESULT AddFilterByCLSID(IGraphBuilder *pGraph, const GUID& clsid, std::string sName, IBaseFilter **ppF);
00080 
00081         static HRESULT AddFilterByCategoryAndName(IGraphBuilder *pGraph, const GUID& category, LPCWSTR wszName, IBaseFilter **ppF);
00082         static HRESULT AddFilterByCategoryAndName(IGraphBuilder *pGraph, const GUID& category, std::string sName, IBaseFilter **ppF);
00083 
00084         // Show the property pages for a filter
00085         // This is stolen from the DX9 SDK
00086         HRESULT ShowFilterPropertyPages(IBaseFilter *pFilter);
00087 
00088         static HRESULT GetFilterNamesByCategory(GUID Category, FILTER_NAME_LIST& vList);
00089         static HRESULT GetVideoInputs(FILTER_NAME_LIST& vList);
00090         static HRESULT GetAudioInputs(FILTER_NAME_LIST& vList);
00091 
00092         static HRESULT GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, IPin **ppPin);
00093 };

Generated on Fri Mar 13 14:12:38 2009 for RTVC by  doxygen 1.5.3