OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_audio_decoder.h" | 5 #include "media/mojo/services/mojo_audio_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
14 #include "media/base/audio_buffer.h" | 14 #include "media/base/audio_buffer.h" |
15 #include "media/base/cdm_context.h" | 15 #include "media/base/cdm_context.h" |
16 #include "media/mojo/common/media_type_converters.h" | 16 #include "media/mojo/common/media_type_converters.h" |
17 | 17 |
18 namespace media { | 18 namespace media { |
19 | 19 |
20 MojoAudioDecoder::MojoAudioDecoder( | 20 MojoAudioDecoder::MojoAudioDecoder( |
21 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 21 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
22 interfaces::AudioDecoderPtr remote_decoder) | 22 interfaces::AudioDecoderPtr remote_decoder) |
23 : task_runner_(task_runner), | 23 : task_runner_(task_runner), |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 uint32_t num_bytes = base::checked_cast<uint32_t>(media_buffer->data_size()); | 225 uint32_t num_bytes = base::checked_cast<uint32_t>(media_buffer->data_size()); |
226 DCHECK_GT(num_bytes, 0u); | 226 DCHECK_GT(num_bytes, 0u); |
227 CHECK_EQ(WriteDataRaw(producer_handle_.get(), media_buffer->data(), | 227 CHECK_EQ(WriteDataRaw(producer_handle_.get(), media_buffer->data(), |
228 &num_bytes, MOJO_READ_DATA_FLAG_ALL_OR_NONE), | 228 &num_bytes, MOJO_READ_DATA_FLAG_ALL_OR_NONE), |
229 MOJO_RESULT_OK); | 229 MOJO_RESULT_OK); |
230 CHECK_EQ(num_bytes, static_cast<uint32_t>(media_buffer->data_size())); | 230 CHECK_EQ(num_bytes, static_cast<uint32_t>(media_buffer->data_size())); |
231 return buffer; | 231 return buffer; |
232 } | 232 } |
233 | 233 |
234 } // namespace media | 234 } // namespace media |
OLD | NEW |