More screenshot tweaks, send blob to remote

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-02-10 02:32:43 +00:00
parent be0ae63541
commit a2b917c163
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
3 changed files with 63 additions and 18 deletions

View file

@ -51,6 +51,7 @@
#endif
#include "../CardinalCommon.hpp"
#include "extra/Base64.hpp"
#include "DistrhoUtils.hpp"
@ -549,7 +550,13 @@ void sendScreenshotToRemote(const char* const screenshot) {
const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, REMOTE_HOST_PORT);
DISTRHO_SAFE_ASSERT_RETURN(addr != nullptr,);
lo_send(addr, "/screenshot", "s", screenshot);
std::vector<uint8_t> data(d_getChunkFromBase64String(screenshot));
if (const lo_blob blob = lo_blob_new(data.size(), data.data())) {
lo_send(addr, "/screenshot", "b", blob);
lo_blob_free(blob);
}
lo_address_free(addr);
#endif
}