Skip to content

Commit 3bdbfd8

Browse files
feat: Create function to set dtvcc encoder to dtvcc_rust in C
1 parent c91d606 commit 3bdbfd8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/lib_ccx/general_loop.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,12 @@ int process_non_multiprogram_general_loop(struct lib_ccx_ctx *ctx,
896896
cinfo = get_cinfo(ctx->demux_ctx, pid);
897897
*enc_ctx = update_encoder_list_cinfo(ctx, cinfo);
898898
*dec_ctx = update_decoder_list_cinfo(ctx, cinfo);
899+
900+
#ifndef DISABLE_RUST
901+
ccxr_dtvcc_set_encoder((*dec_ctx)->dtvcc_rust, *enc_ctx);
902+
#else
899903
(*dec_ctx)->dtvcc->encoder = (void *)(*enc_ctx);
904+
#endif
900905

901906
if ((*dec_ctx)->timing->min_pts == 0x01FFFFFFFFLL) // if we didn't set the min_pts of the program
902907
{
@@ -1093,7 +1098,12 @@ int general_loop(struct lib_ccx_ctx *ctx)
10931098

10941099
enc_ctx = update_encoder_list_cinfo(ctx, cinfo);
10951100
dec_ctx = update_decoder_list_cinfo(ctx, cinfo);
1101+
1102+
#ifndef DISABLE_RUST
1103+
ccxr_dtvcc_set_encoder(dec_ctx->dtvcc_rust, enc_ctx);
1104+
#else
10961105
dec_ctx->dtvcc->encoder = (void *)enc_ctx; // WARN: otherwise cea-708 will not work
1106+
#endif
10971107

10981108
if (dec_ctx->timing->min_pts == 0x01FFFFFFFFLL) // if we didn't set the min_pts of the program
10991109
{
@@ -1268,7 +1278,13 @@ int rcwt_loop(struct lib_ccx_ctx *ctx)
12681278
}
12691279

12701280
dec_ctx = update_decoder_list(ctx);
1281+
1282+
#ifndef DISABLE_RUST
1283+
ccxr_dtvcc_set_encoder(dec_ctx->dtvcc_rust, enc_ctx);
1284+
#else
12711285
dec_ctx->dtvcc->encoder = (void *)enc_ctx; // WARN: otherwise cea-708 will not work
1286+
#endif
1287+
12721288
if (parsebuf[6] == 0 && parsebuf[7] == 2)
12731289
{
12741290
dec_ctx->codec = CCX_CODEC_TELETEXT;

src/lib_ccx/lib_ccx.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ int general_loop(struct lib_ccx_ctx *ctx);
173173
void process_hex(struct lib_ccx_ctx *ctx, char *filename);
174174
int rcwt_loop(struct lib_ccx_ctx *ctx);
175175

176+
#ifndef DISABLE_RUST
177+
void ccxr_dtvcc_set_encoder(void *dtvcc_rust, struct encoder_ctx* encoder);
178+
#endif
179+
176180
extern int end_of_file;
177181

178182
int ccx_mxf_getmoredata(struct lib_ccx_ctx *ctx, struct demuxer_data **ppdata);

0 commit comments

Comments
 (0)