Android: Re-enable videoprocessor integration tests.

The problem was that the encoder was feeded with frames that had 0 as
a timestamp. This confused the encoder. H264 high profile support
clause was also wrong and is corrected.

Bug: webrtc:8601
Change-Id: Ic5a893b4b7573e694f865b63620843b2c9aa489f
Reviewed-on: https://webrtc-review.googlesource.com/32300
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21234}
This commit is contained in:
Sami Kalliomäki
2017-12-12 16:37:16 +01:00
committed by Commit Bot
parent 6acefdb70a
commit 20b294c28e
3 changed files with 7 additions and 8 deletions

View File

@ -30,7 +30,6 @@ namespace test {
namespace {
const int kRtpClockRateHz = 90000;
const int64_t kNoRenderTime = 0;
std::unique_ptr<VideoBitrateAllocator> CreateBitrateAllocator(
TestConfig* config) {
@ -166,9 +165,11 @@ void VideoProcessor::ProcessFrame() {
// want to use capture timestamps in the IVF files.
const uint32_t rtp_timestamp = (frame_number + 1) * kRtpClockRateHz /
config_.codec_settings.maxFramerate;
const int64_t render_time_ms = (frame_number + 1) * rtc::kNumMillisecsPerSec /
config_.codec_settings.maxFramerate;
rtp_timestamp_to_frame_num_[rtp_timestamp] = frame_number;
input_frames_[frame_number] = rtc::MakeUnique<VideoFrame>(
buffer, rtp_timestamp, kNoRenderTime, webrtc::kVideoRotation_0);
buffer, rtp_timestamp, render_time_ms, webrtc::kVideoRotation_0);
std::vector<FrameType> frame_types = config_.FrameTypeForFrame(frame_number);

View File

@ -40,8 +40,7 @@ class VideoProcessorIntegrationTestMediaCodec
}
};
// TODO(bugs.webrtc.org/8601): Fix HW encoder and re-enable.
TEST_F(VideoProcessorIntegrationTestMediaCodec, DISABLED_ForemanCif500kbpsVp8) {
TEST_F(VideoProcessorIntegrationTestMediaCodec, ForemanCif500kbpsVp8) {
config_.SetCodecSettings(kVideoCodecVP8, 1, false, false, false, false, false,
352, 288);
@ -60,9 +59,7 @@ TEST_F(VideoProcessorIntegrationTestMediaCodec, DISABLED_ForemanCif500kbpsVp8) {
kNoVisualizationParams);
}
// TODO(bugs.webrtc.org/8601): Fix HW encoder and re-enable.
TEST_F(VideoProcessorIntegrationTestMediaCodec,
DISABLED_ForemanCif500kbpsH264CBP) {
TEST_F(VideoProcessorIntegrationTestMediaCodec, ForemanCif500kbpsH264CBP) {
config_.encoded_frame_checker = &h264_keyframe_checker_;
config_.SetCodecSettings(kVideoCodecH264, 1, false, false, false, false,
false, 352, 288);

View File

@ -259,7 +259,8 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
}
private boolean isH264HighProfileSupported(MediaCodecInfo info) {
return enableH264HighProfile && info.getName().startsWith(QCOM_PREFIX);
return enableH264HighProfile && Build.VERSION.SDK_INT > Build.VERSION_CODES.M
&& info.getName().startsWith(EXYNOS_PREFIX);
}
private Map<String, String> getCodecProperties(VideoCodecType type, boolean highProfile) {