Allow union initiliazation for webrtc::webrtc_pc_e2e::AudioConfig.

Change-Id: If7f4ac960528099111dd4e195f5934084bde564a
Bug: b/379255467
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368340
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43406}
This commit is contained in:
Jeremy Leconte 2024-11-15 12:48:39 +01:00 committed by WebRTC LUCI CQ
parent b2fc13d094
commit dd8d2ab890
5 changed files with 9 additions and 14 deletions

View File

@ -220,9 +220,6 @@ VideoConfig::VideoConfig(absl::string_view stream_label,
int32_t fps) int32_t fps)
: width(width), height(height), fps(fps), stream_label(stream_label) {} : width(width), height(height), fps(fps), stream_label(stream_label) {}
AudioConfig::AudioConfig(absl::string_view stream_label)
: stream_label(stream_label) {}
VideoCodecConfig::VideoCodecConfig(absl::string_view name) VideoCodecConfig::VideoCodecConfig(absl::string_view name)
: name(name), required_params() {} : name(name), required_params() {}

View File

@ -348,9 +348,6 @@ struct VideoConfig {
// Contains properties for audio in the call. // Contains properties for audio in the call.
struct AudioConfig { struct AudioConfig {
AudioConfig() = default;
explicit AudioConfig(absl::string_view stream_label);
// Have to be unique among all specified configs for all peers in the call. // Have to be unique among all specified configs for all peers in the call.
// Will be auto generated if omitted. // Will be auto generated if omitted.
std::optional<std::string> stream_label; std::optional<std::string> stream_label;

View File

@ -404,10 +404,11 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) {
simulcast.emulated_sfu_config = EmulatedSFUConfig(1); simulcast.emulated_sfu_config = EmulatedSFUConfig(1);
alice->AddVideoConfig(std::move(simulcast)); alice->AddVideoConfig(std::move(simulcast));
AudioConfig audio("alice-audio"); alice->SetAudioConfig({
audio.input_file_name = .stream_label = "alice-audio",
test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); .input_file_name =
alice->SetAudioConfig(std::move(audio)); test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"),
});
alice->SetVideoCodecs({VideoCodecConfig(cricket::kVp9CodecName)}); alice->SetVideoCodecs({VideoCodecConfig(cricket::kVp9CodecName)});
}); });
AddPeer(network_links.second, [](PeerConfigurer* bob) { AddPeer(network_links.second, [](PeerConfigurer* bob) {

View File

@ -52,8 +52,8 @@ void AddDefaultAudioVideoPeer(
absl::string_view video_stream_label, absl::string_view video_stream_label,
const PeerNetworkDependencies& network_dependencies, const PeerNetworkDependencies& network_dependencies,
PeerConnectionE2EQualityTestFixture& fixture) { PeerConnectionE2EQualityTestFixture& fixture) {
AudioConfig audio{std::string(audio_stream_label)}; AudioConfig audio{.stream_label = std::string(audio_stream_label),
audio.sync_group = std::string(peer_name); .sync_group = std::string(peer_name)};
VideoConfig video(std::string(video_stream_label), 320, 180, 15); VideoConfig video(std::string(video_stream_label), 320, 180, 15);
video.sync_group = std::string(peer_name); video.sync_group = std::string(peer_name);
auto peer = std::make_unique<PeerConfigurer>(network_dependencies); auto peer = std::make_unique<PeerConfigurer>(network_dependencies);

View File

@ -53,8 +53,8 @@ void AddDefaultAudioVideoPeer(
absl::string_view video_stream_label, absl::string_view video_stream_label,
const PeerNetworkDependencies& network_dependencies, const PeerNetworkDependencies& network_dependencies,
PeerConnectionE2EQualityTestFixture& fixture) { PeerConnectionE2EQualityTestFixture& fixture) {
AudioConfig audio{std::string(audio_stream_label)}; AudioConfig audio{.stream_label = std::string(audio_stream_label),
audio.sync_group = std::string(peer_name); .sync_group = std::string(peer_name)};
VideoConfig video(std::string(video_stream_label), 320, 180, 15); VideoConfig video(std::string(video_stream_label), 320, 180, 15);
video.sync_group = std::string(peer_name); video.sync_group = std::string(peer_name);
auto peer = std::make_unique<PeerConfigurer>(network_dependencies); auto peer = std::make_unique<PeerConfigurer>(network_dependencies);