From 5de596bb0f64c46bb8c37b87e7b9483a0ab504e5 Mon Sep 17 00:00:00 2001 From: xufuji456 <839789740@qq.com> Date: Wed, 13 Oct 2021 00:10:39 +0800 Subject: [PATCH] relayout global variable --- app/CMakeLists.txt | 2 +- app/src/main/cpp/ffmpeg/ffmpeg.cpp | 23 ++++++++++------------- app/src/main/cpp/ffmpeg/ffmpeg.h | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 0abada5..6f0fadc 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -19,7 +19,7 @@ add_library( # Sets the name of the library. # Provides a relative path to your source file(s). src/main/cpp/ffmpeg/cmdutils.c - src/main/cpp/ffmpeg/ffmpeg.cpp + src/main/cpp/ffmpeg/ffmpeg.cpp src/main/cpp/ffmpeg/ffmpeg_filter.c src/main/cpp/ffmpeg/ffmpeg_opt.c src/main/cpp/ffmpeg_cmd.c diff --git a/app/src/main/cpp/ffmpeg/ffmpeg.cpp b/app/src/main/cpp/ffmpeg/ffmpeg.cpp index 7d9fe1f..b001034 100644 --- a/app/src/main/cpp/ffmpeg/ffmpeg.cpp +++ b/app/src/main/cpp/ffmpeg/ffmpeg.cpp @@ -113,13 +113,9 @@ extern "C" { #include #include -jmp_buf jump_buf; - const char program_name[] = "ffmpeg"; const int program_birth_year = 2000; -static FILE *vstats_file; - const char *const forced_keyframes_const_names[] = { "n", "n_forced", @@ -147,12 +143,17 @@ static int nb_frames_drop = 0; static int64_t decode_error_stat[2]; static int want_sdp = 1; - static BenchmarkTimeStamps current_time; -AVIOContext *progress_avio = NULL; - static uint8_t *subtitle_out; +static volatile int received_sigterm = 0; +static volatile int received_nb_signals = 0; +static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0); +static volatile int ffmpeg_exited = 0; +static int main_return_code = 0; +static FILE *vstats_file; + +AVIOContext *progress_avio = NULL; InputStream **input_streams = NULL; int nb_input_streams = 0; InputFile **input_files = NULL; @@ -167,6 +168,8 @@ FilterGraph **filtergraphs; int nb_filtergraphs; int cancel_execute = 0; +jmp_buf jump_buf; + #if HAVE_TERMIOS_H /* init terminal so that we can grab keys */ @@ -341,12 +344,6 @@ void term_exit(void) term_exit_sigsafe(); } -static volatile int received_sigterm = 0; -static volatile int received_nb_signals = 0; -static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0); -static volatile int ffmpeg_exited = 0; -static int main_return_code = 0; - static void sigterm_handler(int sig) { diff --git a/app/src/main/cpp/ffmpeg/ffmpeg.h b/app/src/main/cpp/ffmpeg/ffmpeg.h index e740e6c..1d635dc 100644 --- a/app/src/main/cpp/ffmpeg/ffmpeg.h +++ b/app/src/main/cpp/ffmpeg/ffmpeg.h @@ -578,6 +578,7 @@ extern OutputStream **output_streams; extern int nb_output_streams; extern OutputFile **output_files; extern int nb_output_files; +extern AVIOContext *progress_avio; extern FilterGraph **filtergraphs; extern int nb_filtergraphs; @@ -608,7 +609,6 @@ extern int print_stats; extern int qp_hist; extern int stdin_interaction; extern int frame_bits_per_raw_sample; -extern AVIOContext *progress_avio; extern float max_error_rate; extern char *videotoolbox_pixfmt;