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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return "Signed 16-bit planar"; | 44 return "Signed 16-bit planar"; |
45 case kSampleFormatPlanarF32: | 45 case kSampleFormatPlanarF32: |
46 return "Float 32-bit planar"; | 46 return "Float 32-bit planar"; |
47 case kSampleFormatPlanarS32: | 47 case kSampleFormatPlanarS32: |
48 return "Signed 32-bit planar"; | 48 return "Signed 32-bit planar"; |
49 } | 49 } |
50 NOTREACHED() << "Invalid sample format provided: " << sample_format; | 50 NOTREACHED() << "Invalid sample format provided: " << sample_format; |
51 return ""; | 51 return ""; |
52 } | 52 } |
53 | 53 |
| 54 bool IsPlanar(SampleFormat sample_format) { |
| 55 switch (sample_format) { |
| 56 case kSampleFormatPlanarS16: |
| 57 case kSampleFormatPlanarF32: |
| 58 case kSampleFormatPlanarS32: |
| 59 return true; |
| 60 case kUnknownSampleFormat: |
| 61 case kSampleFormatU8: |
| 62 case kSampleFormatS16: |
| 63 case kSampleFormatS32: |
| 64 case kSampleFormatF32: |
| 65 return false; |
| 66 } |
| 67 |
| 68 NOTREACHED() << "Invalid sample format provided: " << sample_format; |
| 69 return false; |
| 70 } |
| 71 |
| 72 bool IsInterleaved(SampleFormat sample_format) { |
| 73 switch (sample_format) { |
| 74 case kSampleFormatU8: |
| 75 case kSampleFormatS16: |
| 76 case kSampleFormatS32: |
| 77 case kSampleFormatF32: |
| 78 return true; |
| 79 case kUnknownSampleFormat: |
| 80 case kSampleFormatPlanarS16: |
| 81 case kSampleFormatPlanarF32: |
| 82 case kSampleFormatPlanarS32: |
| 83 return false; |
| 84 } |
| 85 |
| 86 NOTREACHED() << "Invalid sample format provided: " << sample_format; |
| 87 return false; |
| 88 } |
| 89 |
54 } // namespace media | 90 } // namespace media |
OLD | NEW |