| 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 | 10 |
| (...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 } | 1352 } |
| 1353 | 1353 |
| 1354 webrtc::VideoEncoder* MediaCodecVideoEncoderFactory::CreateVideoEncoder( | 1354 webrtc::VideoEncoder* MediaCodecVideoEncoderFactory::CreateVideoEncoder( |
| 1355 const cricket::VideoCodec& codec) { | 1355 const cricket::VideoCodec& codec) { |
| 1356 if (supported_codecs_.empty()) { | 1356 if (supported_codecs_.empty()) { |
| 1357 ALOGW << "No HW video encoder for codec " << codec.name; | 1357 ALOGW << "No HW video encoder for codec " << codec.name; |
| 1358 return nullptr; | 1358 return nullptr; |
| 1359 } | 1359 } |
| 1360 if (FindMatchingCodec(supported_codecs_, codec)) { | 1360 if (FindMatchingCodec(supported_codecs_, codec)) { |
| 1361 ALOGD << "Create HW video encoder for " << codec.name; | 1361 ALOGD << "Create HW video encoder for " << codec.name; |
| 1362 const VideoCodecType type = cricket::CodecTypeFromName(codec.name); | 1362 const VideoCodecType type = webrtc::PayloadNameToCodecType(codec.name) |
| 1363 .value_or(webrtc::kVideoCodecUnknown); |
| 1363 return new MediaCodecVideoEncoder(AttachCurrentThreadIfNeeded(), type, | 1364 return new MediaCodecVideoEncoder(AttachCurrentThreadIfNeeded(), type, |
| 1364 egl_context_); | 1365 egl_context_); |
| 1365 } | 1366 } |
| 1366 ALOGW << "Can not find HW video encoder for type " << codec.name; | 1367 ALOGW << "Can not find HW video encoder for type " << codec.name; |
| 1367 return nullptr; | 1368 return nullptr; |
| 1368 } | 1369 } |
| 1369 | 1370 |
| 1370 const std::vector<cricket::VideoCodec>& | 1371 const std::vector<cricket::VideoCodec>& |
| 1371 MediaCodecVideoEncoderFactory::supported_codecs() const { | 1372 MediaCodecVideoEncoderFactory::supported_codecs() const { |
| 1372 return supported_codecs_; | 1373 return supported_codecs_; |
| 1373 } | 1374 } |
| 1374 | 1375 |
| 1375 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1376 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 1376 webrtc::VideoEncoder* encoder) { | 1377 webrtc::VideoEncoder* encoder) { |
| 1377 ALOGD << "Destroy video encoder."; | 1378 ALOGD << "Destroy video encoder."; |
| 1378 delete encoder; | 1379 delete encoder; |
| 1379 } | 1380 } |
| 1380 | 1381 |
| 1381 } // namespace webrtc_jni | 1382 } // namespace webrtc_jni |
| OLD | NEW |