kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Fix OSD issues at half resoloution
rodzic
ec9b89862b
commit
65d3cc3dc2
|
@ -141,7 +141,7 @@ static void cpld_calibrate(capture_info_t *capinfo, int elk) {
|
||||||
metric = diff_N_frames(capinfo, NUM_CAL_FRAMES, 0, elk);
|
metric = diff_N_frames(capinfo, NUM_CAL_FRAMES, 0, elk);
|
||||||
log_info("INFO: value = %d: metric = ", metric);
|
log_info("INFO: value = %d: metric = ", metric);
|
||||||
sum_metrics[value] = metric;
|
sum_metrics[value] = metric;
|
||||||
osd_sp(config, 1, metric);
|
osd_sp(config, 3, metric);
|
||||||
if (metric < min_metric) {
|
if (metric < min_metric) {
|
||||||
min_metric = metric;
|
min_metric = metric;
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ static void cpld_calibrate(capture_info_t *capinfo, int elk) {
|
||||||
// Perform a final test of errors
|
// Perform a final test of errors
|
||||||
log_info("Performing final test");
|
log_info("Performing final test");
|
||||||
errors = diff_N_frames(capinfo, NUM_CAL_FRAMES, 0, elk);
|
errors = diff_N_frames(capinfo, NUM_CAL_FRAMES, 0, elk);
|
||||||
osd_sp(config, 1, errors);
|
osd_sp(config, 3, errors);
|
||||||
log_sp(config);
|
log_sp(config);
|
||||||
log_info("Calibration complete, errors = %d", errors);
|
log_info("Calibration complete, errors = %d", errors);
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,7 +270,7 @@ static void cpld_calibrate(capture_info_t *capinfo, int elk) {
|
||||||
}
|
}
|
||||||
printf("%8d\r\n", metric);
|
printf("%8d\r\n", metric);
|
||||||
sum_metrics[value] = metric;
|
sum_metrics[value] = metric;
|
||||||
osd_sp(config, 1, metric);
|
osd_sp(config, 3, metric);
|
||||||
if (metric < min_metric) {
|
if (metric < min_metric) {
|
||||||
min_metric = metric;
|
min_metric = metric;
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,7 @@ static void cpld_calibrate(capture_info_t *capinfo, int elk) {
|
||||||
}
|
}
|
||||||
write_config(config);
|
write_config(config);
|
||||||
*errors = diff_N_frames(capinfo, NUM_CAL_FRAMES, mode7, elk);
|
*errors = diff_N_frames(capinfo, NUM_CAL_FRAMES, mode7, elk);
|
||||||
osd_sp(config, 1, *errors);
|
osd_sp(config, 3, *errors);
|
||||||
log_sp(config);
|
log_sp(config);
|
||||||
log_info("Optimization complete, errors = %d", *errors);
|
log_info("Optimization complete, errors = %d", *errors);
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ static void cpld_calibrate(capture_info_t *capinfo, int elk) {
|
||||||
// Perform a final test of errors
|
// Perform a final test of errors
|
||||||
log_info("Performing final test");
|
log_info("Performing final test");
|
||||||
*errors = diff_N_frames(capinfo, NUM_CAL_FRAMES, mode7, elk);
|
*errors = diff_N_frames(capinfo, NUM_CAL_FRAMES, mode7, elk);
|
||||||
osd_sp(config, 1, *errors);
|
osd_sp(config, 3, *errors);
|
||||||
log_sp(config);
|
log_sp(config);
|
||||||
log_info("Calibration complete, errors = %d", *errors);
|
log_info("Calibration complete, errors = %d", *errors);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,12 +59,14 @@ static void update_param_range() {
|
||||||
// Set the range of the V_HEIGHT param based on FB_HEIGHT
|
// Set the range of the V_HEIGHT param based on FB_HEIGHT
|
||||||
max = geometry->fb_height;
|
max = geometry->fb_height;
|
||||||
if (max > DUPLICATE_HEIGHT) {
|
if (max > DUPLICATE_HEIGHT) {
|
||||||
max /= 2;
|
max >>= 1;
|
||||||
}
|
}
|
||||||
params[V_HEIGHT].max = max;
|
params[V_HEIGHT].max = max;
|
||||||
if (geometry->v_height > max) {
|
if (geometry->v_height > max) {
|
||||||
geometry->v_height = max;
|
geometry->v_height = max;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void geometry_init(int version) {
|
void geometry_init(int version) {
|
||||||
|
|
14
src/osd.c
14
src/osd.c
|
@ -917,6 +917,12 @@ void osd_set(int line, int attr, char *text) {
|
||||||
if (len > LINELEN) {
|
if (len > LINELEN) {
|
||||||
len = LINELEN;
|
len = LINELEN;
|
||||||
}
|
}
|
||||||
|
int bufferCharWidth = geometry_get_value(FB_WIDTH) / 12; // SAA5050 character data is 12x20
|
||||||
|
bufferCharWidth = (attr & ATTR_DOUBLE_SIZE) ? (bufferCharWidth >> 1) : bufferCharWidth;
|
||||||
|
if (len > bufferCharWidth) {
|
||||||
|
len = bufferCharWidth;
|
||||||
|
}
|
||||||
|
|
||||||
strncpy(buffer + line * LINELEN, text, len);
|
strncpy(buffer + line * LINELEN, text, len);
|
||||||
osd_update((uint32_t *)capinfo->fb, capinfo->pitch);
|
osd_update((uint32_t *)capinfo->fb, capinfo->pitch);
|
||||||
}
|
}
|
||||||
|
@ -953,7 +959,7 @@ int osd_key(int key) {
|
||||||
redraw_menu();
|
redraw_menu();
|
||||||
} else if (key == key_clock_cal) {
|
} else if (key == key_clock_cal) {
|
||||||
// Clock Calibration
|
// Clock Calibration
|
||||||
osd_set(0, ATTR_DOUBLE_SIZE, "HDMI Calibration");
|
osd_set(2, ATTR_DOUBLE_SIZE, "HDMI Calibration");
|
||||||
// Record the starting value of vsync
|
// Record the starting value of vsync
|
||||||
last_vsync = get_vsync();
|
last_vsync = get_vsync();
|
||||||
// Enable vsync
|
// Enable vsync
|
||||||
|
@ -968,7 +974,7 @@ int osd_key(int key) {
|
||||||
osd_state = CLOCK_CAL0;
|
osd_state = CLOCK_CAL0;
|
||||||
} else if (key == key_auto_cal) {
|
} else if (key == key_auto_cal) {
|
||||||
// Auto Calibration
|
// Auto Calibration
|
||||||
osd_set(0, ATTR_DOUBLE_SIZE, "Auto Calibration");
|
osd_set(2, ATTR_DOUBLE_SIZE, "Auto Calibration");
|
||||||
action_calibrate_auto();
|
action_calibrate_auto();
|
||||||
// Fire OSD_EXPIRED in 50 frames time
|
// Fire OSD_EXPIRED in 50 frames time
|
||||||
ret = 50;
|
ret = 50;
|
||||||
|
@ -982,11 +988,11 @@ int osd_key(int key) {
|
||||||
ret = 50;
|
ret = 50;
|
||||||
if (is_genlocked()) {
|
if (is_genlocked()) {
|
||||||
// move on when locked
|
// move on when locked
|
||||||
osd_set(0, ATTR_DOUBLE_SIZE, "Genlock Succeeded");
|
osd_set(2, ATTR_DOUBLE_SIZE, "Genlock Succeeded");
|
||||||
osd_state = CLOCK_CAL1;
|
osd_state = CLOCK_CAL1;
|
||||||
} else if (cal_count == 10) {
|
} else if (cal_count == 10) {
|
||||||
// give up after 10 seconds
|
// give up after 10 seconds
|
||||||
osd_set(0, ATTR_DOUBLE_SIZE, "Genlock Failed");
|
osd_set(2, ATTR_DOUBLE_SIZE, "Genlock Failed");
|
||||||
osd_state = CLOCK_CAL1;
|
osd_state = CLOCK_CAL1;
|
||||||
// restore the original HDMI clock
|
// restore the original HDMI clock
|
||||||
set_vlockmode(HDMI_ORIGINAL);
|
set_vlockmode(HDMI_ORIGINAL);
|
||||||
|
|
Ładowanie…
Reference in New Issue