Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm

Issue 2998293002: Make CodecType conversion functions non-optional. (Closed)
Patch Set: Keep old functions for backwards-compat Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm b/webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm
index 5a1a51f3f5a515757d14fdf1ca7bfa4ab1f5ffa3..9d4f2b8e0aadc237202d09cefcc3edcbcf62e5d6 100644
--- a/webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm
+++ b/webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm
@@ -104,13 +104,9 @@ id<RTCVideoDecoderFactory> ObjCVideoDecoderFactory::wrapped_decoder_factory() co
}
VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoder(VideoCodecType type) {
- const rtc::Optional<const char *> codec_name = CodecTypeToPayloadName(type);
- if (!codec_name) {
- LOG(LS_ERROR) << "Invalid codec type: " << type;
- return nullptr;
- }
+ const char *codec_name = CodecTypeToPayloadString(type);
- NSString *codecName = [NSString stringWithUTF8String:codec_name.value()];
+ NSString *codecName = [NSString stringWithUTF8String:codec_name];
for (RTCVideoCodecInfo *codecInfo in decoder_factory_.supportedCodecs) {
if ([codecName isEqualToString:codecInfo.name]) {
id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo];
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoEncoderSettings.mm ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698