Allow disabling output format request

This commit is contained in:
Rashad Sookram 2023-07-17 16:39:10 -04:00 committed by GitHub
parent ff4a9d3e8e
commit 54a3523d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,11 @@ void VideoSource::PushVideoFrame(const webrtc::VideoFrame& frame) {
void VideoSource::OnOutputFormatRequest(int width, int height, int fps) { void VideoSource::OnOutputFormatRequest(int width, int height, int fps) {
video_adapter()->OnOutputFormatRequest(std::make_pair(width, height), width * height, fps); if (width > 0 && height > 0 && fps > 0) {
video_adapter()->OnOutputFormatRequest(std::make_pair(width, height), width * height, fps);
} else {
video_adapter()->OnOutputFormatRequest(absl::nullopt, absl::nullopt, absl::nullopt);
}
} }
MediaSourceInterface::SourceState VideoSource::state() const { MediaSourceInterface::SourceState VideoSource::state() const {