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_; |
} |