mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Add a transport_cc() getter and remove rtp_config().
Bug: webrtc:11993 Change-Id: Ie435a702c91b4d3827e528083f474e378fc75cc5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261318 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36822}
This commit is contained in:
parent
cc001e2d2a
commit
7a15ff3f14
10 changed files with 28 additions and 25 deletions
|
@ -211,6 +211,11 @@ void AudioReceiveStream::Stop() {
|
|||
audio_state()->RemoveReceivingStream(this);
|
||||
}
|
||||
|
||||
bool AudioReceiveStream::transport_cc() const {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
return config_.rtp.transport_cc;
|
||||
}
|
||||
|
||||
bool AudioReceiveStream::IsRunning() const {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
return playing_;
|
||||
|
|
|
@ -83,7 +83,7 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream,
|
|||
// webrtc::AudioReceiveStream implementation.
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
const RtpConfig& rtp_config() const override { return config_.rtp; }
|
||||
bool transport_cc() const override;
|
||||
bool IsRunning() const override;
|
||||
void SetDepacketizerToDecoderFrameTransformer(
|
||||
rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer)
|
||||
|
|
|
@ -108,7 +108,7 @@ class AudioReceiveStream : public MediaReceiveStream {
|
|||
std::string ToString() const;
|
||||
|
||||
// Receive-stream specific RTP settings.
|
||||
struct Rtp : public RtpConfig {
|
||||
struct Rtp : public ReceiveStreamRtpConfig {
|
||||
Rtp();
|
||||
~Rtp();
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ bool SendPeriodicFeedback(const std::vector<RtpExtension>& extensions) {
|
|||
}
|
||||
|
||||
bool UseSendSideBwe(const ReceiveStream* stream) {
|
||||
if (!stream->rtp_config().transport_cc)
|
||||
if (!stream->transport_cc())
|
||||
return false;
|
||||
for (const auto& extension : stream->GetRtpExtensions()) {
|
||||
if (extension.uri == RtpExtension::kTransportSequenceNumberUri ||
|
||||
|
|
|
@ -50,7 +50,7 @@ class FlexfecReceiveStream : public RtpPacketSinkInterface,
|
|||
// Payload type for FlexFEC.
|
||||
int payload_type = -1;
|
||||
|
||||
RtpConfig rtp;
|
||||
ReceiveStreamRtpConfig rtp;
|
||||
|
||||
// Vector containing a single element, corresponding to the SSRC of the
|
||||
// media stream being protected by this FlexFEC stream. The vector MUST have
|
||||
|
|
|
@ -61,8 +61,11 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
|
|||
// ReceiveStream impl.
|
||||
void SetRtpExtensions(std::vector<RtpExtension> extensions) override;
|
||||
const std::vector<RtpExtension>& GetRtpExtensions() const override;
|
||||
const RtpConfig& rtp_config() const override { return config_.rtp; }
|
||||
uint32_t remote_ssrc() const { return config_.rtp.remote_ssrc; }
|
||||
bool transport_cc() const override {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
return config_.rtp.transport_cc;
|
||||
}
|
||||
|
||||
private:
|
||||
RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
|
||||
|
|
|
@ -26,7 +26,9 @@ namespace webrtc {
|
|||
class ReceiveStream {
|
||||
public:
|
||||
// Receive-stream specific RTP settings.
|
||||
struct RtpConfig {
|
||||
// TODO(tommi): This struct isn't needed at this level anymore. Move it closer
|
||||
// to where it's used.
|
||||
struct ReceiveStreamRtpConfig {
|
||||
// Synchronization source (stream identifier) to be received.
|
||||
// This member will not change mid-stream and can be assumed to be const
|
||||
// post initialization.
|
||||
|
@ -60,11 +62,13 @@ class ReceiveStream {
|
|||
// TODO(tommi): Consider using `RtpHeaderExtensionMap` instead.
|
||||
virtual const std::vector<RtpExtension>& GetRtpExtensions() const = 0;
|
||||
|
||||
// Called on the packet delivery thread since some members of the config may
|
||||
// change mid-stream (e.g. the local ssrc). All mutation must also happen on
|
||||
// the packet delivery thread. Return value can be assumed to
|
||||
// only be used in the calling context (on the stack basically).
|
||||
virtual const RtpConfig& rtp_config() const = 0;
|
||||
// Returns a bool for whether feedback for send side bandwidth estimation is
|
||||
// enabled. See
|
||||
// https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions
|
||||
// for details.
|
||||
// This value may change mid-stream and must be done on the same thread
|
||||
// that the value is read on (i.e. packet delivery).
|
||||
virtual bool transport_cc() const = 0;
|
||||
|
||||
protected:
|
||||
virtual ~ReceiveStream() {}
|
||||
|
|
|
@ -174,7 +174,7 @@ class VideoReceiveStream : public MediaReceiveStream {
|
|||
VideoDecoderFactory* decoder_factory = nullptr;
|
||||
|
||||
// Receive-stream specific RTP settings.
|
||||
struct Rtp : public RtpConfig {
|
||||
struct Rtp : public ReceiveStreamRtpConfig {
|
||||
Rtp();
|
||||
Rtp(const Rtp&);
|
||||
~Rtp();
|
||||
|
|
|
@ -110,9 +110,7 @@ class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream {
|
|||
}
|
||||
|
||||
private:
|
||||
const webrtc::ReceiveStream::RtpConfig& rtp_config() const override {
|
||||
return config_.rtp;
|
||||
}
|
||||
bool transport_cc() const override { return config_.rtp.transport_cc; }
|
||||
uint32_t remote_ssrc() const override { return config_.rtp.remote_ssrc; }
|
||||
void Start() override { started_ = true; }
|
||||
void Stop() override { started_ = false; }
|
||||
|
@ -268,10 +266,7 @@ class FakeVideoReceiveStream final : public webrtc::VideoReceiveStream {
|
|||
// webrtc::VideoReceiveStream implementation.
|
||||
void SetRtpExtensions(std::vector<webrtc::RtpExtension> extensions) override;
|
||||
const std::vector<webrtc::RtpExtension>& GetRtpExtensions() const override;
|
||||
|
||||
const webrtc::ReceiveStream::RtpConfig& rtp_config() const override {
|
||||
return config_.rtp;
|
||||
}
|
||||
bool transport_cc() const override { return config_.rtp.transport_cc; }
|
||||
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
|
@ -301,10 +296,7 @@ class FakeFlexfecReceiveStream final : public webrtc::FlexfecReceiveStream {
|
|||
|
||||
void SetRtpExtensions(std::vector<webrtc::RtpExtension> extensions) override;
|
||||
const std::vector<webrtc::RtpExtension>& GetRtpExtensions() const override;
|
||||
|
||||
const webrtc::ReceiveStream::RtpConfig& rtp_config() const override {
|
||||
return config_.rtp;
|
||||
}
|
||||
bool transport_cc() const override { return config_.rtp.transport_cc; }
|
||||
|
||||
const webrtc::FlexfecReceiveStream::Config& GetConfig() const;
|
||||
|
||||
|
|
|
@ -136,8 +136,7 @@ class VideoReceiveStream2
|
|||
|
||||
void SetRtpExtensions(std::vector<RtpExtension> extensions) override;
|
||||
const std::vector<RtpExtension>& GetRtpExtensions() const override;
|
||||
|
||||
const RtpConfig& rtp_config() const override { return rtp(); }
|
||||
bool transport_cc() const override { return rtp().transport_cc; }
|
||||
|
||||
webrtc::VideoReceiveStream::Stats GetStats() const override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue