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:-
Dtvcc::new()
to create Dtvcc
using ccx_decoder_dtvcc_settings
as done here, https://github.com/CCExtractor/ccextractor/blob/master/src/lib_ccx/ccx_dtvcc.c#L76-L124ccxr_dtvcc_init()
in lib.rs and use this at all places where dtvcc_init()
is being called. (Probably add a new struct field to lib_cc_decode
like dtvcc_rust
and store Dtvcc
there instead of using the dtvcc
field)dtvcc_free()
Dtvcc
from dec_ctx
instead of creating a new oneAdditionally to fix mp4 code flow:-
- [ ] Call the corresponding rust function here and pass Dtvcc
as done in the above steps