Refactor VideoTrackSource, without raw pointer injection.
Bug: None
Change-Id: If4aa8ba72eb3dbdd7dca8970cd6349f1679bc222
Reviewed-on: https://webrtc-review.googlesource.com/78403
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23370}
diff --git a/pc/rtpreceiver.cc b/pc/rtpreceiver.cc
index ee45c4e..341261b 100644
--- a/pc/rtpreceiver.cc
+++ b/pc/rtpreceiver.cc
@@ -215,8 +215,7 @@
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams)
: worker_thread_(worker_thread),
id_(receiver_id),
- source_(new RefCountedObject<VideoTrackSource>(&broadcaster_,
- true /* remote */)),
+ source_(new RefCountedObject<VideoRtpTrackSource>()),
track_(VideoTrackProxy::Create(
rtc::Thread::Current(),
worker_thread,
@@ -270,7 +269,6 @@
return;
}
source_->SetState(MediaSourceInterface::kEnded);
- source_->OnSourceDestroyed();
if (!media_channel_ || !ssrc_) {
RTC_LOG(LS_WARNING) << "VideoRtpReceiver::Stop: No video channel exists.";
} else {
@@ -293,7 +291,7 @@
SetSink(nullptr);
}
ssrc_ = ssrc;
- SetSink(&broadcaster_);
+ SetSink(source_->sink());
}
void VideoRtpReceiver::SetStreams(