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

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

Issue 3007433002: Let CreateVideoDecoder take a cricket::VideoCodec. (Closed)
Patch Set: Remove unrelated change Created 3 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 ObjCVideoDecoderFactory::ObjCVideoDecoderFactory(id<RTCVideoDecoderFactory> deco der_factory) 97 ObjCVideoDecoderFactory::ObjCVideoDecoderFactory(id<RTCVideoDecoderFactory> deco der_factory)
98 : decoder_factory_(decoder_factory) {} 98 : decoder_factory_(decoder_factory) {}
99 99
100 ObjCVideoDecoderFactory::~ObjCVideoDecoderFactory() {} 100 ObjCVideoDecoderFactory::~ObjCVideoDecoderFactory() {}
101 101
102 id<RTCVideoDecoderFactory> ObjCVideoDecoderFactory::wrapped_decoder_factory() co nst { 102 id<RTCVideoDecoderFactory> ObjCVideoDecoderFactory::wrapped_decoder_factory() co nst {
103 return decoder_factory_; 103 return decoder_factory_;
104 } 104 }
105 105
106 VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoder(VideoCodecType type) { 106 VideoDecoder *ObjCVideoDecoderFactory::CreateVideoDecoder(const cricket::VideoCo dec &codec) {
107 const char *codec_name = CodecTypeToPayloadName(type); 107 NSString *codecName = [NSString stringWithUTF8String:codec.name.c_str()];
magjed_webrtc 2017/08/24 08:59:39 I think we could simplify this whole function now
kthelgason 2017/08/24 10:49:47 Sure, we can do that, but that just moves the resp
magjed_webrtc 2017/08/25 15:55:01 I think we should fix the C++ code in core WebRTC
108
109 NSString *codecName = [NSString stringWithUTF8String:codec_name];
110 for (RTCVideoCodecInfo *codecInfo in decoder_factory_.supportedCodecs) { 108 for (RTCVideoCodecInfo *codecInfo in decoder_factory_.supportedCodecs) {
111 if ([codecName isEqualToString:codecInfo.name]) { 109 if ([codecName isEqualToString:codecInfo.name]) {
112 id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo]; 110 id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo];
113 return new ObjCVideoDecoder(decoder); 111 return new ObjCVideoDecoder(decoder);
114 } 112 }
115 } 113 }
116 114
117 return nullptr; 115 return nullptr;
118 } 116 }
119 117
120 void ObjCVideoDecoderFactory::DestroyVideoDecoder(VideoDecoder *decoder) { 118 void ObjCVideoDecoderFactory::DestroyVideoDecoder(VideoDecoder *decoder) {
121 delete decoder; 119 delete decoder;
122 decoder = nullptr; 120 decoder = nullptr;
123 } 121 }
124 122
125 } // namespace webrtc 123 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698