1 /*****************************************************************************
2 * bdagraph.h : DirectShow BDA graph builder header for vlc
3 *****************************************************************************
4 * Copyright ( C ) 2007 the VideoLAN team
6 * Author: Ken Self <kenself(at)optusnet(dot)com(dot)au>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * ( at your option ) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 /*****************************************************************************
25 *****************************************************************************/
41 # define _I64_MAX LONG_LONG_MAX
42 # define LONGLONG long long
43 /* Work-around a bug in w32api-2.5 */
44 /* # define QACONTAINERFLAGS QACONTAINERFLAGS_SOMETHINGELSE */
46 /* Needed to call CoInitializeEx */
55 /* The main class for building the filter graph */
56 class BDAGraph : public ISampleGrabberCB
59 BDAGraph( access_t* p_access );
62 int SubmitATSCTuneRequest();
63 int SubmitDVBTTuneRequest();
64 int SubmitDVBCTuneRequest();
65 int SubmitDVBSTuneRequest();
67 long ReadBuffer( long* l_buffer_len, BYTE* p_buff );
70 /* ISampleGrabberCB methods */
72 STDMETHODIMP_( ULONG ) AddRef( ) { return ++ul_cbrc; }
73 STDMETHODIMP_( ULONG ) Release( ) { return --ul_cbrc; }
74 STDMETHODIMP QueryInterface( REFIID riid, void** p_p_object )
76 STDMETHODIMP SampleCB( double d_time, IMediaSample* p_sample );
77 STDMETHODIMP BufferCB( double d_time, BYTE* p_buffer, long l_buffer_len );
80 CLSID guid_network_type;
81 long l_tuner_used; /* Index of the Tuning Device */
82 /* registration number for the RunningObjectTable */
83 DWORD d_graph_register;
85 queue<IMediaSample*> queue_sample;
86 queue<IMediaSample*> queue_buffer;
89 IMediaControl* p_media_control;
90 IGraphBuilder* p_filter_graph;
91 ITuningSpace* p_tuning_space;
92 ITuneRequest* p_tune_request;
94 ICreateDevEnum* p_system_dev_enum;
95 IBaseFilter* p_network_provider;
96 IScanningTuner* p_scanning_tuner;
97 IBaseFilter* p_tuner_device;
98 IBaseFilter* p_capture_device;
99 IBaseFilter* p_sample_grabber;
100 IBaseFilter* p_mpeg_demux;
101 IBaseFilter* p_transport_info;
102 ISampleGrabber* p_grabber;
104 HRESULT CreateTuneRequest( );
106 HRESULT FindFilter( REFCLSID clsid, long* i_moniker_used,
107 IBaseFilter* p_upstream, IBaseFilter** p_p_downstream );
108 HRESULT Connect( IBaseFilter* p_filter_upstream,
109 IBaseFilter* p_filter_downstream );