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 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 ALOGD << "VP9 HW Encoder supported."; | 1212 ALOGD << "VP9 HW Encoder supported."; |
1213 supported_codecs_.push_back(cricket::VideoCodec("VP9")); | 1213 supported_codecs_.push_back(cricket::VideoCodec("VP9")); |
1214 } | 1214 } |
1215 | 1215 |
1216 bool is_h264_hw_supported = jni->CallStaticBooleanMethod( | 1216 bool is_h264_hw_supported = jni->CallStaticBooleanMethod( |
1217 j_encoder_class, | 1217 j_encoder_class, |
1218 GetStaticMethodID(jni, j_encoder_class, "isH264HwSupported", "()Z")); | 1218 GetStaticMethodID(jni, j_encoder_class, "isH264HwSupported", "()Z")); |
1219 CHECK_EXCEPTION(jni); | 1219 CHECK_EXCEPTION(jni); |
1220 if (is_h264_hw_supported) { | 1220 if (is_h264_hw_supported) { |
1221 ALOGD << "H.264 HW Encoder supported."; | 1221 ALOGD << "H.264 HW Encoder supported."; |
| 1222 // TODO(magjed): Enumerate actual level instead of using hardcoded level |
| 1223 // 3.1. Level 3.1 is 1280x720@30fps which is enough for now. |
| 1224 const webrtc::H264::Level level = webrtc::H264::kLevel3_1; |
| 1225 cricket::VideoCodec constrained_high(cricket::kH264CodecName); |
| 1226 const webrtc::H264::ProfileLevelId constrained_high_profile( |
| 1227 webrtc::H264::kProfileConstrainedHigh, level); |
| 1228 constrained_high.SetParam( |
| 1229 cricket::kH264FmtpProfileLevelId, |
| 1230 *webrtc::H264::ProfileLevelIdToString(constrained_high_profile)); |
| 1231 constrained_high.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1"); |
| 1232 constrained_high.SetParam(cricket::kH264FmtpPacketizationMode, "1"); |
| 1233 supported_codecs_.push_back(constrained_high); |
1222 // TODO(magjed): Push Constrained High profile as well when negotiation is | 1234 // TODO(magjed): Push Constrained High profile as well when negotiation is |
1223 // ready, http://crbug/webrtc/6337. We can negotiate Constrained High | 1235 // ready, http://crbug/webrtc/6337. We can negotiate Constrained High |
1224 // profile as long as we have decode support for it and still send Baseline | 1236 // profile as long as we have decode support for it and still send Baseline |
1225 // since Baseline is a subset of the High profile. | 1237 // since Baseline is a subset of the High profile. |
1226 cricket::VideoCodec constrained_baseline(cricket::kH264CodecName); | 1238 cricket::VideoCodec constrained_baseline(cricket::kH264CodecName); |
1227 // TODO(magjed): Enumerate actual level instead of using hardcoded level | |
1228 // 3.1. Level 3.1 is 1280x720@30fps which is enough for now. | |
1229 const webrtc::H264::ProfileLevelId constrained_baseline_profile( | 1239 const webrtc::H264::ProfileLevelId constrained_baseline_profile( |
1230 webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel3_1); | 1240 webrtc::H264::kProfileConstrainedBaseline, level); |
1231 constrained_baseline.SetParam( | 1241 constrained_baseline.SetParam( |
1232 cricket::kH264FmtpProfileLevelId, | 1242 cricket::kH264FmtpProfileLevelId, |
1233 *webrtc::H264::ProfileLevelIdToString(constrained_baseline_profile)); | 1243 *webrtc::H264::ProfileLevelIdToString(constrained_baseline_profile)); |
1234 constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1"); | 1244 constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1"); |
1235 constrained_baseline.SetParam(cricket::kH264FmtpPacketizationMode, "1"); | 1245 constrained_baseline.SetParam(cricket::kH264FmtpPacketizationMode, "1"); |
1236 supported_codecs_.push_back(constrained_baseline); | 1246 supported_codecs_.push_back(constrained_baseline); |
1237 } | 1247 } |
1238 } | 1248 } |
1239 | 1249 |
1240 MediaCodecVideoEncoderFactory::~MediaCodecVideoEncoderFactory() { | 1250 MediaCodecVideoEncoderFactory::~MediaCodecVideoEncoderFactory() { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 return supported_codecs_; | 1289 return supported_codecs_; |
1280 } | 1290 } |
1281 | 1291 |
1282 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1292 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1283 webrtc::VideoEncoder* encoder) { | 1293 webrtc::VideoEncoder* encoder) { |
1284 ALOGD << "Destroy video encoder."; | 1294 ALOGD << "Destroy video encoder."; |
1285 delete encoder; | 1295 delete encoder; |
1286 } | 1296 } |
1287 | 1297 |
1288 } // namespace webrtc_jni | 1298 } // namespace webrtc_jni |
OLD | NEW |