Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1103)

Unified Diff: webrtc/modules/congestion_controller/transport_feedback_adapter.h

Issue 2378103005: Reland: Fix race / crash in OnNetworkRouteChanged(). (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/congestion_controller/transport_feedback_adapter.h
diff --git a/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h b/webrtc/modules/congestion_controller/transport_feedback_adapter.h
similarity index 67%
rename from webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h
rename to webrtc/modules/congestion_controller/transport_feedback_adapter.h
index 2db66039846579822412e65189076ca076f4da43..6422736c5c6d005fcb966cb546d896c4e57b3240 100644
--- a/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h
+++ b/webrtc/modules/congestion_controller/transport_feedback_adapter.h
@@ -8,58 +8,63 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_
-#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_
+#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_
+#define WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_
#include <memory>
#include <vector>
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/thread_annotations.h"
+#include "webrtc/base/thread_checker.h"
+#include "webrtc/modules/congestion_controller/delay_based_bwe.h"
#include "webrtc/modules/include/module_common_types.h"
-#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
namespace webrtc {
+class BitrateController;
class ProcessThread;
class TransportFeedbackAdapter : public TransportFeedbackObserver,
public CallStatsObserver {
public:
- explicit TransportFeedbackAdapter(Clock* clock);
+ TransportFeedbackAdapter(Clock* clock, BitrateController* bitrate_controller);
virtual ~TransportFeedbackAdapter();
- void SetBitrateEstimator(RemoteBitrateEstimator* rbe);
- RemoteBitrateEstimator* GetBitrateEstimator() const {
- return bitrate_estimator_.get();
- }
-
+ void InitBwe();
// Implements TransportFeedbackObserver.
void AddPacket(uint16_t sequence_number,
size_t length,
int probe_cluster_id) override;
void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms);
+ // TODO(holmer): This method should return DelayBasedBwe::Result so that we
+ // can get rid of the dependency on BitrateController. Requires changes
+ // to the CongestionController interface.
void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override;
std::vector<PacketInfo> GetTransportFeedbackVector() const override;
// Implements CallStatsObserver.
void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
+ void SetMinBitrate(int min_bitrate_bps);
+
private:
std::vector<PacketInfo> GetPacketFeedbackVector(
const rtcp::TransportFeedback& feedback);
rtc::CriticalSection lock_;
+ rtc::CriticalSection bwe_lock_;
SendTimeHistory send_time_history_ GUARDED_BY(&lock_);
- std::unique_ptr<RemoteBitrateEstimator> bitrate_estimator_;
+ std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(&bwe_lock_);
Clock* const clock_;
int64_t current_offset_ms_;
int64_t last_timestamp_us_;
+ BitrateController* const bitrate_controller_;
std::vector<PacketInfo> last_packet_feedback_vector_;
};
} // namespace webrtc
-#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_
+#endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_TRANSPORT_FEEDBACK_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698