Don't make the missing movie.sh file fatal

This commit is contained in:
Martijn Braam
2024-12-23 15:40:34 +01:00
parent a9f6291c3e
commit 1b5a871641

View File

@@ -176,8 +176,7 @@ setup(MPPipeline *pipeline, const void *data)
state_proc.mode_focus = AAA_DISABLED; state_proc.mode_focus = AAA_DISABLED;
if (!mp_process_find_processor(movie_script, "movie.sh")) { if (!mp_process_find_processor(movie_script, "movie.sh")) {
printf("movie.sh not found\n"); fprintf(stderr,"movie.sh not found, video pipeline disabled\n");
exit(1);
} }
setup_capture(); setup_capture();
} }
@@ -410,7 +409,7 @@ auto_focus_step(const struct focus_stats *stats)
static const int debug = 1; static const int debug = 1;
if (focus_phase >= PH_DONE) { if (focus_phase >= PH_DONE) {
if (debug>1) printf("Phase %d, sharp %d best %d ", focus_phase, (int)(stats->sharp / 10000), (int)(best_sharp/ 10000)); if (debug>1) printf("Phase %d, sharp %d best %d ", focus_phase, (int)(stats->sharp / 10000), (int)(best_sharp/ 10000));
focus_phase++; focus_phase++;
if (stats->sharp > (best_sharp * 2)) { if (stats->sharp > (best_sharp * 2)) {
if (debug>1) printf("Improved on its own.\n"); if (debug>1) printf("Improved on its own.\n");
@@ -473,9 +472,9 @@ focus_stats(struct focus_stats *stats, const unsigned int *frame, const int widt
unsigned int g = (frame[p] >> 8) & 0xff; unsigned int g = (frame[p] >> 8) & 0xff;
unsigned int b = (frame[p] >> 16) & 0xff; unsigned int b = (frame[p] >> 16) & 0xff;
unsigned int y = (r + g + b) / 3; unsigned int y = (r + g + b) / 3;
sharp += (y-last_y) * (y-last_y); sharp += (y-last_y) * (y-last_y);
last_y = y; last_y = y;
} }
stats->sharp = sharp; stats->sharp = sharp;
@@ -511,7 +510,7 @@ summarize()
char buf[2048]; char buf[2048];
time = state_proc.exposure.value * sec_per_line(); time = state_proc.exposure.value * sec_per_line();
/* Gain */ /* Gain */
gain = state_proc.gain.value / ((float) state_proc.gain.min); gain = state_proc.gain.value / ((float) state_proc.gain.min);
/* dgain */ /* dgain */
@@ -829,7 +828,7 @@ static void on_read_complete(GObject *source_object, GAsyncResult *res, gpointer
g_error_free(error); g_error_free(error);
g_object_unref(stream); g_object_unref(stream);
return; return;
} }
//g_print("Got buffer: %.*s", (int)bytes_read, stdout_buf); //g_print("Got buffer: %.*s", (int)bytes_read, stdout_buf);
stdout_buf[bytes_read] = 0; stdout_buf[bytes_read] = 0;
@@ -885,8 +884,8 @@ spawn_movie(char *cmd)
return; return;
} }
GInputStream *stdout_stream; GInputStream *stdout_stream;
// Get the stdout stream of the subprocess // Get the stdout stream of the subprocess
stdout_stream = g_subprocess_get_stdout_pipe(proc); stdout_stream = g_subprocess_get_stdout_pipe(proc);
@@ -1086,7 +1085,7 @@ save_dng(const uint8_t *image, char *fname, int count)
} }
libdng_set_color_matrix_1( libdng_set_color_matrix_1(
&dng, &dng,
state_proc.calibration.color_matrix_1[0], state_proc.calibration.color_matrix_1[0],
state_proc.calibration.color_matrix_1[1], state_proc.calibration.color_matrix_1[1],
state_proc.calibration.color_matrix_1[2], state_proc.calibration.color_matrix_1[2],
@@ -1099,7 +1098,7 @@ save_dng(const uint8_t *image, char *fname, int count)
); );
libdng_set_color_matrix_2( libdng_set_color_matrix_2(
&dng, &dng,
state_proc.calibration.color_matrix_2[0], state_proc.calibration.color_matrix_2[0],
state_proc.calibration.color_matrix_2[1], state_proc.calibration.color_matrix_2[1],
state_proc.calibration.color_matrix_2[2], state_proc.calibration.color_matrix_2[2],
@@ -1112,7 +1111,7 @@ save_dng(const uint8_t *image, char *fname, int count)
); );
libdng_set_forward_matrix_1( libdng_set_forward_matrix_1(
&dng, &dng,
state_proc.calibration.forward_matrix_1[0], state_proc.calibration.forward_matrix_1[0],
state_proc.calibration.forward_matrix_1[1], state_proc.calibration.forward_matrix_1[1],
state_proc.calibration.forward_matrix_1[2], state_proc.calibration.forward_matrix_1[2],
@@ -1125,7 +1124,7 @@ save_dng(const uint8_t *image, char *fname, int count)
); );
libdng_set_forward_matrix_2( libdng_set_forward_matrix_2(
&dng, &dng,
state_proc.calibration.forward_matrix_2[0], state_proc.calibration.forward_matrix_2[0],
state_proc.calibration.forward_matrix_2[1], state_proc.calibration.forward_matrix_2[1],
state_proc.calibration.forward_matrix_2[2], state_proc.calibration.forward_matrix_2[2],