diff options
author | Pierre Ossman <ossman@cendio.se> | 2012-01-30 13:58:44 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2012-01-30 13:58:44 +0000 |
commit | 311a2b47cb39567953dad8170b63f3bb4eb7639e (patch) | |
tree | 1abe5ee007ec2791fda7d7fd400e82b3c5d41310 /common/rfb/TightEncoder.cxx | |
parent | 654e3f906c7e1467f4ec7af06382aa1f4662964a (diff) | |
download | tigervnc-311a2b47cb39567953dad8170b63f3bb4eb7639e.tar.gz tigervnc-311a2b47cb39567953dad8170b63f3bb4eb7639e.zip |
The Tight encoder uses the pixel buffer as a scratch pad, which doesn't
work so well with the new optimisation to feed it the raw frame buffer.
Reorganise and clean up the code to handle this, and make the raw frame
buffer pointer const so that we might avoid such bugs in the future.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4841 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/TightEncoder.cxx')
-rw-r--r-- | common/rfb/TightEncoder.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx index 9be4581e..fcd9d9b0 100644 --- a/common/rfb/TightEncoder.cxx +++ b/common/rfb/TightEncoder.cxx @@ -418,3 +418,19 @@ void TightEncoder::writeSubrect(const Rect& r, bool forceSolid) os->writeBytes(mos.data(), mos.length()); writer->endRect(); } + +void TightEncoder::encodeJpegRect(const Rect& r, rdr::OutStream *os) +{ + const rdr::U8 *buf; + int stride; + + buf = ig->getRawPixelsR(r, &stride); + + jc.clear(); + jc.compress(buf, stride * serverpf.bpp / 8, r, serverpf, + jpegQuality, jpegSubsampling); + + os->writeU8(0x09 << 4); + os->writeCompactLength(jc.length()); + os->writeBytes(jc.data(), jc.length()); +} |