summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakamitsu Yoshii <tyoshii@xevo.com>2019-09-02 11:30:14 +0900
committerTakamitsu Yoshii <tyoshii@xevo.com>2019-09-02 14:02:58 +0900
commit4593cdceecedf98dced9294d88af27ce1a7eb720 (patch)
tree936f1ca886cd22b36b625215e5bb44e3d84f7bc5
parent3422b26e3e0a9e34c9c7ae943611a3d534e8d217 (diff)
downloadsdl_ios-4593cdceecedf98dced9294d88af27ce1a7eb720.tar.gz
reflect bitrate value returned from HMI
-rw-r--r--SmartDeviceLink/SDLStreamingVideoLifecycleManager.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
index c0d92c30d..05342e6a6 100644
--- a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
+++ b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
@@ -344,6 +344,14 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
weakSelf.preferredFormats = capability.supportedFormats;
weakSelf.preferredResolutions = @[capability.preferredResolution];
+ if (capability.maxBitrate != nil) {
+ NSNumber *bitrate = [[NSNumber alloc] initWithInt:[capability.maxBitrate intValue] * 1000]; // HMI returns bitrate in kbps.
+ NSMutableDictionary *settings = [[NSMutableDictionary alloc] init];
+ [settings addEntriesFromDictionary: self.videoEncoderSettings];
+ [settings setObject:bitrate forKey:(__bridge NSString *)kVTCompressionPropertyKey_AverageBitRate];
+ weakSelf.videoEncoderSettings = settings;
+ }
+
if (weakSelf.dataSource != nil) {
SDLLogV(@"Calling data source for modified preferred formats");
weakSelf.preferredFormats = [weakSelf.dataSource preferredVideoFormatOrderFromHeadUnitPreferredOrder:weakSelf.preferredFormats];