Friday, March 23, 2007

AbsDiff() filter error

AbsDiff filter Error :

we can add the filter in two ways...

1. First we render two media files and insert the AbsDiff filter(two

input pin filter...). In this way, the filter works well...

2.Second way, we insert the filter first and then render the two media

files, it will automatically connect to the AbsDiff Filter( Two Input Pin

filter...)

In the second way, i got the error...

I am not able to identify the error where it is...

Solution :

I previously have the input and output pin's CheckMediaType() as follows..

HRESULT CheckMediaType(const CMediaType* pmt)
{
// Check this is a VIDEOINFO type

if (*pmt->FormatType() != FORMAT_VideoInfo)
{
return E_INVALIDARG;
}


VIDEOINFO* vi = (VIDEOINFO*)pmt->Format();
if(vi->bmiHeader.biBitCount != 24)
{
return E_INVALIDARG;
}

return NOERROR;
}


I changed the input and output pin's CheckMediaType as follows...


HRESULT cvSyncOutputPin::CheckMediaType(const CMediaType* pMediaType)
{
// Check this is a VIDEOINFO type

// we accept the following image type: (RGB24, ARGB32 or RGB32)
if (IsEqualGUID(*pMediaType->Type(), MEDIATYPE_Video))
{
if (IsEqualGUID(*pMediaType->Subtype(), MEDIASUBTYPE_RGB24))
{
VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER *) pMediaType->Format();
if(pvi->bmiHeader.biBitCount == 24)
{
return NOERROR;
}
}

}

return E_INVALIDARG;


}

So the Problem lies in while we check the media type,

we checked the FormatType() of the input media type...

I changed it as only checking MEDIATYPE (Type())and MEDIASUBTYPE (SubType())

of the input media type...

This is the excellent problem solving ... I didnt met before like this...

(vennai Olungaa program pannuda...)








I solved the problem of Intelligent Connect ... The problem is due to the CheckMediaType() conditions.....

I changed the CheckMediaType() fn conditions as like as TransformFilter....

Now It is working...

The problem is CheckMediaType() fn...

No comments: