Skip to content

Commit

Permalink
Some more details regarding hisi-gen1
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Aug 20, 2024
1 parent 2404bec commit 9673fb2
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/hal/hisi/v1_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ char _v1_aud_chn = 0;
char _v1_aud_dev = 0;
char _v1_isp_chn = 0;
char _v1_isp_dev = 0;
char _v1_venc_grp = 0;
char _v1_vi_chn = 0;
char _v1_vi_dev = 0;
char _v1_vpss_chn = 0;
Expand Down Expand Up @@ -146,7 +145,7 @@ int v1_channel_bind(char index)
v1_sys_bind source = { .module = V1_SYS_MOD_VPSS,
.device = _v1_vpss_grp, .channel = index };
v1_sys_bind dest = { .module = V1_SYS_MOD_GROUP,
.device = _v1_venc_grp, .channel = index };
.device = index, .channel = 0 };
if (ret = v1_sys.fnBind(&source, &dest))
return ret;
}
Expand Down Expand Up @@ -207,7 +206,7 @@ int v1_channel_unbind(char index)
v1_sys_bind source = { .module = V1_SYS_MOD_VPSS,
.device = _v1_vpss_grp, .channel = index };
v1_sys_bind dest = { .module = V1_SYS_MOD_GROUP,
.device = _v1_venc_grp, .channel = index };
.device = index, .channel = 0 };
if (ret = v1_sys.fnUnbind(&source, &dest))
return ret;
}
Expand Down Expand Up @@ -343,8 +342,8 @@ int v1_region_create(char handle, hal_rect rect, short opacity)
{
int ret;

v1_sys_bind channel = { .module = V1_SYS_MOD_GROUP,
.device = _v1_venc_grp, .channel = 0 };
v1_sys_bind channel = { .module = V1_SYS_MOD_VPSS,
.device = _v1_vpss_grp, .channel = 0 };
v1_rgn_cnf region, regionCurr;
v1_rgn_chn attrib, attribCurr;

Expand Down Expand Up @@ -393,8 +392,8 @@ int v1_region_create(char handle, hal_rect rect, short opacity)

void v1_region_destroy(char handle)
{
v1_sys_bind channel = { .module = V1_SYS_MOD_GROUP,
.device = _v1_venc_grp, .channel = 0 };
v1_sys_bind channel = { .module = V1_SYS_MOD_VPSS,
.device = _v1_vpss_grp, .channel = 0 };

v1_rgn.fnDetachChannel(handle, &channel);
v1_rgn.fnDestroyRegion(handle);
Expand Down Expand Up @@ -450,7 +449,7 @@ int v1_video_create(char index, hal_vidconfig *config)
channel.attrib.jpg.maxPic.height = config->height;
channel.attrib.jpg.bufSize =
config->height * config->width * 2;
channel.attrib.jpg.byFrame = 1;
channel.attrib.jpg.byFrame = 0;
channel.attrib.jpg.fieldOrFrame = 0;
channel.attrib.jpg.priority = 0;
channel.attrib.jpg.pic.width = config->width;
Expand All @@ -462,8 +461,8 @@ int v1_video_create(char index, hal_vidconfig *config)
channel.attrib.mjpg.maxPic.height = config->height;
channel.attrib.mjpg.bufSize =
config->height * config->width * 2;
channel.attrib.mjpg.byFrame = 1;
channel.attrib.mjpg.mainStrmOn = index ? 0 : 1;
channel.attrib.mjpg.byFrame = 0;
channel.attrib.mjpg.mainStrmOn = 1;
channel.attrib.mjpg.fieldOrFrame = 0;
channel.attrib.mjpg.priority = 0;
channel.attrib.mjpg.pic.width = config->width;
Expand Down Expand Up @@ -522,13 +521,13 @@ int v1_video_create(char index, hal_vidconfig *config)
attrib->pic.width = config->width;
attrib->pic.height = config->height;
attach:
if (ret = v1_venc.fnCreateGroup(_v1_venc_grp))
if (ret = v1_venc.fnCreateGroup(index))
return ret;

if (ret = v1_venc.fnCreateChannel(index, &channel))
return ret;

if (ret = v1_venc.fnRegisterChannel(_v1_venc_grp, index))
if (ret = v1_venc.fnRegisterChannel(index, index))
return ret;

if (config->codec != HAL_VIDCODEC_JPG &&
Expand All @@ -553,7 +552,7 @@ int v1_video_destroy(char index)
v1_sys_bind source = { .module = V1_SYS_MOD_VPSS,
.device = _v1_vpss_grp, .channel = index };
v1_sys_bind dest = { .module = V1_SYS_MOD_GROUP,
.device = _v1_venc_grp, .channel = index };
.device = index, .channel = 0 };
if (ret = v1_sys.fnUnbind(&source, &dest))
return ret;
}
Expand All @@ -564,7 +563,7 @@ int v1_video_destroy(char index)
if (ret = v1_venc.fnDestroyChannel(index))
return ret;

if (ret = v1_venc.fnDestroyGroup(_v1_venc_grp))
if (ret = v1_venc.fnDestroyGroup(index))
return ret;

if (ret = v1_vpss.fnDisableChannel(_v1_vpss_grp, index))
Expand Down

0 comments on commit 9673fb2

Please sign in to comment.