OLD | NEW |
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 Loading... |
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 |
OLD | NEW |