summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2013-06-03 18:53:14 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-03 18:53:14 +0000
commitb756239ac620d57bc602f529acd1e5e35d61d743 (patch)
tree52af2d2925ddb101035a1c8a7149bcbe20913823 /media
parent7c684c622110af460025eff85082030947278430 (diff)
parent1ad3eb9441eb509c792c61aa0181b0e74dbe9984 (diff)
downloadframeworks_av-b756239ac620d57bc602f529acd1e5e35d61d743.zip
frameworks_av-b756239ac620d57bc602f529acd1e5e35d61d743.tar.gz
frameworks_av-b756239ac620d57bc602f529acd1e5e35d61d743.tar.bz2
Merge "wifi-display: fix resolution list and keepalive interval"
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/wifi-display/VideoFormats.cpp23
-rw-r--r--media/libstagefright/wifi-display/VideoFormats.h3
-rw-r--r--media/libstagefright/wifi-display/source/WifiDisplaySource.cpp7
3 files changed, 30 insertions, 3 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);
diff --git a/media/libstagefright/wifi-display/VideoFormats.h b/media/libstagefright/wifi-display/VideoFormats.h
index b918652..fd38fd1 100644
--- a/media/libstagefright/wifi-display/VideoFormats.h
+++ b/media/libstagefright/wifi-display/VideoFormats.h
@@ -69,6 +69,9 @@ struct VideoFormats {
void disableAll();
void enableAll();
+ void enableResolutionUpto(
+ ResolutionType type, size_t index,
+ ProfileType profile, LevelType level);
void setResolutionEnabled(
ResolutionType type, size_t index, bool enabled = true);
diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
index dee95eb..b421b35 100644
--- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
+++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
@@ -75,7 +75,8 @@ WifiDisplaySource::WifiDisplaySource(
mSupportedSourceVideoFormats.setNativeResolution(
VideoFormats::RESOLUTION_CEA, 5); // 1280x720 p30
- mSupportedSourceVideoFormats.setProfileLevel(
+ // Enable all resolutions up to 1280x720p30
+ mSupportedSourceVideoFormats.enableResolutionUpto(
VideoFormats::RESOLUTION_CEA, 5,
VideoFormats::PROFILE_CHP, // Constrained High Profile
VideoFormats::LEVEL_32); // Level 3.2
@@ -751,6 +752,8 @@ status_t WifiDisplaySource::sendM16(int32_t sessionID) {
++mNextCSeq;
+ scheduleKeepAlive(sessionID);
+
return OK;
}
@@ -1021,8 +1024,6 @@ status_t WifiDisplaySource::onReceiveM16Response(
if (mClientInfo.mPlaybackSession != NULL) {
mClientInfo.mPlaybackSession->updateLiveness();
-
- scheduleKeepAlive(sessionID);
}
return OK;