00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00027 #ifndef AVUTIL_TIMECODE_H
00028 #define AVUTIL_TIMECODE_H
00029
00030 #include <stdint.h>
00031 #include "rational.h"
00032
00033 #define AV_TIMECODE_STR_SIZE 16
00034
00035 enum AVTimecodeFlag {
00036 AV_TIMECODE_FLAG_DROPFRAME = 1<<0,
00037 AV_TIMECODE_FLAG_24HOURSMAX = 1<<1,
00038 AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2,
00039 };
00040
00041 typedef struct {
00042 int start;
00043 uint32_t flags;
00044 AVRational rate;
00045 unsigned fps;
00046 } AVTimecode;
00047
00056 attribute_deprecated int av_timecode_adjust_ntsc_framenum(int framenum);
00057
00066 int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
00067
00081 uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum);
00082
00095 char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum);
00096
00106 char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df);
00107
00115 char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit);
00116
00129 int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx);
00130
00141 int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx);
00142
00148 int av_timecode_check_frame_rate(AVRational rate);
00149
00150 #endif