mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-12 20:27:19 +00:00
FS-11119: [core] Fix video skew on oddly resized conference layers
This commit is contained in:
parent
dc95ee3d66
commit
ca9a62c539
@ -532,18 +532,28 @@ SWITCH_DECLARE(void) switch_img_patch(switch_image_t *IMG, switch_image_t *img,
|
|||||||
SWITCH_DECLARE(void) switch_img_patch_rect(switch_image_t *IMG, int X, int Y, switch_image_t *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
|
SWITCH_DECLARE(void) switch_img_patch_rect(switch_image_t *IMG, int X, int Y, switch_image_t *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
|
||||||
{
|
{
|
||||||
#ifdef SWITCH_HAVE_VPX
|
#ifdef SWITCH_HAVE_VPX
|
||||||
switch_image_t *tmp;
|
switch_image_t *tmp = NULL;
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
|
|
||||||
if (x >= img->d_w || y >= img->d_h) return;
|
if (x >= img->d_w || y >= img->d_h) return;
|
||||||
|
|
||||||
|
if (w == img->d_w && h == img->d_h) {
|
||||||
|
switch_img_patch(IMG, img, X, Y);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(img->fmt & SWITCH_IMG_FMT_PLANAR)) {
|
if (!(img->fmt & SWITCH_IMG_FMT_PLANAR)) {
|
||||||
data = img->planes[SWITCH_PLANE_PACKED];
|
data = img->planes[SWITCH_PLANE_PACKED];
|
||||||
} else {
|
} else {
|
||||||
data = img->planes[SWITCH_PLANE_Y];
|
data = img->planes[SWITCH_PLANE_Y];
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = (switch_image_t *)vpx_img_wrap(NULL, img->fmt, img->d_w, img->d_h, 1, data);
|
if (img->d_w == img->stride[0]) {
|
||||||
|
tmp = (switch_image_t *)vpx_img_wrap(NULL, img->fmt, img->d_w, img->d_h, 1, data);
|
||||||
|
} else {
|
||||||
|
switch_img_copy(img, &tmp);
|
||||||
|
}
|
||||||
|
|
||||||
if (!tmp) return;
|
if (!tmp) return;
|
||||||
|
|
||||||
w = MIN(img->d_w - x, w);
|
w = MIN(img->d_w - x, w);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user