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

Unified Diff: remoting/protocol/video_frame_pump.h

Issue 1472873005: Add VideoStream interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_video_pump
Patch Set: Created 5 years, 1 month 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/protocol_mock_objects.cc ('k') | remoting/protocol/video_frame_pump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/video_frame_pump.h
diff --git a/remoting/protocol/video_frame_pump.h b/remoting/protocol/video_frame_pump.h
index 1974ec61b2e30ee0fafec471c99a7e2a7b95ade6..b2af08c8bb08d5950e93cabe87e8d91deb3f9ea3 100644
--- a/remoting/protocol/video_frame_pump.h
+++ b/remoting/protocol/video_frame_pump.h
@@ -6,7 +6,6 @@
#define REMOTING_PROTOCOL_VIDEO_FRAME_PUMP_H_
#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/threading/thread_checker.h"
@@ -15,6 +14,7 @@
#include "remoting/codec/video_encoder.h"
#include "remoting/proto/video.pb.h"
#include "remoting/protocol/capture_scheduler.h"
+#include "remoting/protocol/video_stream.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace base {
@@ -63,7 +63,8 @@ class VideoStub;
// of the capture, encode and network processes. However, it also needs to
// rate-limit captures to avoid overloading the host system, either by consuming
// too much CPU, or hogging the host's graphics subsystem.
-class VideoFramePump : public webrtc::DesktopCapturer::Callback {
+class VideoFramePump : public VideoStream,
+ public webrtc::DesktopCapturer::Callback {
public:
// Enables timestamps for generated frames. Used for testing.
static void EnableTimestampsForTests();
@@ -78,17 +79,12 @@ class VideoFramePump : public webrtc::DesktopCapturer::Callback {
protocol::VideoStub* video_stub);
~VideoFramePump() override;
- // Pauses or resumes scheduling of frame captures. Pausing/resuming captures
- // only affects capture scheduling and does not stop/start the capturer.
- void Pause(bool pause);
-
- // Called whenever input event is received.
- void OnInputEventReceived(int64_t event_timestamp);
-
- // Sets whether the video encoder should be requested to encode losslessly,
- // or to use a lossless color space (typically requiring higher bandwidth).
- void SetLosslessEncode(bool want_lossless);
- void SetLosslessColor(bool want_lossless);
+ // VideoStream interface.
+ void Pause(bool pause) override;
+ void OnInputEventReceived(int64_t event_timestamp) override;
+ void SetLosslessEncode(bool want_lossless) override;
+ void SetLosslessColor(bool want_lossless) override;
+ void SetSizeCallback(const SizeCallback& size_callback) override;
protocol::VideoFeedbackStub* video_feedback_stub() {
return &capture_scheduler_;
@@ -166,6 +162,9 @@ class VideoFramePump : public webrtc::DesktopCapturer::Callback {
// Interface through which video frames are passed to the client.
protocol::VideoStub* video_stub_;
+ SizeCallback size_callback_;
+ webrtc::DesktopSize frame_size_;
+
// Timer used to ensure that we send empty keep-alive frames to the client
// even when the video stream is paused or encoder is busy.
base::Timer keep_alive_timer_;
« no previous file with comments | « remoting/protocol/protocol_mock_objects.cc ('k') | remoting/protocol/video_frame_pump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698