But IAMVfwCaptureDialogs has not ICM_GETSTATE/ICM_SETSTATE driver-
specific messages.
My code:
IAMVfwCaptureDialogs* pAMVfwCaptureDialogs = NULL;
hr = pFilter->QueryInterface(IID_IAMVfwCaptureDialogs,
(void**)&pAMVfwCaptureDialogs);
if(SUCCEEDED(hr))
{
if(SUCCEEDED(pAMVfwCaptureDialogs-
>HasDialog(VfwCaptureDialog_Source)))
{
DWORD cb = pAMVfwCaptureDialogs-
>SendDriverMessage(VfwCaptureDialog_Source,ICM_GETSTATE,NULL,0);
// SendDriverMessage returns 0 - The buffer will be empty... ???
LPBYTE pb = new BYTE[cb];
pAMVfwCaptureDialogs->ShowDialog(VfwCaptureDialog_Source, NULL);
hr = pAMVfwCaptureDialogs-
>SendDriverMessage(VfwCaptureDialog_Source,ICM_GETSTATE,(long) pb,cb);
//pb buffer is empty because the memory was not allocated.
if (pb)
delete[] pb;
}
pAMVfwCaptureDialogs->Release();
}
Maybe anybody knows how to set IAMVfwCaptureDialogs parameters without
calling Dialog Boxes?
> But IAMVfwCaptureDialogs has not
> ICM_GETSTATE/ICM_SETSTATE driver- specific messages.
Why would it? ICM messages are for ICM/VCM drivers, not VFW
capture drivers. VFW capture drivers support WM_CAP
messages:
http://msdn.microsoft.com/en-us/library/ms713480(VS.85).aspx
> Maybe anybody knows how to set IAMVfwCaptureDialogs
> parameters without calling Dialog Boxes?
You can't. VFW capture drivers can support 4 configuration
dialogs:
WM_CAP_DLG_VIDEOCOMPRESSION
WM_CAP_DLG_VIDEODISPLAY
WM_CAP_DLG_VIDEOFORMAT
WM_CAP_DLG_VIDEOSOURCE
The only one that has a corresponding direct configuration
message is WM_CAP_DLG_VIDEOFORMAT (WM_CAP_SET_VIDEOFORMAT).
In fact, among all of the interfaces supported by the VFW
Capture Filter in DirectShow
(http://msdn.microsoft.com/en-us/library/ms787894(VS.85).aspx),
you have IAMStreamConfig that corresponds to
WM_CAP_SET_VIDEOFORMAT. (Actually, you also have
IAMVideoCompression.)
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Thank you for your reply. It is sad to know, that using VFW is
imposible to make OWNER "Default video parameters" directly calling
methods, without calling "Video Source" Dialog box... DirectShow using
CROSSBARS has this posibility.
> Thank you for your reply. It is sad to know, that using
> VFW is imposible to make OWNER "Default video parameters"
> directly calling methods, without calling "Video Source"
> Dialog box... DirectShow using CROSSBARS has this
> posibility.
VFW was designed more than 15 years ago.