I am using DirectShow api to capture video from the web camera and I am setting various properties by using IAMVideoProcAmp interface (e.g. VideoProcAmp_WhiteBalance).
Is it possible to get current property value which is set in auto mode? I would like to get it and apply it for manual mode.
The problem is when I try to get value in auto mode by calling IAMVideoProcAmp::Get method, it returns the last value that I set for manual mode (not current value, as I expect).
I don't think it works the way you want. You can read back only the values you set or can set on your own. The interface/methods are not supposed to read back the value the hardware chose itself for "automatic" mode. Eventually it depends on implementation and depends on how this is handled by the driver, but if it does not return it (because it does not have to), then you're out of luck.
Related
I am trying to get programmatically the maximum display rate that Windows allows (i.e, Display settings > Advanced display settings > Refresh rate > max value). Chances are, there's no such query and I instead need to obtain all the possible options. How do I do that ?
I've already obtained the monitor names and current refresh rates using the CCD API, by obtaining DISPLAYCONFIG_PATH_INFOs and by using DisplayConfigGetDeviceInfo. But I can't seem to find a way to obtain the refresh rate options associated to a monitor. A CCD API based solution would be perfect, but an alternative is fine - it just means I'll have to reconcile the information obtained via the CCD API with that obtained from that other API, somehow.
Also, I'm trying to do this in the context of a plain Windows executable, that doesn't use a specific graphics backend library (ex DX12) or game-making framework.
Thanks !
Using the CCD API, you can use DisplayConfigGetDeviceInfo to get the GDI device name using DISPLAYCONFIG_DEVICE_INFO_TYPE::DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME , usually something like \\.\DISPLAY1, \\.\DISPLAY2, etc.
Once you have that device name, you can use the EnumDisplaySettingsW function to enumerate all DEVMODE for this device, this will give you all possible combination of modes (resolution, frequency, etc.) that the device supports (that can easily return hundreds of modes).
Once you have that you just need to group them by DEVMODE's dmDisplayFrequency field (and sort it).
I have a system with lots of custom controls via V4L2 (exposure, gain, etc).. However, I need the ability for some of these controls (like a regularly repeated initialization sequence) to reset the current values of these without executing the s_ctrl callback.
I've noticed that sending an ioctl to set a value more than once to the same value, only results in a single actual call to the s_ctrl. However, I have some interconnected parameters that change these "under the covers" so I need to update the values so that a future value will be sent.
An example:
Disable autogain
Set gain to 100
Turn on autogain
gain moves around
Turn off autogain
Set gain to 100 <-- This one never happens, because it thinks the gain is still at 100 from before.
I finally found it...
You can directly set the ->cur.val property of the v4l2_ctrl entries to do this.
Let's say there is some object I want to keep an eye on, meaning I want to know the current values of the member fields of this object while I use my app - can I do that somehow without having to set a breakpoint within some routine that has a reference to this object?
for Example, is it somehow possible breaking with the debugger in the moment the object is created, but then somehow keep an open view to this particular object within the debugger to see how variables change?
I know it's possible to set Watchpoints that will break whenever a variable changes, but that becomes very difficult to work with for variables that change very frequently - I'd rather have a live view of the objects content.
Hope the question is understandable.
Good thought. Its been a long time after the question asked.
Off course it it possible. You can use watchpoints in Xcode 5 onwards. Watchpoints will pause the program if the value is getting accessed.
You can set the watchpoints in two ways as given below.
(1) Use the following LLDB command
(lldb) w s v self->_your_variable
(2) Select the left debugging pane. select the variable you want to watch, then select on option Watch "_your_variable".
Hope this will help you.
I am accessing my Mac's iSight webcam. I would like to set it to a low exposure. Using USB Video Class I was able to query the exposure with GET_MIN and it returned 100. According to USB's documentation found here, you cannot set the value below this min. I also tried and it returns Control request failed:... error. This makes sense.
What I don't understand is how when I have autoexposure enabled, and I query the exposure value with GET_CUR, the value is 20. How can it be below the minimum? I would like to set it to a value below GET_MIN (i.e. to 20, but manually). Is there a way to do this? Is there a way to change GET_MIN?
How can I install a filter driver as lower filter driver? All samples of DDK are upper filter driver.
Is there any method except using INF file for doing this work?
I know that lower filter drivers sit under FDO and top of BDO, but if there are more that one lower filter driver, how they are ordered? Can I put my driver at a specific location of this stack?
How can I install a filter driver as lower filter driver?
Upper and lower filter drivers are installed in much the same way - you don't actually require an INF - you can just set values in the Registry.
Of course, it depends upon which type of Filter Driver you want install, but as an example, if I want to set a lower disk class filter driver, I open up Regedit and navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}
In here, you should see a string value called UpperFilters containing PartMgr. If you want to add a Lower Filter, simply create a LowerFilters value and set the name of your driver key to it. The GUID in the keyname is horrible, but if you scan through the Class key, you'll see lots of GUID-named keys - the default value of each one contains a brief description of what device the key represents.
Like PartMgr and all the other drivers, you will need to create your driver key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services with all the appropriate configuration values. If you're not sure of the values for your driver, dump the entire HKLM\SYSTEM key to a file, install your driver normally, take a second dump of the entire HKLM\SYSTEM key and diff the dumps to see what values were put where.
Can I put my driver at a specific location of this stack?
Contrary to what anyone tells you otherwise, the answer is no. People sometimes believe that when multiple drivers are listed in the UpperFilters and LowerFilters registry values, the first one in this list gets loaded first. I've even witnessed this turn into "registry wars" where drivers are constantly fighting over their position in the list. It's nonsense and you should design your driver to cope with any other driver appearing above or below you.
you can a osr.com provided utility driverloader which will load you driver either upper/lower filter driver.basically it is a gui based utility in which you will all the options requiring to load the driver.
1. you can set your driver load order.
2. you can select your driver what kind you wrote.
3. no need for inf to set the registry key's it will do it for you automatically but if you want to modify these key value you can do it manually.
4. for more information go for www.osr.com.
Enjoy :-)