| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/decrypting_audio_decoder.h" | 5 #include "media/filters/decrypting_audio_decoder.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <cstdlib> | 9 #include <cstdlib> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "media/base/audio_buffer.h" | 16 #include "media/base/audio_buffer.h" |
| 17 #include "media/base/audio_decoder_config.h" | 17 #include "media/base/audio_decoder_config.h" |
| 18 #include "media/base/audio_timestamp_helper.h" | 18 #include "media/base/audio_timestamp_helper.h" |
| 19 #include "media/base/bind_to_current_loop.h" | 19 #include "media/base/bind_to_current_loop.h" |
| 20 #include "media/base/cdm_context.h" | 20 #include "media/base/cdm_context.h" |
| 21 #include "media/base/decoder_buffer.h" | 21 #include "media/base/decoder_buffer.h" |
| 22 #include "media/base/media_log.h" | 22 #include "media/base/media_log.h" |
| 23 #include "media/base/pipeline.h" | |
| 24 #include "media/base/timestamp_constants.h" | 23 #include "media/base/timestamp_constants.h" |
| 25 | 24 |
| 26 namespace media { | 25 namespace media { |
| 27 | 26 |
| 28 static inline bool IsOutOfSync(const base::TimeDelta& timestamp_1, | 27 static inline bool IsOutOfSync(const base::TimeDelta& timestamp_1, |
| 29 const base::TimeDelta& timestamp_2) { | 28 const base::TimeDelta& timestamp_2) { |
| 30 // Out of sync of 100ms would be pretty noticeable and we should keep any | 29 // Out of sync of 100ms would be pretty noticeable and we should keep any |
| 31 // drift below that. | 30 // drift below that. |
| 32 const int64_t kOutOfSyncThresholdInMilliseconds = 100; | 31 const int64_t kOutOfSyncThresholdInMilliseconds = 100; |
| 33 return std::abs(timestamp_1.InMilliseconds() - timestamp_2.InMilliseconds()) > | 32 return std::abs(timestamp_1.InMilliseconds() - timestamp_2.InMilliseconds()) > |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 347 } |
| 349 | 348 |
| 350 frame->set_timestamp(current_time); | 349 frame->set_timestamp(current_time); |
| 351 timestamp_helper_->AddFrames(frame->frame_count()); | 350 timestamp_helper_->AddFrames(frame->frame_count()); |
| 352 | 351 |
| 353 output_cb_.Run(frame); | 352 output_cb_.Run(frame); |
| 354 } | 353 } |
| 355 } | 354 } |
| 356 | 355 |
| 357 } // namespace media | 356 } // namespace media |
| OLD | NEW |