Device Properties and Live View Properties

CrDeviceProperty class and CrLiveViewProperty class store similar property values. The contents and the differences are explained in this section.

The CrDeviceProperty class has the following member variables shown below:

  • code : Identify the content of the property.

  • enable Flag : Capability of the operation. Modifiable / Get Only / Invalid / Set Only

  • current Value : Current property value. This value is defined as a 64bit variable. If the property has a limited number of options, it has a list of the selectable options.

  • value Size : Number of the selectable options.

  • values : List of the selectable options.

The property code is defined in enum CrDevicePropertyCode in CrDeviceProperty.h. For example, CrDeviceProperty_FNumber is defined as 0x0100. The value type is CrDataType_UInt16. The current value is defined as a 64bit variable, but in this case only the highest 16bit is valid.

Example:

switch (property->code) {
case CrDeviceProperty_FNumber:
        CrInt16u currentvalue = static_cast<CrInt16u>(property->GetCurrentValue());

If the enable flag is modifiable, the property can be acquired and can be set. To change the property value, refer to the SetDeviceProperty() function described in the next section. If the enable flag is Get Only, the property can be acquired and be referred to by GetDeviceProperties(), but cannot be changed.

Invalid means the property is invalid. This property must not be referred to or set. Set Only is also a very special case, as you see there is no “SetLiveViewProperty()” function. The properties you get via GetLiveViewProperties() are properties closely related to the live view feature, but in order to change the property you can use the SetDeviceProperty() function.

Depending on the camera status, this flag value changes. In case of CrDeviceProperty_FNumber, if the exposure mode of the camera is “M” or “A”, this flag is modifiable, and in case of “P” or “S”, this flag is Get Only.

If the property has selectable options, it has the list and the count of the list. Please note that the size is “Byte Size”, not the count of the elements. Therefore, dividing by the size of the value type, the count of the elements can be calculated.

See the following reference pages to understand the property code and the type definitions.

Example:

switch (property->code) {
      case CrDeviceProperty_FNumber:
              CrInt16u currentvalue = static_cast<CrInt16u>(property->GetCurrentValue());
              CrInt32u countofelement = property->GetValueSize() / sizeof(CrInt16u);
              CrInt16u *poptions = static_cast<CrInt16u*>property->GetValues();
              if (countofelement) {
                      CrInt16u *elements = new CrInt16u[countofelement];
                      for (CrInt32u n = 0; n < countofelement; n++) {
                              elements[n] = *poptions++;

The CrLiveViewProperty class has similar members but there is “value size” to specify the memory size of current value, and there is no “selectable option” and its size field.

  • code : Identify the content of the property.

  • value Type : Specify the frame data type of value.

  • enable Flag : Capability of the operation. Get Only

  • value Size : Memory size in Bytes of Current property value.

  • value : Current property value. This value is a memory block. This value size is larger than CrDeviceProperty, because CrLiveViewProperty has the properties that represent coordination, regions or in some cases include the style. The definitions of the data type are described in the header file of “CrDeviceProperty.h” and the following reference section.

Because this CrLiveViewProperty class tells the information of the focus area, live view display magnification region, or custom white balance region, the API to get the properties from the camera is separated from GetDeviceProperties().

But note that to change those properties, the SetDeviceProperty() command must be used.

Example:

switch (property->code) {
case CrLiveViewProperty_AF_Area_Position:
        CrFocusFrameInfo *pinfo = static_cast<CrFocusFrameInfo *>(property->value);