| 68 | } |
| 69 | |
| 70 | uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss, int ff) |
| 71 | { |
| 72 | uint32_t tc = 0; |
| 73 | |
| 74 | /* For SMPTE 12-M timecodes, frame count is a special case if > 30 FPS. |
| 75 | See SMPTE ST 12-1:2014 Sec 12.1 for more info. */ |
| 76 | if (av_cmp_q(rate, (AVRational) {30, 1}) == 1) { |
| 77 | if (ff % 2 == 1) { |
| 78 | if (av_cmp_q(rate, (AVRational) {50, 1}) == 0) |
| 79 | tc |= (1 << 7); |
| 80 | else |
| 81 | tc |= (1 << 23); |
| 82 | } |
| 83 | ff /= 2; |
| 84 | } |
| 85 | |
| 86 | hh = hh % 24; |
| 87 | mm = av_clip(mm, 0, 59); |
| 88 | ss = av_clip(ss, 0, 59); |
| 89 | ff = ff % 40; |
| 90 | |
| 91 | tc |= drop << 30; |
| 92 | tc |= (ff / 10) << 28; |
| 93 | tc |= (ff % 10) << 24; |
| 94 | tc |= (ss / 10) << 20; |
| 95 | tc |= (ss % 10) << 16; |
| 96 | tc |= (mm / 10) << 12; |
| 97 | tc |= (mm % 10) << 8; |
| 98 | tc |= (hh / 10) << 4; |
| 99 | tc |= (hh % 10); |
| 100 | |
| 101 | return tc; |
| 102 | } |
| 103 | |
| 104 | char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum_arg) |
| 105 | { |
no test coverage detected