I've been hurting my head for some weeks , please any one give me some
help.
I want to write a desktop screen capture filter for FlashPlayer inside
browser.
I've got VCam Filter from TMH's Download page (http://tmhare.mvps.org/
downloads.htm),
in Filter.cpp CVCamStream::SetFormat(AM_MEDIA_TYPE *pmt) , comment out
the line
m_mt = *pmt
as disscused in
http://groups.google.com/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/e815d6bc4680a11e/521ef66bc15093eb?lnk=gst&q=Flash+Player#521ef66bc15093eb
then the flash player inside browser displays colored dots, means that
it works OK.
After that, I modified CVCamStream::FillBuffer method to fill in data
buffer
by bitmap of desktop screen, but it works only with 320x240 size, but
I want
to capture a specified area of desktop screen. It seemed that Flash
player
inside the browser require 320x240 output size.
I tried with some change the following parameters in
CVCamStream::GetStreamCaps
and CVCamStream::GetMediaType method, but it didn't work.
pvi->bmiHeader.biWidth = 80 * iPosition;
pvi->bmiHeader.biHeight = 60 * iPosition;
Or, is it necessary to change parameters of VIDEO_STREAM_CONFIG_CAPS
in
CVCamStream::GetStreamCaps method ???
Below is my code in FillBuffer method.
VIDEOINFOHEADER *pVih = (VIDEOINFOHEADER*)m_mt.pbFormat;
HDC hDC;
hDC = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
RECT m_rScreen;
m_rScreen.left = m_rScreen.top = 0;
// m_rScreen.right = 320;
// m_rScreen.bottom = 240;
m_rScreen.right = GetDeviceCaps(hDC, HORZRES);
m_rScreen.bottom = GetDeviceCaps(hDC, VERTRES);
HDIB hDib = CopyScreenToBitmap(&m_rScreen, pData, (BITMAPINFO *)
&(pVih->bmiHeader));
if (hDib)
DeleteObject(hDib);
DeleteDC(hDC);
BTW, it works in GraphEdit if I changed in CVCamStream::GetStreamCaps
and CVCamStream::GetMediaType method like this, then in FillBuffer
copy
to pdata my full screen bitmap:
pvi->bmiHeader.biWidth = 1024;
pvi->bmiHeader.biHeight = 768;
Can any one give me help on this issue, I'm in deep trouble.
Any help would be appreciated.
Thanks very much.
> I want to write a desktop screen capture filter for FlashPlayer inside
> browser.
FYI: Replied to in the Vista dshow forum.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution