| 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> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "media/base/audio_decoder_config.h" | 12 #include "media/base/audio_decoder_config.h" |
| 11 #include "media/base/channel_layout.h" | 13 #include "media/base/channel_layout.h" |
| 12 #include "media/base/decoder_buffer.h" | 14 #include "media/base/decoder_buffer.h" |
| 13 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
| 14 #include "media/base/pipeline_status.h" | 16 #include "media/base/pipeline_status.h" |
| 15 | 17 |
| 16 namespace media { | 18 namespace media { |
| 17 | 19 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 40 typedef base::Callback<void(Status)> DecodeCB; | 42 typedef base::Callback<void(Status)> DecodeCB; |
| 41 | 43 |
| 42 AudioDecoder(); | 44 AudioDecoder(); |
| 43 | 45 |
| 44 // Fires any pending callbacks, stops and destroys the decoder. | 46 // Fires any pending callbacks, stops and destroys the decoder. |
| 45 // Note: Since this is a destructor, |this| will be destroyed after this call. | 47 // Note: Since this is a destructor, |this| will be destroyed after this call. |
| 46 // Make sure the callbacks fired from this call doesn't post any task that | 48 // Make sure the callbacks fired from this call doesn't post any task that |
| 47 // depends on |this|. | 49 // depends on |this|. |
| 48 virtual ~AudioDecoder(); | 50 virtual ~AudioDecoder(); |
| 49 | 51 |
| 52 // Returns the name of the decoder for logging purpose. |
| 53 virtual std::string GetDisplayName() const = 0; |
| 54 |
| 50 // Initializes an AudioDecoder with the given DemuxerStream, executing the | 55 // Initializes an AudioDecoder with the given DemuxerStream, executing the |
| 51 // callback upon completion. | 56 // callback upon completion. |
| 52 // |statistics_cb| is used to update global pipeline statistics. | 57 // |statistics_cb| is used to update global pipeline statistics. |
| 53 // |output_cb| is called for decoded audio buffers (see Decode()). | 58 // |output_cb| is called for decoded audio buffers (see Decode()). |
| 54 virtual void Initialize(const AudioDecoderConfig& config, | 59 virtual void Initialize(const AudioDecoderConfig& config, |
| 55 const PipelineStatusCB& status_cb, | 60 const PipelineStatusCB& status_cb, |
| 56 const OutputCB& output_cb) = 0; | 61 const OutputCB& output_cb) = 0; |
| 57 | 62 |
| 58 // Requests samples to be decoded. Only one decode may be in flight at any | 63 // Requests samples to be decoded. Only one decode may be in flight at any |
| 59 // given time. Once the buffer is decoded the decoder calls |decode_cb|. | 64 // given time. Once the buffer is decoded the decoder calls |decode_cb|. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 73 // aborted before |closure| is called. | 78 // aborted before |closure| is called. |
| 74 virtual void Reset(const base::Closure& closure) = 0; | 79 virtual void Reset(const base::Closure& closure) = 0; |
| 75 | 80 |
| 76 private: | 81 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 82 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 } // namespace media | 85 } // namespace media |
| 81 | 86 |
| 82 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 87 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
| OLD | NEW |