Commit 7e894996 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Default period 0 (no needing return) between each images

parent 3791c4c6
......@@ -37,7 +37,7 @@ int main(int argc, char**argv){
blc_program_add_option(&format_str, 'f', "format", "NDEF|Y800|RGB3|RGBA", "format of the desired image (NDEF for native format of the png)", "NDEF");
blc_program_add_option(&images_nb_str, 'n', "number", "integer", "number of images to load (need: file format like: filename%d.png)", NULL);
blc_program_add_option(&output_name, 'o', "output", "blc_channel-out", "Name of the channel", DEFAULT_OUTPUT_NAME);
blc_program_add_option(&period_str, 'p', "period", "integer", "refresh period in ms (-1 for blocking)", "-1");
blc_program_add_option(&period_str, 'p', "period", "integer", "refresh period in ms (-1 for blocking and waiting return)", "0");
blc_program_add_option(&type_str, 't', "type", "NDEF|UIN8|INT8|FL32", "type of the data (NDEF for native type of png)", "NDEF");
blc_program_add_parameter(&filename, "filename", 1, "filename of the image", NULL);
blc_program_init(&argc, &argv, blc_quit);
......@@ -45,7 +45,7 @@ int main(int argc, char**argv){
if (filename==NULL){
blc_program_args_display_help();
EXIT_ON_ERROR("You need to specify a filename: -F<filename>");
EXIT_ON_ERROR("You need to specify a filename: <filename>");
}
format=STRING_TO_UINT32(format_str);
type=STRING_TO_UINT32(type_str);
......@@ -60,12 +60,8 @@ int main(int argc, char**argv){
SSCANF(1, images_nb_str, "%d", &images_nb);
image_id=0;
SPRINTF(final_filename, filename, image_id);
image_id++;
}
else {
STRCPY(final_filename, filename);
images_nb=1;
}
else STRCPY(final_filename, filename);
//Only the properties are defined, the data is not allocated.
blc_image_def_with_png_file(&output, final_filename, type, format);
......@@ -76,17 +72,15 @@ int main(int argc, char**argv){
blc_loop_try_add_posting_semaphore(output.sem_new_data);
BLC_COMMAND_LOOP(period){
if (images_nb_str){
if ( image_id == images_nb-1) blc_command_ask_quit();
else {
SPRINTF(final_filename, filename, image_id);
image_id++;
}
}
//If we have a number of images to load and we have not finish
blc_image_update_with_png_file(&output, final_filename);
if (images_nb_str){
if ( image_id == images_nb-1) blc_command_ask_quit();
else {
SPRINTF(final_filename, filename, image_id);
image_id++;
}
}
}
return EXIT_SUCCESS;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment