Skip to content

Commit

Permalink
Unspecified FPS where possible and data sequence parsing on Hisi
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Sep 13, 2024
1 parent 319529e commit b9951bd
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 43 deletions.
45 changes: 36 additions & 9 deletions src/hal/hisi/v1_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,44 @@ static enum ConfigError v1_parse_config_videv(
return err;
}
{
const char *possible_values[] = {
"VI_DATA_SEQ_VUVU", "VI_DATA_SEQ_UVUV",
"VI_DATA_SEQ_UYVY", "VI_DATA_SEQ_VYUY",
const char *possible_values[] = {"VI_DATA_SEQ_VUVU", "VI_DATA_SEQ_UVUV"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_DATA_SEQ_UYVY", "VI_DATA_SEQ_VYUY",
"VI_DATA_SEQ_YUYV", "VI_DATA_SEQ_YVYU"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err != CONFIG_OK)
return err;
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_INPUT_DATA_VUVU", "VI_INPUT_DATA_UVUV"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_INPUT_DATA_UYVY", "VI_INPUT_DATA_VYUY",
"VI_INPUT_DATA_YUYV", "VI_INPUT_DATA_YVYU"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err != CONFIG_OK)
return err;
}
data_seq_ok:
{
const char *possible_values[] = {"VI_VSYNC_FIELD", "VI_VSYNC_PULSE"};
const int count = sizeof(possible_values) / sizeof(const char *);
Expand Down
4 changes: 2 additions & 2 deletions src/hal/hisi/v1_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ int v1_pipeline_create(void)
channel.compress = V1_COMPR_NONE;
channel.mirror = 0;
channel.flip = 0;
channel.srcFps = v1_config.img.framerate;
channel.dstFps = v1_config.img.framerate;
channel.srcFps = -1;
channel.dstFps = -1;
if (ret = v1_vi.fnSetChannelConfig(_v1_vi_chn, &channel))
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hal/hisi/v1_vi.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ typedef enum {
} v1_vi_intf;

typedef enum {
V1_VI_SEQ_VUVU,
V1_VI_SEQ_VUVU = 0,
V1_VI_SEQ_UVUV,
V1_VI_SEQ_UYVY,
V1_VI_SEQ_UYVY = 0,
V1_VI_SEQ_VYUY,
V1_VI_SEQ_YUYV,
V1_VI_SEQ_YVYU,
Expand Down
45 changes: 36 additions & 9 deletions src/hal/hisi/v2_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,44 @@ static enum ConfigError v2_parse_config_videv(
return err;
}
{
const char *possible_values[] = {
"VI_DATA_SEQ_VUVU", "VI_DATA_SEQ_UVUV",
"VI_DATA_SEQ_UYVY", "VI_DATA_SEQ_VYUY",
const char *possible_values[] = {"VI_DATA_SEQ_VUVU", "VI_DATA_SEQ_UVUV"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_DATA_SEQ_UYVY", "VI_DATA_SEQ_VYUY",
"VI_DATA_SEQ_YUYV", "VI_DATA_SEQ_YVYU"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err != CONFIG_OK)
return err;
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_INPUT_DATA_VUVU", "VI_INPUT_DATA_UVUV"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_INPUT_DATA_UYVY", "VI_INPUT_DATA_VYUY",
"VI_INPUT_DATA_YUYV", "VI_INPUT_DATA_YVYU"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err != CONFIG_OK)
return err;
}
data_seq_ok:
{
const char *possible_values[] = {"VI_VSYNC_FIELD", "VI_VSYNC_PULSE"};
const int count = sizeof(possible_values) / sizeof(const char *);
Expand Down
4 changes: 2 additions & 2 deletions src/hal/hisi/v2_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ int v2_pipeline_create(void)
channel.compress = V2_COMPR_NONE;
channel.mirror = 0;
channel.flip = 0;
channel.srcFps = v2_config.isp.framerate;
channel.dstFps = v2_config.isp.framerate;
channel.srcFps = -1;
channel.dstFps = -1;
if (ret = v2_vi.fnSetChannelConfig(_v2_vi_chn, &channel))
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hal/hisi/v2_vi.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ typedef enum {
} v2_vi_intf;

typedef enum {
V2_VI_SEQ_VUVU,
V2_VI_SEQ_VUVU = 0,
V2_VI_SEQ_UVUV,
V2_VI_SEQ_UYVY,
V2_VI_SEQ_UYVY = 0,
V2_VI_SEQ_VYUY,
V2_VI_SEQ_YUYV,
V2_VI_SEQ_YVYU,
Expand Down
45 changes: 36 additions & 9 deletions src/hal/hisi/v3_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,44 @@ static enum ConfigError v3_parse_config_videv(
return err;
}
{
const char *possible_values[] = {
"VI_DATA_SEQ_VUVU", "VI_DATA_SEQ_UVUV",
"VI_DATA_SEQ_UYVY", "VI_DATA_SEQ_VYUY",
const char *possible_values[] = {"VI_DATA_SEQ_VUVU", "VI_DATA_SEQ_UVUV"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_DATA_SEQ_UYVY", "VI_DATA_SEQ_VYUY",
"VI_DATA_SEQ_YUYV", "VI_DATA_SEQ_YVYU"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err != CONFIG_OK)
return err;
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_INPUT_DATA_VUVU", "VI_INPUT_DATA_UVUV"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err == CONFIG_OK)
goto data_seq_ok;
}
{
const char *possible_values[] = {"VI_INPUT_DATA_UYVY", "VI_INPUT_DATA_VYUY",
"VI_INPUT_DATA_YUYV", "VI_INPUT_DATA_YVYU"};
const int count = sizeof(possible_values) / sizeof(const char *);
err = parse_enum(
ini, section, "data_seq", (void*)&device->seq,
possible_values, count, 0);
if (err != CONFIG_OK)
return err;
}
data_seq_ok:
{
const char *possible_values[] = {"VI_VSYNC_FIELD", "VI_VSYNC_PULSE"};
const int count = sizeof(possible_values) / sizeof(const char *);
Expand Down
4 changes: 2 additions & 2 deletions src/hal/hisi/v3_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ int v3_pipeline_create(void)
channel.compress = V3_COMPR_NONE;
channel.mirror = 0;
channel.flip = 0;
channel.srcFps = v3_config.isp.framerate;
channel.dstFps = v3_config.isp.framerate;
channel.srcFps = -1;
channel.dstFps = -1;
if (ret = v3_vi.fnSetChannelConfig(_v3_vi_chn, &channel))
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hal/hisi/v3_vi.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ typedef enum {
} v3_vi_rephase;

typedef enum {
V3_VI_SEQ_VUVU,
V3_VI_SEQ_VUVU = 0,
V3_VI_SEQ_UVUV,
V3_VI_SEQ_UYVY,
V3_VI_SEQ_UYVY = 0,
V3_VI_SEQ_VYUY,
V3_VI_SEQ_YUYV,
V3_VI_SEQ_YVYU,
Expand Down
8 changes: 4 additions & 4 deletions src/hal/hisi/v4_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ int v4_pipeline_create(void)
channel.mirror = 0;
channel.flip = 0;
channel.depth = 0;
channel.srcFps = v4_config.isp.framerate;
channel.dstFps = v4_config.isp.framerate;
channel.srcFps = -1;
channel.dstFps = -1;
if (ret = v4_vi.fnSetChannelConfig(_v4_vi_pipe, _v4_vi_chn, &channel))
return ret;
}
Expand Down Expand Up @@ -331,8 +331,8 @@ int v4_pipeline_create(void)
group.dest.height = v4_config.isp.capt.height;
group.pixFmt = V4_PIXFMT_YVU420SP;
group.hdr = V4_HDR_SDR8;
group.srcFps = v4_config.isp.framerate;
group.dstFps = v4_config.isp.framerate;
group.srcFps = -1;
group.dstFps = -1;
group.nRedOn = 1;
group.nRed.mode = V4_VPSS_NMODE_VIDEO;
group.nRed.compress = V4_COMPR_NONE;
Expand Down

0 comments on commit b9951bd

Please sign in to comment.