diff --git a/src/lib_ccx/ccx_dtvcc.h b/src/lib_ccx/ccx_dtvcc.h index 1f4d0b65c..3bcf40d46 100644 --- a/src/lib_ccx/ccx_dtvcc.h +++ b/src/lib_ccx/ccx_dtvcc.h @@ -13,7 +13,7 @@ void dtvcc_free(dtvcc_ctx **); #ifndef DISABLE_RUST extern void *ccxr_dtvcc_init(struct ccx_decoder_dtvcc_settings *settings_dtvcc); extern void ccxr_dtvcc_free(void *dtvcc_rust); -extern void ccxr_dtvcc_process_data(void *dtvcc_rust, const unsigned char *data); +extern void ccxr_dtvcc_process_data(void *dtvcc_rust, const unsigned char cc_valid, const unsigned char cc_type, const unsigned char data1, const unsigned char data2); #endif #endif // CCEXTRACTOR_CCX_DTVCC_H diff --git a/src/lib_ccx/mp4.c b/src/lib_ccx/mp4.c index 1ba2d3135..e4b1350a1 100644 --- a/src/lib_ccx/mp4.c +++ b/src/lib_ccx/mp4.c @@ -420,7 +420,7 @@ static int process_clcp(struct lib_ccx_ctx *ctx, struct encoder_ctx *enc_ctx, #ifndef DISABLE_RUST ccxr_dtvcc_set_encoder(dec_ctx->dtvcc_rust, enc_ctx); - ccxr_dtvcc_process_data(dec_ctx->dtvcc_rust, (unsigned char *)temp); + ccxr_dtvcc_process_data(dec_ctx->dtvcc_rust, temp[0], temp[1], temp[2], temp[3]); #else dec_ctx->dtvcc->encoder = (void *)enc_ctx; dtvcc_process_data(dec_ctx->dtvcc, (unsigned char *)temp); diff --git a/src/rust/src/lib.rs b/src/rust/src/lib.rs index 02a1a072c..0ddd14229 100644 --- a/src/rust/src/lib.rs +++ b/src/rust/src/lib.rs @@ -133,8 +133,15 @@ extern "C" fn ccxr_dtvcc_set_encoder(dtvcc_rust: *mut Dtvcc, encoder: *mut encod unsafe { (*dtvcc_rust).encoder = encoder }; } -extern "C" fn ccxr_dtvcc_process_data(dtvcc_rust: *mut Dtvcc, data: &[u8]) { - unsafe { &mut (*dtvcc_rust) }.process_cc_data(data[0], data[1], data[2], data[3]); +#[no_mangle] +extern "C" fn ccxr_dtvcc_process_data( + dtvcc_rust: *mut Dtvcc, + cc_valid: u8, + cc_type: u8, + data1: u8, + data2: u8, +) { + unsafe { &mut (*dtvcc_rust) }.process_cc_data(cc_valid, cc_type, data1, data2); } /// Process cc_data