Propagate multicodec support to other places of PC level framework
Bug: webrtc:10138 Change-Id: I9258db991053abfa40f2a5112eddfa7f3e0d41a1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167062 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30346}
This commit is contained in:
@ -510,6 +510,7 @@ void PeerConnectionE2EQualityTest::ValidateParams(
|
|||||||
std::set<std::string> audio_labels;
|
std::set<std::string> audio_labels;
|
||||||
int media_streams_count = 0;
|
int media_streams_count = 0;
|
||||||
|
|
||||||
|
bool has_simulcast = false;
|
||||||
for (size_t i = 0; i < params.size(); ++i) {
|
for (size_t i = 0; i < params.size(); ++i) {
|
||||||
Params* p = params[i];
|
Params* p = params[i];
|
||||||
if (p->audio_config) {
|
if (p->audio_config) {
|
||||||
@ -574,6 +575,7 @@ void PeerConnectionE2EQualityTest::ValidateParams(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (video_config.simulcast_config) {
|
if (video_config.simulcast_config) {
|
||||||
|
has_simulcast = true;
|
||||||
// We support simulcast only from caller.
|
// We support simulcast only from caller.
|
||||||
RTC_CHECK_EQ(i, 0)
|
RTC_CHECK_EQ(i, 0)
|
||||||
<< "Only simulcast stream from first peer is supported";
|
<< "Only simulcast stream from first peer is supported";
|
||||||
@ -601,6 +603,11 @@ void PeerConnectionE2EQualityTest::ValidateParams(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (has_simulcast) {
|
||||||
|
RTC_CHECK_EQ(run_params.video_codecs.size(), 1)
|
||||||
|
<< "Only 1 video codec is supported when simulcast is enabled in at "
|
||||||
|
<< "least 1 video config";
|
||||||
|
}
|
||||||
|
|
||||||
RTC_CHECK_GT(media_streams_count, 0) << "No media in the call.";
|
RTC_CHECK_GT(media_streams_count, 0) << "No media in the call.";
|
||||||
}
|
}
|
||||||
@ -673,7 +680,8 @@ void PeerConnectionE2EQualityTest::SetupCallOnSignalingThread(
|
|||||||
RtpTransceiverInit transceiver_params;
|
RtpTransceiverInit transceiver_params;
|
||||||
if (video_config.simulcast_config) {
|
if (video_config.simulcast_config) {
|
||||||
transceiver_params.direction = RtpTransceiverDirection::kSendOnly;
|
transceiver_params.direction = RtpTransceiverDirection::kSendOnly;
|
||||||
if (run_params.video_codec_name == cricket::kVp8CodecName) {
|
// Because simulcast enabled |run_params.video_codecs| has only 1 element.
|
||||||
|
if (run_params.video_codecs[0].name == cricket::kVp8CodecName) {
|
||||||
// For Vp8 simulcast we need to add as many RtpEncodingParameters to the
|
// For Vp8 simulcast we need to add as many RtpEncodingParameters to the
|
||||||
// track as many simulcast streams requested.
|
// track as many simulcast streams requested.
|
||||||
for (int i = 0;
|
for (int i = 0;
|
||||||
@ -937,7 +945,7 @@ void PeerConnectionE2EQualityTest::SetupCall(const RunParams& run_params) {
|
|||||||
video_config.simulcast_config->simulcast_streams_count});
|
video_config.simulcast_config->simulcast_streams_count});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PatchingParams patching_params(run_params.video_codec_name,
|
PatchingParams patching_params(run_params.video_codecs,
|
||||||
run_params.use_conference_mode,
|
run_params.use_conference_mode,
|
||||||
stream_label_to_simulcast_streams_count);
|
stream_label_to_simulcast_streams_count);
|
||||||
SignalingInterceptor signaling_interceptor(patching_params);
|
SignalingInterceptor signaling_interceptor(patching_params);
|
||||||
|
@ -165,12 +165,15 @@ LocalAndRemoteSdp SignalingInterceptor::PatchOffer(
|
|||||||
media_desc->set_conference_mode(params_.use_conference_mode);
|
media_desc->set_conference_mode(params_.use_conference_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params_.video_codec_name == cricket::kVp8CodecName) {
|
if (params_.stream_label_to_simulcast_streams_count.size() > 0) {
|
||||||
return PatchVp8Offer(std::move(offer));
|
// Because simulcast enabled |params_.video_codecs| has only 1 element.
|
||||||
}
|
if (params_.video_codecs[0].name == cricket::kVp8CodecName) {
|
||||||
|
return PatchVp8Offer(std::move(offer));
|
||||||
|
}
|
||||||
|
|
||||||
if (params_.video_codec_name == cricket::kVp9CodecName) {
|
if (params_.video_codecs[0].name == cricket::kVp9CodecName) {
|
||||||
return PatchVp9Offer(std::move(offer));
|
return PatchVp9Offer(std::move(offer));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto offer_for_remote = CloneSessionDescription(offer.get());
|
auto offer_for_remote = CloneSessionDescription(offer.get());
|
||||||
@ -353,12 +356,15 @@ LocalAndRemoteSdp SignalingInterceptor::PatchAnswer(
|
|||||||
media_desc->set_conference_mode(params_.use_conference_mode);
|
media_desc->set_conference_mode(params_.use_conference_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params_.video_codec_name == cricket::kVp8CodecName) {
|
if (params_.stream_label_to_simulcast_streams_count.size() > 0) {
|
||||||
return PatchVp8Answer(std::move(answer));
|
// Because simulcast enabled |params_.video_codecs| has only 1 element.
|
||||||
}
|
if (params_.video_codecs[0].name == cricket::kVp8CodecName) {
|
||||||
|
return PatchVp8Answer(std::move(answer));
|
||||||
|
}
|
||||||
|
|
||||||
if (params_.video_codec_name == cricket::kVp9CodecName) {
|
if (params_.video_codecs[0].name == cricket::kVp9CodecName) {
|
||||||
return PatchVp9Answer(std::move(answer));
|
return PatchVp9Answer(std::move(answer));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto answer_for_remote = CloneSessionDescription(answer.get());
|
auto answer_for_remote = CloneSessionDescription(answer.get());
|
||||||
|
@ -61,15 +61,17 @@ struct LocalAndRemoteSdp {
|
|||||||
|
|
||||||
struct PatchingParams {
|
struct PatchingParams {
|
||||||
PatchingParams(
|
PatchingParams(
|
||||||
std::string video_codec_name,
|
std::vector<PeerConnectionE2EQualityTestFixture::VideoCodecConfig>
|
||||||
|
video_codecs,
|
||||||
bool use_conference_mode,
|
bool use_conference_mode,
|
||||||
std::map<std::string, int> stream_label_to_simulcast_streams_count)
|
std::map<std::string, int> stream_label_to_simulcast_streams_count)
|
||||||
: video_codec_name(video_codec_name),
|
: video_codecs(std::move(video_codecs)),
|
||||||
use_conference_mode(use_conference_mode),
|
use_conference_mode(use_conference_mode),
|
||||||
stream_label_to_simulcast_streams_count(
|
stream_label_to_simulcast_streams_count(
|
||||||
stream_label_to_simulcast_streams_count) {}
|
stream_label_to_simulcast_streams_count) {}
|
||||||
|
|
||||||
std::string video_codec_name;
|
std::vector<PeerConnectionE2EQualityTestFixture::VideoCodecConfig>
|
||||||
|
video_codecs;
|
||||||
bool use_conference_mode;
|
bool use_conference_mode;
|
||||||
std::map<std::string, int> stream_label_to_simulcast_streams_count;
|
std::map<std::string, int> stream_label_to_simulcast_streams_count;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user