From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/pc/video_track_source.h | 73 +++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 third_party/libwebrtc/pc/video_track_source.h (limited to 'third_party/libwebrtc/pc/video_track_source.h') diff --git a/third_party/libwebrtc/pc/video_track_source.h b/third_party/libwebrtc/pc/video_track_source.h new file mode 100644 index 0000000000..723b10d8f3 --- /dev/null +++ b/third_party/libwebrtc/pc/video_track_source.h @@ -0,0 +1,73 @@ +/* + * Copyright 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef PC_VIDEO_TRACK_SOURCE_H_ +#define PC_VIDEO_TRACK_SOURCE_H_ + +#include "absl/types/optional.h" +#include "api/media_stream_interface.h" +#include "api/notifier.h" +#include "api/sequence_checker.h" +#include "api/video/recordable_encoded_frame.h" +#include "api/video/video_frame.h" +#include "api/video/video_sink_interface.h" +#include "api/video/video_source_interface.h" +#include "media/base/media_channel.h" +#include "rtc_base/checks.h" +#include "rtc_base/system/no_unique_address.h" +#include "rtc_base/system/rtc_export.h" +#include "rtc_base/thread_annotations.h" + +namespace webrtc { + +// VideoTrackSource is a convenience base class for implementations of +// VideoTrackSourceInterface. +class RTC_EXPORT VideoTrackSource : public Notifier { + public: + explicit VideoTrackSource(bool remote); + void SetState(SourceState new_state); + + SourceState state() const override { + RTC_DCHECK_RUN_ON(&signaling_thread_checker_); + return state_; + } + bool remote() const override { return remote_; } + + bool is_screencast() const override { return false; } + absl::optional needs_denoising() const override { + return absl::nullopt; + } + + bool GetStats(Stats* stats) override { return false; } + + void AddOrUpdateSink(rtc::VideoSinkInterface* sink, + const rtc::VideoSinkWants& wants) override; + void RemoveSink(rtc::VideoSinkInterface* sink) override; + + bool SupportsEncodedOutput() const override { return false; } + void GenerateKeyFrame() override {} + void AddEncodedSink( + rtc::VideoSinkInterface* sink) override {} + void RemoveEncodedSink( + rtc::VideoSinkInterface* sink) override {} + + protected: + virtual rtc::VideoSourceInterface* source() = 0; + + private: + RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_thread_checker_; + RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_checker_; + SourceState state_ RTC_GUARDED_BY(&signaling_thread_checker_); + const bool remote_; +}; + +} // namespace webrtc + +#endif // PC_VIDEO_TRACK_SOURCE_H_ -- cgit v1.2.3