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

Side by Side Diff: media/mojo/services/mojo_decryptor_service.cc

Issue 2908303003: media: Create Mojo StructTraits for VideoFrame (Closed)
Patch Set: Eagerly initialize the context object. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mojo/services/mojo_decryptor_service.h" 5 #include "media/mojo/services/mojo_decryptor_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 DVLOG_IF(3, status == Status::kSuccess) << __func__; 231 DVLOG_IF(3, status == Status::kSuccess) << __func__;
232 232
233 if (!frame) { 233 if (!frame) {
234 DCHECK_NE(status, Status::kSuccess); 234 DCHECK_NE(status, Status::kSuccess);
235 callback.Run(status, nullptr, nullptr); 235 callback.Run(status, nullptr, nullptr);
236 return; 236 return;
237 } 237 }
238 238
239 // If |frame| has shared memory that will be passed back, keep the reference 239 // If |frame| has shared memory that will be passed back, keep the reference
240 // to it until the other side is done with the memory. 240 // to it until the other side is done with the memory.
241 mojom::VideoFramePtr mojo_frame = mojom::VideoFrame::From(frame);
242 mojom::FrameResourceReleaserPtr releaser; 241 mojom::FrameResourceReleaserPtr releaser;
243 if (frame->storage_type() == VideoFrame::STORAGE_MOJO_SHARED_BUFFER) { 242 if (frame->storage_type() == VideoFrame::STORAGE_MOJO_SHARED_BUFFER) {
244 mojo::MakeStrongBinding( 243 mojo::MakeStrongBinding(base::MakeUnique<FrameResourceReleaserImpl>(frame),
245 base::MakeUnique<FrameResourceReleaserImpl>(std::move(frame)), 244 mojo::MakeRequest(&releaser));
246 mojo::MakeRequest(&releaser));
247 } 245 }
248 246
249 callback.Run(status, std::move(mojo_frame), std::move(releaser)); 247 callback.Run(status, std::move(frame), std::move(releaser));
250 } 248 }
251 249
252 } // namespace media 250 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698