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

Unified Diff: webrtc/api/videotrack.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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/videotrack.cc
diff --git a/webrtc/api/videotrack.cc b/webrtc/api/videotrack.cc
index bd380254b2d0e5ab7ab961152799b9ba4c33af16..c1858d8399bc05e11b3b16789456cf71be0481e3 100644
--- a/webrtc/api/videotrack.cc
+++ b/webrtc/api/videotrack.cc
@@ -31,10 +31,12 @@ std::string VideoTrack::kind() const {
return kVideoKind;
}
+// AddOrUpdateSink and RemoveSink should be called on the worker
+// thread.
void VideoTrack::AddOrUpdateSink(
rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
const rtc::VideoSinkWants& wants) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ // RTC_DCHECK(thread_checker_.CalledOnValidThread());
nisse-webrtc 2016/04/05 10:13:46 Should we have another rtc::ThreadChecker, bound t
perkj_webrtc 2016/04/05 11:02:37 yes please.
nisse-webrtc 2016/04/05 11:43:55 Done.
VideoSourceBase::AddOrUpdateSink(sink, wants);
rtc::VideoSinkWants modified_wants = wants;
modified_wants.black_frames = !enabled();
@@ -43,7 +45,7 @@ void VideoTrack::AddOrUpdateSink(
void VideoTrack::RemoveSink(
rtc::VideoSinkInterface<cricket::VideoFrame>* sink) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ // RTC_DCHECK(thread_checker_.CalledOnValidThread());
VideoSourceBase::RemoveSink(sink);
video_source_->RemoveSink(sink);
}
@@ -53,6 +55,8 @@ bool VideoTrack::set_enabled(bool enable) {
for (auto& sink_pair : sink_pairs()) {
rtc::VideoSinkWants modified_wants = sink_pair.wants;
modified_wants.black_frames = !enable;
+ // video_source_ is a proxy object, marshalling the call to the
+ // worker thread.
perkj_webrtc 2016/04/05 11:02:37 Can you verify if this is true for remote video so
nisse-webrtc 2016/04/05 11:43:55 I'm looking at the VideoRtpReceiver constructor. I
video_source_->AddOrUpdateSink(sink_pair.sink, modified_wants);
}
return MediaStreamTrack<VideoTrackInterface>::set_enabled(enable);

Powered by Google App Engine
This is Rietveld 408576698