Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: remoting/protocol/webrtc_video_stream.h

Issue 2335923002: Add WebrtcCaptureScheduler interface. (Closed)
Patch Set: include <algorithm> Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/webrtc_frame_scheduler_simple.cc ('k') | remoting/protocol/webrtc_video_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_video_stream.h
diff --git a/remoting/protocol/webrtc_video_stream.h b/remoting/protocol/webrtc_video_stream.h
index fa1022b4c649ecfe95b5211f6cf5c006f1aa8948..6e59747ee5686b7f1ac95612446b2908b671acad 100644
--- a/remoting/protocol/webrtc_video_stream.h
+++ b/remoting/protocol/webrtc_video_stream.h
@@ -14,7 +14,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
-#include "base/timer/timer.h"
#include "remoting/codec/webrtc_video_encoder.h"
#include "remoting/protocol/host_video_stats_dispatcher.h"
#include "remoting/protocol/video_stream.h"
@@ -31,8 +30,9 @@ namespace remoting {
namespace protocol {
class HostVideoStatsDispatcher;
-class WebrtcVideoCapturerAdapter;
+class WebrtcFrameScheduler;
class WebrtcTransport;
+class WebrtcVideoCapturerAdapter;
class WebrtcVideoStream : public VideoStream,
public webrtc::DesktopCapturer::Callback,
@@ -64,10 +64,7 @@ class WebrtcVideoStream : public VideoStream,
void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override;
void OnChannelClosed(ChannelDispatcherBase* channel_dispatcher) override;
- // Starts |capture_timer_|.
- void StartCaptureTimer();
-
- // Called by |capture_timer_|.
+ // Called by the |scheduler_|.
void CaptureNextFrame();
// Task running on the encoder thread to encode the |frame|.
@@ -79,7 +76,6 @@ class WebrtcVideoStream : public VideoStream,
void OnFrameEncoded(EncodedFrameWithTimestamps frame);
void SetKeyFrameRequest();
- bool ClearAndGetKeyFrameRequest();
void SetTargetBitrate(int bitrate);
// Capturer used to capture the screen.
@@ -102,23 +98,14 @@ class WebrtcVideoStream : public VideoStream,
// Timestamps for the frame that's being captured.
std::unique_ptr<FrameTimestamps> captured_frame_timestamps_;
- bool key_frame_request_ = false;
- uint32_t target_bitrate_kbps_ = 1000; // Initial bitrate.
+ std::unique_ptr<WebrtcFrameScheduler> scheduler_;
bool received_first_frame_request_ = false;
- bool capture_pending_ = false;
- bool encode_pending_ = false;
-
- // Last time capture was started.
- base::TimeTicks last_capture_started_ticks_;
-
webrtc::DesktopSize frame_size_;
webrtc::DesktopVector frame_dpi_;
Observer* observer_ = nullptr;
- base::RepeatingTimer capture_timer_;
-
base::ThreadChecker thread_checker_;
base::WeakPtrFactory<WebrtcVideoStream> weak_factory_;
« no previous file with comments | « remoting/protocol/webrtc_frame_scheduler_simple.cc ('k') | remoting/protocol/webrtc_video_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698