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"
11 std::string
VideoPixelFormatToString(VideoPixelFormat format
) {
13 case PIXEL_FORMAT_UNKNOWN
:
14 return "PIXEL_FORMAT_UNKNOWN";
15 case PIXEL_FORMAT_YV12
:
16 return "PIXEL_FORMAT_YV12";
17 case PIXEL_FORMAT_YV16
:
18 return "PIXEL_FORMAT_YV16";
19 case PIXEL_FORMAT_I420
:
20 return "PIXEL_FORMAT_I420";
21 case PIXEL_FORMAT_YV12A
:
22 return "PIXEL_FORMAT_YV12A";
23 case PIXEL_FORMAT_YV24
:
24 return "PIXEL_FORMAT_YV24";
25 case PIXEL_FORMAT_ARGB
:
26 return "PIXEL_FORMAT_ARGB";
27 case PIXEL_FORMAT_XRGB
:
28 return "PIXEL_FORMAT_XRGB";
29 case PIXEL_FORMAT_NV12
:
30 return "PIXEL_FORMAT_NV12";
31 case PIXEL_FORMAT_UYVY
:
32 return "PIXEL_FORMAT_UYVY";
34 NOTREACHED() << "Invalid VideoPixelFormat provided: " << format
;
38 bool IsYuvPlanar(VideoPixelFormat format
) {
40 case PIXEL_FORMAT_YV12
:
41 case PIXEL_FORMAT_I420
:
42 case PIXEL_FORMAT_YV16
:
43 case PIXEL_FORMAT_YV12A
:
44 case PIXEL_FORMAT_YV24
:
45 case PIXEL_FORMAT_NV12
:
48 case PIXEL_FORMAT_UNKNOWN
:
49 case PIXEL_FORMAT_ARGB
:
50 case PIXEL_FORMAT_XRGB
:
51 case PIXEL_FORMAT_UYVY
: