@@ -48,9 +48,10 @@ VideoTrack::~VideoTrack() {
4848
4949void VideoTrack::add_sink (const std::shared_ptr<NativeVideoSink>& sink) const {
5050 webrtc::MutexLock lock (&mutex_);
51- track ()->AddOrUpdateSink (sink.get (),
52- webrtc::VideoSinkWants ()); // TODO(theomonnom): Expose
53- // VideoSinkWants to Rust?
51+ track ()->AddOrUpdateSink (
52+ sink.get (),
53+ webrtc::VideoSinkWants ()); // TODO(theomonnom): Expose
54+ // VideoSinkWants to Rust?
5455 sinks_.push_back (sink);
5556}
5657
@@ -106,12 +107,20 @@ std::shared_ptr<NativeVideoSink> new_native_video_sink(
106107
107108VideoTrackSource::InternalSource::InternalSource (
108109 const VideoResolution& resolution)
109- : webrtc::AdaptedVideoTrackSource(4 ), resolution_(resolution) {}
110+ : webrtc::AdaptedVideoTrackSource(4 ),
111+ resolution_ (resolution),
112+ is_screencast_(false ) {}
110113
111114VideoTrackSource::InternalSource::~InternalSource () {}
112115
113116bool VideoTrackSource::InternalSource::is_screencast () const {
114- return false ;
117+ webrtc::MutexLock lock (&mutex_);
118+ return is_screencast_;
119+ }
120+
121+ void VideoTrackSource::InternalSource::set_is_screencast (bool is_screencast) {
122+ webrtc::MutexLock lock (&mutex_);
123+ is_screencast_ = is_screencast;
115124}
116125
117126std::optional<bool > VideoTrackSource::InternalSource::needs_denoising () const {
@@ -189,6 +198,10 @@ bool VideoTrackSource::on_captured_frame(
189198 return source_->on_captured_frame (rtc_frame);
190199}
191200
201+ void VideoTrackSource::set_is_screencast (bool is_screencast) const {
202+ source_->set_is_screencast (is_screencast);
203+ }
204+
192205webrtc::scoped_refptr<VideoTrackSource::InternalSource> VideoTrackSource::get ()
193206 const {
194207 return source_;
0 commit comments