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
94095a5
xds module : boilerplate created
Dec 24, 2025
f03ff26
xds module : added datatypes(structs, enums) and C<->Rust data transf…
steel-bucket Dec 24, 2025
801ce5e
xds module : added xdsprint(function) rust implementation
steel-bucket Dec 24, 2025
5c168d0
xds module : added complete internal rust implementation
Dec 24, 2025
32e3f20
xds module : added ffi implementation
Dec 24, 2025
e81a5f3
xds module : fixes requested : 1, 2, 3, 4
Dec 25, 2025
4e252c2
xds module : fix clippy warnings
Dec 25, 2025
1215985
xds module : fixes requested : 5
Dec 26, 2025
46ab8e6
xds module : add setter function for TS_START_OF_XDS from C code
Dec 28, 2025
450654d
xds module : fix minor issue with timing ctx resulting in missing xds…
Feb 3, 2026
9a548ef
xds module : trying to fix frame timing mismatch in regression test 106
Feb 4, 2026
bb55f8a
xds module : fix clippy warnings and fmt errors
Feb 4, 2026
251605a
remove depreciated DISABLE_RUST flag
Mar 27, 2026
86aba32
replace libc::malloc,free usage with ffi usage
Mar 27, 2026
6d6a952
replace log::debug,info usage with libccxr::debug,info
Mar 27, 2026
6a8381d
add unit tests for FromCType and CType
Mar 27, 2026
e5f1a86
refactor handlers.rs to move structs/constants to top, added XdsPacke…
Mar 27, 2026
5b900a2
refactor to move constants, statics, enums to separate file from type…
Mar 27, 2026
f66ab8f
refactor to move constants, statics, enums to separate file from type…
Mar 27, 2026
9ec38fa
fix minor console output regression due to replacement of log::info w…
Mar 27, 2026
23f6ae7
fix minor windows build issue in ci
Mar 27, 2026
f2bca52
fix clippy errors and run cargo fmt
Mar 27, 2026
9e59457
revert till f66ab8fd refactor to move constants, statics, enums to se…
Mar 27, 2026
c1ca3a3
fix c formatting
Mar 27, 2026
4f6fb20
run cargo fmt
Mar 27, 2026
8f5bb19
remove usage of free,malloc
Mar 27, 2026
c0f44dc
add XdsError enum, replace Result<(), ()> with Result<(), XdsError>
Mar 27, 2026
81082a6
run cargo fmt
Mar 27, 2026
1957894
fix : update handlers.rs to match c code after commit 50b51e4234a86e1…
Mar 30, 2026
8f20d6c
fix : remove payload_length < 3 guard
Mar 30, 2026
d4b1e56
fix : check DECODER_XDS flag
Mar 30, 2026
ed3cc1f
remove libc from src/rust/Cargo.toml
Apr 2, 2026
43bc019
fix clippy warning
Apr 2, 2026
717822c
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 @@ -63,6 +63,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 @@ -29,6 +29,7 @@ pub mod libccxr_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