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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 virtual int samples_per_second() OVERRIDE; | 61 virtual int samples_per_second() OVERRIDE; |
62 | 62 |
63 protected: | 63 protected: |
64 virtual ~DecryptingAudioDecoder(); | 64 virtual ~DecryptingAudioDecoder(); |
65 | 65 |
66 private: | 66 private: |
67 // For a detailed state diagram please see this link: http://goo.gl/8jAok | 67 // For a detailed state diagram please see this link: http://goo.gl/8jAok |
68 // TODO(xhwang): Add a ASCII state diagram in this file after this class | 68 // TODO(xhwang): Add a ASCII state diagram in this file after this class |
69 // stabilizes. | 69 // stabilizes. |
70 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. | 70 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. |
71 enum DecoderState { | 71 enum State { |
72 kUninitialized = 0, | 72 kUninitialized = 0, |
73 kDecryptorRequested, | 73 kDecryptorRequested, |
74 kPendingDecoderInit, | 74 kPendingDecoderInit, |
75 kIdle, | 75 kIdle, |
76 kPendingDemuxerRead, | 76 kPendingDemuxerRead, |
77 kPendingDecode, | 77 kPendingDecode, |
78 kWaitingForKey, | 78 kWaitingForKey, |
79 kDecodeFinished, | 79 kDecodeFinished, |
80 }; | 80 }; |
81 | 81 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 // Converts number of samples to duration. | 130 // Converts number of samples to duration. |
131 base::TimeDelta NumberOfSamplesToDuration(int number_of_samples) const; | 131 base::TimeDelta NumberOfSamplesToDuration(int number_of_samples) const; |
132 | 132 |
133 // This is !is_null() iff Initialize() hasn't been called. | 133 // This is !is_null() iff Initialize() hasn't been called. |
134 MessageLoopFactoryCB message_loop_factory_cb_; | 134 MessageLoopFactoryCB message_loop_factory_cb_; |
135 | 135 |
136 scoped_refptr<base::MessageLoopProxy> message_loop_; | 136 scoped_refptr<base::MessageLoopProxy> message_loop_; |
137 | 137 |
138 // Current state of the DecryptingAudioDecoder. | 138 // Current state of the DecryptingAudioDecoder. |
139 DecoderState state_; | 139 State state_; |
140 | 140 |
141 PipelineStatusCB init_cb_; | 141 PipelineStatusCB init_cb_; |
142 StatisticsCB statistics_cb_; | 142 StatisticsCB statistics_cb_; |
143 ReadCB read_cb_; | 143 ReadCB read_cb_; |
144 base::Closure reset_cb_; | 144 base::Closure reset_cb_; |
145 | 145 |
146 // Pointer to the demuxer stream that will feed us compressed buffers. | 146 // Pointer to the demuxer stream that will feed us compressed buffers. |
147 scoped_refptr<DemuxerStream> demuxer_stream_; | 147 scoped_refptr<DemuxerStream> demuxer_stream_; |
148 | 148 |
149 // Callback to request/cancel decryptor creation notification. | 149 // Callback to request/cancel decryptor creation notification. |
(...skipping 22 matching lines...) Expand all Loading... |
172 | 172 |
173 base::TimeDelta output_timestamp_base_; | 173 base::TimeDelta output_timestamp_base_; |
174 int total_samples_decoded_; | 174 int total_samples_decoded_; |
175 | 175 |
176 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); | 176 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); |
177 }; | 177 }; |
178 | 178 |
179 } // namespace media | 179 } // namespace media |
180 | 180 |
181 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 181 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
OLD | NEW |