Help - Search - Members - Calendar
Full Version: BDASample
DVB Owners Discussion Forum - dvbowners.com > Technical & Development Forums > BDA Driver Development
jb007
Help!

With the BDASample, I keep getting a 80020005 error 'Type Mismatch' when trying to add the locator to the tune request in the following code:
//
// Add the locator to our created Tune Request
//
hr = pDVBTTuneRequest->put_Locator(pDVBTLocator); //Get 80020005 'Type Mismatch' Error here
if (FAILED( hr))
{
ErrorMessageBox(TEXT("Cannot put the locator\n"));
return hr;
}

I'm getting this under Visual Studio .net 2003 and have a Dvico Fusion with BDA drivers. This is driving me crazy. If I comment out (ignore) the error handling I get no further errors, and I can connect graphedit and get a incomplete graph.

Has anyone else got this running with VS .net ?

jb007
JoeyBloggs
Have you actually registered the TuningSpace. Last time I looked the BDASample was loading one rather than creating one on the fly...
nate
This is how it's done in DigitalWatch.
CODE
HRESULT DVBSourceBDA::InitialiseTuningSpace()
{
    HRESULT hr = S_OK;

    if FAILED(hr = m_pTuningSpace.CoCreateInstance(CLSID_DVBTuningSpace))
    {
 ErrorMessageBox("Could not create DVBTuningSpace");
 return E_FAIL;
    }

    CComQIPtr <IDVBTuningSpace2> piDVBTuningSpace(m_pTuningSpace);
    if (!piDVBTuningSpace)
    {
 m_pTuningSpace.Release();
 ErrorMessageBox("Could not QI TuningSpace");
 return E_FAIL;
    }
    if (FAILED(hr = piDVBTuningSpace->put_SystemType(DVB_Terrestrial)))
    {
 piDVBTuningSpace.Release();
 m_pTuningSpace.Release();
 ErrorMessageBox("Could not put SystemType");
 return E_FAIL;
    }
    CComBSTR bstrNetworkType = "{216C62DF-6D7F-4E9A-8571-05F14EDB766A}";
    if (FAILED(hr = piDVBTuningSpace->put_NetworkType(bstrNetworkType)))
    {
 piDVBTuningSpace.Release();
 m_pTuningSpace.Release();
 ErrorMessageBox("Could not put NetworkType");
 return E_FAIL;
    }
    piDVBTuningSpace.Release();

    return hr;
}

