Skip to content

Commit 4c04e3c

Browse files
committed
Completed file_functions and demuxer
1 parent e64bf85 commit 4c04e3c

File tree

9 files changed

+2721
-851
lines changed

9 files changed

+2721
-851
lines changed

src/rust/Cargo.lock

Lines changed: 254 additions & 387 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ num-integer = "0.1.46"
2929
lib_ccxr = { path = "lib_ccxr" }
3030
url = "2.5.2"
3131
libc = "0.2.169"
32+
tempfile = "3.19.0"
33+
nix = { version = "0.29.0", features = ["fs"] }
34+
lazy_static = "1.5.0"
35+
memoffset = "0.9.1"
3236

3337
[build-dependencies]
3438
bindgen = "0.64.0"
@@ -40,6 +44,7 @@ wtv_debug = []
4044
enable_ffmpeg = []
4145
with_libcurl = []
4246
hardsubx_ocr = ["rsmpeg", "tesseract-sys", "leptonica-sys"]
47+
sanity_check = []
4348

4449
[profile.release-with-debug]
4550
inherits = "release"

src/rust/src/decoder/common_structs.rs

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ use crate::decoder::xds::XdsContext;
44
const MAXBFRAMES: usize = 50;
55
const SORTBUF: usize = 2 * MAXBFRAMES + 1;
66

7-
// #define CCX_OK 0
8-
// #define CCX_FALSE 0
9-
// #define CCX_TRUE 1
10-
// #define CCX_EAGAIN -100
11-
// #define CCX_EOF -101
12-
// #define CCX_EINVAL -102
13-
// #define CCX_ENOSUPP -103
14-
// #define CCX_ENOMEM -104
7+
158

169
pub const CCX_OK: i32 = 0;
1710
pub const CCX_FALSE: i32 = 0;
@@ -135,3 +128,74 @@ pub struct LibCcDecode {
135128
pub ocr_quantmode: i32,
136129
pub prev: *mut LibCcDecode,
137130
}
131+
impl Default for LibCcDecode {
132+
fn default() -> Self {
133+
LibCcDecode {
134+
cc_stats: [0; 4],
135+
saw_caption_block: 0,
136+
processed_enough: 0,
137+
context_cc608_field_1: std::ptr::null_mut(),
138+
context_cc608_field_2: std::ptr::null_mut(),
139+
no_rollup: 0,
140+
noscte20: 0,
141+
fix_padding: 0,
142+
write_format: lib_ccxr::common::OutputFormat::Raw,
143+
extraction_start: None,
144+
extraction_end: None,
145+
subs_delay: 0,
146+
extract: 0,
147+
fullbin: 0,
148+
in_bufferdatatype: lib_ccxr::common::BufferdataType::Unknown,
149+
hauppauge_mode: 0,
150+
frames_since_last_gop: 0,
151+
saw_gop_header: 0,
152+
max_gop_length: 0,
153+
last_gop_length: 0,
154+
total_pulldownfields: 0,
155+
total_pulldownframes: 0,
156+
program_number: 0,
157+
list: crate::demuxer::demuxer::HList::default(),
158+
timing: std::ptr::null_mut(),
159+
codec: lib_ccxr::common::Codec::Dvb,
160+
has_ccdata_buffered: 0,
161+
is_alloc: 0,
162+
avc_ctx: std::ptr::null_mut(),
163+
private_data: std::ptr::null_mut(),
164+
current_hor_size: 0,
165+
current_vert_size: 0,
166+
current_aspect_ratio: 0,
167+
current_frame_rate: 0,
168+
no_bitstream_error: 0,
169+
saw_seqgoppic: 0,
170+
in_pic_data: 0,
171+
current_progressive_sequence: 0,
172+
current_pulldownfields: 0,
173+
temporal_reference: 0,
174+
picture_coding_type: lib_ccxr::common::FrameType::ResetOrUnknown,
175+
num_key_frames: 0,
176+
picture_structure: 0,
177+
repeat_first_field: 0,
178+
progressive_frame: 0,
179+
pulldownfields: 0,
180+
top_field_first: 0,
181+
stat_numuserheaders: 0,
182+
stat_dvdccheaders: 0,
183+
stat_scte20ccheaders: 0,
184+
stat_replay5000headers: 0,
185+
stat_replay4000headers: 0,
186+
stat_dishheaders: 0,
187+
stat_hdtv: 0,
188+
stat_divicom: 0,
189+
false_pict_header: 0,
190+
current_field: 0,
191+
maxtref: 0,
192+
cc_data_count: [0; SORTBUF],
193+
cc_fts: [0; SORTBUF],
194+
cc_data_pkts: [[0; 10 * 31 * 3 + 1]; SORTBUF],
195+
anchor_seq_number: 0,
196+
xds_ctx: std::ptr::null_mut(),
197+
ocr_quantmode: 0,
198+
prev: std::ptr::null_mut(),
199+
}
200+
}
201+
}

0 commit comments

Comments
 (0)