mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-17 07:37:51 +01:00

This cl/ implements configuring of encode resolution in the video_stream_encoder (webrtc_video_engine) in a way that is independent of frame resolution (i.e not using scale_resolution_down_by). The cl/ reuses the VideoAdapter as is, and hence the output resolution will be the same as it is today. Anticipated further patches 3) Hook up resource adaptation 4) Let VideoSource do adaption if possible Bug: webrtc:14451 Change-Id: I881b031c5b23be26cacfe138730154f1cb1b66a8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276742 Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38245}
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2022 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef API_VIDEO_RESOLUTION_H_
|
|
#define API_VIDEO_RESOLUTION_H_
|
|
|
|
#include <utility>
|
|
|
|
namespace webrtc {
|
|
|
|
// A struct representing a video resolution in pixels.
|
|
struct Resolution {
|
|
int width = 0;
|
|
int height = 0;
|
|
|
|
// Helper methods.
|
|
int PixelCount() const { return width * height; }
|
|
std::pair<int, int> ToPair() const { return std::make_pair(width, height); }
|
|
};
|
|
|
|
inline bool operator==(const Resolution& lhs, const Resolution& rhs) {
|
|
return lhs.width == rhs.width && lhs.height == rhs.height;
|
|
}
|
|
|
|
inline bool operator!=(const Resolution& lhs, const Resolution& rhs) {
|
|
return !(lhs == rhs);
|
|
}
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // API_VIDEO_RESOLUTION_H_
|