Open
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 createDtvcc
usingccx_decoder_dtvcc_settings
as 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_decode
likedtvcc_rust
and storeDtvcc
there instead of using thedtvcc
field) - Similar for
dtvcc_free()
- Now change ccxr_process_cc_data to use
Dtvcc
fromdec_ctx
instead of creating a new one
Additionally to fix mp4 code flow:-
- Call the corresponding rust function here and pass
Dtvcc
as done in the above steps