Add a smoke test for VideoToolbox H.264 codec on MacOS/iOS

There doesn't seem to be any tests currently running with
VideoToolbox H.264 codec.
Add a minimal test to make sure there are no regressions.

Bug: webrtc:13934
Change-Id: I664833d06e9b4f919b0662781891f5448e6057c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257922
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#36511}
This commit is contained in:
Byoungchan Lee 2022-04-06 10:59:00 +09:00 committed by WebRTC LUCI CQ
parent a30d767a6d
commit 7f3e0e80b7
2 changed files with 60 additions and 0 deletions

View File

@ -490,6 +490,9 @@ if (!build_with_chromium) {
"../../../test:test_support",
]
data = peer_connection_e2e_smoke_test_resources
if (is_mac || is_ios) {
deps += [ "../../../modules/video_coding:objc_codec_factory_helper" ]
}
if (is_ios) {
deps += [ ":peer_connection_e2e_smoke_test_resources_bundle_data" ]
}

View File

@ -27,6 +27,10 @@
#include "test/pc/e2e/stats_based_network_quality_metrics_reporter.h"
#include "test/testsupport/file_utils.h"
#if defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
#include "modules/video_coding/codecs/test/objc_codec_factory_helper.h" // nogncheck
#endif
namespace webrtc {
namespace webrtc_pc_e2e {
namespace {
@ -183,6 +187,59 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) {
RunAndCheckEachVideoStreamReceivedFrames(run_params);
}
#if defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
TEST_F(PeerConnectionE2EQualityTestSmokeTest, SmokeH264) {
std::pair<EmulatedNetworkManagerInterface*, EmulatedNetworkManagerInterface*>
network_links = CreateNetwork();
AddPeer(network_links.first, [](PeerConfigurer* alice) {
VideoConfig video(160, 120, 15);
video.stream_label = "alice-video";
video.sync_group = "alice-media";
alice->AddVideoConfig(std::move(video));
AudioConfig audio;
audio.stream_label = "alice-audio";
audio.mode = AudioConfig::Mode::kFile;
audio.input_file_name =
test::ResourcePath("pc_quality_smoke_test_alice_source", "wav");
audio.sampling_frequency_in_hz = 48000;
audio.sync_group = "alice-media";
alice->SetAudioConfig(std::move(audio));
alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
alice->SetVideoEncoderFactory(webrtc::test::CreateObjCEncoderFactory());
alice->SetVideoDecoderFactory(webrtc::test::CreateObjCDecoderFactory());
});
AddPeer(network_links.second, [](PeerConfigurer* charlie) {
charlie->SetName("charlie");
VideoConfig video(160, 120, 15);
video.stream_label = "charlie-video";
video.temporal_layers_count = 2;
charlie->AddVideoConfig(std::move(video));
AudioConfig audio;
audio.stream_label = "charlie-audio";
audio.mode = AudioConfig::Mode::kFile;
audio.input_file_name =
test::ResourcePath("pc_quality_smoke_test_bob_source", "wav");
charlie->SetAudioConfig(std::move(audio));
charlie->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
charlie->SetVideoEncoderFactory(webrtc::test::CreateObjCEncoderFactory());
charlie->SetVideoDecoderFactory(webrtc::test::CreateObjCDecoderFactory());
});
fixture()->AddQualityMetricsReporter(
std::make_unique<StatsBasedNetworkQualityMetricsReporter>(
std::map<std::string, std::vector<EmulatedEndpoint*>>(
{{"alice", network_links.first->endpoints()},
{"charlie", network_links.second->endpoints()}}),
network_emulation()));
RunParams run_params(TimeDelta::Seconds(2));
run_params.enable_flex_fec_support = true;
RunAndCheckEachVideoStreamReceivedFrames(run_params);
}
#endif
// IOS debug builds can be quite slow, disabling to avoid issues with timeouts.
#if defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64) && !defined(NDEBUG)
#define MAYBE_ChangeNetworkConditions DISABLED_ChangeNetworkConditions