diff options
-rw-r--r-- | remoting/client/client_util.cc | 35 | ||||
-rw-r--r-- | remoting/client/client_util.h | 4 | ||||
-rw-r--r-- | remoting/host/capturer_gdi.cc | 4 |
3 files changed, 8 insertions, 35 deletions
diff --git a/remoting/client/client_util.cc b/remoting/client/client_util.cc index 66906f8..a6bf1877 100644 --- a/remoting/client/client_util.cc +++ b/remoting/client/client_util.cc @@ -6,37 +6,12 @@ #include <iostream> -static void SetConsoleEcho(bool on) { -#ifdef WIN32 - HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE); - if ((hIn == INVALID_HANDLE_VALUE) || (hIn == NULL)) - return; - - DWORD mode; - if (!GetConsoleMode(hIn, &mode)) - return; - - if (on) { - mode = mode | ENABLE_ECHO_INPUT; - } else { - mode = mode & ~ENABLE_ECHO_INPUT; - } - - SetConsoleMode(hIn, mode); -#else - if (on) - system("stty echo"); - else - system("stty -echo"); -#endif -} - namespace remoting { // Get host JID from command line arguments, or stdin if not specified. bool GetLoginInfo(std::string& host_jid, std::string& username, - std::string& password) { + std::string& auth_token) { std::cout << "Host JID: "; std::cin >> host_jid; std::cin.ignore(); // Consume the leftover '\n' @@ -64,11 +39,9 @@ bool GetLoginInfo(std::string& host_jid, return 1; } - // Get password (with console echo turned off). - SetConsoleEcho(false); - std::cout << "Password: "; - getline(std::cin, password); - SetConsoleEcho(true); + // Get authenication token (with console echo turned off). + std::cout << "Auth token: "; + getline(std::cin, auth_token); std::cout << std::endl; return true; } diff --git a/remoting/client/client_util.h b/remoting/client/client_util.h index 4c2902e..ba9fefe 100644 --- a/remoting/client/client_util.h +++ b/remoting/client/client_util.h @@ -10,9 +10,9 @@ namespace remoting { // Get the login info from the console and writes into |host_jid|, |username| -// and |password|. Return true if successful. +// and |auth_token|. Return true if successful. bool GetLoginInfo(std::string& host_jid, std::string& username, - std::string& password); + std::string& auth_token); } // namespace remoting diff --git a/remoting/host/capturer_gdi.cc b/remoting/host/capturer_gdi.cc index af32f9b..35a8c43 100644 --- a/remoting/host/capturer_gdi.cc +++ b/remoting/host/capturer_gdi.cc @@ -11,7 +11,7 @@ namespace remoting { // 3780 pixels per meter is equivalent to 96 DPI, typical on desktop monitors. static const int kPixelsPerMeter = 3780; // 24 bit RGB is 3 bytes per pixel. -static const int kBytesPerPixel = 3; +static const int kBytesPerPixel = 4; CapturerGdi::CapturerGdi() : initialized_(false) { @@ -84,7 +84,7 @@ void CapturerGdi::InitializeBuffers() { int rounded_width = (width_ + 3) & (~3); // Dimensions of screen. - pixel_format_ = PixelFormatRgb24; + pixel_format_ = PixelFormatRgb32; bytes_per_pixel_ = kBytesPerPixel; bytes_per_row_ = rounded_width * bytes_per_pixel_; |