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_CHANNEL_LAYOUT_H_ | 5 #ifndef MEDIA_BASE_CHANNEL_LAYOUT_H_ |
6 #define MEDIA_BASE_CHANNEL_LAYOUT_H_ | 6 #define MEDIA_BASE_CHANNEL_LAYOUT_H_ |
7 | 7 |
8 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 LEFT_OF_CENTER, | 119 LEFT_OF_CENTER, |
120 RIGHT_OF_CENTER, | 120 RIGHT_OF_CENTER, |
121 BACK_CENTER, | 121 BACK_CENTER, |
122 SIDE_LEFT, | 122 SIDE_LEFT, |
123 SIDE_RIGHT, | 123 SIDE_RIGHT, |
124 CHANNELS_MAX = SIDE_RIGHT, // Must always equal the largest value ever logged. | 124 CHANNELS_MAX = SIDE_RIGHT, // Must always equal the largest value ever logged. |
125 }; | 125 }; |
126 | 126 |
127 // Returns the expected channel position in an interleaved stream. Values of -1 | 127 // Returns the expected channel position in an interleaved stream. Values of -1 |
128 // mean the channel at that index is not used for that layout. Values range | 128 // mean the channel at that index is not used for that layout. Values range |
129 // from 0 to CHANNELS_MAX - 1. | 129 // from 0 to ChannelLayoutToChannelCount(layout) - 1. |
130 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); | 130 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); |
131 | 131 |
132 // Returns the number of channels in a given ChannelLayout. | 132 // Returns the number of channels in a given ChannelLayout. |
133 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); | 133 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); |
134 | 134 |
135 // Given the number of channels, return the best layout, | 135 // Given the number of channels, return the best layout, |
136 // or return CHANNEL_LAYOUT_UNSUPPORTED if there is no good match. | 136 // or return CHANNEL_LAYOUT_UNSUPPORTED if there is no good match. |
137 MEDIA_EXPORT ChannelLayout GuessChannelLayout(int channels); | 137 MEDIA_EXPORT ChannelLayout GuessChannelLayout(int channels); |
138 | 138 |
139 // Returns a string representation of the channel layout. | 139 // Returns a string representation of the channel layout. |
140 MEDIA_EXPORT const char* ChannelLayoutToString(ChannelLayout layout); | 140 MEDIA_EXPORT const char* ChannelLayoutToString(ChannelLayout layout); |
141 | 141 |
142 } // namespace media | 142 } // namespace media |
143 | 143 |
144 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ | 144 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ |
OLD | NEW |