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 "build/build_config.h" |
8 #include "media/base/media_export.h" | 9 #include "media/base/media_export.h" |
9 | 10 |
10 enum ChannelLayout { | 11 enum ChannelLayout { |
11 CHANNEL_LAYOUT_NONE = 0, | 12 CHANNEL_LAYOUT_NONE = 0, |
12 CHANNEL_LAYOUT_UNSUPPORTED, | 13 CHANNEL_LAYOUT_UNSUPPORTED, |
13 | 14 |
14 // Front C | 15 // Front C |
15 CHANNEL_LAYOUT_MONO, | 16 CHANNEL_LAYOUT_MONO, |
16 | 17 |
17 // Front L, Front R | 18 // Front L, Front R |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 LEFT_OF_CENTER, | 71 LEFT_OF_CENTER, |
71 RIGHT_OF_CENTER, | 72 RIGHT_OF_CENTER, |
72 BACK_CENTER, | 73 BACK_CENTER, |
73 SIDE_LEFT, | 74 SIDE_LEFT, |
74 SIDE_RIGHT, | 75 SIDE_RIGHT, |
75 STEREO_LEFT, | 76 STEREO_LEFT, |
76 STEREO_RIGHT, | 77 STEREO_RIGHT, |
77 CHANNELS_MAX | 78 CHANNELS_MAX |
78 }; | 79 }; |
79 | 80 |
| 81 #if defined(OS_MACOSX) || defined(USE_PULSEAUDIO) |
80 // The channel orderings for each layout as specified by FFmpeg. | 82 // The channel orderings for each layout as specified by FFmpeg. |
81 // Values represent the index of each channel in each layout. For example, the | 83 // Values represent the index of each channel in each layout. For example, the |
82 // left side surround sound channel in FFmpeg's 5.1 layout is in the 5th | 84 // left side surround sound channel in FFmpeg's 5.1 layout is in the 5th |
83 // position (because the order is L, R, C, LFE, LS, RS), so | 85 // position (because the order is L, R, C, LFE, LS, RS), so |
84 // kChannelOrderings[CHANNEL_LAYOUT_5POINT1][SIDE_LEFT] = 4; | 86 // kChannelOrderings[CHANNEL_LAYOUT_5POINT1][SIDE_LEFT] = 4; |
85 // Values of -1 mean the channel at that index is not used for that layout. | 87 // Values of -1 mean the channel at that index is not used for that layout. |
86 MEDIA_EXPORT extern const int | 88 extern const int kChannelOrderings[CHANNEL_LAYOUT_MAX][CHANNELS_MAX]; |
87 kChannelOrderings[CHANNEL_LAYOUT_MAX][CHANNELS_MAX]; | 89 #endif |
88 | 90 |
89 // Returns the number of channels in a given ChannelLayout. | 91 // Returns the number of channels in a given ChannelLayout. |
90 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); | 92 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); |
91 | 93 |
92 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ | 94 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ |
OLD | NEW |