1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #ifndef VIDEO_VIDEO_SOURCE_SINK_CONTROLLER_H_
- #define VIDEO_VIDEO_SOURCE_SINK_CONTROLLER_H_
- #include <string>
- #include "absl/types/optional.h"
- #include "api/video/video_frame.h"
- #include "api/video/video_sink_interface.h"
- #include "api/video/video_source_interface.h"
- #include "call/adaptation/video_source_restrictions.h"
- #include "rtc_base/synchronization/sequence_checker.h"
- #include "rtc_base/system/no_unique_address.h"
- namespace webrtc {
- class VideoSourceSinkController {
- public:
- VideoSourceSinkController(rtc::VideoSinkInterface<VideoFrame>* sink,
- rtc::VideoSourceInterface<VideoFrame>* source);
- ~VideoSourceSinkController();
- void SetSource(rtc::VideoSourceInterface<VideoFrame>* source);
- bool HasSource() const;
-
-
- void PushSourceSinkSettings();
- VideoSourceRestrictions restrictions() const;
- absl::optional<size_t> pixels_per_frame_upper_limit() const;
- absl::optional<double> frame_rate_upper_limit() const;
- bool rotation_applied() const;
- int resolution_alignment() const;
-
-
- void SetRestrictions(VideoSourceRestrictions restrictions);
- void SetPixelsPerFrameUpperLimit(
- absl::optional<size_t> pixels_per_frame_upper_limit);
- void SetFrameRateUpperLimit(absl::optional<double> frame_rate_upper_limit);
- void SetRotationApplied(bool rotation_applied);
- void SetResolutionAlignment(int resolution_alignment);
- private:
- rtc::VideoSinkWants CurrentSettingsToSinkWants() const
- RTC_EXCLUSIVE_LOCKS_REQUIRED(sequence_checker_);
-
-
-
- RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_checker_;
- rtc::VideoSinkInterface<VideoFrame>* const sink_;
- rtc::VideoSourceInterface<VideoFrame>* source_
- RTC_GUARDED_BY(&sequence_checker_);
-
- VideoSourceRestrictions restrictions_ RTC_GUARDED_BY(&sequence_checker_);
-
-
-
- absl::optional<size_t> pixels_per_frame_upper_limit_
- RTC_GUARDED_BY(&sequence_checker_);
- absl::optional<double> frame_rate_upper_limit_
- RTC_GUARDED_BY(&sequence_checker_);
- bool rotation_applied_ RTC_GUARDED_BY(&sequence_checker_) = false;
- int resolution_alignment_ RTC_GUARDED_BY(&sequence_checker_) = 1;
- };
- }
- #endif
|