PDA

View Full Version : DirectShow - control camera


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.

yrsmart
18th August 2008, 01:56 PM
will this work on a samsung i760?

Le Sage
18th August 2008, 03:39 PM
I don't really know, I guess it would need testing (I don't have this specific device to test), but I can tell it also works on the SGH-i900/Omnia/Player Addict (http://www.pdadb.net/index.php?m=specs&id=1328) from the same manufacturer (Samsung).
But all this doesn't really answer my question. :D

Le Sage
25th August 2008, 03:42 PM
So has anyone managed to use this on a recent HTC device ?

nir36
25th August 2008, 07:17 PM
I tried ASPing it but ... nothing.

Le Sage
26th August 2008, 09:19 AM
hey nir36, thanks for your answer... which I didn't understand :confused: (I'm not really a frequent reader of this forum yet, & English isn't my native langage :D )
ASPing? The only two ASP I'm aware of is Active Server Pages (from Microsoft) or Advanced Simple Profile (from MPEG4), which neither make sense to me here ! :rolleyes: Did I miss something ?

nir36
26th August 2008, 09:32 AM
hey nir36, thanks for your answer... which I didn't understand :confused: (I'm not really a frequent reader of this forum yet, & English isn't my native langage :D )
ASPing? The only two ASP I'm aware of is Active Server Pages (from Microsoft) or Advanced Simple Profile (from MPEG4), which neither make sense to me here ! :rolleyes: Did I miss something ?

ASP.NET
it's mainly used for website building but since it's so advanced you can use almost any kind of control in it. HTML or ASP built websites in Windows Mobile and in desktop Windows is exactly the same so the controls are the same as well. DirectShow's controls are contained in ASP so you can use most command lines from ASP to control whatever DirectShow application you want. the problem in your situation is that the HTC camera application is not initially meant to work with ASP so it's hard (maybe impossible) to use it to control the camera.

Since i know directshow is very flexible it would be a wonderful idea to use it to control the camera.. it will allow many many more options than the camera app currently does.

I'm not an experiened ASP programmer so i couldn't work it.. sorry.

Le Sage
4th September 2008, 01:15 PM
http://www.reant.net/smileys/shock.png
For me, ASP.NET is a server language that can generate HTML from .NET components. The code I posted is supposed to be C++, so I wonder how you could use it in ASP.
As I said, I got it to work on a Samsung SGH-i780, but I wonder if anyone got it to work on a recent HTC device.
Obviously, this question targets people which already have coded with the DirectShow API. http://www.reant.net/smileys/smile.png