Replace use of codec name strings with constants.

Bug: webrtc:8401
Change-Id: I2aee61e026330ec233eb8b3bfe2d529187562249
Reviewed-on: https://webrtc-review.googlesource.com/10814
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20340}
This commit is contained in:
Kári Tristan Helgason
2017-10-18 14:22:22 +02:00
committed by Commit Bot
parent a849fd8ef5
commit 117c48291c
6 changed files with 30 additions and 19 deletions

View File

@ -304,7 +304,7 @@ CFStringRef ExtractProfile(webrtc::SdpVideoFormat videoFormat) {
_packetizationMode = RTCH264PacketizationModeNonInterleaved;
_profile = ExtractProfile([codecInfo nativeSdpVideoFormat]);
LOG(LS_INFO) << "Using profile " << CFStringToString(_profile);
RTC_CHECK([codecInfo.name isEqualToString:@"H264"]);
RTC_CHECK([codecInfo.name isEqualToString:kVideoCodecH264Name]);
#if defined(WEBRTC_IOS)
[RTCUIApplicationStatusObserver prepareForUse];
@ -320,7 +320,7 @@ CFStringRef ExtractProfile(webrtc::SdpVideoFormat videoFormat) {
- (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores {
RTC_DCHECK(settings);
RTC_DCHECK([settings.name isEqualToString:@"H264"]);
RTC_DCHECK([settings.name isEqualToString:kVideoCodecH264Name]);
_width = settings.width;
_height = settings.height;

View File

@ -144,7 +144,8 @@ VideoEncoderFactory::CodecInfo ObjCVideoEncoderFactory::QueryVideoEncoder(
const SdpVideoFormat &format) const {
// TODO(andersc): This is a hack until we figure out how this should be done properly.
NSString *formatName = [NSString stringForStdString:format.name];
NSSet *wrappedSoftwareFormats = [NSSet setWithObjects:@"VP8", @"VP9", nil];
NSSet *wrappedSoftwareFormats =
[NSSet setWithObjects:kVideoCodecVp8Name, kVideoCodecVp9Name, nil];
CodecInfo codec_info;
codec_info.is_hardware_accelerated = ![wrappedSoftwareFormats containsObject:formatName];