| 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_CONFIG_H_ | 5 #ifndef MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| 6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 13 #include "media/base/channel_layout.h" | 12 #include "media/base/channel_layout.h" |
| 14 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 15 #include "media/base/sample_format.h" | 14 #include "media/base/sample_format.h" |
| 16 | 15 |
| 17 namespace media { | 16 namespace media { |
| 18 | 17 |
| 19 enum AudioCodec { | 18 enum AudioCodec { |
| 20 // These values are histogrammed over time; do not change their ordinal | 19 // These values are histogrammed over time; do not change their ordinal |
| 21 // values. When deleting a codec replace it with a dummy value; when adding a | 20 // values. When deleting a codec replace it with a dummy value; when adding a |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const std::vector<uint8_t>& extra_data, | 62 const std::vector<uint8_t>& extra_data, |
| 64 bool is_encrypted); | 63 bool is_encrypted); |
| 65 | 64 |
| 66 ~AudioDecoderConfig(); | 65 ~AudioDecoderConfig(); |
| 67 | 66 |
| 68 // Resets the internal state of this object. |codec_delay| is in frames. | 67 // Resets the internal state of this object. |codec_delay| is in frames. |
| 69 void Initialize(AudioCodec codec, | 68 void Initialize(AudioCodec codec, |
| 70 SampleFormat sample_format, | 69 SampleFormat sample_format, |
| 71 ChannelLayout channel_layout, | 70 ChannelLayout channel_layout, |
| 72 int samples_per_second, | 71 int samples_per_second, |
| 73 const std::vector<uint8>& extra_data, | 72 const std::vector<uint8_t>& extra_data, |
| 74 bool is_encrypted, | 73 bool is_encrypted, |
| 75 base::TimeDelta seek_preroll, | 74 base::TimeDelta seek_preroll, |
| 76 int codec_delay); | 75 int codec_delay); |
| 77 | 76 |
| 78 // Returns true if this object has appropriate configuration values, false | 77 // Returns true if this object has appropriate configuration values, false |
| 79 // otherwise. | 78 // otherwise. |
| 80 bool IsValidConfig() const; | 79 bool IsValidConfig() const; |
| 81 | 80 |
| 82 // Returns true if all fields in |config| match this config. | 81 // Returns true if all fields in |config| match this config. |
| 83 // Note: The contents of |extra_data_| are compared not the raw pointers. | 82 // Note: The contents of |extra_data_| are compared not the raw pointers. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 int codec_delay_; | 127 int codec_delay_; |
| 129 | 128 |
| 130 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 129 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
| 131 // generated copy constructor and assignment operator. Since the extra data is | 130 // generated copy constructor and assignment operator. Since the extra data is |
| 132 // typically small, the performance impact is minimal. | 131 // typically small, the performance impact is minimal. |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 } // namespace media | 134 } // namespace media |
| 136 | 135 |
| 137 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 136 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| OLD | NEW |