@@ -30,6 +30,18 @@ int gop_rollover = 0;
30
30
31
31
struct ccx_common_timing_settings_t ccx_common_timing_settings ;
32
32
33
+ #ifndef DISABLE_RUST
34
+ void ccxr_add_current_pts (struct ccx_common_timing_ctx * ctx , LLONG pts );
35
+ void ccxr_set_current_pts (struct ccx_common_timing_ctx * ctx , LLONG pts );
36
+ int ccxr_set_fts (struct ccx_common_timing_ctx * ctx );
37
+ LLONG ccxr_get_fts (struct ccx_common_timing_ctx * ctx , int current_field );
38
+ LLONG ccxr_get_fts_max (struct ccx_common_timing_ctx * ctx );
39
+ char * ccxr_print_mstime_static (LLONG mstime , char * buf );
40
+ void ccxr_print_debug_timing (struct ccx_common_timing_ctx * ctx );
41
+ void ccxr_calculate_ms_gop_time (struct gop_time_code * g );
42
+ int ccxr_gop_accepted (struct gop_time_code * g );
43
+ #endif
44
+
33
45
void ccx_common_timing_init (LLONG * file_position , int no_sync )
34
46
{
35
47
ccx_common_timing_settings .disable_sync_check = 0 ;
@@ -73,11 +85,18 @@ struct ccx_common_timing_ctx *init_timing_ctx(struct ccx_common_timing_settings_
73
85
74
86
void add_current_pts (struct ccx_common_timing_ctx * ctx , LLONG pts )
75
87
{
88
+ #ifndef DISABLE_RUST
89
+ return ccxr_add_current_pts (ctx , pts );
90
+ #endif
91
+
76
92
set_current_pts (ctx , ctx -> current_pts + pts );
77
93
}
78
94
79
95
void set_current_pts (struct ccx_common_timing_ctx * ctx , LLONG pts )
80
96
{
97
+ #ifndef DISABLE_RUST
98
+ return ccxr_set_current_pts (ctx , pts );
99
+ #endif
81
100
LLONG prev_pts = ctx -> current_pts ;
82
101
ctx -> current_pts = pts ;
83
102
if (ctx -> pts_set == 0 )
@@ -95,6 +114,9 @@ void set_current_pts(struct ccx_common_timing_ctx *ctx, LLONG pts)
95
114
96
115
int set_fts (struct ccx_common_timing_ctx * ctx )
97
116
{
117
+ #ifndef DISABLE_RUST
118
+ return ccxr_set_fts (ctx );
119
+ #endif
98
120
int pts_jump = 0 ;
99
121
100
122
// ES don't have PTS unless GOP timing is used
@@ -266,6 +288,10 @@ int set_fts(struct ccx_common_timing_ctx *ctx)
266
288
267
289
LLONG get_fts (struct ccx_common_timing_ctx * ctx , int current_field )
268
290
{
291
+ #ifndef DISABLE_RUST
292
+ return ccxr_get_fts (ctx , current_field );
293
+ #endif
294
+
269
295
LLONG fts ;
270
296
271
297
switch (current_field )
@@ -290,6 +316,10 @@ LLONG get_fts(struct ccx_common_timing_ctx *ctx, int current_field)
290
316
291
317
LLONG get_fts_max (struct ccx_common_timing_ctx * ctx )
292
318
{
319
+ #ifndef DISABLE_RUST
320
+ return ccxr_get_fts_max (ctx );
321
+ #endif
322
+
293
323
// This returns the maximum FTS that belonged to a frame. Caption block
294
324
// counters are not applicable.
295
325
return ctx -> fts_max + ctx -> fts_global ;
@@ -350,13 +380,22 @@ size_t print_mstime_buff(LLONG mstime, char *fmt, char *buf)
350
380
char * print_mstime_static (LLONG mstime )
351
381
{
352
382
static char buf [15 ]; // 14 should be long enough
383
+
384
+ #ifndef DISABLE_RUST
385
+ return ccxr_print_mstime_static (mstime , buf );
386
+ #endif
387
+
353
388
print_mstime_buff (mstime , "%02u:%02u:%02u:%03u" , buf );
354
389
return buf ;
355
390
}
356
391
357
392
/* Helper function for to display debug timing info. */
358
393
void print_debug_timing (struct ccx_common_timing_ctx * ctx )
359
394
{
395
+ #ifndef DISABLE_RUST
396
+ return ccxr_print_debug_timing (ctx );
397
+ #endif
398
+
360
399
// Avoid wrong "Calc. difference" and "Asynchronous by" numbers
361
400
// for uninitialized min_pts
362
401
LLONG tempmin_pts = (ctx -> min_pts == 0x01FFFFFFFFLL ? ctx -> sync_pts : ctx -> min_pts );
@@ -383,6 +422,10 @@ void print_debug_timing(struct ccx_common_timing_ctx *ctx)
383
422
384
423
void calculate_ms_gop_time (struct gop_time_code * g )
385
424
{
425
+ #ifndef DISABLE_RUST
426
+ return ccxr_calculate_ms_gop_time (g );
427
+ #endif
428
+
386
429
int seconds = (g -> time_code_hours * 3600 ) + (g -> time_code_minutes * 60 ) + g -> time_code_seconds ;
387
430
g -> ms = (LLONG )(1000 * (seconds + g -> time_code_pictures / current_fps ));
388
431
if (gop_rollover )
@@ -391,6 +434,10 @@ void calculate_ms_gop_time(struct gop_time_code *g)
391
434
392
435
int gop_accepted (struct gop_time_code * g )
393
436
{
437
+ #ifndef DISABLE_RUST
438
+ return ccxr_gop_accepted (g );
439
+ #endif
440
+
394
441
if (!((g -> time_code_hours <= 23 ) && (g -> time_code_minutes <= 59 ) && (g -> time_code_seconds <= 59 ) && (g -> time_code_pictures <= 59 )))
395
442
return 0 ;
396
443
0 commit comments