Make VideoBitrateAllocatorFactory injectable.
This patch makes VideoBitrateAllocatorFactory injectable
by adding to PeerConnectionDependencies instead of allowing it to be
overridden using MediaEngine (on PeerConnectionFactory).
With this patch VideoBitrateAllocatorFactory is owned
by the PeerConnection.
WANT_LGTM (examples) : sakal@
WANT_LGTM (api/pc) : steveanton@
Bug: webrtc:10547
Change-Id: I768d400a621f2b7a98795eb7f410adb48651bfd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132706
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27654}
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index 2cf3662..c21261c 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -1332,6 +1332,15 @@
// channel manager and the session description factory.
rtc::UniqueRandomIdGenerator ssrc_generator_
RTC_GUARDED_BY(signaling_thread());
+
+ // A video bitrate allocator factory.
+ // This can injected using the PeerConnectionDependencies,
+ // or else the CreateBuiltinVideoBitrateAllocatorFactory() will be called.
+ // Note that one can still choose to override this in a MediaEngine
+ // if one wants too.
+ std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
+ video_bitrate_allocator_factory_;
+
bool is_negotiation_needed_ RTC_GUARDED_BY(signaling_thread()) = false;
};