From: Pierre Ossman Date: Thu, 20 Sep 2018 08:51:00 +0000 (+0200) Subject: Add method to get compression settings from encoder X-Git-Tag: v1.9.90~81^2~5^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ab9fd6b4d5060cd02bfad7846fa5164353f5c277;p=tigervnc.git Add method to get compression settings from encoder --- 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,