This is a reland of 9d230d54c7eef31ac1100f0aeef1374dd1ac62fa Original change's description: > (Un/)Subscribe RtpVideoSender for feedback on the transport queue. > > * RtpVideoSender now registers/unregisters for feedback callback > inside of SetActive(), which runs on the transport queue. > * Transport feedback is given on the transport queue > * Registration/unregistration for feedback is done on the same > * Removed the last mutex from TransportFeedbackDemuxer. > > Ultimately, this work is related to moving state from the Call > class, that's related to network configuration, but due to the code > is currently written is attached to the worker thread, over to the > Transport, where it's used (e.g. suspended_video_send_ssrcs_). > > Bug: webrtc:13517, webrtc:11993 > Change-Id: I057d0e2597e6cb746b335e0308599cd547350e56 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248165 > Reviewed-by: Erik Språng <sprang@webrtc.org> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#35777} Bug: webrtc:13517, webrtc:11993 Change-Id: I766e569abea8bae96d32267a951fcdc195ced8a7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249782 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35863}
61 lines
2.4 KiB
C++
61 lines
2.4 KiB
C++
/*
|
|
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#ifndef MODULES_CONGESTION_CONTROLLER_RTP_TRANSPORT_FEEDBACK_DEMUXER_H_
|
|
#define MODULES_CONGESTION_CONTROLLER_RTP_TRANSPORT_FEEDBACK_DEMUXER_H_
|
|
|
|
#include <map>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "api/sequence_checker.h"
|
|
#include "modules/include/module_common_types_public.h"
|
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
|
#include "rtc_base/system/no_unique_address.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// Implementation of StreamFeedbackProvider that provides a way for
|
|
// implementations of StreamFeedbackObserver to register for feedback callbacks
|
|
// for a given set of SSRCs.
|
|
// Registration methods need to be called from the same execution context
|
|
// (thread or task queue) and callbacks to
|
|
// StreamFeedbackObserver::OnPacketFeedbackVector will be made in that same
|
|
// context.
|
|
// TODO(tommi): This appears to be the only implementation of this interface.
|
|
// Do we need the interface?
|
|
class TransportFeedbackDemuxer final : public StreamFeedbackProvider {
|
|
public:
|
|
TransportFeedbackDemuxer();
|
|
|
|
// Implements StreamFeedbackProvider interface
|
|
void RegisterStreamFeedbackObserver(
|
|
std::vector<uint32_t> ssrcs,
|
|
StreamFeedbackObserver* observer) override;
|
|
void DeRegisterStreamFeedbackObserver(
|
|
StreamFeedbackObserver* observer) override;
|
|
void AddPacket(const RtpPacketSendInfo& packet_info);
|
|
void OnTransportFeedback(const rtcp::TransportFeedback& feedback);
|
|
|
|
private:
|
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker observer_checker_;
|
|
SequenceNumberUnwrapper seq_num_unwrapper_ RTC_GUARDED_BY(&observer_checker_);
|
|
std::map<int64_t, StreamFeedbackObserver::StreamPacketInfo> history_
|
|
RTC_GUARDED_BY(&observer_checker_);
|
|
|
|
// Maps a set of ssrcs to corresponding observer. Vectors are used rather than
|
|
// set/map to ensure that the processing order is consistent independently of
|
|
// the randomized ssrcs.
|
|
std::vector<std::pair<std::vector<uint32_t>, StreamFeedbackObserver*>>
|
|
observers_ RTC_GUARDED_BY(&observer_checker_);
|
|
};
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_CONGESTION_CONTROLLER_RTP_TRANSPORT_FEEDBACK_DEMUXER_H_
|