Improve how options are handled

This commit is contained in:
Kamil Trzcinski 2022-04-12 08:59:04 +02:00
parent b9fd63154c
commit 5ab25f435a
3 changed files with 17 additions and 11 deletions

View File

@ -38,6 +38,20 @@ camera_options_t camera_options = {
.allow_dma = true,
.high_res_factor = 1.0,
.low_res_factor = 0.0,
.h264 = {
.options =
"video_bitrate_mode=0" OPTION_VALUE_LIST_SEP
"video_bitrate=5000000" OPTION_VALUE_LIST_SEP
"repeat_sequence_header=5000000" OPTION_VALUE_LIST_SEP
"h264_i_frame_period=30" OPTION_VALUE_LIST_SEP
"h264_level=11" OPTION_VALUE_LIST_SEP
"h264_profile=4" OPTION_VALUE_LIST_SEP
"h264_minimum_qp_value=16" OPTION_VALUE_LIST_SEP
"h264_maximum_qp_value=32"
},
.jpeg = {
.options = "compression_quality=80"
},
};
http_server_options_t http_options = {

View File

@ -92,7 +92,7 @@ int buffer_list_set_stream(buffer_list_t *buf_list, bool do_on)
buf_list->streaming = do_on;
int enqueued = buffer_list_count_enqueued(buf_list);
LOG_VERBOSE(buf_list, "Streaming %s... Was %d of %d enqueud", do_on ? "started" : "stopped", enqueued, buf_list->nbufs);
LOG_INFO(buf_list, "Streaming %s... Was %d of %d enqueud", do_on ? "started" : "stopped", enqueued, buf_list->nbufs);
return 0;
error:

View File

@ -87,17 +87,9 @@ int camera_set_params(camera_t *camera)
// Set some defaults
for (int i = 0; i < 2; i++) {
device_set_option_list(camera->legacy_isp[2], camera->options.isp.options);
device_set_option_string(camera->codec_jpeg[i], "compression_quality", "80");
device_set_option_string(camera->codec_h264[i], "video_bitrate_mode", "0");
device_set_option_string(camera->codec_h264[i], "video_bitrate", "5000000");
device_set_option_string(camera->codec_h264[i], "repeat_sequence_header", "1");
device_set_option_string(camera->codec_h264[i], "h264_i_frame_period", "30");
device_set_option_string(camera->codec_h264[i], "h264_level", "11");
device_set_option_string(camera->codec_h264[i], "h264_profile", "4");
device_set_option_string(camera->codec_h264[i], "h264_minimum_qp_value", "16");
device_set_option_string(camera->codec_h264[i], "h264_maximum_qp_value", "32");
device_set_option_list(camera->legacy_isp[i], camera->options.isp.options);
device_set_option_list(camera->codec_jpeg[i], camera->options.jpeg.options);
device_set_option_string(camera->codec_h264[i], "repeat_sequence_header", "1"); // required for force key support
device_set_option_list(camera->codec_h264[i], camera->options.h264.options);
}
return 0;