blob: 2220d60ab7dfc8b29b87294142f668e9c9b408aa [file] [log] [blame]
Kuang-che Wudb9c20b2014-04-17 16:14:18 +08001// Copyright 2014 The Chromium OS 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.
Alex Vakulenkoe36a9812014-08-11 15:59:58 -07004#ifndef AVTEST_LABEL_DETECT_LABEL_DETECT_H_
5#define AVTEST_LABEL_DETECT_LABEL_DETECT_H_
Hirokazu Honda491b1682019-12-06 14:03:36 +09006
Kuang-che Wudb9c20b2014-04-17 16:14:18 +08007#include <stdbool.h>
8#include <stdint.h>
Hirokazu Honda491b1682019-12-06 14:03:36 +09009
10#if defined(USE_V4L2_CODEC)
11#include <linux/videodev2.h>
12#endif // defined(USE_V4L2_CODEC)
13
Tom Hughes0e816952020-08-24 18:04:24 -070014#if defined(USE_VAAPI)
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080015#include <va/va.h>
Hirokazu Honda491b1682019-12-06 14:03:36 +090016#endif // defined (USE_VAAPI)
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080017
18/* main.c */
19extern int verbose;
Tom Hughes0e816952020-08-24 18:04:24 -070020#define TRACE(...) \
21 do { \
22 if (verbose) \
23 printf(__VA_ARGS__); \
24 } while (0)
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080025
Kuang-che Wu6b5559a2016-06-23 10:07:59 +080026/* table_lookup.c */
27extern void detect_label_by_board_name(void);
28
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080029/* util.c */
30extern int do_ioctl(int fd, int request, void* arg);
Kuang-che Wuca2bd582014-07-22 18:24:45 +080031extern bool is_any_device(const char* pattern, bool (*func)(int fd));
Keiichi Watanabeaea439c2019-03-22 22:56:51 +090032extern bool is_any_device_with_path(const char* pattern,
Tom Hughes0e816952020-08-24 18:04:24 -070033 bool (*func)(const char* dev_path, int fd));
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080034extern void convert_fourcc_to_str(uint32_t fourcc, char* str);
35
36/* util_v4l2 */
Hirokazu Honda491b1682019-12-06 14:03:36 +090037#if defined(USE_V4L2_CODEC)
Tom Hughes0e816952020-08-24 18:04:24 -070038extern bool is_v4l2_support_format(int fd,
39 enum v4l2_buf_type buf_type,
40 uint32_t fourcc);
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080041extern bool is_hw_video_acc_device(int fd);
henryhsu5c4b6642015-08-13 14:15:00 +080042extern bool is_hw_jpeg_acc_device(int fd);
Tom Hughes0e816952020-08-24 18:04:24 -070043bool get_v4l2_max_resolution(int fd,
44 uint32_t fourcc,
45 int32_t* const resolution_width,
46 int32_t* const resolution_height);
Hirokazu Honda491b1682019-12-06 14:03:36 +090047#endif // defined(USE_V4L2_CODEC)
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080048
49/* util_vaapi */
Hirokazu Honda491b1682019-12-06 14:03:36 +090050#if defined(USE_VAAPI)
Tom Hughes0e816952020-08-24 18:04:24 -070051bool is_vaapi_support_formats(int fd,
52 const VAProfile* profiles,
53 VAEntrypoint entrypoint,
54 unsigned int format);
55bool get_vaapi_max_resolution(int fd,
56 const VAProfile* profiles,
Steve Cho79784862021-01-22 13:59:00 -080057 VAEntrypoint entrypoint,
58 unsigned int format,
Tom Hughes0e816952020-08-24 18:04:24 -070059 int32_t* const resolution_width,
60 int32_t* const resolution_height);
Jeffrey Kardatzke819314a2021-03-01 17:10:32 -080061bool are_vaapi_attribs_supported(int fd,
62 VAProfile va_profile,
63 VAEntrypoint entrypoint,
64 const VAConfigAttrib* required_attribs,
65 int num_required_attribs);
Hirokazu Honda491b1682019-12-06 14:03:36 +090066#endif // defined(USE_VAAPI)
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080067
68/* detectors */
Keiichi Watanabeaea439c2019-03-22 22:56:51 +090069extern bool detect_builtin_usb_camera(void);
70extern bool detect_builtin_mipi_camera(void);
71extern bool detect_vivid_camera(void);
72extern bool detect_builtin_camera(void);
73extern bool detect_builtin_or_vivid_camera(void);
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080074extern bool detect_video_acc_h264(void);
75extern bool detect_video_acc_vp8(void);
Kuang-che Wud477fae2015-03-09 21:03:21 +080076extern bool detect_video_acc_vp9(void);
Miguel Casas69368492017-11-29 17:49:46 -050077extern bool detect_video_acc_vp9_2(void);
Steve Cho79784862021-01-22 13:59:00 -080078extern bool detect_video_acc_av1(void);
79extern bool detect_video_acc_av1_10bpp(void);
Jeffrey Kardatzkeeab7cc02021-02-24 12:53:14 -080080extern bool detect_video_acc_hevc(void);
81extern bool detect_video_acc_hevc_10bpp(void);
Kuang-che Wudb9c20b2014-04-17 16:14:18 +080082extern bool detect_video_acc_enc_h264(void);
83extern bool detect_video_acc_enc_vp8(void);
Hirokazu Hondad752e4e2019-02-10 20:53:56 +090084extern bool detect_video_acc_enc_vp9(void);
henryhsu5c4b6642015-08-13 14:15:00 +080085extern bool detect_jpeg_acc_dec(void);
Sheng-Hao Tsaoef33e4e2018-01-26 17:37:57 +080086extern bool detect_jpeg_acc_enc(void);
Hirokazu Hondab0328c32017-10-02 13:18:37 +090087bool detect_4k_device_h264(void);
88bool detect_4k_device_vp8(void);
89bool detect_4k_device_vp9(void);
Steve Cho79784862021-01-22 13:59:00 -080090bool detect_4k_device_av1(void);
91bool detect_4k_device_av1_10bpp(void);
Jeffrey Kardatzkeeab7cc02021-02-24 12:53:14 -080092bool detect_4k_device_hevc(void);
93bool detect_4k_device_hevc_10bpp(void);
Pin-chih Lin5195fe12019-03-06 21:20:15 +080094bool detect_4k_device_enc_h264(void);
95bool detect_4k_device_enc_vp8(void);
96bool detect_4k_device_enc_vp9(void);
Jeffrey Kardatzke819314a2021-03-01 17:10:32 -080097bool detect_video_prot_cencv1_h264_cbc(void);
98bool detect_video_prot_cencv1_h264_ctr(void);
99bool detect_video_prot_cencv3_av1_cbc(void);
100bool detect_video_prot_cencv3_av1_ctr(void);
101bool detect_video_prot_cencv3_h264_cbc(void);
102bool detect_video_prot_cencv3_h264_ctr(void);
103bool detect_video_prot_cencv3_hevc_cbc(void);
104bool detect_video_prot_cencv3_hevc_ctr(void);
105bool detect_video_prot_cencv3_vp9_cbc(void);
106bool detect_video_prot_cencv3_vp9_ctr(void);
Alex Vakulenkoe36a9812014-08-11 15:59:58 -0700107#endif // AVTEST_LABEL_DETECT_LABEL_DETECT_H_