Make Android min-resolution rotation-agnostic.
Min resolution shouldn't have anything to do with CVO being enabled or not, nor device rotation. BUG=webrtc:5678 R=glaznev@webrtc.org TBR=stefan@webrtc.org Review URL: https://codereview.webrtc.org/1824083002 . Cr-Commit-Position: refs/heads/master@{#12092}
This commit is contained in:
@ -354,8 +354,7 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
||||
const webrtc::VideoCodec* codec_settings,
|
||||
int32_t /* number_of_cores */,
|
||||
size_t /* max_payload_size */) {
|
||||
const int kMinWidth = 320;
|
||||
const int kMinHeight = 180;
|
||||
const int kMinDimension = 180;
|
||||
if (codec_settings == NULL) {
|
||||
ALOGE << "NULL VideoCodec instance";
|
||||
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
|
||||
@ -398,11 +397,11 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
||||
RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds.";
|
||||
scale_ = false;
|
||||
}
|
||||
quality_scaler_.SetMinResolution(kMinWidth, kMinHeight);
|
||||
quality_scaler_.SetMinResolution(kMinDimension, kMinDimension);
|
||||
quality_scaler_.ReportFramerate(codec_settings->maxFramerate);
|
||||
QualityScaler::Resolution res = quality_scaler_.GetScaledResolution();
|
||||
init_width = std::max(res.width, kMinWidth);
|
||||
init_height = std::max(res.height, kMinHeight);
|
||||
init_width = std::max(res.width, kMinDimension);
|
||||
init_height = std::max(res.height, kMinDimension);
|
||||
ALOGD << "Scaled resolution: " << init_width << " x " << init_height;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user