bdagraph.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "bda.h"
00028
00029 using namespace std;
00030 #ifndef _MSC_VER
00031 # include <wtypes.h>
00032 # include <unknwn.h>
00033 # include <ole2.h>
00034 # include <limits.h>
00035 # ifdef _WINGDI_
00036 # undef _WINGDI_
00037 # endif
00038 # define _WINGDI_ 1
00039 # define AM_NOVTABLE
00040 # define _OBJBASE_H_
00041 # undef _X86_
00042 # define _I64_MAX LONG_LONG_MAX
00043 # define LONGLONG long long
00044
00045
00046 #endif
00047
00048
00049 #define _WIN32_DCOM
00050
00051 #include <dshow.h>
00052 #include <comcat.h>
00053 #include "bdadefs.h"
00054
00055 class BDAOutput
00056 {
00057 public:
00058 BDAOutput( access_t * );
00059 ~BDAOutput();
00060
00061 void Push( block_t * );
00062 block_t *Pop();
00063 void Empty();
00064
00065 private:
00066 access_t *p_access;
00067 vlc_mutex_t lock;
00068 vlc_cond_t wait;
00069 block_t *p_first;
00070 block_t **pp_next;
00071 };
00072
00073
00074 class BDAGraph : public ISampleGrabberCB
00075 {
00076 public:
00077 BDAGraph( access_t* p_access );
00078 virtual ~BDAGraph();
00079
00080
00081 int SubmitATSCTuneRequest();
00082 int SubmitDVBTTuneRequest();
00083 int SubmitDVBCTuneRequest();
00084 int SubmitDVBSTuneRequest();
00085
00086
00087 block_t *Pop();
00088
00089 private:
00090
00091 ULONG ul_cbrc;
00092 STDMETHODIMP_( ULONG ) AddRef( ) { return ++ul_cbrc; }
00093 STDMETHODIMP_( ULONG ) Release( ) { return --ul_cbrc; }
00094 STDMETHODIMP QueryInterface( REFIID riid, void** p_p_object )
00095 { return E_NOTIMPL; }
00096 STDMETHODIMP SampleCB( double d_time, IMediaSample* p_sample );
00097 STDMETHODIMP BufferCB( double d_time, BYTE* p_buffer, long l_buffer_len );
00098
00099 access_t* p_access;
00100 CLSID guid_network_type;
00101 long l_tuner_used;
00102
00103 DWORD d_graph_register;
00104
00105 BDAOutput output;
00106
00107 IMediaControl* p_media_control;
00108 IGraphBuilder* p_filter_graph;
00109 ITuningSpace* p_tuning_space;
00110 ITuneRequest* p_tune_request;
00111
00112 ICreateDevEnum* p_system_dev_enum;
00113 IBaseFilter* p_network_provider;
00114 IScanningTuner* p_scanning_tuner;
00115 IBaseFilter* p_tuner_device;
00116 IBaseFilter* p_capture_device;
00117 IBaseFilter* p_sample_grabber;
00118 IBaseFilter* p_mpeg_demux;
00119 IBaseFilter* p_transport_info;
00120 ISampleGrabber* p_grabber;
00121
00122 HRESULT CreateTuneRequest( );
00123 HRESULT Build( );
00124 HRESULT FindFilter( REFCLSID clsid, long* i_moniker_used,
00125 IBaseFilter* p_upstream, IBaseFilter** p_p_downstream );
00126 HRESULT Connect( IBaseFilter* p_filter_upstream,
00127 IBaseFilter* p_filter_downstream );
00128 HRESULT Start( );
00129 HRESULT Destroy( );
00130 HRESULT Register( );
00131 void Deregister( );
00132 };