-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Labels
Description
Currently, the entry point for the rust decoder is here where we create a new Dtvcc struct each time. This causes the data to be reset each time ccxr_process_cc_data() is called.
Instead, we want to initialize Dtvcc only once at the start of the program and then use it for all subsequent function calls.
Steps:-
- Change
Dtvcc::new()to createDtvccusingccx_decoder_dtvcc_settingsas done here, https://github.com/CCExtractor/ccextractor/blob/master/src/lib_ccx/ccx_dtvcc.c#L76-L124 - Create a new extern C fn
ccxr_dtvcc_init()in lib.rs and use this at all places wheredtvcc_init()is being called. (Probably add a new struct field tolib_cc_decodelikedtvcc_rustand storeDtvccthere instead of using thedtvccfield) - Similar for
dtvcc_free() - Now change ccxr_process_cc_data to use
Dtvccfromdec_ctxinstead of creating a new one
Additionally to fix mp4 code flow:-
- Call the corresponding rust function here and pass
Dtvccas done in the above steps