| Index: webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc
|
| diff --git a/webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc b/webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc
|
| index cc4c602b18f0150815e3867138e934272b153e23..346b12b9a3e77aca46ba3ee2a3c92475a3c965bc 100644
|
| --- a/webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc
|
| +++ b/webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc
|
| @@ -1214,31 +1214,10 @@ MediaCodecVideoEncoderFactory::MediaCodecVideoEncoderFactory()
|
| ALOGD << "VP9 HW Encoder supported.";
|
| supported_codecs_.push_back(cricket::VideoCodec("VP9"));
|
| }
|
| -
|
| - bool is_h264_hw_supported = jni->CallStaticBooleanMethod(
|
| - j_encoder_class,
|
| - GetStaticMethodID(jni, j_encoder_class, "isH264HwSupported", "()Z"));
|
| - CHECK_EXCEPTION(jni);
|
| - if (is_h264_hw_supported) {
|
| - ALOGD << "H.264 HW Encoder supported.";
|
| - // TODO(magjed): Push Constrained High profile as well when negotiation is
|
| - // ready, http://crbug/webrtc/6337. We can negotiate Constrained High
|
| - // profile as long as we have decode support for it and still send Baseline
|
| - // since Baseline is a subset of the High profile.
|
| - cricket::VideoCodec constrained_baseline(cricket::kH264CodecName);
|
| - const webrtc::H264::ProfileLevelId constrained_baseline_profile(
|
| - webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel3_1);
|
| - constrained_baseline.SetParam(
|
| - cricket::kH264FmtpProfileLevelId,
|
| - *webrtc::H264::ProfileLevelIdToString(constrained_baseline_profile));
|
| - constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1");
|
| - constrained_baseline.SetParam(cricket::kH264FmtpPacketizationMode, "1");
|
| - supported_codecs_.push_back(constrained_baseline);
|
| - }
|
| + supported_codecs_with_h264_hp_ = supported_codecs_;
|
|
|
| // Check if high profile is supported by decoder. If yes, encoder can always
|
| // fall back to baseline profile as a subset as high profile.
|
| - supported_codecs_with_h264_hp_ = supported_codecs_;
|
| bool is_h264_high_profile_hw_supported = jni->CallStaticBooleanMethod(
|
| j_decoder_class,
|
| GetStaticMethodID(jni, j_decoder_class, "isH264HighProfileHwSupported",
|
| @@ -1258,6 +1237,28 @@ MediaCodecVideoEncoderFactory::MediaCodecVideoEncoderFactory()
|
| constrained_high.SetParam(cricket::kH264FmtpPacketizationMode, "1");
|
| supported_codecs_with_h264_hp_.push_back(constrained_high);
|
| }
|
| +
|
| + bool is_h264_hw_supported = jni->CallStaticBooleanMethod(
|
| + j_encoder_class,
|
| + GetStaticMethodID(jni, j_encoder_class, "isH264HwSupported", "()Z"));
|
| + CHECK_EXCEPTION(jni);
|
| + if (is_h264_hw_supported) {
|
| + ALOGD << "H.264 HW Encoder supported.";
|
| + // TODO(magjed): Push Constrained High profile as well when negotiation is
|
| + // ready, http://crbug/webrtc/6337. We can negotiate Constrained High
|
| + // profile as long as we have decode support for it and still send Baseline
|
| + // since Baseline is a subset of the High profile.
|
| + cricket::VideoCodec constrained_baseline(cricket::kH264CodecName);
|
| + const webrtc::H264::ProfileLevelId constrained_baseline_profile(
|
| + webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel3_1);
|
| + constrained_baseline.SetParam(
|
| + cricket::kH264FmtpProfileLevelId,
|
| + *webrtc::H264::ProfileLevelIdToString(constrained_baseline_profile));
|
| + constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1");
|
| + constrained_baseline.SetParam(cricket::kH264FmtpPacketizationMode, "1");
|
| + supported_codecs_.push_back(constrained_baseline);
|
| + supported_codecs_with_h264_hp_.push_back(constrained_baseline);
|
| + }
|
| }
|
|
|
| MediaCodecVideoEncoderFactory::~MediaCodecVideoEncoderFactory() {
|
|
|