Make RtpTransceiver not inherit from RefCountedObject.
Also update API proxy Create() factory functions to accept the inner
reference counted object via scoped_refptr instead of a raw pointer.
This is to avoid accidentally creating and deleting an object when
passing an inner object to a proxy class.
Consider something like:
auto proxy = MyProxy::Create(
signaling_thread(), make_ref_counted<Foo>());
Bug: webrtc:13464, webrtc:12701
Change-Id: I55ccfff43bbc164a5e909b2c9020e306ebb09075
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256010
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36261}
diff --git a/pc/video_track.cc b/pc/video_track.cc
index 744800c..aa8e0df 100644
--- a/pc/video_track.cc
+++ b/pc/video_track.cc
@@ -136,8 +136,9 @@
rtc::Thread* worker_thread) {
rtc::scoped_refptr<
VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
- source_proxy = VideoTrackSourceProxy::Create(rtc::Thread::Current(),
- worker_thread, source);
+ source_proxy = VideoTrackSourceProxy::Create(
+ rtc::Thread::Current(), worker_thread,
+ rtc::scoped_refptr<VideoTrackSourceInterface>(source));
return rtc::make_ref_counted<VideoTrack>(id, std::move(source_proxy),
worker_thread);