Lines Matching refs:tc

53 uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum)
55 unsigned fps = tc->fps;
56 int drop = !!(tc->flags & AV_TIMECODE_FLAG_DROPFRAME);
59 framenum += tc->start;
61 framenum = av_timecode_adjust_ntsc_framenum2(framenum, tc->fps);
66 return av_timecode_get_smpte(tc->rate, drop, hh, mm, ss, ff);
71 uint32_t tc = 0;
78 tc |= (1 << 7);
80 tc |= (1 << 23);
90 tc |= drop << 30;
91 tc |= (ff / 10) << 28;
92 tc |= (ff % 10) << 24;
93 tc |= (ss / 10) << 20;
94 tc |= (ss % 10) << 16;
95 tc |= (mm / 10) << 12;
96 tc |= (mm % 10) << 8;
97 tc |= (hh / 10) << 4;
98 tc |= (hh % 10);
100 return tc;
103 char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum)
105 int fps = tc->fps;
106 int drop = tc->flags & AV_TIMECODE_FLAG_DROPFRAME;
109 framenum += tc->start;
114 neg = tc->flags & AV_TIMECODE_FLAG_ALLOWNEGATIVE;
120 if (tc->flags & AV_TIMECODE_FLAG_24HOURSMAX)
192 static int check_timecode(void *log_ctx, AVTimecode *tc)
194 if ((int)tc->fps <= 0) {
198 if ((tc->flags & AV_TIMECODE_FLAG_DROPFRAME) && tc->fps % 30 != 0) {
202 if (check_fps(tc->fps) < 0) {
204 tc->rate.num, tc->rate.den);
221 int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx)
223 memset(tc, 0, sizeof(*tc));
224 tc->start = frame_start;
225 tc->flags = flags;
226 tc->rate = rate;
227 tc->fps = fps_from_frame_rate(rate);
228 return check_timecode(log_ctx, tc);
231 int av_timecode_init_from_components(AVTimecode *tc, AVRational rate, int flags, int hh, int mm, int ss, int ff, void *log_ctx)
235 memset(tc, 0, sizeof(*tc));
236 tc->flags = flags;
237 tc->rate = rate;
238 tc->fps = fps_from_frame_rate(rate);
240 ret = check_timecode(log_ctx, tc);
244 tc->start = (hh*3600 + mm*60 + ss) * tc->fps + ff;
245 if (tc->flags & AV_TIMECODE_FLAG_DROPFRAME) { /* adjust frame number */
247 tc->start -= (tc->fps / 30 * 2) * (tmins - tmins/10);
252 int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
264 return av_timecode_init_from_components(tc, rate, flags, hh, mm, ss, ff, log_ctx);