Make it possible to clear the VideoFormat set on VideoAdapter by making VideoAdapter::OnOutputFormatRequest take an rtc::Optional

Bug: webrtc:8966
Change-Id: Ia58e63f074ea7d21d54e12adfcebb78778cca1ca
Reviewed-on: https://webrtc-review.googlesource.com/59300
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Chris Dziemborowicz <chrisdz@google.com>
Cr-Commit-Position: refs/heads/master@{#22266}
This commit is contained in:
Chris Dziemborowicz 2018-03-01 17:55:53 -08:00 committed by Commit Bot
parent 12196b4e20
commit 048805e821
2 changed files with 3 additions and 2 deletions

View File

@ -255,7 +255,8 @@ bool VideoAdapter::AdaptFrameResolution(int in_width,
return true; return true;
} }
void VideoAdapter::OnOutputFormatRequest(const VideoFormat& format) { void VideoAdapter::OnOutputFormatRequest(
const rtc::Optional<VideoFormat>& format) {
rtc::CritScope cs(&critical_section_); rtc::CritScope cs(&critical_section_);
requested_format_ = format; requested_format_ = format;
next_frame_timestamp_ns_ = rtc::nullopt; next_frame_timestamp_ns_ = rtc::nullopt;

View File

@ -48,7 +48,7 @@ class VideoAdapter {
// requested aspect ratio is orientation agnostic and will be adjusted to // requested aspect ratio is orientation agnostic and will be adjusted to
// maintain the input orientation, so it doesn't matter if e.g. 1280x720 or // maintain the input orientation, so it doesn't matter if e.g. 1280x720 or
// 720x1280 is requested. // 720x1280 is requested.
void OnOutputFormatRequest(const VideoFormat& format); void OnOutputFormatRequest(const rtc::Optional<VideoFormat>& format);
// Requests the output frame size from |AdaptFrameResolution| to have as close // Requests the output frame size from |AdaptFrameResolution| to have as close
// as possible to |target_pixel_count| pixels (if set) but no more than // as possible to |target_pixel_count| pixels (if set) but no more than