diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-09-20 10:51:00 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-09-20 12:08:46 +0200 |
commit | ab9fd6b4d5060cd02bfad7846fa5164353f5c277 (patch) | |
tree | db802ea84dcacc34aa11d8fb32fd7d968664f2b3 | |
parent | 4694d88cb56497f74b7d0f67a3f0e7b731ce659d (diff) | |
download | tigervnc-ab9fd6b4d5060cd02bfad7846fa5164353f5c277.tar.gz tigervnc-ab9fd6b4d5060cd02bfad7846fa5164353f5c277.zip |
Add method to get compression settings from encoder
-rw-r--r-- | common/rfb/Encoder.h | 3 | ||||
-rw-r--r-- | common/rfb/TightJPEGEncoder.cxx | 5 | ||||
-rw-r--r-- | common/rfb/TightJPEGEncoder.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/common/rfb/Encoder.h b/common/rfb/Encoder.h index 1e57fda5..e135ec0e 100644 --- a/common/rfb/Encoder.h +++ b/common/rfb/Encoder.h @@ -54,6 +54,9 @@ namespace rfb { virtual void setQualityLevel(int level) {}; virtual void setFineQualityLevel(int quality, int subsampling) {}; + virtual int getCompressLevel() { return -1; }; + virtual int getQualityLevel() { return -1; }; + // writeRect() is the main interface that encodes the given rectangle // with data from the PixelBuffer onto the SConnection given at // encoder creation. diff --git a/common/rfb/TightJPEGEncoder.cxx b/common/rfb/TightJPEGEncoder.cxx index 5d39b62c..bbe4f8fa 100644 --- a/common/rfb/TightJPEGEncoder.cxx +++ b/common/rfb/TightJPEGEncoder.cxx @@ -101,6 +101,11 @@ void TightJPEGEncoder::setFineQualityLevel(int quality, int subsampling) fineSubsampling = subsampling; } +int TightJPEGEncoder::getQualityLevel() +{ + return qualityLevel; +} + void TightJPEGEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) { const rdr::U8* buffer; diff --git a/common/rfb/TightJPEGEncoder.h b/common/rfb/TightJPEGEncoder.h index 458c3831..3d8fa8c1 100644 --- a/common/rfb/TightJPEGEncoder.h +++ b/common/rfb/TightJPEGEncoder.h @@ -35,6 +35,8 @@ namespace rfb { virtual void setQualityLevel(int level); virtual void setFineQualityLevel(int quality, int subsampling); + virtual int getQualityLevel(); + virtual void writeRect(const PixelBuffer* pb, const Palette& palette); virtual void writeSolidRect(int width, int height, const PixelFormat& pf, |