OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "remoting/base/util.h" | 5 #include "remoting/base/util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
| 9 using media::VideoFrame; |
| 10 |
9 namespace remoting { | 11 namespace remoting { |
10 | 12 |
11 int GetBytesPerPixel(PixelFormat format) { | 13 int GetBytesPerPixel(VideoFrame::Format format) { |
12 // Note: The order is important here for performance. This is sorted from the | 14 // Note: The order is important here for performance. This is sorted from the |
13 // most common to the less common (PIXEL_FORMAT_ASCII is mostly used | 15 // most common to the less common (PIXEL_FORMAT_ASCII is mostly used |
14 // just for testing). | 16 // just for testing). |
15 switch (format) { | 17 switch (format) { |
16 case PIXEL_FORMAT_RGB24: return 3; | 18 case VideoFrame::RGB24: return 3; |
17 case PIXEL_FORMAT_RGB565: return 2; | 19 case VideoFrame::RGB565: return 2; |
18 case PIXEL_FORMAT_RGB32: return 4; | 20 case VideoFrame::RGB32: return 4; |
19 case PIXEL_FORMAT_ASCII: return 1; | 21 case VideoFrame::ASCII: return 1; |
20 default: | 22 default: |
21 NOTREACHED() << "Pixel format not supported"; | 23 NOTREACHED() << "Pixel format not supported"; |
22 return 0; | 24 return 0; |
23 } | 25 } |
24 } | 26 } |
25 | 27 |
26 } // namespace remoting | 28 } // namespace remoting |
OLD | NEW |