Skip to content

Commit

Permalink
#389 download as plain "RGB" so we save a little bit of memory bandwi…
Browse files Browse the repository at this point in the history
…dth and storage space

git-svn-id: https://xpra.org/svn/Xpra/trunk@15730 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 27, 2017
1 parent bcadfd4 commit 94b9ef0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/xpra/codecs/nvfbc/fbc_capture.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ cdef class NvFBC_Capture:
self.framebuffer = NULL
memset(&params, 0, sizeof(NVFBC_TOSYS_SETUP_PARAMS))
params.dwVersion = NVFBC_TOSYS_SETUP_PARAMS_VER
params.eMode = NVFBC_TOSYS_ARGB
params.eMode = NVFBC_TOSYS_RGB
params.bWithHWCursor = True
params.bDiffMap = False
params.ppBuffer = <void**> &self.framebuffer
Expand Down Expand Up @@ -502,10 +502,12 @@ cdef class NvFBC_Capture:
start = monotonic_time()
#TODO: only copy when the next frame is going to overwrite the buffer,
#or when closing the context
buf = self.framebuffer[:grab_info.dwHeight*grab_info.dwBufferWidth*4]
image = ImageWrapper(0, 0, int(grab_info.dwWidth), int(grab_info.dwHeight), buf, "BGRX", 32, int(grab_info.dwBufferWidth*4))
rgb_format = "RGB"
Bpp = len(rgb_format) # ie: "BGR" -> 3
buf = self.framebuffer[:grab_info.dwHeight*grab_info.dwBufferWidth*Bpp]
image = ImageWrapper(0, 0, int(grab_info.dwWidth), int(grab_info.dwHeight), buf, rgb_format, Bpp*8, int(grab_info.dwBufferWidth*Bpp), Bpp)
end = monotonic_time()
log("image=%s (copy took %ims)", image, int((end-start)*1000))
log("image=%s buffer len=%i, (copy took %ims)", image, len(buf), int((end-start)*1000))
return image

def clean(self): #@DuplicatedSignature
Expand Down

0 comments on commit 94b9ef0

Please sign in to comment.