FS-11364 Fix tile flicker when layout has 'overlap' and 'zoom' options

Usually tiles recalculated when new image comes in, however when 'overlap' option is in effect - tiles recalculated multiple times.
And when layout also has 'zoom' option - when image recalculated it each round zooms itself deeper and deeper, until new images comes and image resets to proper state.
This looks like flicker.

The fix is to always take for zoom calculations real image dimensions instead of previously recalculated.

HOWEVER!
There are too many math and corner cases in mod_conference, so i propose it to be reviewed by widest audience of people who wrote mod_conference!
This commit is contained in:
Sergey Khripchenko 2018-08-29 05:46:56 -07:00 committed by Mike Jerris
parent 25682d619c
commit e7c5e2480a
1 changed files with 5 additions and 5 deletions

View File

@ -723,7 +723,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
crop_y = c_y;
}
set_bounds(&crop_x, &crop_y, img->d_w, img->d_h, crop_w, crop_h);
set_bounds(&crop_x, &crop_y, img->w, img->h, crop_w, crop_h);
//printf("ZOOM %d,%d %d,%d %dx%d\n", crop_x, crop_y, c_x, c_y, zoom_w, zoom_h);
}
@ -745,7 +745,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
crop_x = use_geometry->x;
}
} else if (screen_aspect < img_aspect) {
crop_x = img->d_w / 4;
crop_x = img->w / 4;
}
if (can_pan) {
@ -755,7 +755,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
crop_y = use_geometry->y;
}
} else if (screen_aspect > img_aspect) {
crop_y = img->d_h / 4;
crop_y = img->h / 4;
}
crop_x = switch_round_to_step(crop_x, layer->cam_opts.snap_factor);
@ -763,7 +763,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
}
//printf("BOUNDS B4 %d,%d %dx%d %dx%d\n", crop_x, crop_y, img->d_w, img->d_h, crop_w, crop_h);
set_bounds(&crop_x, &crop_y, img->d_w, img->d_h, crop_w, crop_h);
set_bounds(&crop_x, &crop_y, img->w, img->h, crop_w, crop_h);
//printf("BOUNDS AF %d,%d %dx%d %dx%d\n", crop_x, crop_y, img->d_w, img->d_h, crop_w, crop_h);
if (img_changed) {
@ -789,7 +789,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
layer->crop_h = layer->crop_w / screen_aspect;
if (layer->crop_h > img->d_h) layer->crop_h = img->d_h;
set_bounds(&layer->crop_x, &layer->crop_y, img->d_w, img->d_h, layer->crop_w, layer->crop_h);
set_bounds(&layer->crop_x, &layer->crop_y, img->w, img->h, layer->crop_w, layer->crop_h);
assert(layer->crop_w > 0);