| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 |
| 11 | #include "pc/video_track_source.h" |
| 12 |
| 13 | #include "rtc_base/checks.h" |
| 14 |
| 15 | namespace webrtc { |
| 16 |
| 17 | VideoTrackSource::VideoTrackSource(bool remote) |
| 18 | : state_(kInitializing), remote_(remote) {} |
| 19 |
| 20 | void VideoTrackSource::SetState(SourceState new_state) { |
| 21 | RTC_DCHECK_RUN_ON(&signaling_thread_checker_); |
| 22 | if (state_ != new_state) { |
| 23 | state_ = new_state; |
| 24 | FireOnChanged(); |
| 25 | } |
| 26 | } |
| 27 |
| 28 | void VideoTrackSource::AddOrUpdateSink( |
| 29 | rtc::VideoSinkInterface<VideoFrame>* sink, |
| 30 | const rtc::VideoSinkWants& wants) { |
| 31 | RTC_DCHECK(worker_thread_checker_.IsCurrent()); |
| 32 | source()->AddOrUpdateSink(sink, wants); |
| 33 | } |
| 34 |
| 35 | void VideoTrackSource::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) { |
| 36 | RTC_DCHECK(worker_thread_checker_.IsCurrent()); |
| 37 | source()->RemoveSink(sink); |
| 38 | } |
| 39 |
| 40 | } // namespace webrtc |
| 41 |