mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client/obs] improve frambuffer_read functions to support copy pitch
Fixes #244
This commit is contained in:
14
obs/lg.c
14
obs/lg.c
@@ -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
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user