Chromium Code Reviews| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 | 92 |
| 93 // Front L, Front R, Front C, Back L, Back R, LFE, Front LofC, Front RofC | 93 // Front L, Front R, Front C, Back L, Back R, LFE, Front LofC, Front RofC |
| 94 CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, | 94 CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, |
| 95 | 95 |
| 96 // Front L, Front R, Front C, Side L, Side R, Rear C, Back L, Back R. | 96 // Front L, Front R, Front C, Side L, Side R, Rear C, Back L, Back R. |
| 97 CHANNEL_LAYOUT_OCTAGONAL = 28, | 97 CHANNEL_LAYOUT_OCTAGONAL = 28, |
| 98 | 98 |
| 99 // Channels are not explicitly mapped to speakers. | 99 // Channels are not explicitly mapped to speakers. |
| 100 CHANNEL_LAYOUT_DISCRETE = 29, | 100 CHANNEL_LAYOUT_DISCRETE = 29, |
| 101 | 101 |
| 102 // Total number of layouts. | 102 // Max value |
|
scherkus (not reviewing)
2014/02/25 03:44:49
combine subsequent comment w/ this one? (or replac
| |
| 103 CHANNEL_LAYOUT_MAX // Must always be last! | 103 CHANNEL_LAYOUT_MAX = CHANNEL_LAYOUT_DISCRETE // Must always equal the largest |
| 104 // entry ever logged. | |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 enum Channels { | 107 enum Channels { |
| 107 LEFT = 0, | 108 LEFT = 0, |
| 108 RIGHT, | 109 RIGHT, |
| 109 CENTER, | 110 CENTER, |
| 110 LFE, | 111 LFE, |
| 111 BACK_LEFT, | 112 BACK_LEFT, |
| 112 BACK_RIGHT, | 113 BACK_RIGHT, |
| 113 LEFT_OF_CENTER, | 114 LEFT_OF_CENTER, |
| 114 RIGHT_OF_CENTER, | 115 RIGHT_OF_CENTER, |
| 115 BACK_CENTER, | 116 BACK_CENTER, |
| 116 SIDE_LEFT, | 117 SIDE_LEFT, |
| 117 SIDE_RIGHT, | 118 SIDE_RIGHT, |
| 118 CHANNELS_MAX | 119 CHANNELS_MAX = SIDE_RIGHT, // Must always equal the largest value ever logged. |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 // Returns the expected channel position in an interleaved stream. Values of -1 | 122 // Returns the expected channel position in an interleaved stream. Values of -1 |
| 122 // mean the channel at that index is not used for that layout. Values range | 123 // mean the channel at that index is not used for that layout. Values range |
| 123 // from 0 to CHANNELS_MAX - 1. | 124 // from 0 to CHANNELS_MAX - 1. |
| 124 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); | 125 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); |
| 125 | 126 |
| 126 // Returns the number of channels in a given ChannelLayout. | 127 // Returns the number of channels in a given ChannelLayout. |
| 127 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); | 128 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); |
| 128 | 129 |
| 129 // Given the number of channels, return the best layout, | 130 // Given the number of channels, return the best layout, |
| 130 // or return CHANNEL_LAYOUT_UNSUPPORTED if there is no good match. | 131 // or return CHANNEL_LAYOUT_UNSUPPORTED if there is no good match. |
| 131 MEDIA_EXPORT ChannelLayout GuessChannelLayout(int channels); | 132 MEDIA_EXPORT ChannelLayout GuessChannelLayout(int channels); |
| 132 | 133 |
| 133 // Returns a string representation of the channel layout. | 134 // Returns a string representation of the channel layout. |
| 134 MEDIA_EXPORT const char* ChannelLayoutToString(ChannelLayout layout); | 135 MEDIA_EXPORT const char* ChannelLayoutToString(ChannelLayout layout); |
| 135 | 136 |
| 136 } // namespace media | 137 } // namespace media |
| 137 | 138 |
| 138 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ | 139 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ |
| OLD | NEW |