Skip to content

Commit

Permalink
Pass resolution and FPS infos on MP4 stream, allow loading sensor con…
Browse files Browse the repository at this point in the history
…figuration files on T31
  • Loading branch information
wberube committed Jun 3, 2024
1 parent 0b4e200 commit 5f40539
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hal/inge/t31_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ int t31_channel_unbind(char index)
return EXIT_SUCCESS;
}

int t31_config_load(char *path)
{
return t31_isp.fnLoadConfig(path);
}

int t31_region_create(int *handle, hal_rect rect)
{
int ret;
Expand Down Expand Up @@ -247,7 +252,7 @@ int t31_video_create(char index, hal_vidconfig *config)

memset(&channel, 0, sizeof(channel));
t31_venc.fnSetDefaults(&channel, profile, ratemode, config->width, config->height,
config->framerate, 1, config->gop, 2, -1, config->bitrate);
config->framerate, 1, config->gop, config->gop / config->framerate, -1, config->bitrate);

switch (channel.rate.mode) {
case T31_VENC_RATEMODE_CBR:
Expand Down
2 changes: 2 additions & 0 deletions src/hal/inge/t31_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void t31_channel_destroy(char index);
int t31_channel_grayscale(char enable);
int t31_channel_unbind(char index);

int t31_config_load(char *path);

int t31_region_create(int *handle, hal_rect rect);
void t31_region_destroy(int *handle);
int t31_region_setbitmap(int *handle, hal_bitmap *bitmap);
Expand Down
3 changes: 3 additions & 0 deletions src/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ int start_sdk() {
index, ret, errstr(ret));
return EXIT_FAILURE;
}

set_mp4_config(app_config.mp4_width, app_config.mp4_height, app_config.mp4_fps);
}

if (ret = bind_vpss_venc(index, app_config.mp4_fps, 0)) {
Expand Down Expand Up @@ -360,6 +362,7 @@ int start_sdk() {
case HAL_PLATFORM_I6: i6_config_load(app_config.sensor_config); break;
case HAL_PLATFORM_I6C: i6c_config_load(app_config.sensor_config); break;
case HAL_PLATFORM_I6F: i6f_config_load(app_config.sensor_config); break;
case HAL_PLATFORM_T31: t31_config_load(app_config.sensor_config); break;
}

fprintf(stderr, "SDK has started successfully!\n");
Expand Down

0 comments on commit 5f40539

Please sign in to comment.