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

Unified Diff: media/cast/sender/video_sender.cc

Issue 2867013003: Remove base::SupportsWeakPtr from {Audio,Video}Sender (Closed)
Patch Set: Remove base::SupportsWeakPtr Created 3 years, 7 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
« no previous file with comments | « media/cast/sender/video_sender.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/video_sender.cc
diff --git a/media/cast/sender/video_sender.cc b/media/cast/sender/video_sender.cc
index 8447223d1e93ee14aab7c426e3dbe1deec980787..d81fab759676f742a67e3cdebbc8dfa2c6b9c46c 100644
--- a/media/cast/sender/video_sender.cc
+++ b/media/cast/sender/video_sender.cc
@@ -257,8 +257,8 @@ void VideoSender::InsertRawVideoFrame(
last_reported_lossy_utilization_, video_frame);
if (video_encoder_->EncodeVideoFrame(
frame_to_encode, reference_time,
- base::Bind(&VideoSender::OnEncodedVideoFrame,
- weak_factory_.GetWeakPtr(), frame_to_encode, bitrate))) {
+ base::Bind(&VideoSender::OnEncodedVideoFrame, AsWeakPtr(),
+ frame_to_encode, bitrate))) {
TRACE_EVENT_ASYNC_BEGIN1("cast.stream", "Video Encode",
frame_to_encode.get(), "rtp_timestamp",
rtp_timestamp.lower_32_bits());
@@ -278,6 +278,10 @@ std::unique_ptr<VideoFrameFactory> VideoSender::CreateVideoFrameFactory() {
return video_encoder_ ? video_encoder_->CreateVideoFrameFactory() : nullptr;
}
+base::WeakPtr<VideoSender> VideoSender::AsWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
int VideoSender::GetNumberOfFramesInEncoder() const {
return frames_in_encoder_;
}
« no previous file with comments | « media/cast/sender/video_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698