Bug 1848242 - Mark basic.any.html subtest as intermittent. a=test-only
[gecko.git] / third_party / libwebrtc / pc / video_track_source.cc
blobd4b7f5505573551f8c123109b125915ece747ed1
1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
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 */
11 #include "pc/video_track_source.h"
13 #include "rtc_base/checks.h"
15 namespace webrtc {
17 VideoTrackSource::VideoTrackSource(bool remote)
18 : state_(kInitializing), remote_(remote) {}
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();
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);
35 void VideoTrackSource::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
36 RTC_DCHECK(worker_thread_checker_.IsCurrent());
37 source()->RemoveSink(sink);
40 } // namespace webrtc