Chromium Code Reviews

Unified Diff: webrtc/api/videotracksource.cc

Issue 1861633002: Extended proxy abstraction, to call certain methods to the worker thread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« webrtc/api/videotrack.cc ('K') | « webrtc/api/videotrack.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/videotracksource.cc
diff --git a/webrtc/api/videotracksource.cc b/webrtc/api/videotracksource.cc
index f8212d7a70cab20cfce2d4dc5349bb172b06cc4f..4c8691fa31fbea075ab0fa8a9fe25583cc5d7df9 100644
--- a/webrtc/api/videotracksource.cc
+++ b/webrtc/api/videotracksource.cc
@@ -12,8 +12,6 @@
#include <string>
-#include "webrtc/base/bind.h"
-
namespace webrtc {
VideoTrackSource::VideoTrackSource(
@@ -39,22 +37,20 @@ void VideoTrackSource::OnSourceDestroyed() {
void VideoTrackSource::AddOrUpdateSink(
rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
const rtc::VideoSinkWants& wants) {
+ RTC_CHECK(worker_thread_->IsCurrent());
nisse-webrtc 2016/04/05 10:13:46 These RTC_CHECKs are now the only use of |worker_t
perkj_webrtc 2016/04/05 11:02:37 yes please and name accordingly.
nisse-webrtc 2016/04/05 11:43:55 I'm deleting the constructor argument as well (the
if (!source_) {
return;
}
- worker_thread_->Invoke<void>(rtc::Bind(
- &rtc::VideoSourceInterface<cricket::VideoFrame>::AddOrUpdateSink, source_,
- sink, wants));
+ source_->AddOrUpdateSink(sink, wants);
}
void VideoTrackSource::RemoveSink(
rtc::VideoSinkInterface<cricket::VideoFrame>* sink) {
+ RTC_CHECK(worker_thread_->IsCurrent());
if (!source_) {
return;
}
- worker_thread_->Invoke<void>(
- rtc::Bind(&rtc::VideoSourceInterface<cricket::VideoFrame>::RemoveSink,
- source_, sink));
+ source_->RemoveSink(sink);
}
} // namespace webrtc
« webrtc/api/videotrack.cc ('K') | « webrtc/api/videotrack.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine