Index: media/mojo/clients/mojo_decryptor.cc |
diff --git a/media/mojo/clients/mojo_decryptor.cc b/media/mojo/clients/mojo_decryptor.cc |
index 2a08ae57d7a929cba637fe330d6abbd03ba7fe24..4b57ed9a1545a0497106356d349851b920116cda 100644 |
--- a/media/mojo/clients/mojo_decryptor.cc |
+++ b/media/mojo/clients/mojo_decryptor.cc |
@@ -224,27 +224,20 @@ void MojoDecryptor::OnAudioDecoded( |
void MojoDecryptor::OnVideoDecoded(const VideoDecodeCB& video_decode_cb, |
Status status, |
- mojom::VideoFramePtr video_frame, |
+ const scoped_refptr<VideoFrame>& video_frame, |
dcheng
2017/06/05 20:33:01
Nit: Consider passing by value and using std::move
sandersd (OOO until July 31)
2017/06/05 20:46:13
This would be the ideal setup, but I don't see a c
|
mojom::FrameResourceReleaserPtr releaser) { |
DVLOG_IF(1, status != kSuccess) << __func__ << "(" << status << ")"; |
DVLOG_IF(3, status == kSuccess) << __func__; |
DCHECK(thread_checker_.CalledOnValidThread()); |
- if (video_frame.is_null()) { |
- video_decode_cb.Run(status, nullptr); |
- return; |
- } |
- |
- scoped_refptr<VideoFrame> frame(video_frame.To<scoped_refptr<VideoFrame>>()); |
- |
// If using shared memory, ensure that |releaser| is closed when |
// |frame| is destroyed. |
- if (releaser) { |
- frame->AddDestructionObserver( |
+ if (video_frame && releaser) { |
+ video_frame->AddDestructionObserver( |
base::Bind(&ReleaseFrameResource, base::Passed(&releaser))); |
} |
- video_decode_cb.Run(status, frame); |
+ video_decode_cb.Run(status, video_frame); |
} |
} // namespace media |