Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 1b87d56

Browse files
6by9popcornmix
authored andcommitted
IL Camera: Add manual analog and digital gain controls.
With MMAL_PARAMETER_ANALOG_GAIN and MMAL_PARAMETER_DIGITAL_GAIN setting either numerator or denominator to 0 will retain auto operation, otherwise the tuner will adopt the specified gain where the hardware will allow. The AGC algorithm does NOT include a fixed digital gain, so a fixed digital gain with auto exposure and analog gain will typically result in over exposed images.
1 parent a797602 commit 1b87d56

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

interface/mmal/mmal_parameters_camera.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ enum {
147147
MMAL_PARAMETER_OUTPUT_SHIFT, /**< Takes a @ref MMAL_PARAMETER_INT32_T */
148148
MMAL_PARAMETER_CCM_SHIFT, /**< Takes a @ref MMAL_PARAMETER_INT32_T */
149149
MMAL_PARAMETER_CUSTOM_CCM, /**< Takes a @ref MMAL_PARAMETER_CUSTOM_CCM_T */
150+
MMAL_PARAMETER_ANALOG_GAIN, /**< Takes a @ref MMAL_PARAMETER_RATIONAL_T */
151+
MMAL_PARAMETER_DIGITAL_GAIN, /**< Takes a @ref MMAL_PARAMETER_RATIONAL_T */
150152
};
151153

152154
/** Thumbnail configuration parameter type */

interface/vmcs_host/khronos/IL/OMX_Broadcom.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,5 +2651,14 @@ typedef struct OMX_PARAM_CUSTOMCCMTYPE {
26512651
OMX_S32 nColorOffset[3]; /**< */
26522652
} OMX_PARAM_CUSTOMCCMTYPE;
26532653

2654+
typedef struct OMX_CONFIG_CAMERAGAINTYPE {
2655+
OMX_U32 nSize;
2656+
OMX_VERSIONTYPE nVersion;
2657+
OMX_U32 nPortIndex;
2658+
2659+
OMX_U32 xGain; /**< Gain to be applied, stored as Q16 format */
2660+
OMX_BOOL bAutoGain; /**< Whether gain is set automatically */
2661+
} OMX_CONFIG_CAMERAGAINTYPE;
2662+
26542663
#endif
26552664
/* File EOF */

interface/vmcs_host/khronos/IL/OMX_Index.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ typedef enum OMX_INDEXTYPE {
535535
OMX_IndexParamOutputShift, /**< reference: OMX_PARAM_S32TYPE */
536536
OMX_IndexParamCcmShift, /**< reference: OMX_PARAM_S32TYPE */
537537
OMX_IndexParamCustomCcm, /**< reference: OMX_PARAM_CUSTOMCCMTYPE */
538+
OMX_IndexConfigCameraAnalogGain, /**< reference: OMX_CONFIG_CAMERAGAINTYPE */
539+
OMX_IndexConfigCameraDigitalGain, /**< reference: OMX_CONFIG_CAMERAGAINTYPE */
538540
OMX_IndexMax = 0x7FFFFFFF
539541
} OMX_INDEXTYPE;
540542

0 commit comments

Comments
 (0)