Add force interlace option

pull/360/head
IanSB 2023-05-31 13:45:31 +01:00
rodzic eb620884c7
commit 2f58ada76b
3 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -561,7 +561,8 @@ typedef struct {
#define VSYNC_NONINTERLACED_DEJITTER 4
#define VSYNC_BLANKING 5
#define VSYNC_POLARITY 6
#define NUM_VSYNC 7
#define VSYNC_FORCE_INTERLACE 7
#define NUM_VSYNC 8
#define VIDEO_PROGRESSIVE 0
#define VIDEO_INTERLACED 1

Wyświetl plik

@ -33,7 +33,8 @@ static const char *vsync_names[] = {
"Non Interlaced",
"Flywheel",
"Blanking",
"Polarity"
"Polarity",
"Force Interlaced"
};
static const char *setup_names[] = {
@ -376,6 +377,10 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
capinfo->video_type = VIDEO_PROGRESSIVE;
}
if (capinfo->vsync_type == VSYNC_FORCE_INTERLACE) {
capinfo->vsync_type = VSYNC_INTERLACED;
}
capinfo->sizex2 = geometry->fb_sizex2;
switch(geometry->fb_bpp) {
case BPP_4:

Wyświetl plik

@ -1043,11 +1043,14 @@ int calibrate_sampling_clock(int profile_changed) {
// Instead, calculate the number of lines per frame
double lines_per_2_vsyncs_double = ((double) vsync_time_ns) / (((double) nlines_time_ns) / ((double) nlines));
one_line_time_ns = nlines_time_ns / nlines;
// If number of lines is odd, then we must be interlaced
interlaced = ((int)(lines_per_2_vsyncs_double + 0.5)) % 2;
if (geometry_get_value(VSYNC_TYPE) == VSYNC_FORCE_INTERLACE) {
interlaced = 1;
} else {
// If number of lines is odd, then we must be interlaced
interlaced = ((int)(lines_per_2_vsyncs_double + 0.5)) % 2;
}
one_vsync_time_ns = vsync_time_ns >> 1;
lines_per_vsync = ((int) (lines_per_2_vsyncs_double + 0.5) >> 1);
lines_per_2_vsyncs = (int) (lines_per_2_vsyncs_double + 0.5);