29 calculate_framecount (gavl_time_t t, uint fps)
31 return lumiera_quantise_frames_fps (t,0,fps);
37 const int FRAMES = 15;
38 const int MILLIS = 700;
39 const int SECONDS = 20;
40 const int MINUTES = 55;
53 CHECK ((gavl_time_t) t == 0);
60 CHECK (calculate_framecount (t,FPS) == 0);
61 CHECK (calculate_framecount (t, FPS+5) == 0);
74 CHECK (calculate_framecount (t, FPS) == 338896);
75 CHECK (calculate_framecount (t, FPS+5) == 409500);
94 CHECK (calculate_framecount (t, FPS) == 338895);
95 CHECK (calculate_framecount (t, FPS+5) == 409498);
102 TEST (ntsc_drop_frame)
107 CHECK ((gavl_time_t) t == 0);
114 CHECK (calculate_framecount (t, FPS) == 0);
115 CHECK (calculate_framecount (t, FPS+5) == 0);
122 int frames = FRAMES + 30*SECONDS + 30*60*MINUTES + 30*60*60*HOURS;
123 int minutes_to_drop_frames = (MINUTES - MINUTES/10) + (HOURS * 54);
124 frames -= 2*minutes_to_drop_frames;
125 int64_t expectedMillis = 1000LL * frames * 1001/30000;
127 expectedMillis %= 1000;
145 for (hrs = 0; hrs <= 24; hrs += 6)
146 for (min = 0; min <= 59; min += 1)
147 for (sec = 0; sec <= 59; sec += 10)
148 for (frame = 0; frame <= 29; frame++)
151 if (min % 10 && sec == 0 && frame < 2)
171 for (i = 0; i < 59; i++)
173 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)