| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
#include <queue> |
|---|
| 27 |
|
|---|
| 28 |
using namespace std; |
|---|
| 29 |
#ifndef _MSC_VER |
|---|
| 30 |
# include <wtypes.h> |
|---|
| 31 |
# include <unknwn.h> |
|---|
| 32 |
# include <ole2.h> |
|---|
| 33 |
# include <limits.h> |
|---|
| 34 |
# ifdef _WINGDI_ |
|---|
| 35 |
# undef _WINGDI_ |
|---|
| 36 |
# endif |
|---|
| 37 |
# define _WINGDI_ 1 |
|---|
| 38 |
# define AM_NOVTABLE |
|---|
| 39 |
# define _OBJBASE_H_ |
|---|
| 40 |
# undef _X86_ |
|---|
| 41 |
# define _I64_MAX LONG_LONG_MAX |
|---|
| 42 |
# define LONGLONG long long |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
#endif |
|---|
| 46 |
|
|---|
| 47 |
#define _WIN32_DCOM |
|---|
| 48 |
|
|---|
| 49 |
#include <dshow.h> |
|---|
| 50 |
#include <comcat.h> |
|---|
| 51 |
#include "bdadefs.h" |
|---|
| 52 |
#include "bda.h" |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
class BDAGraph : public ISampleGrabberCB |
|---|
| 56 |
{ |
|---|
| 57 |
public: |
|---|
| 58 |
BDAGraph( access_t* p_access ); |
|---|
| 59 |
virtual ~BDAGraph(); |
|---|
| 60 |
|
|---|
| 61 |
int SubmitATSCTuneRequest(); |
|---|
| 62 |
int SubmitDVBTTuneRequest(); |
|---|
| 63 |
int SubmitDVBCTuneRequest(); |
|---|
| 64 |
int SubmitDVBSTuneRequest(); |
|---|
| 65 |
long GetBufferSize(); |
|---|
| 66 |
long ReadBuffer( long* l_buffer_len, BYTE* p_buff ); |
|---|
| 67 |
|
|---|
| 68 |
private: |
|---|
| 69 |
|
|---|
| 70 |
STDMETHODIMP_( ULONG ) AddRef( ) { return 1; } |
|---|
| 71 |
STDMETHODIMP_( ULONG ) Release( ) { return 2; } |
|---|
| 72 |
STDMETHODIMP QueryInterface( REFIID riid, void** p_p_object ) |
|---|
| 73 |
{return E_NOTIMPL; } |
|---|
| 74 |
STDMETHODIMP SampleCB( double d_time, IMediaSample* p_sample ); |
|---|
| 75 |
STDMETHODIMP BufferCB( double d_time, BYTE* p_buffer, long l_buffer_len ); |
|---|
| 76 |
|
|---|
| 77 |
access_t* p_access; |
|---|
| 78 |
CLSID guid_network_type; |
|---|
| 79 |
long l_tuner_used; |
|---|
| 80 |
|
|---|
| 81 |
DWORD d_graph_register; |
|---|
| 82 |
|
|---|
| 83 |
queue<IMediaSample*> queue_sample; |
|---|
| 84 |
queue<IMediaSample*> queue_buffer; |
|---|
| 85 |
BOOL b_ready; |
|---|
| 86 |
|
|---|
| 87 |
IMediaControl* p_media_control; |
|---|
| 88 |
IGraphBuilder* p_filter_graph; |
|---|
| 89 |
ITuningSpace* p_tuning_space; |
|---|
| 90 |
ITuneRequest* p_tune_request; |
|---|
| 91 |
|
|---|
| 92 |
ICreateDevEnum* p_system_dev_enum; |
|---|
| 93 |
IBaseFilter* p_network_provider; |
|---|
| 94 |
IScanningTuner* p_scanning_tuner; |
|---|
| 95 |
IBaseFilter* p_tuner_device; |
|---|
| 96 |
IBaseFilter* p_capture_device; |
|---|
| 97 |
IBaseFilter* p_sample_grabber; |
|---|
| 98 |
IBaseFilter* p_mpeg_demux; |
|---|
| 99 |
IBaseFilter* p_transport_info; |
|---|
| 100 |
ISampleGrabber* p_grabber; |
|---|
| 101 |
|
|---|
| 102 |
HRESULT CreateTuneRequest( ); |
|---|
| 103 |
HRESULT Build( ); |
|---|
| 104 |
HRESULT FindFilter( REFCLSID clsid, long* i_moniker_used, |
|---|
| 105 |
IBaseFilter* p_upstream, IBaseFilter** p_p_downstream ); |
|---|
| 106 |
HRESULT Connect( IBaseFilter* p_filter_upstream, |
|---|
| 107 |
IBaseFilter* p_filter_downstream ); |
|---|
| 108 |
HRESULT Start( ); |
|---|
| 109 |
HRESULT Destroy( ); |
|---|
| 110 |
HRESULT Register( ); |
|---|
| 111 |
void Deregister( ); |
|---|
| 112 |
}; |
|---|