[MacViews] Show comboboxes with a native NSMenu
[chromium-blink-merge.git] / media / base / video_types.cc
blob627fc8e7cd9d2e603006a48c20db4bc8094c3fe3
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/base/video_types.h"
7 #include "base/logging.h"
9 namespace media {
11 std::string VideoPixelFormatToString(VideoPixelFormat format) {
12 switch (format) {
13 case PIXEL_FORMAT_UNKNOWN:
14 return "PIXEL_FORMAT_UNKNOWN";
15 case PIXEL_FORMAT_I420:
16 return "PIXEL_FORMAT_I420";
17 case PIXEL_FORMAT_YV12:
18 return "PIXEL_FORMAT_YV12";
19 case PIXEL_FORMAT_YV16:
20 return "PIXEL_FORMAT_YV16";
21 case PIXEL_FORMAT_YV12A:
22 return "PIXEL_FORMAT_YV12A";
23 case PIXEL_FORMAT_YV24:
24 return "PIXEL_FORMAT_YV24";
25 case PIXEL_FORMAT_NV12:
26 return "PIXEL_FORMAT_NV12";
27 case PIXEL_FORMAT_NV21:
28 return "PIXEL_FORMAT_NV21";
29 case PIXEL_FORMAT_UYVY:
30 return "PIXEL_FORMAT_UYVY";
31 case PIXEL_FORMAT_YUY2:
32 return "PIXEL_FORMAT_YUY2";
33 case PIXEL_FORMAT_ARGB:
34 return "PIXEL_FORMAT_ARGB";
35 case PIXEL_FORMAT_XRGB:
36 return "PIXEL_FORMAT_XRGB";
37 case PIXEL_FORMAT_RGB24:
38 return "PIXEL_FORMAT_RGB24";
39 case PIXEL_FORMAT_RGB32:
40 return "PIXEL_FORMAT_RGB32";
41 case PIXEL_FORMAT_MJPEG:
42 return "PIXEL_FORMAT_MJPEG";
44 NOTREACHED() << "Invalid VideoPixelFormat provided: " << format;
45 return "";
48 bool IsYuvPlanar(VideoPixelFormat format) {
49 switch (format) {
50 case PIXEL_FORMAT_YV12:
51 case PIXEL_FORMAT_I420:
52 case PIXEL_FORMAT_YV16:
53 case PIXEL_FORMAT_YV12A:
54 case PIXEL_FORMAT_YV24:
55 case PIXEL_FORMAT_NV12:
56 case PIXEL_FORMAT_NV21:
57 return true;
59 case PIXEL_FORMAT_UNKNOWN:
60 case PIXEL_FORMAT_UYVY:
61 case PIXEL_FORMAT_YUY2:
62 case PIXEL_FORMAT_ARGB:
63 case PIXEL_FORMAT_XRGB:
64 case PIXEL_FORMAT_RGB24:
65 case PIXEL_FORMAT_RGB32:
66 case PIXEL_FORMAT_MJPEG:
67 return false;
69 return false;
72 } // namespace media