38 calculate_framecount (gavl_time_t t, uint fps)
40 return lumiera_quantise_frames_fps (t,0,fps);
46 const int FRAMES = 15;
47 const int MILLIS = 700;
48 const int SECONDS = 20;
49 const int MINUTES = 55;
62 CHECK ((gavl_time_t) t == 0);
69 CHECK (calculate_framecount (t,FPS) == 0);
70 CHECK (calculate_framecount (t, FPS+5) == 0);
83 CHECK (calculate_framecount (t, FPS) == 338896);
84 CHECK (calculate_framecount (t, FPS+5) == 409500);
103 CHECK (calculate_framecount (t, FPS) == 338895);
104 CHECK (calculate_framecount (t, FPS+5) == 409498);
111 TEST (ntsc_drop_frame)
116 CHECK ((gavl_time_t) t == 0);
123 CHECK (calculate_framecount (t, FPS) == 0);
124 CHECK (calculate_framecount (t, FPS+5) == 0);
131 int frames = FRAMES + 30*SECONDS + 30*60*MINUTES + 30*60*60*HOURS;
132 int minutes_to_drop_frames = (MINUTES - MINUTES/10) + (HOURS * 54);
133 frames -= 2*minutes_to_drop_frames;
134 int64_t expectedMillis = 1000LL * frames * 1001/30000;
136 expectedMillis %= 1000;
154 for (hrs = 0; hrs <= 24; hrs += 6)
155 for (min = 0; min <= 59; min += 1)
156 for (sec = 0; sec <= 59; sec += 10)
157 for (frame = 0; frame <= 29; frame++)
160 if (min % 10 && sec == 0 && frame < 2)
180 for (i = 0; i < 59; i++)
182 int frame = (i % 10 == 0) ? 0 : 2;
int lumiera_time_ntsc_drop_frames(gavl_time_t time)
Extract the frame part of given time, using NTSC drop-frame timecode.
int lumiera_time_hours(gavl_time_t time)
Extract the hour part of given time.
gavl_time_t lumiera_build_time(long millis, uint secs, uint mins, uint hours)
Build a time value by summing up the given components.
Common functions for handling of time values.
Helpers and support macros for defining test executables in C.
int lumiera_time_ntsc_drop_seconds(gavl_time_t time)
Extract the second part of given time, using NTSC drop-frame timecode.
int lumiera_time_frames(gavl_time_t time, uint fps)
Extract the remaining frame part of given time.
gavl_time_t lumiera_build_time_ntsc_drop(uint frames, uint secs, uint mins, uint hours)
Builds a time value by summing up the given components.
int lumiera_time_millis(gavl_time_t time)
Extract the milliseconds part of given time.
int lumiera_time_ntsc_drop_hours(gavl_time_t time)
Extract the hour part of given time, using NTSC drop-frame timecode.
int lumiera_time_seconds(gavl_time_t time)
Extract the seconds part of given time.
int lumiera_time_minutes(gavl_time_t time)
Extract the minute part of given time.
int lumiera_time_ntsc_drop_minutes(gavl_time_t time)
Extract the minute part of given time, using NTSC drop-frame timecode.
gavl_time_t lumiera_build_time_fps(uint fps, uint frames, uint secs, uint mins, uint hours)
Builds a time value by summing up the given components.
char * lumiera_tmpbuf_print_time(gavl_time_t time)