52 #include "tuner/providers/Channels.h"
54 #include "system/thread/Thread.h"
55 using namespace br::pucrio::telemidia::ginga::core::system::thread;
63 #define NO_DSHOW_STRSAFE
102 ISampleGrabberCB :
public IUnknown {
103 virtual STDMETHODIMP SampleCB(
double SampleTime, IMediaSample *pSample ) = 0;
104 virtual STDMETHODIMP BufferCB(
double SampleTime, BYTE *pBuffer,
long BufferLen ) = 0;
111 IID IID_ISampleGrabberCB = { 0x0579154A, 0x2B53, 0x4994, { 0xB0, 0xD0, 0xE7, 0x73, 0x14, 0x8E, 0xFF, 0x85 } };
116 ISampleGrabber :
public IUnknown {
117 virtual HRESULT STDMETHODCALLTYPE SetOneShot( BOOL OneShot ) = 0;
118 virtual HRESULT STDMETHODCALLTYPE SetMediaType(
const AM_MEDIA_TYPE *pType ) = 0;
119 virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( AM_MEDIA_TYPE *pType ) = 0;
120 virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( BOOL BufferThem ) = 0;
121 virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer(
long *pBufferSize,
long *pBuffer ) = 0;
122 virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( IMediaSample **ppSample ) = 0;
123 virtual HRESULT STDMETHODCALLTYPE SetCallback( ISampleGrabberCB *pCallback,
long WhichMethodToCallback ) = 0;
130 IID IID_ISampleGrabber = { 0x6B652FFF, 0x11FE, 0x4fce, { 0x92, 0xAD, 0x02, 0x66, 0xB5, 0xD7, 0xC7, 0x8F } };
136 CLSID CLSID_SampleGrabber = { 0xC1F400A0, 0x3F08, 0x11d3, { 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 } };
142 CLSID CLSID_NullRenderer = { 0xC1F400A4, 0x3F08, 0x11d3, { 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 } };
148 CLSID CLSID_VideoEffects1Category = { 0xcc7bfb42, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
154 CLSID CLSID_VideoEffects2Category = { 0xcc7bfb43, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
160 CLSID CLSID_AudioEffects1Category = { 0xcc7bfb44, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
166 CLSID CLSID_AudioEffects2Category = { 0xcc7bfb45, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
190 #define FREQ_LOW 470143
191 #define FREQ_HIGH 806143
192 #define FREQ_BANDWIDTH 6
202 namespace telemidia {
214 HRESULT searchChannels();
215 long getSignalStrength();
218 HRESULT execute(
long freq);
219 HRESULT changeChannelTo(
long freq,
bool setDefault =
false);
220 bool getBuffer(
Buffer** buffer);
225 vector<Buffer*> bufferList;
226 pthread_mutex_t bufferMutex;
230 STDMETHODIMP_(ULONG) AddRef() {
return ++ul_cbrc; }
231 STDMETHODIMP_(ULONG) Release() {
return --ul_cbrc; }
232 STDMETHODIMP QueryInterface(REFIID ,
void** )
233 {
return E_NOTIMPL; }
234 STDMETHODIMP SampleCB(
double d_time, IMediaSample* p_sample);
235 STDMETHODIMP BufferCB(
double d_time, BYTE* p_buffer,
long l_buffer_len);
237 CLSID guid_network_type;
242 DWORD d_graph_register;
244 IMediaControl* p_media_control;
245 IGraphBuilder* p_filter_graph;
246 ITuningSpaceContainer* p_tuning_space_container;
247 ITuningSpace* p_tuning_space;
248 ITuneRequest* p_tune_request;
249 IDVBTuningSpace* p_dvb_tuning_space;
250 IDVBSTuningSpace* p_dvbs_tuning_space;
252 bool canReadNetworkName;
253 string currentNetworkName;
254 unsigned char currentVirtualChannel;
260 ICreateDevEnum* p_system_dev_enum;
261 IBaseFilter* p_network_provider;
262 IBaseFilter* p_tuner_device;
263 IBaseFilter* p_capture_device;
264 IBaseFilter* p_sample_grabber;
265 IBaseFilter* p_mpeg_demux;
266 IBaseFilter* p_transport_info;
267 IScanningTuner* p_scanning_tuner;
268 ISampleGrabber* p_grabber;
270 void readNetworkInfo(clock_t stopTime);
271 void readNI(BYTE* buf,
size_t bufLen);
272 int SubmitTuneRequest(
void);
273 unsigned EnumSystems(
void);
275 HRESULT SetUpTuner(REFCLSID guid_this_network_type);
277 HRESULT Check(REFCLSID guid_this_network_type);
278 HRESULT GetFilterName(IBaseFilter* p_filter,
char** psz_bstr_name);
279 HRESULT GetPinName(IPin* p_pin,
char** psz_bstr_name);
280 unsigned GetSystem(REFCLSID clsid);
281 HRESULT ListFilters(REFCLSID this_clsid);
282 HRESULT FindFilter(REFCLSID clsid,
long* i_moniker_used,
283 IBaseFilter* p_upstream, IBaseFilter** p_p_downstream);
284 HRESULT Connect(IBaseFilter* p_filter_upstream,
285 IBaseFilter* p_filter_downstream);
286 HRESULT SetDVBT(
long,
long);
Definition: Channels.h:65
Definition: BDAGraph.h:206
Definition: BDAGraph.h:194