| 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 }; | 43 }; |
| 44 | 44 |
| 45 // The channel orderings for each layout as specified by FFmpeg. Each value | 45 // The channel orderings for each layout as specified by FFmpeg. Each value |
| 46 // represents the index of each channel in each layout. Values of -1 mean the | 46 // represents the index of each channel in each layout. Values of -1 mean the |
| 47 // channel at that index is not used for that layout.For example, the left side | 47 // channel at that index is not used for that layout.For example, the left side |
| 48 // surround sound channel in FFmpeg's 5.1 layout is in the 5th position (because | 48 // surround sound channel in FFmpeg's 5.1 layout is in the 5th position (because |
| 49 // the order is L, R, C, LFE, LS, RS), so | 49 // the order is L, R, C, LFE, LS, RS), so |
| 50 // kChannelOrderings[CHANNEL_LAYOUT_5POINT1][SIDE_LEFT] = 4; | 50 // kChannelOrderings[CHANNEL_LAYOUT_5POINT1][SIDE_LEFT] = 4; |
| 51 static const int kChannelOrderings[CHANNEL_LAYOUT_MAX][CHANNELS_MAX] = { | 51 static const int kChannelOrderings[CHANNEL_LAYOUT_MAX + 1][CHANNELS_MAX + 1] = { |
| 52 // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR | 52 // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR |
| 53 | 53 |
| 54 // CHANNEL_LAYOUT_NONE | 54 // CHANNEL_LAYOUT_NONE |
| 55 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, | 55 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, |
| 56 | 56 |
| 57 // CHANNEL_LAYOUT_UNSUPPORTED | 57 // CHANNEL_LAYOUT_UNSUPPORTED |
| 58 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, | 58 { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, |
| 59 | 59 |
| 60 // CHANNEL_LAYOUT_MONO | 60 // CHANNEL_LAYOUT_MONO |
| 61 { -1 , -1 , 0 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, | 61 { -1 , -1 , 0 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 case CHANNEL_LAYOUT_6_1_FRONT: | 239 case CHANNEL_LAYOUT_6_1_FRONT: |
| 240 return "6.1_FRONT"; | 240 return "6.1_FRONT"; |
| 241 case CHANNEL_LAYOUT_7_0_FRONT: | 241 case CHANNEL_LAYOUT_7_0_FRONT: |
| 242 return "7.0_FRONT"; | 242 return "7.0_FRONT"; |
| 243 case CHANNEL_LAYOUT_7_1_WIDE_BACK: | 243 case CHANNEL_LAYOUT_7_1_WIDE_BACK: |
| 244 return "7.1_WIDE_BACK"; | 244 return "7.1_WIDE_BACK"; |
| 245 case CHANNEL_LAYOUT_OCTAGONAL: | 245 case CHANNEL_LAYOUT_OCTAGONAL: |
| 246 return "OCTAGONAL"; | 246 return "OCTAGONAL"; |
| 247 case CHANNEL_LAYOUT_DISCRETE: | 247 case CHANNEL_LAYOUT_DISCRETE: |
| 248 return "DISCRETE"; | 248 return "DISCRETE"; |
| 249 case CHANNEL_LAYOUT_MAX: | |
| 250 break; | |
| 251 } | 249 } |
| 252 NOTREACHED() << "Invalid channel layout provided: " << layout; | 250 NOTREACHED() << "Invalid channel layout provided: " << layout; |
| 253 return ""; | 251 return ""; |
| 254 } | 252 } |
| 255 | 253 |
| 256 } // namespace media | 254 } // namespace media |
| OLD | NEW |