Propagate base minimum delay to audio_receiver_stream
Bug: webrtc:10287 Change-Id: Id7914976ef5b7eb708802119932b554d9ce4879e Reviewed-on: https://webrtc-review.googlesource.com/c/121563 Commit-Queue: Ruslan Burakov <kuddai@google.com> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26563}
This commit is contained in:
committed by
Commit Bot
parent
9ce800d6d1
commit
3b50f9f9ce
@ -239,6 +239,16 @@ void AudioReceiveStream::SetGain(float gain) {
|
||||
channel_receive_->SetChannelOutputVolumeScaling(gain);
|
||||
}
|
||||
|
||||
bool AudioReceiveStream::SetBaseMinimumPlayoutDelayMs(int delay_ms) {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
return channel_receive_->SetBaseMinimumPlayoutDelayMs(delay_ms);
|
||||
}
|
||||
|
||||
int AudioReceiveStream::GetBaseMinimumPlayoutDelayMs() const {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
return channel_receive_->GetBaseMinimumPlayoutDelayMs();
|
||||
}
|
||||
|
||||
std::vector<RtpSource> AudioReceiveStream::GetSources() const {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
return channel_receive_->GetSources();
|
||||
|
||||
@ -64,6 +64,8 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream,
|
||||
webrtc::AudioReceiveStream::Stats GetStats() const override;
|
||||
void SetSink(AudioSinkInterface* sink) override;
|
||||
void SetGain(float gain) override;
|
||||
bool SetBaseMinimumPlayoutDelayMs(int delay_ms) override;
|
||||
int GetBaseMinimumPlayoutDelayMs() const override;
|
||||
std::vector<webrtc::RtpSource> GetSources() const override;
|
||||
|
||||
// TODO(nisse): We don't formally implement RtpPacketSinkInterface, and this
|
||||
|
||||
@ -144,6 +144,10 @@ class ChannelReceive : public ChannelReceiveInterface,
|
||||
void SetMinimumPlayoutDelay(int delayMs) override;
|
||||
uint32_t GetPlayoutTimestamp() const override;
|
||||
|
||||
// Audio quality.
|
||||
bool SetBaseMinimumPlayoutDelayMs(int delay_ms) override;
|
||||
int GetBaseMinimumPlayoutDelayMs() const override;
|
||||
|
||||
// Produces the transport-related timestamps; current_delay_ms is left unset.
|
||||
absl::optional<Syncable::Info> GetSyncInfo() const override;
|
||||
|
||||
@ -865,6 +869,14 @@ uint32_t ChannelReceive::GetPlayoutTimestamp() const {
|
||||
}
|
||||
}
|
||||
|
||||
bool ChannelReceive::SetBaseMinimumPlayoutDelayMs(int delay_ms) {
|
||||
return audio_coding_->SetBaseMinimumPlayoutDelayMs(delay_ms);
|
||||
}
|
||||
|
||||
int ChannelReceive::GetBaseMinimumPlayoutDelayMs() const {
|
||||
return audio_coding_->GetBaseMinimumPlayoutDelayMs();
|
||||
}
|
||||
|
||||
absl::optional<Syncable::Info> ChannelReceive::GetSyncInfo() const {
|
||||
RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread());
|
||||
Syncable::Info info;
|
||||
|
||||
@ -102,6 +102,12 @@ class ChannelReceiveInterface : public RtpPacketSinkInterface {
|
||||
virtual void SetMinimumPlayoutDelay(int delay_ms) = 0;
|
||||
virtual uint32_t GetPlayoutTimestamp() const = 0;
|
||||
|
||||
// Audio quality.
|
||||
// Base minimum delay sets lower bound on minimum delay value which
|
||||
// determines minimum delay until audio playout.
|
||||
virtual bool SetBaseMinimumPlayoutDelayMs(int delay_ms) = 0;
|
||||
virtual int GetBaseMinimumPlayoutDelayMs() const = 0;
|
||||
|
||||
// Produces the transport-related timestamps; current_delay_ms is left unset.
|
||||
virtual absl::optional<Syncable::Info> GetSyncInfo() const = 0;
|
||||
|
||||
|
||||
@ -53,6 +53,8 @@ class MockChannelReceive : public voe::ChannelReceiveInterface {
|
||||
MOCK_CONST_METHOD0(GetPlayoutTimestamp, uint32_t());
|
||||
MOCK_CONST_METHOD0(GetSyncInfo, absl::optional<Syncable::Info>());
|
||||
MOCK_METHOD1(SetMinimumPlayoutDelay, void(int delay_ms));
|
||||
MOCK_METHOD1(SetBaseMinimumPlayoutDelayMs, bool(int delay_ms));
|
||||
MOCK_CONST_METHOD0(GetBaseMinimumPlayoutDelayMs, int());
|
||||
MOCK_CONST_METHOD0(GetReceiveCodec,
|
||||
absl::optional<std::pair<int, SdpAudioFormat>>());
|
||||
MOCK_METHOD1(SetReceiveCodecs,
|
||||
|
||||
@ -164,6 +164,15 @@ class AudioReceiveStream {
|
||||
// is potentially forwarded to any attached AudioSinkInterface implementation.
|
||||
virtual void SetGain(float gain) = 0;
|
||||
|
||||
// Sets a base minimum for the playout delay. Base minimum delay sets lower
|
||||
// bound on minimum delay value determining lower bound on playout delay.
|
||||
//
|
||||
// Returns true if value was successfully set, false overwise.
|
||||
virtual bool SetBaseMinimumPlayoutDelayMs(int delay_ms) = 0;
|
||||
|
||||
// Returns current value of base minimum delay in milliseconds.
|
||||
virtual int GetBaseMinimumPlayoutDelayMs() const = 0;
|
||||
|
||||
virtual std::vector<RtpSource> GetSources() const = 0;
|
||||
|
||||
protected:
|
||||
|
||||
@ -104,6 +104,13 @@ class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream {
|
||||
webrtc::AudioReceiveStream::Stats GetStats() const override;
|
||||
void SetSink(webrtc::AudioSinkInterface* sink) override;
|
||||
void SetGain(float gain) override;
|
||||
bool SetBaseMinimumPlayoutDelayMs(int delay_ms) override {
|
||||
base_minimum_playout_delay_ms_ = delay_ms;
|
||||
return true;
|
||||
}
|
||||
int GetBaseMinimumPlayoutDelayMs() const override {
|
||||
return base_minimum_playout_delay_ms_;
|
||||
}
|
||||
std::vector<webrtc::RtpSource> GetSources() const override {
|
||||
return std::vector<webrtc::RtpSource>();
|
||||
}
|
||||
@ -116,6 +123,7 @@ class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream {
|
||||
float gain_ = 1.0f;
|
||||
rtc::Buffer last_packet_;
|
||||
bool started_ = false;
|
||||
int base_minimum_playout_delay_ms_ = 0;
|
||||
};
|
||||
|
||||
class FakeVideoSendStream final
|
||||
|
||||
@ -100,6 +100,10 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
|
||||
// Maximum playout delay.
|
||||
int SetMaximumPlayoutDelay(int time_ms) override;
|
||||
|
||||
bool SetBaseMinimumPlayoutDelayMs(int delay_ms) override;
|
||||
|
||||
int GetBaseMinimumPlayoutDelayMs() const override;
|
||||
|
||||
absl::optional<uint32_t> PlayoutTimestamp() override;
|
||||
|
||||
int FilteredCurrentDelayMs() const override;
|
||||
@ -708,6 +712,15 @@ int AudioCodingModuleImpl::SetMaximumPlayoutDelay(int time_ms) {
|
||||
return receiver_.SetMaximumDelay(time_ms);
|
||||
}
|
||||
|
||||
bool AudioCodingModuleImpl::SetBaseMinimumPlayoutDelayMs(int delay_ms) {
|
||||
// All necessary validation happens on NetEq level.
|
||||
return receiver_.SetBaseMinimumDelayMs(delay_ms);
|
||||
}
|
||||
|
||||
int AudioCodingModuleImpl::GetBaseMinimumPlayoutDelayMs() const {
|
||||
return receiver_.GetBaseMinimumDelayMs();
|
||||
}
|
||||
|
||||
// Get 10 milliseconds of raw audio data to play out.
|
||||
// Automatic resample to the requested frequency.
|
||||
int AudioCodingModuleImpl::PlayoutData10Ms(int desired_freq_hz,
|
||||
|
||||
@ -275,6 +275,15 @@ class AudioCodingModule {
|
||||
//
|
||||
virtual int SetMaximumPlayoutDelay(int time_ms) = 0;
|
||||
|
||||
// Sets a base minimum for the playout delay. Base minimum delay sets lower
|
||||
// bound minimum delay value which is set via SetMinimumPlayoutDelay.
|
||||
//
|
||||
// Returns true if value was successfully set, false overwise.
|
||||
virtual bool SetBaseMinimumPlayoutDelayMs(int delay_ms) = 0;
|
||||
|
||||
// Returns current value of base minimum delay in milliseconds.
|
||||
virtual int GetBaseMinimumPlayoutDelayMs() const = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// int32_t PlayoutTimestamp()
|
||||
// The send timestamp of an RTP packet is associated with the decoded
|
||||
|
||||
Reference in New Issue
Block a user