#include <rfb/UpdateTracker.h>
#include <rfb/SMsgWriter.h>
#include <rfb/LogWriter.h>
+#include <rfb/JpegEncoder.h>
using namespace rfb;
bytesSent[i] = 0;
rectsSent[i] = 0;
}
+ jpegEncoder = new JpegEncoder(this);
}
SMsgWriter::~SMsgWriter()
vlog.info(" raw bytes equivalent %d, compression ratio %f",
rawBytesEquivalent, (double)rawBytesEquivalent / bytes);
delete [] imageBuf;
+ delete jpegEncoder;
}
void SMsgWriter::writeSetColourMapEntries(int firstColour, int nColours,
return encoders[encoding]->writeRect(r, ig, actual);
}
+void SMsgWriter::writeVideoRect(PixelBuffer *pb, const Rect& r)
+{
+ jpegEncoder->writeRect(pb, r);
+}
+
void SMsgWriter::writeCopyRect(const Rect& r, int srcX, int srcY)
{
startRect(r,encodingCopyRect);
#include <rdr/types.h>
#include <rfb/encodings.h>
#include <rfb/Encoder.h>
+#include <rfb/PixelBuffer.h>
namespace rdr { class OutStream; }
class ColourMap;
class Region;
class UpdateInfo;
+ class JpegEncoder;
class WriteSetCursorCallback {
public:
virtual void writeCopyRect(const Rect& r, int srcX, int srcY);
+ virtual void writeVideoRect(PixelBuffer *pb, const Rect& r);
+
virtual void startRect(const Rect& r, unsigned int enc)=0;
virtual void endRect()=0;
rdr::OutStream* os;
Encoder* encoders[encodingMax+1];
+ JpegEncoder* jpegEncoder;
int lenBeforeRect;
unsigned int currentEncoding;
int updatesSent;
int bytesSent[encodingMax+1];
int rectsSent[encodingMax+1];
int rawBytesEquivalent;
+ // FIXME: Gather statistics for JpegEncoder as well.
rdr::U8* imageBuf;
int imageBufSize;