Skip to content

Commit

Permalink
Removed unnecessary video encoder settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
asm09fsu committed May 27, 2016
1 parent f7540a0 commit 2d51834
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions SmartDeviceLink-iOS/SmartDeviceLink/SDLStreamingMediaManager.m
Expand Up @@ -236,33 +236,6 @@ - (BOOL)sdl_configureVideoEncoderWithError:(NSError *__autoreleasing *)error {
return NO;
}

// Set the bitrate of our video compression
int bitRate = 5000;
CFNumberRef bitRateNumRef = CFNumberCreate(NULL, kCFNumberSInt32Type, &bitRate);
if (bitRateNumRef == NULL) {
// TODO: Log & end session
if (*error != nil) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationAllocationFailure userInfo:nil];
}

return NO;
}

status = VTSessionSetProperty(self.compressionSession, kVTCompressionPropertyKey_AverageBitRate, bitRateNumRef);

// Release our bitrate number
CFRelease(bitRateNumRef);
bitRateNumRef = NULL;

if (status != noErr) {
// TODO: Log & End session
if (*error != nil) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationCompressionSessionSetPropertyFailure userInfo:@{ @"OSStatus" : @(status) }];
}

return NO;
}

// Set the profile level of the video stream
status = VTSessionSetProperty(self.compressionSession, kVTCompressionPropertyKey_ProfileLevel, kVTProfileLevel_H264_Baseline_AutoLevel);
if (status != noErr) {
Expand All @@ -283,31 +256,6 @@ - (BOOL)sdl_configureVideoEncoderWithError:(NSError *__autoreleasing *)error {
return NO;
}

// Set the key-frame interval
// TODO: This may be unnecessary, can the encoder do a better job than us?
int interval = 50;
CFNumberRef intervalNumRef = CFNumberCreate(NULL, kCFNumberSInt32Type, &interval);
if (intervalNumRef == NULL) {
if (*error != nil) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationAllocationFailure userInfo:nil];
}

return NO;
}

status = VTSessionSetProperty(self.compressionSession, kVTCompressionPropertyKey_MaxKeyFrameInterval, intervalNumRef);

CFRelease(intervalNumRef);
intervalNumRef = NULL;

if (status != noErr) {
if (*error != nil) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationCompressionSessionSetPropertyFailure userInfo:@{ @"OSStatus" : @(status) }];
}

return NO;
}

return YES;
}

Expand Down

0 comments on commit 2d51834

Please sign in to comment.