• 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 "V4L2ComponentCommon"
7 
8 #include <v4l2_codec2/common/V4L2ComponentCommon.h>
9 
10 #include <log/log.h>
11 
12 namespace android {
13 
14 const std::string V4L2ComponentName::kH264Encoder = "c2.v4l2.avc.encoder";
15 
16 const std::string V4L2ComponentName::kH264Decoder = "c2.v4l2.avc.decoder";
17 const std::string V4L2ComponentName::kVP8Decoder = "c2.v4l2.vp8.decoder";
18 const std::string V4L2ComponentName::kVP9Decoder = "c2.v4l2.vp9.decoder";
19 const std::string V4L2ComponentName::kH264SecureDecoder = "c2.v4l2.avc.decoder.secure";
20 const std::string V4L2ComponentName::kVP8SecureDecoder = "c2.v4l2.vp8.decoder.secure";
21 const std::string V4L2ComponentName::kVP9SecureDecoder = "c2.v4l2.vp9.decoder.secure";
22 
23 // static
isValid(const char * name)24 bool V4L2ComponentName::isValid(const char* name) {
25     return name == kH264Encoder || name == kH264Decoder || name == kVP8Decoder ||
26            name == kVP9Decoder || name == kH264SecureDecoder || name == kVP8SecureDecoder ||
27            name == kVP9SecureDecoder;
28 }
29 
30 // static
isEncoder(const char * name)31 bool V4L2ComponentName::isEncoder(const char* name) {
32     ALOG_ASSERT(isValid(name));
33 
34     return name == kH264Encoder;
35 }
36 
37 }  // namespace android
38