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:
committed by
Commit Bot
parent
a849fd8ef5
commit
117c48291c
@ -14,6 +14,12 @@
|
||||
#import "RTCVideoCodec+Private.h"
|
||||
#import "WebRTC/RTCVideoCodecFactory.h"
|
||||
|
||||
NSString *const kVideoCodecVp8Name = @"VP8";
|
||||
NSString *const kVideoCodecVp9Name = @"VP9";
|
||||
NSString *const kVideoCodecH264Name = @"H264";
|
||||
NSString *const kLevel31ConstrainedHigh = @"640c1f";
|
||||
NSString *const kLevel31ConstrainedBaseline = @"42e01f";
|
||||
|
||||
@implementation RTCVideoCodecInfo
|
||||
|
||||
@synthesize name = _name;
|
||||
|
||||
@ -20,9 +20,6 @@
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
||||
const char kHighProfileExperiment[] = "WebRTC-H264HighProfile";
|
||||
static NSString *kH264CodecName = @"H264";
|
||||
static NSString *kLevel31ConstrainedHigh = @"640c1f";
|
||||
static NSString *kLevel31ConstrainedBaseline = @"42e01f";
|
||||
|
||||
bool IsHighProfileEnabled() {
|
||||
return webrtc::field_trial::IsEnabled(kHighProfileExperiment);
|
||||
@ -36,7 +33,7 @@ bool IsHighProfileEnabled() {
|
||||
- (webrtc::CodecSpecificInfo)nativeCodecSpecificInfo {
|
||||
webrtc::CodecSpecificInfo codecSpecificInfo;
|
||||
codecSpecificInfo.codecType = webrtc::kVideoCodecH264;
|
||||
codecSpecificInfo.codec_name = [kH264CodecName cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
codecSpecificInfo.codec_name = [kVideoCodecH264Name cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
codecSpecificInfo.codecSpecific.H264.packetization_mode =
|
||||
(webrtc::H264PacketizationMode)_packetizationMode;
|
||||
|
||||
@ -50,7 +47,7 @@ bool IsHighProfileEnabled() {
|
||||
|
||||
- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
|
||||
NSMutableArray<RTCVideoCodecInfo *> *codecs = [NSMutableArray array];
|
||||
NSString *codecName = kH264CodecName;
|
||||
NSString *codecName = kVideoCodecH264Name;
|
||||
|
||||
if (IsHighProfileEnabled()) {
|
||||
NSDictionary<NSString *, NSString *> *constrainedHighParams = @{
|
||||
@ -89,7 +86,7 @@ bool IsHighProfileEnabled() {
|
||||
}
|
||||
|
||||
- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
|
||||
NSString *codecName = kH264CodecName;
|
||||
NSString *codecName = kVideoCodecH264Name;
|
||||
return @[ [[RTCVideoCodecInfo alloc] initWithName:codecName parameters:nil] ];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user