Hello,
Antoine and I are trying to modify the videoDC1394.cpp file in order to be able to control camera "feature" like gain/shutter etc. the code is a bit complex and we failed to understand how to correctly implement all set / get and enum property.
So, Iohannes : have you planed to implement this very soon? ;-) if not, could you explain us a bit how should we proceed? more specifically, how dc1394 and pix_video communicate? how does gem::properties works?
thanks a lot Cyrille
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 04/13/2011 11:21 AM, cyrille henry wrote:
Hello,
Antoine and I are trying to modify the videoDC1394.cpp file in order to be able to control camera "feature" like gain/shutter etc. the code is a bit complex and we failed to understand how to correctly implement all set / get and enum property.
darn, i thought i made it easy. gem::properties is using some hacks to get untyped values into C++, which might seem a bit confusing.
So, Iohannes : have you planed to implement this very soon? ;-)
what is very soon? i hope to have time for these kind of things right after easter (though not before).
if not, could you explain us a bit how should we proceed?
use gem::properties :-)
more specifically, how dc1394 and pix_video communicate?
[pix_video] calls a number methods in video, which then delegates them to videoDC1394 (well, this is a rather generic answer).
how does gem::properties works?
gem::properties is a dictionary that maps keys (std::string) to values (gem::any). it is what the user can define using the "setProps <key> <value>" method.
videoDC1394 should provide a list of available 'readable' and 'writable' properties through the enumProperties() method; if a property is both readable and writeable, it should be reported twice; enumProperties() should return not only a list of keys, but a full dictionary (for both read and write access), in order to allow the patch figure out which values are expected. at some point i planned to make it return hints on valid values (e.g. numeric range (1.5..10; -63..64), or list of valid strings ('PAL', 'NTSC', 'SECAM'), but practically it's only a type hint. if a property expects a number, set the value to something numeric (e.g. the default value if known; the maximum value; 0), if the property expects a string, set the value to a string (preferrably the default value)
the user then sets the property-dictionary to their needs.
the entire dictionary is passed to videoDC1394 through the setProperties() method (and through the openDevice() method, in case some properties need to be set before opening). the backend then ignores all the properties it doesn't know about (in theory, all those it has not listed in thee "writable" section when calling enumProperties()), and applies those it does know about.
if transport needs to be restarted, the backend should restart the transport through restartTransport()
hope this helps.
dfgmasdr IOhannes