Android: Fix QueryVideoEncoder() for H264 High Profile
This CL is a forward fix of https://webrtc-review.googlesource.com/c/src/+/83729. That CL implemented QueryVideoEncoder() using |supported_formats_| instead of |supported_formats_with_h264_hp_|, which means |is_hardware_accelerated| will incorrectly be set to false for H264 High Profile. This CL fixes that. Actually, after removing H264 CHP field trial code in https://webrtc-review.googlesource.com/c/src/+/73242, there is no need for separate |supported_formats_| and |supported_formats_with_h264_hp_| so this CL merges them again. TBR=andersc@webrtc.org Bug: webrtc:7925 Change-Id: I35a8ef2f76368fe43f984b13f28c6c83a28e98fd Reviewed-on: https://webrtc-review.googlesource.com/87940 Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23912}
This commit is contained in:
committed by
Commit Bot
parent
32134470ca
commit
9ea085a208
@ -1229,7 +1229,6 @@ MediaCodecVideoEncoderFactory::MediaCodecVideoEncoderFactory()
|
||||
ALOGD << "VP9 HW Encoder supported.";
|
||||
supported_formats_.push_back(SdpVideoFormat(cricket::kVp9CodecName));
|
||||
}
|
||||
supported_formats_with_h264_hp_ = supported_formats_;
|
||||
|
||||
// Check if high profile is supported by decoder. If yes, encoder can always
|
||||
// fall back to baseline profile as a subset as high profile.
|
||||
@ -1246,7 +1245,7 @@ MediaCodecVideoEncoderFactory::MediaCodecVideoEncoderFactory()
|
||||
*H264::ProfileLevelIdToString(constrained_high_profile);
|
||||
constrained_high.parameters[cricket::kH264FmtpLevelAsymmetryAllowed] = "1";
|
||||
constrained_high.parameters[cricket::kH264FmtpPacketizationMode] = "1";
|
||||
supported_formats_with_h264_hp_.push_back(constrained_high);
|
||||
supported_formats_.push_back(constrained_high);
|
||||
}
|
||||
|
||||
bool is_h264_hw_supported =
|
||||
@ -1266,7 +1265,6 @@ MediaCodecVideoEncoderFactory::MediaCodecVideoEncoderFactory()
|
||||
"1";
|
||||
constrained_baseline.parameters[cricket::kH264FmtpPacketizationMode] = "1";
|
||||
supported_formats_.push_back(constrained_baseline);
|
||||
supported_formats_with_h264_hp_.push_back(constrained_baseline);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1309,7 +1307,7 @@ std::unique_ptr<VideoEncoder> MediaCodecVideoEncoderFactory::CreateVideoEncoder(
|
||||
|
||||
std::vector<SdpVideoFormat> MediaCodecVideoEncoderFactory::GetSupportedFormats()
|
||||
const {
|
||||
return supported_formats_with_h264_hp_;
|
||||
return supported_formats_;
|
||||
}
|
||||
|
||||
VideoEncoderFactory::CodecInfo MediaCodecVideoEncoderFactory::QueryVideoEncoder(
|
||||
|
||||
@ -38,7 +38,6 @@ class MediaCodecVideoEncoderFactory : public VideoEncoderFactory {
|
||||
|
||||
// Empty if platform support is lacking, const after ctor returns.
|
||||
std::vector<SdpVideoFormat> supported_formats_;
|
||||
std::vector<SdpVideoFormat> supported_formats_with_h264_hp_;
|
||||
};
|
||||
|
||||
} // namespace jni
|
||||
|
||||
Reference in New Issue
Block a user