Make CodecType conversion functions non-optional.

We can't handle no value here anyway and end up setting a default
at each call site. The defaults aren't even the same in each place.

BUG=None

Review-Url: https://codereview.webrtc.org/2998293002
Cr-Commit-Position: refs/heads/master@{#19485}
This commit is contained in:
kthelgason
2017-08-24 03:52:48 -07:00
committed by Commit Bot
parent 821e21402d
commit 1cdddc96fa
19 changed files with 56 additions and 71 deletions

View File

@ -30,10 +30,8 @@
- (instancetype)initWithNativeVideoCodec:(const webrtc::VideoCodec *)videoCodec {
if (self = [super init]) {
if (videoCodec) {
rtc::Optional<const char *> codecName = CodecTypeToPayloadName(videoCodec->codecType);
if (codecName) {
_name = [NSString stringWithUTF8String:codecName.value()];
}
const char *codecName = CodecTypeToPayloadString(videoCodec->codecType);
_name = [NSString stringWithUTF8String:codecName];
_width = videoCodec->width;
_height = videoCodec->height;