mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Default sending capture clock offset in abs-capture-time header extension.
Bug: webrtc:10739 Change-Id: Ieadb6d75122e5988b22509ac14dc528277a7f56f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232906 Commit-Queue: Minyue Li <minyue@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35149}
This commit is contained in:
parent
c9f43f8f81
commit
2bfa5b20fe
4 changed files with 14 additions and 14 deletions
|
@ -60,8 +60,8 @@ RTPSenderAudio::RTPSenderAudio(Clock* clock, RTPSender* rtp_sender)
|
|||
rtp_sender_(rtp_sender),
|
||||
absolute_capture_time_sender_(clock),
|
||||
include_capture_clock_offset_(
|
||||
absl::StartsWith(field_trials_.Lookup(kIncludeCaptureClockOffset),
|
||||
"Enabled")) {
|
||||
!absl::StartsWith(field_trials_.Lookup(kIncludeCaptureClockOffset),
|
||||
"Disabled")) {
|
||||
RTC_DCHECK(clock_);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,16 @@ TEST_F(RtpSenderAudioTest, SendAudioWithoutAbsoluteCaptureTime) {
|
|||
.HasExtension<AbsoluteCaptureTimeExtension>());
|
||||
}
|
||||
|
||||
// Essentially the same test as
|
||||
// SendAudioWithAbsoluteCaptureTimeWithCaptureClockOffset but with a field
|
||||
// trial. We will remove this test eventually.
|
||||
TEST_F(RtpSenderAudioTest, SendAudioWithAbsoluteCaptureTime) {
|
||||
// Recreate rtp_sender_audio_ with new field trial.
|
||||
test::ScopedFieldTrials field_trial(
|
||||
"WebRTC-IncludeCaptureClockOffset/Disabled/");
|
||||
rtp_sender_audio_ =
|
||||
std::make_unique<RTPSenderAudio>(&fake_clock_, rtp_module_->RtpSender());
|
||||
|
||||
rtp_module_->RegisterRtpHeaderExtension(AbsoluteCaptureTimeExtension::Uri(),
|
||||
kAbsoluteCaptureTimeExtensionId);
|
||||
constexpr uint32_t kAbsoluteCaptureTimestampMs = 521;
|
||||
|
@ -174,17 +183,8 @@ TEST_F(RtpSenderAudioTest, SendAudioWithAbsoluteCaptureTime) {
|
|||
absolute_capture_time->estimated_capture_clock_offset.has_value());
|
||||
}
|
||||
|
||||
// Essentially the same test as SendAudioWithAbsoluteCaptureTime but with a
|
||||
// field trial. After the field trial is experimented, we will remove
|
||||
// SendAudioWithAbsoluteCaptureTime.
|
||||
TEST_F(RtpSenderAudioTest,
|
||||
SendAudioWithAbsoluteCaptureTimeWithCaptureClockOffset) {
|
||||
// Recreate rtp_sender_audio_ wieh new field trial.
|
||||
test::ScopedFieldTrials field_trial(
|
||||
"WebRTC-IncludeCaptureClockOffset/Enabled/");
|
||||
rtp_sender_audio_ =
|
||||
std::make_unique<RTPSenderAudio>(&fake_clock_, rtp_module_->RtpSender());
|
||||
|
||||
rtp_module_->RegisterRtpHeaderExtension(AbsoluteCaptureTimeExtension::Uri(),
|
||||
kAbsoluteCaptureTimeExtensionId);
|
||||
constexpr uint32_t kAbsoluteCaptureTimestampMs = 521;
|
||||
|
|
|
@ -175,9 +175,9 @@ RTPSenderVideo::RTPSenderVideo(const Config& config)
|
|||
rtp_sender_->SSRC(),
|
||||
config.send_transport_queue)
|
||||
: nullptr),
|
||||
include_capture_clock_offset_(absl::StartsWith(
|
||||
include_capture_clock_offset_(!absl::StartsWith(
|
||||
config.field_trials->Lookup(kIncludeCaptureClockOffset),
|
||||
"Enabled")) {
|
||||
"Disabled")) {
|
||||
if (frame_transformer_delegate_)
|
||||
frame_transformer_delegate_->Init();
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ class FieldTrials : public WebRtcKeyValueConfig {
|
|||
if (key == "WebRTC-SendSideBwe-WithOverhead") {
|
||||
return use_send_side_bwe_with_overhead_ ? "Enabled" : "";
|
||||
} else if (key == "WebRTC-IncludeCaptureClockOffset") {
|
||||
return include_capture_clock_offset_ ? "Enabled" : "";
|
||||
return include_capture_clock_offset_ ? "" : "Disabled";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue