Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: media/base/channel_layout.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/channel_layout.cc
diff --git a/media/base/channel_layout.cc b/media/base/channel_layout.cc
index 958430ac4e7768f10c45f00120d6fd8d10e98928..6103a7bf5e9c45545302ba312e7a97370f0fe2de 100644
--- a/media/base/channel_layout.cc
+++ b/media/base/channel_layout.cc
@@ -48,104 +48,105 @@ static const int kLayoutToChannels[] = {
// surround sound channel in FFmpeg's 5.1 layout is in the 5th position (because
// the order is L, R, C, LFE, LS, RS), so
// kChannelOrderings[CHANNEL_LAYOUT_5POINT1][SIDE_LEFT] = 4;
-static const int kChannelOrderings[CHANNEL_LAYOUT_MAX][CHANNELS_MAX] = {
- // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
+static const int
rileya (GONE FROM CHROMIUM) 2014/01/27 20:59:38 This possibly unnecessary indenting brought to you
+ kChannelOrderings[CHANNEL_LAYOUT_HISTOGRAM_MAX][CHANNELS_HISTOGRAM_MAX] = {
+ // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
- // CHANNEL_LAYOUT_NONE
- { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_NONE
+ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_UNSUPPORTED
- { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_UNSUPPORTED
+ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_MONO
- { -1 , -1 , 0 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_MONO
+ {-1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_STEREO
- { 0 , 1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_STEREO
+ {0, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_2_1
- { 0 , 1 , -1 , -1 , -1 , -1 , -1 , -1 , 2 , -1 , -1 },
+ // CHANNEL_LAYOUT_2_1
+ {0, 1, -1, -1, -1, -1, -1, -1, 2, -1, -1},
- // CHANNEL_LAYOUT_SURROUND
- { 0 , 1 , 2 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_SURROUND
+ {0, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_4_0
- { 0 , 1 , 2 , -1 , -1 , -1 , -1 , -1 , 3 , -1 , -1 },
+ // CHANNEL_LAYOUT_4_0
+ {0, 1, 2, -1, -1, -1, -1, -1, 3, -1, -1},
- // CHANNEL_LAYOUT_2_2
- { 0 , 1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , 2 , 3 },
+ // CHANNEL_LAYOUT_2_2
+ {0, 1, -1, -1, -1, -1, -1, -1, -1, 2, 3},
- // CHANNEL_LAYOUT_QUAD
- { 0 , 1 , -1 , -1 , 2 , 3 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_QUAD
+ {0, 1, -1, -1, 2, 3, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_5_0
- { 0 , 1 , 2 , -1 , -1 , -1 , -1 , -1 , -1 , 3 , 4 },
+ // CHANNEL_LAYOUT_5_0
+ {0, 1, 2, -1, -1, -1, -1, -1, -1, 3, 4},
- // CHANNEL_LAYOUT_5_1
- { 0 , 1 , 2 , 3 , -1 , -1 , -1 , -1 , -1 , 4 , 5 },
+ // CHANNEL_LAYOUT_5_1
+ {0, 1, 2, 3, -1, -1, -1, -1, -1, 4, 5},
- // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
+ // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
- // CHANNEL_LAYOUT_5_0_BACK
- { 0 , 1 , 2 , -1 , 3 , 4 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_5_0_BACK
+ {0, 1, 2, -1, 3, 4, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_5_1_BACK
- { 0 , 1 , 2 , 3 , 4 , 5 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_5_1_BACK
+ {0, 1, 2, 3, 4, 5, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_7_0
- { 0 , 1 , 2 , -1 , 5 , 6 , -1 , -1 , -1 , 3 , 4 },
+ // CHANNEL_LAYOUT_7_0
+ {0, 1, 2, -1, 5, 6, -1, -1, -1, 3, 4},
- // CHANNEL_LAYOUT_7_1
- { 0 , 1 , 2 , 3 , 6 , 7 , -1 , -1 , -1 , 4 , 5 },
+ // CHANNEL_LAYOUT_7_1
+ {0, 1, 2, 3, 6, 7, -1, -1, -1, 4, 5},
- // CHANNEL_LAYOUT_7_1_WIDE
- { 0 , 1 , 2 , 3 , -1 , -1 , 6 , 7 , -1 , 4 , 5 },
+ // CHANNEL_LAYOUT_7_1_WIDE
+ {0, 1, 2, 3, -1, -1, 6, 7, -1, 4, 5},
- // CHANNEL_LAYOUT_STEREO_DOWNMIX
- { 0 , 1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_STEREO_DOWNMIX
+ {0, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_2POINT1
- { 0 , 1 , -1 , 2 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_2POINT1
+ {0, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_3_1
- { 0 , 1 , 2 , 3 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_3_1
+ {0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1},
- // CHANNEL_LAYOUT_4_1
- { 0 , 1 , 2 , 4 , -1 , -1 , -1 , -1 , 3 , -1 , -1 },
+ // CHANNEL_LAYOUT_4_1
+ {0, 1, 2, 4, -1, -1, -1, -1, 3, -1, -1},
- // CHANNEL_LAYOUT_6_0
- { 0 , 1 , 2 , -1 , -1 , -1 , -1 , -1 , 5 , 3 , 4 },
+ // CHANNEL_LAYOUT_6_0
+ {0, 1, 2, -1, -1, -1, -1, -1, 5, 3, 4},
- // CHANNEL_LAYOUT_6_0_FRONT
- { 0 , 1 , -1 , -1 , -1 , -1 , 4 , 5 , -1 , 2 , 3 },
+ // CHANNEL_LAYOUT_6_0_FRONT
+ {0, 1, -1, -1, -1, -1, 4, 5, -1, 2, 3},
- // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
+ // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
- // CHANNEL_LAYOUT_HEXAGONAL
- { 0 , 1 , 2 , -1 , 3 , 4 , -1 , -1 , 5 , -1 , -1 },
+ // CHANNEL_LAYOUT_HEXAGONAL
+ {0, 1, 2, -1, 3, 4, -1, -1, 5, -1, -1},
- // CHANNEL_LAYOUT_6_1
- { 0 , 1 , 2 , 3 , -1 , -1 , -1 , -1 , 6 , 4 , 5 },
+ // CHANNEL_LAYOUT_6_1
+ {0, 1, 2, 3, -1, -1, -1, -1, 6, 4, 5},
- // CHANNEL_LAYOUT_6_1_BACK
- { 0 , 1 , 2 , 3 , 4 , 5 , -1 , -1 , 6 , -1 , -1 },
+ // CHANNEL_LAYOUT_6_1_BACK
+ {0, 1, 2, 3, 4, 5, -1, -1, 6, -1, -1},
- // CHANNEL_LAYOUT_6_1_FRONT
- { 0 , 1 , -1 , 6 , -1 , -1 , 4 , 5 , -1 , 2 , 3 },
+ // CHANNEL_LAYOUT_6_1_FRONT
+ {0, 1, -1, 6, -1, -1, 4, 5, -1, 2, 3},
- // CHANNEL_LAYOUT_7_0_FRONT
- { 0 , 1 , 2 , -1 , -1 , -1 , 5 , 6 , -1 , 3 , 4 },
+ // CHANNEL_LAYOUT_7_0_FRONT
+ {0, 1, 2, -1, -1, -1, 5, 6, -1, 3, 4},
- // CHANNEL_LAYOUT_7_1_WIDE_BACK
- { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_7_1_WIDE_BACK
+ {0, 1, 2, 3, 4, 5, 6, 7, -1, -1, -1},
- // CHANNEL_LAYOUT_OCTAGONAL
- { 0 , 1 , 2 , -1 , 5 , 6 , -1 , -1 , 7 , 3 , 4 },
+ // CHANNEL_LAYOUT_OCTAGONAL
+ {0, 1, 2, -1, 5, 6, -1, -1, 7, 3, 4},
- // CHANNEL_LAYOUT_DISCRETE
- { -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 },
+ // CHANNEL_LAYOUT_DISCRETE
+ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
- // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
+ // FL | FR | FC | LFE | BL | BR | FLofC | FRofC | BC | SL | SR
};
int ChannelLayoutToChannelCount(ChannelLayout layout) {
@@ -246,7 +247,7 @@ const char* ChannelLayoutToString(ChannelLayout layout) {
return "OCTAGONAL";
case CHANNEL_LAYOUT_DISCRETE:
return "DISCRETE";
- case CHANNEL_LAYOUT_MAX:
+ case CHANNEL_LAYOUT_HISTOGRAM_MAX:
break;
}
NOTREACHED() << "Invalid channel layout provided: " << layout;

Powered by Google App Engine
This is Rietveld 408576698