| 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 #ifndef MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
| 6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "media/base/audio_decoder.h" | 10 #include "media/base/audio_decoder.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 Decryptor::Status status, | 95 Decryptor::Status status, |
| 96 const Decryptor::AudioBuffers& frames); | 96 const Decryptor::AudioBuffers& frames); |
| 97 | 97 |
| 98 // Callback for the |decryptor_| to notify this object that a new key has been | 98 // Callback for the |decryptor_| to notify this object that a new key has been |
| 99 // added. | 99 // added. |
| 100 void OnKeyAdded(); | 100 void OnKeyAdded(); |
| 101 | 101 |
| 102 // Resets decoder and calls |reset_cb_|. | 102 // Resets decoder and calls |reset_cb_|. |
| 103 void DoReset(); | 103 void DoReset(); |
| 104 | 104 |
| 105 // Sets audio configs from |demuxer_stream_| and resets |
| 106 // |output_timestamp_base_| and |total_samples_decoded_|. |
| 107 void SetDecoderConfig(); |
| 108 |
| 105 // Sets timestamp and duration for |queued_audio_frames_| to make sure the | 109 // Sets timestamp and duration for |queued_audio_frames_| to make sure the |
| 106 // renderer always receives continuous frames without gaps and overlaps. | 110 // renderer always receives continuous frames without gaps and overlaps. |
| 107 void EnqueueFrames(const Decryptor::AudioBuffers& frames); | 111 void EnqueueFrames(const Decryptor::AudioBuffers& frames); |
| 108 | 112 |
| 109 // Converts number of samples to duration. | 113 // Converts number of samples to duration. |
| 110 base::TimeDelta NumberOfSamplesToDuration(int number_of_samples) const; | 114 base::TimeDelta NumberOfSamplesToDuration(int number_of_samples) const; |
| 111 | 115 |
| 112 scoped_refptr<base::MessageLoopProxy> message_loop_; | 116 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 113 | 117 |
| 114 State state_; | 118 State state_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 151 |
| 148 base::TimeDelta output_timestamp_base_; | 152 base::TimeDelta output_timestamp_base_; |
| 149 int total_samples_decoded_; | 153 int total_samples_decoded_; |
| 150 | 154 |
| 151 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); | 155 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); |
| 152 }; | 156 }; |
| 153 | 157 |
| 154 } // namespace media | 158 } // namespace media |
| 155 | 159 |
| 156 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 160 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
| OLD | NEW |