File: switch-5.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (68 lines) | stat: -rw-r--r-- 1,572 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* { dg-additional-options "-fno-analyzer-call-summaries" } */

typedef unsigned char u8;
typedef signed int s32;
typedef unsigned int u32;

enum v4l2_mpeg_video_hevc_profile {
  V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN = 0,
  V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE = 1,
  V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 = 2
};
enum v4l2_buf_type {
  V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
  V4L2_BUF_TYPE_VIDEO_OUTPUT = 2
};
struct v4l2_fmtdesc {
  u32 index;
  u32 type;
};
struct v4l2_ctrl;
s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
struct create_channel_param {
  u8 profile;
};

u8
hevc_profile_to_mcu_profile(enum v4l2_mpeg_video_hevc_profile profile) {
  switch (profile) {
  default:
  case V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN:
    return 1;
  case V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10:
    return 2;
  case V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE:
    return 3;
  }
}

int fill_create_channel_param(struct v4l2_ctrl *ctrl,
			      struct create_channel_param *param) {
  enum v4l2_mpeg_video_hevc_profile profile;
  profile = v4l2_ctrl_g_ctrl(ctrl);
  param->profile = hevc_profile_to_mcu_profile(profile);
  return 0;
}

int allegro_enum_fmt_vid(struct v4l2_fmtdesc *f) {
  switch (f->type) {
  case V4L2_BUF_TYPE_VIDEO_OUTPUT:
    if (f->index >= 1)
      return -22;
    break;
  case V4L2_BUF_TYPE_VIDEO_CAPTURE:
    if (f->index >= 2)
      return -22;
    break;
  default:
    return -22;
  }
  return 0;
}

int allegro_ioctl_streamon(struct v4l2_ctrl *ctrl,
			   struct create_channel_param *param) {
  fill_create_channel_param(ctrl, param);

  return 0;
}