diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index 4106125..b1ef22f 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -129,15 +129,15 @@ static void parseRegionPart(const bool percents, rdr::U16 &pcdest, int &dest, *inptr = ptr; } -VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_) +VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_, bool a) : blHosts(&blacklist), desktop(desktop_), desktopStarted(false), - blockCounter(0), pb(0), blackedpb(0), ledState(ledUnknown), - name(strDup(name_)), pointerClient(0), clipboardClient(0), - comparer(0), cursor(new Cursor(0, 0, Point(), NULL)), + blockCounter(0), pb(nullptr), blackedpb(nullptr), ledState(ledUnknown), + name(strDup(name_)), pointerClient(nullptr), clipboardClient(nullptr), + comparer(nullptr), cursor(new Cursor(0, 0, Point(), nullptr)), renderedCursorInvalid(false), - queryConnectionHandler(0), keyRemapper(&KeyRemapper::defInstance), + queryConnectionHandler(nullptr), keyRemapper(&KeyRemapper::defInstance), lastConnectionTime(0), disableclients(false), - frameTimer(this), apimessager(NULL), trackingFrameStats(0), + frameTimer(this), apimessager(nullptr), trackingFrameStats(0), clipboardId(0), sendWatermark(false) { lastUserInputTime = lastDisconnectTime = time(0); diff --git a/common/rfb/benchmark.cxx b/common/rfb/benchmark.cxx index ce0019a..d80c2ed 100644 --- a/common/rfb/benchmark.cxx +++ b/common/rfb/benchmark.cxx @@ -94,6 +94,13 @@ void benchmark(const std::string &path) { rgb_frame->width = codec_ctx->width; rgb_frame->height = codec_ctx->height; + static const rfb::PixelFormat pf{32, 24, false, true, 0xFF, 0xFF, 0xFF, 0, 8, 16}; + const rfb::Rect rect{0, 0, rgb_frame->width, rgb_frame->height}; + + rfb::ManagedPixelBuffer pb{pf, rect.width(), rect.height()}; + + server->setPixelBuffer(&pb); + if (av_frame_get_buffer(rgb_frame, 0) != 0) throw std::runtime_error("Could not allocate frame data"); @@ -105,8 +112,8 @@ void benchmark(const std::string &path) { sws_scale(sws_ctx, frame->data, frame->linesize, 0, frame->height, rgb_frame->data, rgb_frame->linesize); - // Save as BMP - // saveFrameAsBMP(rgb_frame, ++frameNumber); + + pb.imageRect(rect, rgb_frame->data[0], rect.width()); } } }