Skip to content

Commit

Permalink
Myrtille 2.9.0 (stable)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrozor committed Sep 20, 2020
1 parent 43f3207 commit 4c07dea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/Windows/wf_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam)

if (context->settings->MyrtilleSessionId != NULL)
{
wf_myrtille_send_screen(wfc);
wf_myrtille_send_screen(wfc, false);
}

#pragma endregion
Expand Down
20 changes: 10 additions & 10 deletions client/Windows/wf_myrtille.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::string createRemoteSessionDirectory(wfContext* wfc);
void processResizeDisplay(wfContext* wfc, bool keepAspectRatio, std::string resolution);
void processMouseInput(wfContext* wfc, std::string input, UINT16 flags);
void sendMessage(wfContext* wfc, std::wstring msg);
void processImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int left, int top, int right, int bottom, bool fullscreen);
void processImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int left, int top, int right, int bottom, bool fullscreen, bool adaptive);
void saveImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int idx, int format, int quality, bool fullscreen);
void sendImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int idx, int posX, int posY, int width, int height, int format, int quality, IStream* stream, int size, bool fullscreen);
void sendAudio(wfContext* wfc, const BYTE* data, size_t size);
Expand Down Expand Up @@ -148,7 +148,7 @@ enum class IMAGE_QUALITY
LOW = 10,
MEDIUM = 25,
HIGH = 50, // not applicable for PNG (lossless); may be tweaked dynamically depending on image encoding and client bandwidth
HIGHER = 75, // not applicable for PNG (lossless); used for fullscreen updates
HIGHER = 75, // not applicable for PNG (lossless); used for fullscreen updates in adaptive mode
HIGHEST = 100 // default
};

Expand Down Expand Up @@ -445,7 +445,7 @@ HANDLE wf_myrtille_connect(wfContext* wfc)
return thread;
}

void wf_myrtille_send_screen(wfContext* wfc)
void wf_myrtille_send_screen(wfContext* wfc, bool adaptive)
{
if (wfc->context.settings->MyrtilleSessionId == NULL)
return;
Expand Down Expand Up @@ -485,7 +485,7 @@ void wf_myrtille_send_screen(wfContext* wfc)

// --------------------------- process it ----------------------------------------------------

processImage(wfc, bmpScreen, 0, 0, myrtille->scaleDisplay ? cw : dw, myrtille->scaleDisplay ? ch : dh, true);
processImage(wfc, bmpScreen, 0, 0, myrtille->scaleDisplay ? cw : dw, myrtille->scaleDisplay ? ch : dh, true, adaptive);

// --------------------------- cleanup -------------------------------------------------------

Expand Down Expand Up @@ -626,7 +626,7 @@ void wf_myrtille_send_region(wfContext* wfc, RECT region)

// --------------------------- process it ----------------------------------------------------

processImage(wfc, bmpRegion, region.left, region.top, region.right, region.bottom, false);
processImage(wfc, bmpRegion, region.left, region.top, region.right, region.bottom, false, false);

// --------------------------- cleanup -------------------------------------------------------

Expand Down Expand Up @@ -1414,12 +1414,12 @@ DWORD WINAPI processInputsPipe(LPVOID lpParameter)
// take screenshot
case COMMAND::TAKE_SCREENSHOT:
myrtille->screenshotEnabled = true;
wf_myrtille_send_screen(wfc);
wf_myrtille_send_screen(wfc, true);
break;

// fullscreen update
case COMMAND::REQUEST_FULLSCREEN_UPDATE:
wf_myrtille_send_screen(wfc);
wf_myrtille_send_screen(wfc, commandArgs == "adaptive");
break;

// client clipboard
Expand Down Expand Up @@ -1616,7 +1616,7 @@ void sendMessage(wfContext* wfc, std::wstring msg)
header = NULL;
}

void processImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int left, int top, int right, int bottom, bool fullscreen)
void processImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int left, int top, int right, int bottom, bool fullscreen, bool adaptive)
{
wfMyrtille* myrtille = (wfMyrtille*)wfc->myrtille;

Expand All @@ -1627,8 +1627,8 @@ void processImage(wfContext* wfc, Gdiplus::Bitmap* bmp, int left, int top, int r
STATSTG statstg;

int format;
// PNG: use highest quality (lossless); AUTO/JPEG/WEBP: use higher quality for fullscreen updates or current quality otherwise
int quality = (myrtille->imageEncoding == (int)IMAGE_ENCODING::PNG ? (int)IMAGE_QUALITY::HIGHEST : (fullscreen ? (int)IMAGE_QUALITY::HIGHER : myrtille->imageQuality));
// PNG: use highest quality (lossless); AUTO/JPEG/WEBP: use higher quality for fullscreen updates in adaptive mode or current quality otherwise
int quality = (myrtille->imageEncoding == (int)IMAGE_ENCODING::PNG ? (int)IMAGE_QUALITY::HIGHEST : (fullscreen && adaptive ? (int)IMAGE_QUALITY::HIGHER : myrtille->imageQuality));
IStream* stream = NULL;
ULONG size = 0;

Expand Down
2 changes: 1 addition & 1 deletion client/Windows/wf_myrtille.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern "C" {
void wf_myrtille_start(wfContext* wfc);
void wf_myrtille_stop(wfContext* wfc);
HANDLE wf_myrtille_connect(wfContext* wfc);
void wf_myrtille_send_screen(wfContext* wfc);
void wf_myrtille_send_screen(wfContext* wfc, bool adaptive);
void wf_myrtille_send_region(wfContext* wfc, RECT region);
void wf_myrtille_send_cursor(wfContext* wfc);
void wf_myrtille_read_client_clipboard(wfContext* wfc, const wchar_t** text, size_t* size);
Expand Down

0 comments on commit 4c07dea

Please sign in to comment.