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 const std::string V4L2ComponentName::kVP8Encoder = "c2.v4l2.vp8.encoder"; 16 const std::string V4L2ComponentName::kVP9Encoder = "c2.v4l2.vp9.encoder"; 17 18 const std::string V4L2ComponentName::kH264Decoder = "c2.v4l2.avc.decoder"; 19 const std::string V4L2ComponentName::kVP8Decoder = "c2.v4l2.vp8.decoder"; 20 const std::string V4L2ComponentName::kVP9Decoder = "c2.v4l2.vp9.decoder"; 21 const std::string V4L2ComponentName::kH264SecureDecoder = "c2.v4l2.avc.decoder.secure"; 22 const std::string V4L2ComponentName::kVP8SecureDecoder = "c2.v4l2.vp8.decoder.secure"; 23 const std::string V4L2ComponentName::kVP9SecureDecoder = "c2.v4l2.vp9.decoder.secure"; 24 25 // static isValid(const char * name)26bool V4L2ComponentName::isValid(const char* name) { 27 return name == kH264Encoder || name == kVP8Encoder || name == kVP9Encoder || 28 name == kH264Decoder || name == kVP8Decoder || name == kVP9Decoder || 29 name == kH264SecureDecoder || name == kVP8SecureDecoder || name == kVP9SecureDecoder; 30 } 31 32 // static isEncoder(const char * name)33bool V4L2ComponentName::isEncoder(const char* name) { 34 ALOG_ASSERT(isValid(name)); 35 36 return name == kH264Encoder || name == kVP8Encoder || name == kVP9Encoder; 37 } 38 39 } // namespace android 40