diff options
author | Chong Zhang <chz@google.com> | 2013-05-30 21:51:38 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2013-05-30 21:59:05 -0700 |
commit | 1ad3eb9441eb509c792c61aa0181b0e74dbe9984 (patch) | |
tree | 4c9d638d9522efc8fcbc0dd28bad71482e02ef58 /media/libstagefright/wifi-display/VideoFormats.cpp | |
parent | fbb70ce416b193655fbe5ff7f6c8676050bdf524 (diff) | |
download | frameworks_av-1ad3eb9441eb509c792c61aa0181b0e74dbe9984.zip frameworks_av-1ad3eb9441eb509c792c61aa0181b0e74dbe9984.tar.gz frameworks_av-1ad3eb9441eb509c792c61aa0181b0e74dbe9984.tar.bz2 |
wifi-display: fix resolution list and keepalive interval
- add all resolutions lower than 1280x720p30
- schedule next keepalive when sending M16
bug 9116665
Change-Id: I7b3fea2101d3d882c0af5c153af5c502b8ce98f6
Diffstat (limited to 'media/libstagefright/wifi-display/VideoFormats.cpp')
-rw-r--r-- | media/libstagefright/wifi-display/VideoFormats.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/media/libstagefright/wifi-display/VideoFormats.cpp b/media/libstagefright/wifi-display/VideoFormats.cpp index c368c38..04e02c1 100644 --- a/media/libstagefright/wifi-display/VideoFormats.cpp +++ b/media/libstagefright/wifi-display/VideoFormats.cpp @@ -178,6 +178,29 @@ void VideoFormats::enableAll() { } } +void VideoFormats::enableResolutionUpto( + ResolutionType type, size_t index, + ProfileType profile, LevelType level) { + size_t width, height, fps, score; + bool interlaced; + if (!GetConfiguration(type, index, &width, &height, + &fps, &interlaced)) { + ALOGE("Maximum resolution not found!"); + return; + } + score = width * height * fps * (!interlaced + 1); + for (size_t i = 0; i < kNumResolutionTypes; ++i) { + for (size_t j = 0; j < 32; j++) { + if (GetConfiguration((ResolutionType)i, j, + &width, &height, &fps, &interlaced) + && score >= width * height * fps * (!interlaced + 1)) { + setResolutionEnabled((ResolutionType)i, j); + setProfileLevel((ResolutionType)i, j, profile, level); + } + } + } +} + void VideoFormats::setResolutionEnabled( ResolutionType type, size_t index, bool enabled) { CHECK_LT(type, kNumResolutionTypes); |