From 048805e8210c1fd04252e4363e1c1277bb4ac53f Mon Sep 17 00:00:00 2001 From: Chris Dziemborowicz Date: Thu, 1 Mar 2018 17:55:53 -0800 Subject: [PATCH] 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 Commit-Queue: Chris Dziemborowicz Cr-Commit-Position: refs/heads/master@{#22266} --- media/base/videoadapter.cc | 3 ++- media/base/videoadapter.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/media/base/videoadapter.cc b/media/base/videoadapter.cc index 553c2c320b..52619831b4 100644 --- a/media/base/videoadapter.cc +++ b/media/base/videoadapter.cc @@ -255,7 +255,8 @@ bool VideoAdapter::AdaptFrameResolution(int in_width, return true; } -void VideoAdapter::OnOutputFormatRequest(const VideoFormat& format) { +void VideoAdapter::OnOutputFormatRequest( + const rtc::Optional& format) { rtc::CritScope cs(&critical_section_); requested_format_ = format; next_frame_timestamp_ns_ = rtc::nullopt; diff --git a/media/base/videoadapter.h b/media/base/videoadapter.h index 5b3d13841b..abf6069df7 100644 --- a/media/base/videoadapter.h +++ b/media/base/videoadapter.h @@ -48,7 +48,7 @@ class VideoAdapter { // 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 // 720x1280 is requested. - void OnOutputFormatRequest(const VideoFormat& format); + void OnOutputFormatRequest(const rtc::Optional& format); // Requests the output frame size from |AdaptFrameResolution| to have as close // as possible to |target_pixel_count| pixels (if set) but no more than