| OLD | NEW |
| 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 Loading... |
| 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::CreateVideoDecoderWithParams( |
| 107 const char *codec_name = CodecTypeToPayloadString(type); | 107 const cricket::VideoCodec &codec, cricket::VideoDecoderParams params) { |
| 108 | 108 NSString *codecName = [NSString stringWithUTF8String:codec.name.c_str()]; |
| 109 NSString *codecName = [NSString stringWithUTF8String:codec_name]; | |
| 110 for (RTCVideoCodecInfo *codecInfo in decoder_factory_.supportedCodecs) { | 109 for (RTCVideoCodecInfo *codecInfo in decoder_factory_.supportedCodecs) { |
| 111 if ([codecName isEqualToString:codecInfo.name]) { | 110 if ([codecName isEqualToString:codecInfo.name]) { |
| 112 id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo]; | 111 id<RTCVideoDecoder> decoder = [decoder_factory_ createDecoder:codecInfo]; |
| 113 return new ObjCVideoDecoder(decoder); | 112 return new ObjCVideoDecoder(decoder); |
| 114 } | 113 } |
| 115 } | 114 } |
| 116 | 115 |
| 117 return nullptr; | 116 return nullptr; |
| 118 } | 117 } |
| 119 | 118 |
| 120 void ObjCVideoDecoderFactory::DestroyVideoDecoder(VideoDecoder *decoder) { | 119 void ObjCVideoDecoderFactory::DestroyVideoDecoder(VideoDecoder *decoder) { |
| 121 delete decoder; | 120 delete decoder; |
| 122 decoder = nullptr; | 121 decoder = nullptr; |
| 123 } | 122 } |
| 124 | 123 |
| 125 } // namespace webrtc | 124 } // namespace webrtc |
| OLD | NEW |