Loading media/libstagefright/wifi-display/VideoFormats.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -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); Loading media/libstagefright/wifi-display/VideoFormats.h +3 −0 Original line number Diff line number Diff line Loading @@ -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); Loading media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -751,6 +752,8 @@ status_t WifiDisplaySource::sendM16(int32_t sessionID) { ++mNextCSeq; scheduleKeepAlive(sessionID); return OK; } Loading Loading @@ -1021,8 +1024,6 @@ status_t WifiDisplaySource::onReceiveM16Response( if (mClientInfo.mPlaybackSession != NULL) { mClientInfo.mPlaybackSession->updateLiveness(); scheduleKeepAlive(sessionID); } return OK; Loading Loading
media/libstagefright/wifi-display/VideoFormats.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
media/libstagefright/wifi-display/VideoFormats.h +3 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -751,6 +752,8 @@ status_t WifiDisplaySource::sendM16(int32_t sessionID) { ++mNextCSeq; scheduleKeepAlive(sessionID); return OK; } Loading Loading @@ -1021,8 +1024,6 @@ status_t WifiDisplaySource::onReceiveM16Response( if (mClientInfo.mPlaybackSession != NULL) { mClientInfo.mPlaybackSession->updateLiveness(); scheduleKeepAlive(sessionID); } return OK; Loading