camera_get_supported_videoencoder_parameter_values()

Updated: April 19, 2023

Retrieve the supported values of a video encoder parameter

Synopsis:

#include <camera/camera_encoder.h>
camera_error_t camera_get_supported_videoencoder_parameter_values(camera_handle_t handle,
                                                                  int parameter,
                                                                  int numasked,
                                                                  int *numsupported,
                                                                  int *values,
                                                                  bool *maxmin)

Arguments:

handle
The handle returned by a call to the camera_open() function.
parameter
The parameter that you want to query supported values for. The enumerated type that you select your parameter from must correspond with the currently configured video codec. For example, if you are using the H.264/AVC video codec, you can query parameters from the camera_h264avc_parameters_t enumerated type.
numasked
The requested number of values to return in the values array. You can specify 0 for this argument to determine the number of supported values.
numsupported
A pointer to an int value that is updated with the number of supported video encoder parameters.
values
A pointer to an int array that is updated with the values supported for the queried parameter. Ensure that you allocate an array with numasked elements. If the maxmin flag returns true, then the first and second values returned in this array are the maximum and minimum supported values for the parameter.
maxmin
A pointer to a bool value that will be set to true if the values returned describe a maximum and a minimum value, or to false if the values describe the discrete parameter values supported.

Library:

libcamapi

Description:

Use this function to determine whether a specific video encoder parameter is supported and if so, the acceptable values for that parameter.

Ensure that the values argument points to an array which has at least numasked elements allocated. To determine an appropriate size for this array, you can invoke this function in presizing mode by setting the numasked argument to 0 or the values argument to NULL. The function then returns, in the numsupported argument, the maximum array size required. You can then allocate an array of this size and invoke the function again with numasked set to that previous numsupported value.

The values that you retrieve using this function can be written to the given parameter using the camera_set_videoencoder_parameter() function.

Returns:

CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed. CAMERA_EOPNOTSUPP is returned when a given parameter is not supported for one of the following reasons:
  • The current value of another parameter has made parameter invalid.
  • The queried parameter is not supported by the platform. It is important to recognize that if you change the value of one parameter, a parameter that previously was not supported may now become supported, or vice-versa.