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

Unified Diff: media/mojo/clients/mojo_decryptor.cc

Issue 2908303003: media: Create Mojo StructTraits for VideoFrame (Closed)
Patch Set: Code formatting. 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
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

Powered by Google App Engine
This is Rietveld 408576698