S.No | Tasks completed |
|
1 | sample application for loading JPEG,BMP images using Windows SDK | VC++ |
2 | Source Filter for displaying numbers on the screen… | completed |
3 | Source filter for displaying the image file Source | completed |
30 –March-2007….
Problems faced …
Directshow Source Filter development :
While developing the filter I got The error as the
I developed the source filter for displaying numbers on the screen...
The code related to this ...
But I faced the following problem...
---------------------------
GraphEdit
---------------------------
Sorry, the Filter Graph cannot render this pin.
Class not registered (Return code: 0x80040154)
---------------------------
OK
---------------------------
HRESULT CMySourceStream::GetMediaType(CMediaType* pMediaType)
{
try
{
HRESULT hr = S_OK;
CheckPointer(pMediaType,E_POINTER);
OutputDebugString("n CMySourceStream::GetMediaType() fn");
ZeroMemory(pMediaType,sizeof(CMediaType));
VIDEOINFO *pvi = (VIDEOINFO*)pMediaType->AllocFormatBuffer(sizeof(VIDEOINFO));
pvi->bmiHeader.biCompression = BI_RGB;
pvi->bmiHeader.biBitCount = 24;
pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pvi->bmiHeader.biWidth = 300;
pvi->bmiHeader.biHeight = 300;
pvi->bmiHeader.biPlanes = 1;
pvi->bmiHeader.biSizeImage = pvi->bmiHeader.biWidth * pvi->bmiHeader.biHeight * (pvi->bmiHeader.biBitCount/8);
pvi->bmiHeader.biClrImportant = 0;
SetRectEmpty(&(pvi->rcSource));
SetRectEmpty(&(pvi->rcTarget));
pMediaType->SetType(&MEDIATYPE_Video);
pMediaType->SetFormatType(&FORMAT_VideoInfo);
pMediaType->SetTemporalCompression(FALSE);
//pMediaType->SetSubtype(&MEDIASUBTYPE_Vi)
const GUID SubTypeGUID = GetBitmapSubtype(&pvi->bmiHeader);
pMediaType->SetSubtype(&SubTypeGUID);
pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage);
m_bmpInfo.bmiHeader = pvi->bmiHeader;
return hr;
}
catch(...)
{
OutputDebugString("n Errror in CMySourceStream::GetMediaType() fn");
return E_FAIL;
}
}
Solution :
--------------
1.I added the checkMediaType() fn as follows...
CheckMediaType() is an important Function for any filter....
without it, the filter will not work...
HRESULT CMySourceStream::CheckMediaType(const CMediaType *pMediaType)
{
CheckPointer(pMediaType,E_POINTER);
try
{
OutputDebugString("n CheckMediaType fn...");
if((*(pMediaType->Type()) != MEDIATYPE_Video) || // we only output video
!(pMediaType->IsFixedSize())) // in fixed size samples
{
return E_INVALIDARG;
}
// Check for the subtypes we support
const GUID *SubType = pMediaType->Subtype();
if (SubType == NULL)
return E_INVALIDARG;
if(*SubType != MEDIASUBTYPE_RGB24)
{
return E_INVALIDARG;
}
// Get the format area of the media type
VIDEOINFO *pvi = (VIDEOINFO *) pMediaType->Format();
if(pvi == NULL)
return E_INVALIDARG;
if(pvi->bmiHeader.biBitCount==24)
return NOERROR;
else
return E_INVALIDARG;
}
catch(...)
{
OutputDebugString("n Exception in CheckMediaType() fn...");
return E_INVALIDARG;
}
}
S.No | Tasks To be Done Next |
|
1 | Identify the time taken for filter's processing per frame… |
|
2 | look at WMINTF |
|
3 | Prepare Class diagram and Architecture Diagram for Ur Directshow filters | |
4 | Prepare DFD for ur directshow filters |
|
5 | Prepare Documentation |
|
6 | Directshow source filter for screen capturing |
|
7 | Add File Dialog to Directshow Image File source filter |
|
8 | Add histogram and property dialog to the filter |
|
1 | Sample application for displaying numbers on the screen | D:samplesSDKBitmapTest |
2 | Sample application for source filter | SnakeSource filter on Desktop… |
3 | Directshow source filter | D:samplesSourceFilter |
S.No | Puzzle |
|
|
|
|
1 | There are 3 glasses. The biggest one can hold 24 ounces. The medium one can hold 11 ounces and the smallest one can hold 5 ounces. Now you have 24 ounces of soft drink in the largest glass. Can you use just these 3 glasses to make the largest glass contain 12 ounces of soft drink by pouring soft drink from one glass to another? |
|
|
|
|
|
|
|
|
|
|
| Ans | 24ounce | 11 ounce | 5 ounce | |
| 24ounce is filled | 24 | 0 | 0 | Initial State |
|
| 13 | 11 | 0 | From 24 ounce, Fill the 11 ounce |
|
| 18 | 6 | 0 |
|
|
| 18 | 1 | 5 |
|
|
| 23 | 1 | 0 |
|
|
| 23 | 0 | 1 |
|
|
| 12 | 11 | 1 | Target state |
0 Comments:
Post a Comment
<< Home