Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reflect bitrate returned from HMI in video encoder settings #1393

Merged
merged 5 commits into from
Sep 23, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ - (void)didEnterStateVideoStreamStarting {
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.
t-yoshii marked this conversation as resolved.
Show resolved Hide resolved
NSMutableDictionary *settings = [[NSMutableDictionary alloc] init];
[settings addEntriesFromDictionary: self.videoEncoderSettings];
[settings setObject:bitrate forKey:(__bridge NSString *)kVTCompressionPropertyKey_AverageBitRate];
weakSelf.videoEncoderSettings = settings;
t-yoshii marked this conversation as resolved.
Show resolved Hide resolved
}

if (weakSelf.dataSource != nil) {
SDLLogV(@"Calling data source for modified preferred formats");
weakSelf.preferredFormats = [weakSelf.dataSource preferredVideoFormatOrderFromHeadUnitPreferredOrder:weakSelf.preferredFormats];
Expand Down