HRESULT DVBSourceBDA::newRequest(LONG lFrequency, LONG lBandwidth, ITuneRequest* &pExTuneRequest)
{
    HRESULT hr = S_OK;

    if (m_pTuningSpace == NULL)
    {
       ErrorMessageBox("Tuning Space is NULL");
       return E_FAIL;
    }

    //Get an interface to the TuningSpace
    CComQIPtr <IDVBTuningSpace2> piDVBTuningSpace(m_pTuningSpace);
   if (!piDVBTuningSpace)
    {
       ErrorMessageBox("Can't Query Interface for an IDVBTuningSpace2");
       return E_FAIL;
   }

    //Get new TuneRequest from tuning space
    //CComPtr <ITuneRequest> pTuneRequest;
    hr = piDVBTuningSpace->CreateTuneRequest(&pExTuneRequest);
    piDVBTuningSpace.Release();
   if (FAILED(hr))
    {
 ErrorMessageBox("Failed to create Tune Request");
 return E_FAIL;
    }

    //Get interface to the TuneRequest
    CComQIPtr <IDVBTuneRequest> piDVBTuneRequest(pExTuneRequest);
    if (!piDVBTuneRequest)
    {
 pExTuneRequest->Release();
       ErrorMessageBox("Can't Query Interface for an IDVBTuneRequest.");
       return E_FAIL;
    }

    //
    // Start
    //
    CComPtr <IDVBTLocator> pDVBTLocator;
    hr = pDVBTLocator.CoCreateInstance(CLSID_DVBTLocator);
    switch (hr)
    {
    case REGDB_E_CLASSNOTREG:
 pExTuneRequest->Release();
 piDVBTuneRequest.Release();
 ErrorMessageBox("The DVBTLocator class isn't registered in the registration database.");
 return E_FAIL;
    case CLASS_E_NOAGGREGATION:
 pExTuneRequest->Release();
 piDVBTuneRequest.Release();
 ErrorMessageBox("The DVBTLocator class can't be created as part of an aggregate.");
 return E_FAIL;
    }

    if (FAILED(hr = pDVBTLocator->put_CarrierFrequency(lFrequency)))
    {
 pDVBTLocator.Release();
 pExTuneRequest->Release();
 piDVBTuneRequest.Release();
 ErrorMessageBox("Can't set Frequency on Locator.");
 return E_FAIL;
    }
    if(FAILED(hr = pDVBTLocator->put_SymbolRate(lBandwidth)))
    {
 pDVBTLocator.Release();
 pExTuneRequest->Release();
 piDVBTuneRequest.Release();
 ErrorMessageBox("Can't set Bandwidth on Locator.");
 return E_FAIL;
    }
    //
    //End
    //

    // Bind the locator to the tune request.
    
   if(FAILED(hr = piDVBTuneRequest->put_Locator(pDVBTLocator))) {
 pDVBTLocator.Release();
 pExTuneRequest->Release();
 piDVBTuneRequest.Release();
       ErrorMessageBox("Cannot put the locator on DVB Tune Request");
       return E_FAIL;
   }

    //hr = pTuneRequest.QueryInterface(pExTuneRequest);

    pDVBTLocator.Release();
    piDVBTuneRequest.Release();

    return hr;
}


P.S. Doesn't it suck that the [ code ] tags don't keep indenting properly.
jb007
QUOTE (JoeyBloggs @ Sep 7 2004, 04:41 PM)
Have you actually registered the TuningSpace. Last time I looked the BDASample was loading one rather than creating one on the fly...

Thanks for your reply.
I think the sample is creating a new tuningspace. I'm very new to DirectShow, BDA & C++ so bear with me!

jb007
jb007
QUOTE (nate @ Sep 7 2004, 04:45 PM)
P.S. Doesn't it suck that the [ code ] tags don't keep indenting properly.

Hi nate, thanks for your code.
I cannot see any real difference between your code & the BDASample in regards to the bind of the locator to the tunerequest. I still fell it's a setting or something in the VS .net environment. I think its complaining about the pDVBTLocator being the wrong type when its passed to the pDVBTTuneRequest->put_Locator(pDVBTLocator).

Any ideas?

jb007
JoeyBloggs
You are using the modified BDASample code that uses DVBT rather than ATSC tuning ??? If the code you've got is instantiating anything ATSC then you've got the wrong codebase ~
jb007
QUOTE (JoeyBloggs @ Sep 7 2004, 05:37 PM)
You are using the modified BDASample code that uses DVBT rather than ATSC tuning ??? If the code you've got is instantiating anything ATSC then you've got the wrong codebase ~

I'm using the BDASample (BDA Sample Ver-02.zip) which I got of this forum. It has been modified to use DVB-T instead of ATSC.

Another point is the exe that was included in this zip file gives me the same error when its run and the 'Build DVD-T Graph' menu option is run ie "Cannot put the locator". So maybe it's a system problem rather than a code problem?

jb007
shinson
Dear jb007:
can you send me one copy "BDA Sample Ver-02.zip"? my mail address is shinsonyang@hotmail.com. I do not know why I can not download such file from the URL.

thanks
shinson Yang
pieer
Hi,

I am a newer to BDA driver, could anybody send the BDASample zip to pieer.xu@gmail.com?

Many thanks,
Pieer rolleyes.gif
DORSET
Hi
can anybody send me BDA Sample Ver-02.zip to johnhovell@btinternet.com
regards
Dorset
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.