| 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_BASE_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_DECODER_H_ |
| 6 #define MEDIA_BASE_AUDIO_DECODER_H_ | 6 #define MEDIA_BASE_AUDIO_DECODER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 typedef base::Callback<void(DecodeStatus)> DecodeCB; | 36 typedef base::Callback<void(DecodeStatus)> DecodeCB; |
| 37 | 37 |
| 38 AudioDecoder(); | 38 AudioDecoder(); |
| 39 | 39 |
| 40 // Fires any pending callbacks, stops and destroys the decoder. | 40 // Fires any pending callbacks, stops and destroys the decoder. |
| 41 // Note: Since this is a destructor, |this| will be destroyed after this call. | 41 // Note: Since this is a destructor, |this| will be destroyed after this call. |
| 42 // Make sure the callbacks fired from this call doesn't post any task that | 42 // Make sure the callbacks fired from this call doesn't post any task that |
| 43 // depends on |this|. | 43 // depends on |this|. |
| 44 virtual ~AudioDecoder(); | 44 virtual ~AudioDecoder(); |
| 45 | 45 |
| 46 // Returns the name of the decoder for logging purpose. | 46 // Returns the name of the decoder for logging and decoder selection purposes. |
| 47 // This name should be available immediately after construction (e.g. before |
| 48 // Initialize() is called). It should also be stable in the sense that the |
| 49 // name does not change across multiple constructions. |
| 50 // TODO(xhwang): Rename this method since the name is not only for display. |
| 47 virtual std::string GetDisplayName() const = 0; | 51 virtual std::string GetDisplayName() const = 0; |
| 48 | 52 |
| 49 // Initializes an AudioDecoder with |config|, executing the |init_cb| upon | 53 // Initializes an AudioDecoder with |config|, executing the |init_cb| upon |
| 50 // completion. | 54 // completion. |
| 51 // | 55 // |
| 52 // |cdm_context| can be used to handle encrypted buffers. May be null if the | 56 // |cdm_context| can be used to handle encrypted buffers. May be null if the |
| 53 // stream is not encrypted. | 57 // stream is not encrypted. |
| 54 // |init_cb| is used to return initialization status. | 58 // |init_cb| is used to return initialization status. |
| 55 // |output_cb| is called for decoded audio buffers (see Decode()). | 59 // |output_cb| is called for decoded audio buffers (see Decode()). |
| 56 virtual void Initialize(const AudioDecoderConfig& config, | 60 virtual void Initialize(const AudioDecoderConfig& config, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 79 // Returns true if the decoder needs bitstream conversion before decoding. | 83 // Returns true if the decoder needs bitstream conversion before decoding. |
| 80 virtual bool NeedsBitstreamConversion() const; | 84 virtual bool NeedsBitstreamConversion() const; |
| 81 | 85 |
| 82 private: | 86 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 87 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace media | 90 } // namespace media |
| 87 | 91 |
| 88 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 92 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
| OLD | NEW |