| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 #include "webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.h" | 10 #include "webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #if defined(WEBRTC_IOS) | 40 #if defined(WEBRTC_IOS) |
| 41 supported_codecs_.push_back(cricket::VideoCodec(cricket::kH264CodecName)); | 41 supported_codecs_.push_back(cricket::VideoCodec(cricket::kH264CodecName)); |
| 42 #endif | 42 #endif |
| 43 } | 43 } |
| 44 | 44 |
| 45 VideoToolboxVideoEncoderFactory::~VideoToolboxVideoEncoderFactory() {} | 45 VideoToolboxVideoEncoderFactory::~VideoToolboxVideoEncoderFactory() {} |
| 46 | 46 |
| 47 VideoEncoder* VideoToolboxVideoEncoderFactory::CreateVideoEncoder( | 47 VideoEncoder* VideoToolboxVideoEncoderFactory::CreateVideoEncoder( |
| 48 const cricket::VideoCodec& codec) { | 48 const cricket::VideoCodec& codec) { |
| 49 #if defined(WEBRTC_IOS) | 49 #if defined(WEBRTC_IOS) |
| 50 if (IsCodecSupported(supported_codecs_, codec)) { | 50 if (FindMatchingCodec(supported_codecs_, codec)) { |
| 51 LOG(LS_INFO) << "Creating HW encoder for " << codec.name; | 51 LOG(LS_INFO) << "Creating HW encoder for " << codec.name; |
| 52 return new H264VideoToolboxEncoder(); | 52 return new H264VideoToolboxEncoder(); |
| 53 } | 53 } |
| 54 #endif | 54 #endif |
| 55 LOG(LS_INFO) << "No HW encoder found for codec " << codec.name; | 55 LOG(LS_INFO) << "No HW encoder found for codec " << codec.name; |
| 56 return nullptr; | 56 return nullptr; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void VideoToolboxVideoEncoderFactory::DestroyVideoEncoder( | 59 void VideoToolboxVideoEncoderFactory::DestroyVideoEncoder( |
| 60 VideoEncoder* encoder) { | 60 VideoEncoder* encoder) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 76 supported_codecs_.push_back(cricket::VideoCodec("H264")); | 76 supported_codecs_.push_back(cricket::VideoCodec("H264")); |
| 77 #endif | 77 #endif |
| 78 } | 78 } |
| 79 | 79 |
| 80 VideoToolboxVideoDecoderFactory::~VideoToolboxVideoDecoderFactory() {} | 80 VideoToolboxVideoDecoderFactory::~VideoToolboxVideoDecoderFactory() {} |
| 81 | 81 |
| 82 VideoDecoder* VideoToolboxVideoDecoderFactory::CreateVideoDecoder( | 82 VideoDecoder* VideoToolboxVideoDecoderFactory::CreateVideoDecoder( |
| 83 VideoCodecType type) { | 83 VideoCodecType type) { |
| 84 const auto codec = cricket::VideoCodec(NameFromCodecType(type)); | 84 const auto codec = cricket::VideoCodec(NameFromCodecType(type)); |
| 85 #if defined(WEBRTC_IOS) | 85 #if defined(WEBRTC_IOS) |
| 86 if (IsCodecSupported(supported_codecs_, codec)) { | 86 if (FindMatchingCodec(supported_codecs_, codec)) { |
| 87 LOG(LS_INFO) << "Creating HW decoder for " << codec.name; | 87 LOG(LS_INFO) << "Creating HW decoder for " << codec.name; |
| 88 return new H264VideoToolboxDecoder(); | 88 return new H264VideoToolboxDecoder(); |
| 89 } | 89 } |
| 90 #endif | 90 #endif |
| 91 LOG(LS_INFO) << "No HW decoder found for codec " << codec.name; | 91 LOG(LS_INFO) << "No HW decoder found for codec " << codec.name; |
| 92 return nullptr; | 92 return nullptr; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void VideoToolboxVideoDecoderFactory::DestroyVideoDecoder( | 95 void VideoToolboxVideoDecoderFactory::DestroyVideoDecoder( |
| 96 VideoDecoder* decoder) { | 96 VideoDecoder* decoder) { |
| 97 #if defined(WEBRTC_IOS) | 97 #if defined(WEBRTC_IOS) |
| 98 delete decoder; | 98 delete decoder; |
| 99 decoder = nullptr; | 99 decoder = nullptr; |
| 100 #endif | 100 #endif |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace webrtc | 103 } // namespace webrtc |
| OLD | NEW |