Le Sage
18th August 2008, 11:21 AM
Hey guys ! :)
I'm trying to control the camera using DirectShow API (like changing the zoom value, the exposure value, etc...), doing something like this :
HRESULT hr = S_OK;
tagCameraControlProperty tCameraControlProperty = CameraControl_Exposure;
long lValue = 3000; // range is 0 - 3456 according to IAMCameraControl::GetRange (http://msdn.microsoft.com/en-us/library/aa930653.aspx)
long Flags = CameraControl_Flags_Manual;
CComPtr<IAMCameraControl> pCameraControl;
hr = m_pVideoCaptureFilter->QueryInterface(IID_IAMCameraControl, (void**)&pCameraControl);
// ok, it returns S_OK
hr = pCameraControl->Set(tCameraControlProperty, lValue, Flags);See MSDN for IAMCameraControl::Set function (http://msdn.microsoft.com/en-us/library/aa927822.aspx).
The HRESULT returned is E_INVALIDARG = 0x80070057, & of course there is no change on the resulting DirectShow stream.
Has anyone managed to change any possible camera parameter using DirectShow on a recent HTC Device (say Polaris (http://wiki.xda-developers.com/index.php?pagename=HTC_Polaris), Diamond (http://wiki.xda-developers.com/index.php?pagename=HTC_Diamond) or Raphael (http://wiki.xda-developers.com/index.php?pagename=HTC_Raphael))? I got the same code to work on a Samsung SGH-i780 (http://www.pdadb.net/index.php?m=specs&id=866).
For another sample of this same code, see here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2925387&SiteID=1).
I have to use DirectShow 'cause my code is supposed to be multi-platform.
I'm trying to control the camera using DirectShow API (like changing the zoom value, the exposure value, etc...), doing something like this :
HRESULT hr = S_OK;
tagCameraControlProperty tCameraControlProperty = CameraControl_Exposure;
long lValue = 3000; // range is 0 - 3456 according to IAMCameraControl::GetRange (http://msdn.microsoft.com/en-us/library/aa930653.aspx)
long Flags = CameraControl_Flags_Manual;
CComPtr<IAMCameraControl> pCameraControl;
hr = m_pVideoCaptureFilter->QueryInterface(IID_IAMCameraControl, (void**)&pCameraControl);
// ok, it returns S_OK
hr = pCameraControl->Set(tCameraControlProperty, lValue, Flags);See MSDN for IAMCameraControl::Set function (http://msdn.microsoft.com/en-us/library/aa927822.aspx).
The HRESULT returned is E_INVALIDARG = 0x80070057, & of course there is no change on the resulting DirectShow stream.
Has anyone managed to change any possible camera parameter using DirectShow on a recent HTC Device (say Polaris (http://wiki.xda-developers.com/index.php?pagename=HTC_Polaris), Diamond (http://wiki.xda-developers.com/index.php?pagename=HTC_Diamond) or Raphael (http://wiki.xda-developers.com/index.php?pagename=HTC_Raphael))? I got the same code to work on a Samsung SGH-i780 (http://www.pdadb.net/index.php?m=specs&id=866).
For another sample of this same code, see here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2925387&SiteID=1).
I have to use DirectShow 'cause my code is supposed to be multi-platform.