summaryrefslogtreecommitdiff
path: root/media/eco/ECOSession.cpp
diff options
context:
space:
mode:
authorChing Yin Derek Pang <derekpang@google.com>2019-04-28 22:54:16 -0700
committerChing Yin Derek Pang <derekpang@google.com>2019-04-29 14:27:46 -0700
commitd9116453211b4e1fd2be71f90e1147b7eaebebcb (patch)
tree5e1a56f55c595932eb48f20cef7ad44266b4aef8 /media/eco/ECOSession.cpp
parentba5b1775ae194d023f62aeb5cee68f616c938ad2 (diff)
downloadav-d9116453211b4e1fd2be71f90e1147b7eaebebcb.tar.gz
[ECO] Fixes in ECOUtils and ECOSession.
1) Fixed data types in ECOUtils. 2) Account dimension for portrait and landscape mode in ECOSession. Test: Unit test. Bug: 124805646 Change-Id: Idfd6877bc39b77968d73ee1e95a2573a1439f435
Diffstat (limited to 'media/eco/ECOSession.cpp')
-rw-r--r--media/eco/ECOSession.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/eco/ECOSession.cpp b/media/eco/ECOSession.cpp
index a6d8434..7192f11 100644
--- a/media/eco/ECOSession.cpp
+++ b/media/eco/ECOSession.cpp
@@ -55,7 +55,8 @@ sp<ECOSession> ECOSession::createECOSession(int32_t width, int32_t height, bool
// Only support up to 720P and camera recording use case.
// TODO(hkuang): Support the same resolution as in EAF. Also relax the isCameraRecording
// as encoder may not konw it is from camera for some usage cases.
- if (width > 1280 || height > 720 || width == 0 || height == 0 || isCameraRecording == false) {
+ if (width <= 0 || height <= 0 || width > 5120 || height > 5120 ||
+ width > 1280 * 720 / height || isCameraRecording == false) {
ALOGE("Failed to create ECOSession with w: %d, h: %d, isCameraRecording: %d", width, height,
isCameraRecording);
return nullptr;