Wednesday, April 25, 2007

Input pin size is different from Outputpin size

1. GetMediaType() fn

we returned the size of the output pin's media type

CheckMediaType() fn is also called before setting the media type

or SetMediaType() function we have to specify the output pin's width and Height

2.DecideBufferSize() fn

allocate the output pin's allocator buffer by specifying width and height






HRESULT OutputPin :: SetMediaType(const CMediaType* pmt) fn...

{
// I doubted whether it is possible to change the output pin;'s size with this method
// The reason is it is CMediaType is constant so they may not allow us to change the media type.

// It is true , we are in need to change only the output video size ... which resides in the pointer(pbFormat) so we can change it easily

VIDEOINFOHEADER* pvi = (VIDEOINFOHEADER*) pmt->pbFormat;
pvi ->bmiHeader.biWidth = 400;
pvi->bmiHeader.biHeight = 400;
pvi->bmiHeader.biSizeImage = pvi->bmiHeader.biWidth * pvi->bmiHeader.biHeight * (pvi->bmiHeader.biBitCount / 8);
}





I completed both the steps...

Next look on Deliver () fn...

we have to copy the output image to the Output pin's media sample as follows in

InitializeOutputSamples() in CTransformFilter class

No comments: