Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sample_format.h" | 5 #include "media/base/sample_format.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 case kSampleFormatPlanarF32: | 22 case kSampleFormatPlanarF32: |
| 23 return 4; | 23 return 4; |
| 24 case kSampleFormatMax: | 24 case kSampleFormatMax: |
| 25 break; | 25 break; |
| 26 } | 26 } |
| 27 | 27 |
| 28 NOTREACHED() << "Invalid sample format provided: " << sample_format; | 28 NOTREACHED() << "Invalid sample format provided: " << sample_format; |
| 29 return 0; | 29 return 0; |
| 30 } | 30 } |
| 31 | 31 |
| 32 const char* SampleFormatToString(SampleFormat sample_format) { | |
| 33 switch(sample_format) { | |
| 34 case kUnknownSampleFormat: | |
| 35 return "UNKNOWN_SAMPLE_FORMAT"; | |
|
DaleCurtis
2013/08/05 22:16:54
Is this the style you want? Not say, "Unknown", "8
Ty Overby
2013/08/05 22:23:29
I like yours more.
Done.
| |
| 36 case kSampleFormatU8: | |
| 37 return "U8"; | |
| 38 case kSampleFormatS16: | |
| 39 return "S16"; | |
| 40 case kSampleFormatS32: | |
| 41 return "S32"; | |
| 42 case kSampleFormatF32: | |
| 43 return "F32"; | |
| 44 case kSampleFormatPlanarS16: | |
| 45 return "PLANAR S16"; | |
| 46 case kSampleFormatPlanarF32: | |
| 47 return "PLANAR F32"; | |
| 48 case kSampleFormatMax: | |
|
DaleCurtis
2013/08/05 22:16:54
Just break here and rely on the NOTREACHED() below
Ty Overby
2013/08/05 22:23:29
Done.
| |
| 49 NOTREACHED() << "Invalid sample format provided: " << sample_format; | |
| 50 break; | |
| 51 } | |
| 52 NOTREACHED() << "Invalid sample format provided: " << sample_format; | |
| 53 return ""; | |
| 54 } | |
| 55 | |
| 32 } // namespace media | 56 } // namespace media |
| OLD | NEW |