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 #define AV_TIMECODE_OPTION(ctx, string_field, flags) \
00036 "timecode", "set timecode value following hh:mm:ss[:;.]ff format, " \
00037 "use ';' or '.' before frame number for drop frame", \
00038 offsetof(ctx, string_field), \
00039 AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, flags
00040
00041 enum AVTimecodeFlag {
00042 AV_TIMECODE_FLAG_DROPFRAME = 1<<0,
00043 AV_TIMECODE_FLAG_24HOURSMAX = 1<<1,
00044 AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2,
00045 };
00046
00047 typedef struct {
00048 int start;
00049 uint32_t flags;
00050 AVRational rate;
00051 unsigned fps;
00052 } AVTimecode;
00053
00061 int av_timecode_adjust_ntsc_framenum(int framenum);
00062
00076 uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum);
00077
00090 char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum);
00091
00101 char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df);
00102
00110 char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit);
00111
00124 int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx);
00125
00136 int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx);
00137
00138 #endif