Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0189de6
xds module : boilerplate created
Dec 24, 2025
f2a6292
xds module : added datatypes(structs, enums) and C<->Rust data transf…
steel-bucket Dec 24, 2025
afc0d36
xds module : added xdsprint(function) rust implementation
steel-bucket Dec 24, 2025
b0e6837
xds module : added complete internal rust implementation
Dec 24, 2025
2a0c158
xds module : added ffi implementation
Dec 24, 2025
fcaf6e1
xds module : fixes requested : 1, 2, 3, 4
Dec 25, 2025
a72614c
xds module : fix clippy warnings
Dec 25, 2025
56ca7d0
xds module : fixes requested : 5
Dec 26, 2025
4674c60
xds module : add setter function for TS_START_OF_XDS from C code
Dec 28, 2025
f670410
xds module : fix minor issue with timing ctx resulting in missing xds…
Feb 3, 2026
6d1b175
xds module : trying to fix frame timing mismatch in regression test 106
Feb 4, 2026
d7937bf
xds module : fix clippy warnings and fmt errors
Feb 4, 2026
915ab4c
remove depreciated DISABLE_RUST flag
Mar 27, 2026
e60d4dc
replace libc::malloc,free usage with ffi usage
Mar 27, 2026
49531ff
replace log::debug,info usage with libccxr::debug,info
Mar 27, 2026
776d5a7
add unit tests for FromCType and CType
Mar 27, 2026
b2a2064
refactor handlers.rs to move structs/constants to top, added XdsPacke…
Mar 27, 2026
aa641e3
refactor to move constants, statics, enums to separate file from type…
Mar 27, 2026
2f65799
refactor to move constants, statics, enums to separate file from type…
Mar 27, 2026
521354b
fix minor console output regression due to replacement of log::info w…
Mar 27, 2026
7df5e62
fix minor windows build issue in ci
Mar 27, 2026
fa4f327
fix clippy errors and run cargo fmt
Mar 27, 2026
b36ead4
revert till f66ab8fd refactor to move constants, statics, enums to se…
Mar 27, 2026
f1e2dce
fix c formatting
Mar 27, 2026
14f3743
run cargo fmt
Mar 27, 2026
accdebe
remove usage of free,malloc
Mar 27, 2026
9930e83
add XdsError enum, replace Result<(), ()> with Result<(), XdsError>
Mar 27, 2026
86ea839
run cargo fmt
Mar 27, 2026
d8c4ddb
fix : update handlers.rs to match c code after commit 50b51e4234a86e1…
Mar 30, 2026
92ed32e
fix : remove payload_length < 3 guard
Mar 30, 2026
de5e23d
fix : check DECODER_XDS flag
Mar 30, 2026
3710fde
remove libc from src/rust/Cargo.toml
Apr 2, 2026
c0935b2
fix clippy warning
Apr 2, 2026
961a9dc
run cargo fmt
Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/lib_ccx/ccx_decoders_xds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
#include "ccx_common_common.h"
#include "utility.h"

extern void ccxr_process_xds_bytes(
struct ccx_decoders_xds_context *ctx,
unsigned char hi,
int lo);

extern void ccxr_do_end_of_xds(
struct cc_subtitle *sub,
struct ccx_decoders_xds_context *ctx,
unsigned char expected_checksum);

extern void ccxr_set_ts_start_of_xds(long long value);

LLONG ts_start_of_xds = -1; // Time at which we switched to XDS mode, =-1 hasn't happened yet

static const char *XDSclasses[] =
Expand Down Expand Up @@ -238,6 +250,9 @@ void clear_xds_buffer(struct ccx_decoders_xds_context *ctx, int num)

void process_xds_bytes(struct ccx_decoders_xds_context *ctx, const unsigned char hi, int lo)
{
ccxr_process_xds_bytes(ctx, hi, lo);
return; // use the rust implementation

int is_new;
if (!ctx)
return;
Expand Down Expand Up @@ -890,6 +905,10 @@ int xds_do_misc(struct ccx_decoders_xds_context *ctx)

void do_end_of_xds(struct cc_subtitle *sub, struct ccx_decoders_xds_context *ctx, unsigned char expected_checksum)
{
ccxr_set_ts_start_of_xds(ts_start_of_xds);
ccxr_do_end_of_xds(sub, ctx, expected_checksum);
return; // use the rust implementation

int cs = 0;
int i;

Expand Down
2 changes: 2 additions & 0 deletions src/lib_ccx/lib_ccx.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "avc_functions.h"
#include "teletext.h"

#include "ccx_decoders_xds.h"

#ifdef WITH_LIBCURL
#include <curl/curl.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions src/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fn main() {
"ccx_encoding_type",
"ccx_decoder_608_settings",
"ccx_decoder_608_report",
"ccx_decoders_xds_context",
"ccx_gxf",
"MXFContext",
"demuxer_data",
Expand Down
5 changes: 5 additions & 0 deletions src/rust/lib_ccxr/src/util/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ impl<'a> CCExtractorLogger {
self.debug_mask.is_debug_mode()
}

/// Check if a specific debug flag is set in the current debug mask
pub fn has_debug_flag(&self, flag: DebugMessageFlag) -> bool {
self.debug_mask.mask().intersects(flag)
}

/// Returns the currently set target for logging messages.
pub fn target(&self) -> OutputTarget {
self.target
Expand Down
1 change: 1 addition & 0 deletions src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub mod mp4_ffmpeg_exports;
pub mod parser;
pub mod track_lister;
pub mod utils;
pub mod xds;

#[cfg(windows)]
use std::os::windows::io::{FromRawHandle, RawHandle};
Expand Down
6 changes: 3 additions & 3 deletions src/rust/src/libccxr_exports/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub unsafe extern "C" fn ccxr_millis_to_time(
/// # Safety
///
/// `ctx` should not be null.
unsafe fn generate_timing_context(ctx: *const ccx_common_timing_ctx) -> TimingContext {
pub unsafe fn generate_timing_context(ctx: *const ccx_common_timing_ctx) -> TimingContext {
let pts_set = match (*ctx).pts_set {
0 => PtsSet::No,
1 => PtsSet::Received,
Expand Down Expand Up @@ -206,7 +206,7 @@ unsafe fn generate_timing_context(ctx: *const ccx_common_timing_ctx) -> TimingCo
/// # Safety
///
/// `ctx` should not be null.
unsafe fn write_back_to_common_timing_ctx(
pub unsafe fn write_back_to_common_timing_ctx(
ctx: *mut ccx_common_timing_ctx,
timing_ctx: &TimingContext,
) {
Expand Down Expand Up @@ -275,7 +275,7 @@ unsafe fn write_back_to_common_timing_ctx(
/// # Safety
///
/// All the static variables should be initialized and in valid state.
unsafe fn apply_timing_info() {
pub(crate) unsafe fn apply_timing_info() {
let Ok(mut timing_info) = GLOBAL_TIMING_INFO.write() else {
// RwLock is poisoned, skip updating
return;
Expand Down
Loading
Loading