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 #include "media/base/channel_layout.h" | 5 #include "media/base/channel_layout.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 30 matching lines...) Expand all Loading... |
41 8, // CHANNEL_LAYOUT_OCTAGONAL | 41 8, // CHANNEL_LAYOUT_OCTAGONAL |
42 0, // CHANNEL_LAYOUT_DISCRETE | 42 0, // CHANNEL_LAYOUT_DISCRETE |
43 3, // CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC | 43 3, // CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC |
44 }; | 44 }; |
45 | 45 |
46 // The channel orderings for each layout as specified by FFmpeg. Each value | 46 // The channel orderings for each layout as specified by FFmpeg. Each value |
47 // represents the index of each channel in each layout. Values of -1 mean the | 47 // represents the index of each channel in each layout. Values of -1 mean the |
48 // channel at that index is not used for that layout. For example, the left side | 48 // channel at that index is not used for that layout. For example, the left side |
49 // surround sound channel in FFmpeg's 5.1 layout is in the 5th position (because | 49 // surround sound channel in FFmpeg's 5.1 layout is in the 5th position (because |
50 // the order is L, R, C, LFE, LS, RS), so | 50 // the order is L, R, C, LFE, LS, RS), so |
51 // kChannelOrderings[CHANNEL_LAYOUT_5POINT1][SIDE_LEFT] = 4; | 51 // kChannelOrderings[CHANNEL_LAYOUT_5_1][SIDE_LEFT] = 4; |
52 static const int kChannelOrderings[CHANNEL_LAYOUT_MAX + 1][CHANNELS_MAX + 1] = { | 52 static const int kChannelOrderings[CHANNEL_LAYOUT_MAX + 1][CHANNELS_MAX + 1] = { |
53 // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR | 53 // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR |
54 | 54 |
55 // CHANNEL_LAYOUT_NONE | 55 // CHANNEL_LAYOUT_NONE |
56 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, | 56 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, |
57 | 57 |
58 // CHANNEL_LAYOUT_UNSUPPORTED | 58 // CHANNEL_LAYOUT_UNSUPPORTED |
59 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, | 59 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, |
60 | 60 |
61 // CHANNEL_LAYOUT_MONO | 61 // CHANNEL_LAYOUT_MONO |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 case CHANNEL_LAYOUT_DISCRETE: | 251 case CHANNEL_LAYOUT_DISCRETE: |
252 return "DISCRETE"; | 252 return "DISCRETE"; |
253 case CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC: | 253 case CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC: |
254 return "STEREO_AND_KEYBOARD_MIC"; | 254 return "STEREO_AND_KEYBOARD_MIC"; |
255 } | 255 } |
256 NOTREACHED() << "Invalid channel layout provided: " << layout; | 256 NOTREACHED() << "Invalid channel layout provided: " << layout; |
257 return ""; | 257 return ""; |
258 } | 258 } |
259 | 259 |
260 } // namespace media | 260 } // namespace media |
OLD | NEW |