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

Unified Diff: webrtc/media/base/fakevideocapturer.h

Issue 1711763003: New flag is_screencast in VideoOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix use-after-free of FakeVideoSendStream. Created 4 years, 10 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
Index: webrtc/media/base/fakevideocapturer.h
diff --git a/webrtc/media/base/fakevideocapturer.h b/webrtc/media/base/fakevideocapturer.h
index a5baf8ef3fde3dd47d536837317276f3b7c33d50..df7efce9f301279d16f6a31a48b917d80e3ce978 100644
--- a/webrtc/media/base/fakevideocapturer.h
+++ b/webrtc/media/base/fakevideocapturer.h
@@ -28,11 +28,11 @@ namespace cricket {
// Fake video capturer that allows the test to manually pump in frames.
class FakeVideoCapturer : public cricket::VideoCapturer {
public:
- FakeVideoCapturer()
+ FakeVideoCapturer(bool is_screencast)
: running_(false),
initial_unix_timestamp_(time(NULL) * rtc::kNumNanosecsPerSec),
next_timestamp_(rtc::kNumNanosecsPerMillisec),
- is_screencast_(false),
+ is_screencast_(is_screencast),
rotation_(webrtc::kVideoRotation_0) {
#ifdef HAVE_WEBRTC_VIDEO
set_frame_factory(new cricket::WebRtcVideoFrameFactory());
@@ -51,6 +51,9 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
cricket::VideoFormat::FpsToInterval(60), cricket::FOURCC_I420));
ResetSupportedFormats(formats);
}
+ FakeVideoCapturer()
+ : FakeVideoCapturer(false) {}
+
~FakeVideoCapturer() {
SignalDestroyed(this);
}
@@ -135,9 +138,6 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
SetCaptureState(cricket::CS_STOPPED);
}
virtual bool IsRunning() { return running_; }
- void SetScreencast(bool is_screencast) {
- is_screencast_ = is_screencast;
- }
virtual bool IsScreencast() const { return is_screencast_; }
bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) {
fourccs->push_back(cricket::FOURCC_I420);
@@ -155,7 +155,7 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
bool running_;
int64_t initial_unix_timestamp_;
int64_t next_timestamp_;
- bool is_screencast_;
+ const bool is_screencast_;
webrtc::VideoRotation rotation_;
};

Powered by Google App Engine
This is Rietveld 408576698