| Index: webrtc/api/videotracksource.cc
|
| diff --git a/webrtc/api/videotracksource.cc b/webrtc/api/videotracksource.cc
|
| index f8212d7a70cab20cfce2d4dc5349bb172b06cc4f..17d32fbc71031890e360b2a970b500a89711e069 100644
|
| --- a/webrtc/api/videotracksource.cc
|
| +++ b/webrtc/api/videotracksource.cc
|
| @@ -12,18 +12,14 @@
|
|
|
| #include <string>
|
|
|
| -#include "webrtc/base/bind.h"
|
| -
|
| namespace webrtc {
|
|
|
| VideoTrackSource::VideoTrackSource(
|
| rtc::VideoSourceInterface<cricket::VideoFrame>* source,
|
| - rtc::Thread* worker_thread,
|
| bool remote)
|
| - : source_(source),
|
| - worker_thread_(worker_thread),
|
| - state_(kInitializing),
|
| - remote_(remote) {}
|
| + : source_(source), state_(kInitializing), remote_(remote) {
|
| + worker_thread_checker_.DetachFromThread();
|
| +}
|
|
|
| void VideoTrackSource::SetState(SourceState new_state) {
|
| if (state_ != new_state) {
|
| @@ -39,22 +35,20 @@ void VideoTrackSource::OnSourceDestroyed() {
|
| void VideoTrackSource::AddOrUpdateSink(
|
| rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
|
| const rtc::VideoSinkWants& wants) {
|
| + RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| 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_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| if (!source_) {
|
| return;
|
| }
|
| - worker_thread_->Invoke<void>(
|
| - rtc::Bind(&rtc::VideoSourceInterface<cricket::VideoFrame>::RemoveSink,
|
| - source_, sink));
|
| + source_->RemoveSink(sink);
|
| }
|
|
|
| } // namespace webrtc
|
|
|