I am currently developping an application with DirectShow using BDA driver. I succeed to mount the graph, create a tune request and get a channel program displayed on my screen. But now i would like to know how to have an exhaustive channel scan.
So is there anyone who develops or can explain how can I scan all channel available on the frequency MAP from my country??
I heard about IScanningTuner and AutoProgram but i dont undersand how does it work ...
I have tried with the TIF filter and getservices :
CODE
HRESULT GetChannel()
{
IGuideData *pGuideData = NULL;
HRESULT theHr;
if(!m_pTIF)
{
theHr = mBDAGraph->FindFilterByName(L"BDA MPEG2 Transport Information Filter", &m_pTIF);
if(theHr != S_OK)
{
return theHr;
}
}
theHr = m_pTIF->QueryInterface(__uuidof(IGuideData),(void **)&pGuideData);
if(theHr!=S_OK)
{
return theHr;
}
IEnumTuneRequests *pEnumTuneRequests = NULL;
if (SUCCEEDED(theHr))
{
theHr = pGuideData->GetServices(&pEnumTuneRequests);
ITuneRequest* theTR;
unsigned long theNbReturn;
while (SUCCEEDED(pEnumTuneRequests->Next(1, &theTR, &theNbReturn)))
{
if (theNbReturn == 0)
break;
IEnumGuideDataProperties* theEnumProp;
pGuideData->GetServiceProperties(theTR, &theEnumProp);
IGuideDataProperty* theProp;
while (SUCCEEDED(theEnumProp->Next(1, &theProp, &theNbReturn)))
{
if (theNbReturn == 0)
break;
BSTR theSTR;
VARIANT varValue;
VariantInit(&varValue);
long lLang;
BSTR szValue;
theHr = theProp->get_Name(&theSTR);
theHr = theProp->get_Value(&varValue);
szValue = varValue.bstrVal;
switch (varValue.vt)
{
case VT_BSTR: { szValue = varValue.bstrVal; break; }
case VT_I4:
{
lLang = varValue.lVal;
break;
}
default: { break; }
}
theProp->Release();
}
theEnumProp->Release();
theTR->Release();
}
pEnumTuneRequests->Release();
}
else
{
return theHr;
}
return S_OK;
}
{
IGuideData *pGuideData = NULL;
HRESULT theHr;
if(!m_pTIF)
{
theHr = mBDAGraph->FindFilterByName(L"BDA MPEG2 Transport Information Filter", &m_pTIF);
if(theHr != S_OK)
{
return theHr;
}
}
theHr = m_pTIF->QueryInterface(__uuidof(IGuideData),(void **)&pGuideData);
if(theHr!=S_OK)
{
return theHr;
}
IEnumTuneRequests *pEnumTuneRequests = NULL;
if (SUCCEEDED(theHr))
{
theHr = pGuideData->GetServices(&pEnumTuneRequests);
ITuneRequest* theTR;
unsigned long theNbReturn;
while (SUCCEEDED(pEnumTuneRequests->Next(1, &theTR, &theNbReturn)))
{
if (theNbReturn == 0)
break;
IEnumGuideDataProperties* theEnumProp;
pGuideData->GetServiceProperties(theTR, &theEnumProp);
IGuideDataProperty* theProp;
while (SUCCEEDED(theEnumProp->Next(1, &theProp, &theNbReturn)))
{
if (theNbReturn == 0)
break;
BSTR theSTR;
VARIANT varValue;
VariantInit(&varValue);
long lLang;
BSTR szValue;
theHr = theProp->get_Name(&theSTR);
theHr = theProp->get_Value(&varValue);
szValue = varValue.bstrVal;
switch (varValue.vt)
{
case VT_BSTR: { szValue = varValue.bstrVal; break; }
case VT_I4:
{
lLang = varValue.lVal;
break;
}
default: { break; }
}
theProp->Release();
}
theEnumProp->Release();
theTR->Release();
}
pEnumTuneRequests->Release();
}
else
{
return theHr;
}
return S_OK;
}
but this one do not give all channel for every frequency.
Thx a lot !!
