mirror of
				https://github.com/kunkundi/crossdesk.git
				synced 2025-10-26 20:25:34 +08:00 
			
		
		
		
	Start capturing screen when connection established
This commit is contained in:
		| @@ -225,11 +225,10 @@ int MainWindow::Run() { | |||||||
|                 } |                 } | ||||||
|               }); |               }); | ||||||
|  |  | ||||||
|           if (0 == screen_capturer_init_ret) { |           if (0 != screen_capturer_init_ret) { | ||||||
|             screen_capturer_->Start(); |  | ||||||
|           } else { |  | ||||||
|             screen_capturer_->Destroy(); |             screen_capturer_->Destroy(); | ||||||
|             screen_capturer_ = nullptr; |             screen_capturer_ = nullptr; | ||||||
|  |             LOG_ERROR("Create screen capturer failed"); | ||||||
|           } |           } | ||||||
|  |  | ||||||
|           // Mouse control |           // Mouse control | ||||||
|   | |||||||
| @@ -153,12 +153,14 @@ void MainWindow::OnConnectionStatusCb(ConnectionStatus status, | |||||||
|   } else if (ConnectionStatus::Connected == status) { |   } else if (ConnectionStatus::Connected == status) { | ||||||
|     main_window->connection_status_str_ = "Connected"; |     main_window->connection_status_str_ = "Connected"; | ||||||
|     main_window->connection_established_ = true; |     main_window->connection_established_ = true; | ||||||
|  |     main_window->screen_capturer_->Start(); | ||||||
|   } else if (ConnectionStatus::Disconnected == status) { |   } else if (ConnectionStatus::Disconnected == status) { | ||||||
|     main_window->connection_status_str_ = "Disconnected"; |     main_window->connection_status_str_ = "Disconnected"; | ||||||
|   } else if (ConnectionStatus::Failed == status) { |   } else if (ConnectionStatus::Failed == status) { | ||||||
|     main_window->connection_status_str_ = "Failed"; |     main_window->connection_status_str_ = "Failed"; | ||||||
|   } else if (ConnectionStatus::Closed == status) { |   } else if (ConnectionStatus::Closed == status) { | ||||||
|     main_window->connection_status_str_ = "Closed"; |     main_window->connection_status_str_ = "Closed"; | ||||||
|  |     main_window->screen_capturer_->Stop(); | ||||||
|   } else if (ConnectionStatus::IncorrectPassword == status) { |   } else if (ConnectionStatus::IncorrectPassword == status) { | ||||||
|     main_window->connection_status_str_ = "Incorrect password"; |     main_window->connection_status_str_ = "Incorrect password"; | ||||||
|     if (main_window->connect_button_pressed_) { |     if (main_window->connect_button_pressed_) { | ||||||
|   | |||||||
| @@ -133,12 +133,12 @@ int ScreenCapturerX11::Start() { | |||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | int ScreenCapturerX11::Stop() { return 0; } | ||||||
|  |  | ||||||
| int ScreenCapturerX11::Pause() { return 0; } | int ScreenCapturerX11::Pause() { return 0; } | ||||||
|  |  | ||||||
| int ScreenCapturerX11::Resume() { return 0; } | int ScreenCapturerX11::Resume() { return 0; } | ||||||
|  |  | ||||||
| int ScreenCapturerX11::Stop() { return 0; } |  | ||||||
|  |  | ||||||
| void ScreenCapturerX11::OnFrame() {} | void ScreenCapturerX11::OnFrame() {} | ||||||
|  |  | ||||||
| void ScreenCapturerX11::CleanUp() {} | void ScreenCapturerX11::CleanUp() {} | ||||||
|   | |||||||
| @@ -32,9 +32,10 @@ class ScreenCapturerX11 : public ScreenCapturer { | |||||||
|  |  | ||||||
|   virtual int Start(); |   virtual int Start(); | ||||||
|  |  | ||||||
|  |   virtual int Stop(); | ||||||
|  |  | ||||||
|   int Pause(); |   int Pause(); | ||||||
|   int Resume(); |   int Resume(); | ||||||
|   int Stop(); |  | ||||||
|  |  | ||||||
|   void OnFrame(); |   void OnFrame(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -134,12 +134,12 @@ int ScreenCapturerAvf::Start() { | |||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | int ScreenCapturerAvf::Stop() { return 0; } | ||||||
|  |  | ||||||
| int ScreenCapturerAvf::Pause() { return 0; } | int ScreenCapturerAvf::Pause() { return 0; } | ||||||
|  |  | ||||||
| int ScreenCapturerAvf::Resume() { return 0; } | int ScreenCapturerAvf::Resume() { return 0; } | ||||||
|  |  | ||||||
| int ScreenCapturerAvf::Stop() { return 0; } |  | ||||||
|  |  | ||||||
| void ScreenCapturerAvf::OnFrame() {} | void ScreenCapturerAvf::OnFrame() {} | ||||||
|  |  | ||||||
| void ScreenCapturerAvf::CleanUp() {} | void ScreenCapturerAvf::CleanUp() {} | ||||||
|   | |||||||
| @@ -38,9 +38,10 @@ class ScreenCapturerAvf : public ScreenCapturer { | |||||||
|  |  | ||||||
|   virtual int Start(); |   virtual int Start(); | ||||||
|  |  | ||||||
|  |   virtual int Stop(); | ||||||
|  |  | ||||||
|   int Pause(); |   int Pause(); | ||||||
|   int Resume(); |   int Resume(); | ||||||
|   int Stop(); |  | ||||||
|  |  | ||||||
|   void OnFrame(); |   void OnFrame(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -28,6 +28,8 @@ class ScreenCapturer { | |||||||
|   virtual int Destroy() = 0; |   virtual int Destroy() = 0; | ||||||
|  |  | ||||||
|   virtual int Start() = 0; |   virtual int Start() = 0; | ||||||
|  |  | ||||||
|  |   virtual int Stop() = 0; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
| @@ -27,7 +27,7 @@ class ScreenCapturerWgc : public ScreenCapturer, | |||||||
|  |  | ||||||
|   int Pause(); |   int Pause(); | ||||||
|   int Resume(); |   int Resume(); | ||||||
|   int Stop(); |   virtual int Stop(); | ||||||
|  |  | ||||||
|   void OnFrame(const WgcSession::wgc_session_frame &frame); |   void OnFrame(const WgcSession::wgc_session_frame &frame); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user