You don't need qcom proprietary mm-camera source code if you just want to read this, but if you actually want to patch something - you 100% need it.
mm-camera sets max exposure time via a loop that interates over all available resolutions. The loops looks like this (pseudocode): (file -> sensor.c)
uint64_t max;
for (i = 0; i < res_table.size; i++) {
uint64_t current_max = (uint64_t)(((float)res_table[i].line_length_pclk *
NANO_SEC_PER_SEC) / (float)(res_table[i].line_length_pclk * res_table[i].frame_length_lines * res_table[i].max_fps));
max = MIN(current_max, max);
}
max = max * sensor->aec_info.max_linecount;
return max;
Easiest way to increase max expo is just to increase aec_info.max_linecount in sensor lib.
Max ISO is calculated using this algo: (file -> sensor.c)
capatibility->max_gain = (uint32_t)(sensor->aec_info.max_gain * 100);
Just increasing aec_info.max_gain in sensor lib is enough to increase the ISO.
Black level is set using: (file -> sensor.c)
capatibility->black_level_pattern[0] =
sensor->color_level_info.r_pedestal;
capatibility->black_level_pattern[1] =
sensor->color_level_info.gr_pedestal;
capatibility->black_level_pattern[2] =
sensor->color_level_info.gb_pedestal;
capatibility->black_level_pattern[3] =
sensor->color_level_info.b_pedestal;
Meaning we just have to change those values in sensor lib.