Hi Marcus,

thanks a lot for the super fast reply!

More below:

On 8/19/20 8:53 AM, Marcus Meissner wrote:
> On Tue, Aug 18, 2020 at 10:58:41PM +0200, Nicole Faerber wrote:
>> Hi,
>> first of all my apologies, I am not subscribed to the dev list and
>> frankly do not intend to since my interest and question is very
>> specific.
>>
>> I just got myself a new camera, a Nikon Keymission 360, and was happy
>> to see that it is already partially supported with Gphoto2.
>>
>> But there are quite a number of properties which are not supported (or
>> reported?) yet but which I think I can identify - by looking at the
>> Android app and e.g. comparing values. For example I am pretty sure
>> that:
>>
>> Property 0xd323:(readwrite) (type=0x6) Enumeration [50,100,300,600]
>> value: 50
>>
>> is the movie loop length in 1/10 of a minute, i.e. 5, 10, 30 or 60
>> minutes, and so on. I would very much like to contribute all my
>> findings so that the output of Gphoto becomes overall more complete and
>> more useful.
>>
>> I looked at the sourcecode and have to admit to e a bit overwhelmed.
>> The only reference to the KeyMission 360 camera I found was in
>>      camlibs/ptp2/cameras/nikon-keymission360.txt
>> But I was not able to find anything that would suggest that these files
>> get parsed at any time? So I guess putting more property descriptions
>> there will likely not end up in the library?
>>
>> If someone could briefly explain to me how to add further properties
>> for an existing camera (esp. the Nikon KeyMission 360) then I will
>> gladly do and test this and then create a patch / merge request.
> 
> The cameras/* files are debug files and not used during build of the library.

Oh OK, got it.

> To get them in
> 
> - you can either add it to the code yourself and send a patch,
> - or describe the property and I can turn it into code.
> 
>   E.g. I could work with what you describe already and put it into code.
> 
>   (I am fine with doing that.)

Thank you! That's a very generous offer, especially looking at the first
patch you so quickly created.

> To add it to the code:
> 
> So unknown properties to the code:
> 
> - add #defines by name to ptp.h
> 
>   (search for PTP_DPC_NIKON_  and put them into the list, sorted by the 
> numeric value).
> 
>   You will need to invent a name, like e.g. PTP_DPC_NIKON_MovieLoopLength
> 
> 
> - Name decoding for --summary ... 
> 
>   This is done via a ptp.c mapping entry, look for the 
> ptp_device_properties_Nikon[] = 
>   table.
> 
>   This will only change the output of summary. (and the generic property 
> handling in set-config / get-config)
> 
> 
> - Hook it up as configurable in config.c
> 
>   This is for --set-config and --list-config availability. 
> 
>   There are various decoder tables in config.c, this seems a capture setting, 
> so look for
> 
>   nikon_generic_capture_settings
> 
>   and add a line with "movielooplength" 
> 
>                                                                               
>         v the name you used in ptp.h                                    v 
> this is 6 for the data type
>           { N_("Movie Loop Length"),                  "movielooplength",      
>        PTP_DPC_NIKON_MovieLoopLength,            PTP_VENDOR_NIKON,   
> PTP_DTC_UINT32,  _get_INT,            _put_INT },
> 
>   This will just reflect this as number directly. For correct decoding it 
> needs an own function ... 
>   You can use either an existing one, or write a new one.
> 
> I wrote some code by your description and put it into libgphoto2 GIT and also 
> attached the patch here.

Wow!
I mean I don't want to complain, but this seems like a *lot* of effort
'just' for adding a property. Maybe some day this could be moved into a
more generic form that does not require code for each new property, more
like a table with 'property ID, name, type, value range, ...' or so?

Anyway, it is what it is right now and I am so grateful that Gphoto
exists, allows me to do what I need to do with the camera, is free
software which can be extended when needed and your effort and great
help! Now I can grind into it and see if I can come up with a patch on
my own or if I indeed load this off to you :-) I'd rather like to do it
on my own and saving you the effort but let's see. At least I know the
path now, you explained it very clearly and it's my turn now :)

Thanks again, very much appreciated!

> Ciao, Marcus
Cheeers
  nicole

-- 
Sapere aude!


_______________________________________________
Gphoto-devel mailing list
Gphoto-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gphoto-devel

Reply via email to