• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 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.
4 
5 //#define LOG_NDEBUG 0
6 #define LOG_TAG "VideoTypes"
7 
8 #include <v4l2_codec2/common/VideoTypes.h>
9 
10 #include <log/log.h>
11 
12 namespace android {
13 
VideoCodecToString(VideoCodec codec)14 const char* VideoCodecToString(VideoCodec codec) {
15     switch (codec) {
16     case VideoCodec::H264:
17         return "H264";
18     case VideoCodec::VP8:
19         return "VP8";
20     case VideoCodec::VP9:
21         return "VP9";
22     }
23 }
24 
profileToString(C2Config::profile_t profile)25 const char* profileToString(C2Config::profile_t profile) {
26     switch (profile) {
27     case C2Config::PROFILE_UNUSED:
28         return "unused";
29     case C2Config::PROFILE_AVC_BASELINE:
30         return "h264 baseline";
31     case C2Config::PROFILE_AVC_MAIN:
32         return "h264 main";
33     case C2Config::PROFILE_AVC_EXTENDED:
34         return "h264 extended";
35     case C2Config::PROFILE_AVC_HIGH:
36         return "h264 high";
37     case C2Config::PROFILE_AVC_HIGH_10:
38         return "h264 high 10";
39     case C2Config::PROFILE_AVC_HIGH_422:
40         return "h264 high 4:2:2";
41     case C2Config::PROFILE_AVC_HIGH_444_PREDICTIVE:
42         return "h264 high 4:4:4 predictive";
43     case C2Config::PROFILE_AVC_SCALABLE_BASELINE:
44         return "h264 scalable baseline";
45     case C2Config::PROFILE_AVC_SCALABLE_HIGH:
46         return "h264 scalable high";
47     case C2Config::PROFILE_AVC_STEREO_HIGH:
48         return "h264 stereo high";
49     case C2Config::PROFILE_AVC_MULTIVIEW_HIGH:
50         return "h264 multiview high";
51     case C2Config::PROFILE_HEVC_MAIN:
52         return "hevc main";
53     case C2Config::PROFILE_HEVC_MAIN_10:
54         return "hevc main 10";
55     case C2Config::PROFILE_HEVC_MAIN_STILL:
56         return "hevc main still-picture";
57     case C2Config::PROFILE_VP8_0:
58         return "vp8 profile0";
59     case C2Config::PROFILE_VP8_1:
60         return "vp8 profile1";
61     case C2Config::PROFILE_VP8_2:
62         return "vp8 profile2";
63     case C2Config::PROFILE_VP8_3:
64         return "vp8 profile3";
65     case C2Config::PROFILE_VP9_0:
66         return "vp9 profile0";
67     case C2Config::PROFILE_VP9_1:
68         return "vp9 profile1";
69     case C2Config::PROFILE_VP9_2:
70         return "vp9 profile2";
71     case C2Config::PROFILE_VP9_3:
72         return "vp9 profile3";
73     case C2Config::PROFILE_AV1_0:
74         return "av1 profile 0";
75     case C2Config::PROFILE_AV1_1:
76         return "av1 profile 1";
77     case C2Config::PROFILE_AV1_2:
78         return "av1 profile 2";
79     default:
80         return "unknown";
81     }
82 }
83 
HalPixelFormatToString(HalPixelFormat format)84 const char* HalPixelFormatToString(HalPixelFormat format) {
85     switch (format) {
86     case HalPixelFormat::UNKNOWN:
87         return "Unknown";
88     case HalPixelFormat::YCBCR_420_888:
89         return "YCBCR_420_888";
90     case HalPixelFormat::YV12:
91         return "YV12";
92     case HalPixelFormat::NV12:
93         return "NV12";
94     }
95 }
96 
97 }  // namespace android
98