summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinichi Watanabe <swatanabe@xevo.com>2021-01-27 10:45:34 +0900
committerShinichi Watanabe <swatanabe@xevo.com>2021-01-27 10:45:34 +0900
commit1d1eb83ff3bbeb6bc30c5277c4859edd31b08656 (patch)
treeddc1b662b2dd69afb425d8fb14bd0f46544c7590
parent65b3011735c1d78bb4af355ec06fc0afb61bc41f (diff)
downloadsdl_android-1d1eb83ff3bbeb6bc30c5277c4859edd31b08656.tar.gz
Update VideoStreamingParameters#update, as per review at https://github.com/smartdevicelink/sdl_java_suite/pull/1576.
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java b/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
index 8d7009d63..e34c09008 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
@@ -178,7 +178,9 @@ public class VideoStreamingParameters {
*/
public void update(VideoStreamingCapability capability, String vehicleMake) {
if (capability.getMaxBitrate() != null) {
- this.bitrate = capability.getMaxBitrate() * 1000;
+ // Taking lower value as per SDL 0323 :
+ // https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0323-align-VideoStreamingParameter-with-capability.md
+ this.bitrate = Math.min(this.bitrate, capability.getMaxBitrate() * 1000);
} // NOTE: the unit of maxBitrate in getSystemCapability is kbps.
double scale = DEFAULT_SCALE;
// For resolution and scale, the capability values should be taken rather than parameters specified by developers.
@@ -202,7 +204,8 @@ public class VideoStreamingParameters {
}
}
if (capability.getPreferredFPS() != null) {
- this.frameRate = capability.getPreferredFPS();
+ // Taking lower value as per SDL 0323
+ this.frameRate = Math.min(this.frameRate, capability.getPreferredFPS());
}
// This should be the last call as it will return out once a suitable format is found