[client/obs] improve frambuffer_read functions to support copy pitch

Fixes #244
This commit is contained in:
Geoffrey McRae
2020-04-14 13:27:07 +10:00
parent ead09ed110
commit f6691a90c0
6 changed files with 68 additions and 36 deletions

View File

@@ -169,8 +169,16 @@ static void lgVideoTick(void * data, float seconds)
uint8_t *texData;
uint32_t linesize;
gs_texture_map(this->texture, &texData, &linesize);
if (linesize == frame->pitch)
framebuffer_read(fb, texData, frame->height * frame->pitch);
framebuffer_read(
fb,
texData, // dst
linesize, // dstpitch
frame->height, // height
frame->width, // width
4, // bpp
frame->pitch // linepitch
);
gs_texture_unmap(this->texture);
// gs_texture_set_image(this->texture, frameData, frame->pitch, false);
@@ -229,4 +237,4 @@ struct obs_source_info lg_source =
.get_width = lgGetWidth,
.get_height = lgGetHeight,
// .icon_type = OBS_ICON_TYPE_DESKTOP_CAPTURE
};
};