| 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.h" | 5 #include "media/mojo/services/mojo_decryptor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "media/base/audio_buffer.h" | 13 #include "media/base/audio_buffer.h" |
| 14 #include "media/base/decoder_buffer.h" | 14 #include "media/base/decoder_buffer.h" |
| 15 #include "media/base/video_frame.h" | 15 #include "media/base/video_frame.h" |
| 16 #include "media/mojo/interfaces/decryptor.mojom.h" | 16 #include "media/mojo/interfaces/decryptor.mojom.h" |
| 17 #include "media/mojo/services/media_type_converters.h" | 17 #include "media/mojo/services/media_type_converters.h" |
| 18 #include "mojo/application/public/cpp/connect.h" | 18 #include "mojo/shell/public/cpp/connect.h" |
| 19 | 19 |
| 20 namespace media { | 20 namespace media { |
| 21 | 21 |
| 22 MojoDecryptor::MojoDecryptor(interfaces::DecryptorPtr remote_decryptor) | 22 MojoDecryptor::MojoDecryptor(interfaces::DecryptorPtr remote_decryptor) |
| 23 : remote_decryptor_(std::move(remote_decryptor)), weak_factory_(this) { | 23 : remote_decryptor_(std::move(remote_decryptor)), weak_factory_(this) { |
| 24 CreateDataPipes(); | 24 CreateDataPipes(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 MojoDecryptor::~MojoDecryptor() {} | 27 MojoDecryptor::~MojoDecryptor() {} |
| 28 | 28 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 uint32_t num_bytes = media_buffer->data_size(); | 209 uint32_t num_bytes = media_buffer->data_size(); |
| 210 DCHECK_GT(num_bytes, 0u); | 210 DCHECK_GT(num_bytes, 0u); |
| 211 CHECK_EQ(ReadDataRaw(consumer_handle_.get(), media_buffer->writable_data(), | 211 CHECK_EQ(ReadDataRaw(consumer_handle_.get(), media_buffer->writable_data(), |
| 212 &num_bytes, MOJO_READ_DATA_FLAG_ALL_OR_NONE), | 212 &num_bytes, MOJO_READ_DATA_FLAG_ALL_OR_NONE), |
| 213 MOJO_RESULT_OK); | 213 MOJO_RESULT_OK); |
| 214 CHECK_EQ(num_bytes, static_cast<uint32_t>(media_buffer->data_size())); | 214 CHECK_EQ(num_bytes, static_cast<uint32_t>(media_buffer->data_size())); |
| 215 return media_buffer; | 215 return media_buffer; |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace media | 218 } // namespace media |
| OLD | NEW |