| 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 "chromecast/media/cma/decoder/cast_audio_decoder.h" | 5 #include "chromecast/media/cma/decoder/cast_audio_decoder.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | |
| 9 #include <limits> | 8 #include <limits> |
| 10 #include <queue> | 9 #include <queue> |
| 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "chromecast/media/cma/base/decoder_buffer_adapter.h" | 18 #include "chromecast/media/cma/base/decoder_buffer_adapter.h" |
| 19 #include "chromecast/media/cma/base/decoder_buffer_base.h" | 19 #include "chromecast/media/cma/base/decoder_buffer_base.h" |
| 20 #include "chromecast/media/cma/base/decoder_config_adapter.h" | 20 #include "chromecast/media/cma/base/decoder_config_adapter.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 // static | 270 // static |
| 271 scoped_ptr<CastAudioDecoder> CastAudioDecoder::Create( | 271 scoped_ptr<CastAudioDecoder> CastAudioDecoder::Create( |
| 272 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 272 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 273 const media::AudioConfig& config, | 273 const media::AudioConfig& config, |
| 274 OutputFormat output_format, | 274 OutputFormat output_format, |
| 275 const InitializedCallback& initialized_callback) { | 275 const InitializedCallback& initialized_callback) { |
| 276 scoped_ptr<CastAudioDecoderImpl> decoder(new CastAudioDecoderImpl( | 276 scoped_ptr<CastAudioDecoderImpl> decoder(new CastAudioDecoderImpl( |
| 277 task_runner, initialized_callback, output_format)); | 277 task_runner, initialized_callback, output_format)); |
| 278 decoder->Initialize(config); | 278 decoder->Initialize(config); |
| 279 return decoder.Pass(); | 279 return std::move(decoder); |
| 280 } | 280 } |
| 281 | 281 |
| 282 // static | 282 // static |
| 283 int CastAudioDecoder::OutputFormatSizeInBytes( | 283 int CastAudioDecoder::OutputFormatSizeInBytes( |
| 284 CastAudioDecoder::OutputFormat format) { | 284 CastAudioDecoder::OutputFormat format) { |
| 285 switch (format) { | 285 switch (format) { |
| 286 case CastAudioDecoder::OutputFormat::kOutputSigned16: | 286 case CastAudioDecoder::OutputFormat::kOutputSigned16: |
| 287 return 2; | 287 return 2; |
| 288 case CastAudioDecoder::OutputFormat::kOutputPlanarFloat: | 288 case CastAudioDecoder::OutputFormat::kOutputPlanarFloat: |
| 289 return 4; | 289 return 4; |
| 290 } | 290 } |
| 291 NOTREACHED(); | 291 NOTREACHED(); |
| 292 return 1; | 292 return 1; |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace media | 295 } // namespace media |
| 296 } // namespace chromecast | 296 } // namespace chromecast |
| OLD | NEW |