mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-07 05:34:38 +00:00
style: apply clang-format and cargo fmt formatting fixes
Fix formatting issues detected by CI: - C files: Tab alignment, trailing whitespace, blank line cleanup - Rust: Import statement grouping in pic.rs - Cargo.lock: Remove duplicate bindgen dependency entries 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,43 +17,43 @@ struct gop_time_code
|
||||
|
||||
struct ccx_common_timing_settings_t
|
||||
{
|
||||
int disable_sync_check; // If 1, timeline jumps will be ignored. This is important in several input formats that are assumed to have correct timing, no matter what.
|
||||
int no_sync; // If 1, there will be no sync at all. Mostly useful for debugging.
|
||||
int disable_sync_check; // If 1, timeline jumps will be ignored. This is important in several input formats that are assumed to have correct timing, no matter what.
|
||||
int no_sync; // If 1, there will be no sync at all. Mostly useful for debugging.
|
||||
int is_elementary_stream; // Needs to be set, as it's used in set_fts.
|
||||
LLONG *file_position; // The position of the file
|
||||
LLONG *file_position; // The position of the file
|
||||
};
|
||||
extern struct ccx_common_timing_settings_t ccx_common_timing_settings;
|
||||
|
||||
struct ccx_boundary_time
|
||||
{
|
||||
int hh,mm,ss;
|
||||
int hh, mm, ss;
|
||||
LLONG time_in_ms;
|
||||
int set;
|
||||
};
|
||||
|
||||
struct ccx_common_timing_ctx
|
||||
{
|
||||
int pts_set; // 0 = No, 1 = received, 2 = min_pts set
|
||||
int min_pts_adjusted; // 0 = No, 1=Yes (don't adjust again)
|
||||
int seen_known_frame_type; // 0 = No, 1 = Yes. Tracks if we've seen a frame with known type
|
||||
LLONG pending_min_pts; // Minimum PTS seen while waiting for frame type determination
|
||||
int pts_set; // 0 = No, 1 = received, 2 = min_pts set
|
||||
int min_pts_adjusted; // 0 = No, 1=Yes (don't adjust again)
|
||||
int seen_known_frame_type; // 0 = No, 1 = Yes. Tracks if we've seen a frame with known type
|
||||
LLONG pending_min_pts; // Minimum PTS seen while waiting for frame type determination
|
||||
unsigned int unknown_frame_count; // Count of set_fts calls with unknown frame type
|
||||
LLONG current_pts;
|
||||
enum ccx_frame_type current_picture_coding_type;
|
||||
int current_tref; // Store temporal reference of current frame
|
||||
int current_tref; // Store temporal reference of current frame
|
||||
LLONG min_pts;
|
||||
LLONG max_pts;
|
||||
LLONG sync_pts;
|
||||
LLONG minimum_fts; // No screen should start before this FTS
|
||||
LLONG fts_now; // Time stamp of current file (w/ fts_offset, w/o fts_global)
|
||||
LLONG fts_now; // Time stamp of current file (w/ fts_offset, w/o fts_global)
|
||||
LLONG fts_offset; // Time before first sync_pts
|
||||
LLONG fts_fc_offset; // Time before first GOP
|
||||
LLONG fts_max; // Remember the maximum fts that we saw in current file
|
||||
LLONG fts_max; // Remember the maximum fts that we saw in current file
|
||||
LLONG fts_global; // Duration of previous files (-ve mode)
|
||||
int sync_pts2fts_set; // 0 = No, 1 = Yes
|
||||
LLONG sync_pts2fts_fts;
|
||||
LLONG sync_pts2fts_pts;
|
||||
int pts_reset; // 0 = No, 1 = Yes. PTS resets when current_pts is lower than prev
|
||||
int pts_reset; // 0 = No, 1 = Yes. PTS resets when current_pts is lower than prev
|
||||
};
|
||||
// Count 608 (per field) and 708 blocks since last set_fts() call
|
||||
extern int cb_field1, cb_field2, cb_708;
|
||||
@@ -63,7 +63,6 @@ extern int MPEG_CLOCK_FREQ; // This is part of the standard
|
||||
extern int max_dif;
|
||||
extern unsigned pts_big_change;
|
||||
|
||||
|
||||
extern enum ccx_frame_type current_picture_coding_type;
|
||||
extern double current_fps;
|
||||
extern int frames_since_ref_time;
|
||||
@@ -88,7 +87,7 @@ LLONG get_fts_max(struct ccx_common_timing_ctx *ctx);
|
||||
char *print_mstime_static(LLONG mstime);
|
||||
size_t print_mstime_buff(LLONG mstime, char *fmt, char *buf);
|
||||
void print_debug_timing(struct ccx_common_timing_ctx *ctx);
|
||||
int gop_accepted(struct gop_time_code* g);
|
||||
int gop_accepted(struct gop_time_code *g);
|
||||
void calculate_ms_gop_time(struct gop_time_code *g);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -797,7 +797,7 @@ void handle_command(unsigned char c1, const unsigned char c2, ccx_decoder_608_co
|
||||
erase_memory(context, true); // Make sure the lines we just wrote aren't written again
|
||||
}
|
||||
}
|
||||
roll_up(context); // The roll must be done anyway of course.
|
||||
roll_up(context); // The roll must be done anyway of course.
|
||||
// When in pop-on to roll-up transition with changes=0 (first CR, only 1 line),
|
||||
// preserve the CR time so the next caption uses the display state change time,
|
||||
// not the character typing time. This matches FFmpeg's timing behavior.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef CCX_DECODER_608_H
|
||||
#define CCX_DECODER_608_H
|
||||
#define CCX_DECODER_608_H
|
||||
#include "ccx_common_platform.h"
|
||||
#include "ccx_common_structs.h"
|
||||
#include "ccx_decoders_structs.h"
|
||||
@@ -19,11 +19,11 @@ struct ccx_decoder_608_report
|
||||
|
||||
typedef struct ccx_decoder_608_settings
|
||||
{
|
||||
int direct_rollup; // Write roll-up captions directly instead of line by line?
|
||||
int force_rollup; // 0=Disabled, 1, 2 or 3=max lines in roll-up mode
|
||||
int no_rollup; // If 1, write one line at a time
|
||||
int direct_rollup; // Write roll-up captions directly instead of line by line?
|
||||
int force_rollup; // 0=Disabled, 1, 2 or 3=max lines in roll-up mode
|
||||
int no_rollup; // If 1, write one line at a time
|
||||
enum ccx_decoder_608_color_code default_color; // Default color to use.
|
||||
int screens_to_process; // How many screenfuls we want? Use -1 for unlimited
|
||||
int screens_to_process; // How many screenfuls we want? Use -1 for unlimited
|
||||
struct ccx_decoder_608_report *report;
|
||||
} ccx_decoder_608_settings;
|
||||
|
||||
@@ -34,34 +34,33 @@ typedef struct ccx_decoder_608_context
|
||||
struct eia608_screen buffer2;
|
||||
int cursor_row, cursor_column;
|
||||
int visible_buffer;
|
||||
int screenfuls_counter; // Number of meaningful screenfuls written
|
||||
int screenfuls_counter; // Number of meaningful screenfuls written
|
||||
LLONG current_visible_start_ms; // At what time did the current visible buffer became so?
|
||||
enum cc_modes mode;
|
||||
unsigned char last_c1, last_c2;
|
||||
int channel; // Currently selected channel
|
||||
enum ccx_decoder_608_color_code current_color; // Color we are currently using to write
|
||||
enum font_bits font; // Font we are currently using to write
|
||||
int channel; // Currently selected channel
|
||||
enum ccx_decoder_608_color_code current_color; // Color we are currently using to write
|
||||
enum font_bits font; // Font we are currently using to write
|
||||
int rollup_base_row;
|
||||
LLONG ts_start_of_current_line; /* Time at which the first character for current line was received, =-1 no character received yet */
|
||||
LLONG ts_last_char_received; /* Time at which the last written character was received, =-1 no character received yet */
|
||||
int new_channel; // The new channel after a channel change
|
||||
int my_field; // Used for sanity checks
|
||||
int my_channel; // Used for sanity checks
|
||||
int rollup_from_popon; // Track transition from pop-on/paint-on to roll-up mode
|
||||
long bytes_processed_608; // To be written ONLY by process_608
|
||||
LLONG ts_last_char_received; /* Time at which the last written character was received, =-1 no character received yet */
|
||||
int new_channel; // The new channel after a channel change
|
||||
int my_field; // Used for sanity checks
|
||||
int my_channel; // Used for sanity checks
|
||||
int rollup_from_popon; // Track transition from pop-on/paint-on to roll-up mode
|
||||
long bytes_processed_608; // To be written ONLY by process_608
|
||||
int have_cursor_position;
|
||||
|
||||
int *halt; // Can be used to halt the feeding of caption data. Set to 1 if screens_to_progress != -1 && screenfuls_counter >= screens_to_process
|
||||
int cc_to_stdout; // If this is set to 1, the stdout will be flushed when data was written to the screen during a process_608 call.
|
||||
int *halt; // Can be used to halt the feeding of caption data. Set to 1 if screens_to_progress != -1 && screenfuls_counter >= screens_to_process
|
||||
int cc_to_stdout; // If this is set to 1, the stdout will be flushed when data was written to the screen during a process_608 call.
|
||||
struct ccx_decoder_608_report *report;
|
||||
LLONG subs_delay; // ms to delay (or advance) subs
|
||||
LLONG subs_delay; // ms to delay (or advance) subs
|
||||
enum ccx_output_format output_format; // What kind of output format should be used?
|
||||
int textprinted;
|
||||
struct ccx_common_timing_ctx *timing;
|
||||
|
||||
} ccx_decoder_608_context;
|
||||
|
||||
|
||||
#define MAX_COLOR 10
|
||||
extern const char *color_text[MAX_COLOR][2];
|
||||
|
||||
@@ -81,7 +80,7 @@ enum command_code
|
||||
COM_ERASENONDISPLAYEDMEMORY = 11,
|
||||
COM_BACKSPACE = 12,
|
||||
COM_RESUMETEXTDISPLAY = 13,
|
||||
COM_ALARMOFF =14,
|
||||
COM_ALARMOFF = 14,
|
||||
COM_ALARMON = 15,
|
||||
COM_DELETETOENDOFROW = 16,
|
||||
COM_RESUMEDIRECTCAPTIONING = 17,
|
||||
@@ -90,15 +89,14 @@ enum command_code
|
||||
COM_FAKE_RULLUP1 = 18
|
||||
};
|
||||
|
||||
|
||||
void ccx_decoder_608_dinit_library(void **ctx);
|
||||
/*
|
||||
*
|
||||
*/
|
||||
ccx_decoder_608_context* ccx_decoder_608_init_library(struct ccx_decoder_608_settings *settings, int channel,
|
||||
int field, int *halt,
|
||||
int cc_to_stdout,
|
||||
enum ccx_output_format output_format, struct ccx_common_timing_ctx *timing);
|
||||
ccx_decoder_608_context *ccx_decoder_608_init_library(struct ccx_decoder_608_settings *settings, int channel,
|
||||
int field, int *halt,
|
||||
int cc_to_stdout,
|
||||
enum ccx_output_format output_format, struct ccx_common_timing_ctx *timing);
|
||||
|
||||
/**
|
||||
* @param data raw cc608 data to be processed
|
||||
|
||||
147
src/rust/Cargo.lock
generated
147
src/rust/Cargo.lock
generated
@@ -109,29 +109,6 @@ dependencies = [
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.69.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"itertools 0.12.1",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"log",
|
||||
"prettyplease",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"rustc-hash 1.1.0",
|
||||
"shlex",
|
||||
"syn 2.0.108",
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.71.1"
|
||||
@@ -141,7 +118,7 @@ dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"itertools 0.13.0",
|
||||
"itertools",
|
||||
"log",
|
||||
"prettyplease",
|
||||
"proc-macro2",
|
||||
@@ -164,31 +141,6 @@ version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
|
||||
|
||||
[[package]]
|
||||
name = "bon"
|
||||
version = "3.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ebeb9aaf9329dff6ceb65c689ca3db33dbf15f324909c60e4e5eef5701ce31b1"
|
||||
dependencies = [
|
||||
"bon-macros",
|
||||
"rustversion",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bon-macros"
|
||||
version = "3.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77e9d642a7e3a318e37c2c9427b5a6a48aa1ad55dcd986f3034ab2239045a645"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"ident_case",
|
||||
"prettyplease",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn 2.0.108",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "camino"
|
||||
version = "1.2.1"
|
||||
@@ -210,8 +162,7 @@ dependencies = [
|
||||
"num-integer",
|
||||
"palette",
|
||||
"pkg-config",
|
||||
"rsmpeg 0.14.2+ffmpeg.6.1",
|
||||
"rsmpeg 0.18.0+ffmpeg.8.0",
|
||||
"rsmpeg",
|
||||
"serial_test",
|
||||
"strum_macros 0.25.3",
|
||||
"tempfile",
|
||||
@@ -307,41 +258,6 @@ dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"darling_macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_core"
|
||||
version = "0.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4"
|
||||
dependencies = [
|
||||
"fnv",
|
||||
"ident_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn 2.0.108",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
"syn 2.0.108",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.5.5"
|
||||
@@ -434,12 +350,6 @@ dependencies = [
|
||||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||
|
||||
[[package]]
|
||||
name = "form_urlencoded"
|
||||
version = "1.2.2"
|
||||
@@ -667,12 +577,6 @@ dependencies = [
|
||||
"zerovec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ident_case"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "1.1.0"
|
||||
@@ -710,15 +614,6 @@ version = "1.70.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.13.0"
|
||||
@@ -1140,25 +1035,11 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
||||
|
||||
[[package]]
|
||||
name = "rsmpeg"
|
||||
version = "0.14.2+ffmpeg.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "927012cd6ae43519f519741f4a69602ce3a47cf84750784da124dffd03527cc0"
|
||||
version = "0.15.3+ffmpeg.7.1"
|
||||
source = "git+https://github.com/CCExtractor/rsmpeg.git#2ddc3c05af684893ee9c6874924fc112bff0401e"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"paste",
|
||||
"rusty_ffmpeg 0.13.3+ffmpeg.6.1",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rsmpeg"
|
||||
version = "0.18.0+ffmpeg.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "523351495c9ff0bf4b99ed1f42f1415fc709526ddb63526cff85022b387c5811"
|
||||
dependencies = [
|
||||
"bon",
|
||||
"paste",
|
||||
"rusty_ffmpeg 0.16.7+ffmpeg.8",
|
||||
"rusty_ffmpeg",
|
||||
"thiserror 2.0.17",
|
||||
]
|
||||
|
||||
@@ -1215,30 +1096,16 @@ version = "1.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
||||
|
||||
[[package]]
|
||||
name = "rusty_ffmpeg"
|
||||
version = "0.13.3+ffmpeg.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "716adffa5f909c8533611b1dab9ab5666bece35687845865b75ed6a990fc239c"
|
||||
dependencies = [
|
||||
"bindgen 0.69.5",
|
||||
"camino",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rusty_ffmpeg"
|
||||
version = "0.16.7+ffmpeg.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f25d40a46450059278c9f9f2616018910b647877a66a2093a83f115f59763967"
|
||||
source = "git+https://github.com/CCExtractor/rusty_ffmpeg.git#bdbaf09d5fdda4f3fd1278cdd11abe2a47dd9a99"
|
||||
dependencies = [
|
||||
"bindgen 0.71.1",
|
||||
"camino",
|
||||
"once_cell",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use crate::bindings::{cc_subtitle, encoder_ctx, lib_cc_decode};
|
||||
use crate::libccxr_exports::time::{ccxr_get_fts, ccxr_print_debug_timing, ccxr_set_fts};
|
||||
use crate::{anchor_hdcc, process_hdcc};
|
||||
use crate::{ccx_options, current_fps, frames_since_ref_time, fts_at_gop_start, total_frames_count};
|
||||
use crate::{
|
||||
ccx_options, current_fps, frames_since_ref_time, fts_at_gop_start, total_frames_count,
|
||||
};
|
||||
use lib_ccxr::common::{BitStreamRust, BitstreamError, FrameType};
|
||||
use lib_ccxr::debug;
|
||||
use lib_ccxr::util::log::DebugMessageFlag;
|
||||
|
||||
Reference in New Issue
Block a user