World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл timecode.h

См. исходные тексты.

Классы

struct  AVTimecode
 

Перечисления

enum  AVTimecodeFlag { AV_TIMECODE_FLAG_DROPFRAME = 1<<0, AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2 }
 

Функции

int av_timecode_adjust_ntsc_framenum2 (int framenum, int fps)
 
uint32_t av_timecode_get_smpte_from_framenum (const AVTimecode *tc, int framenum)
 
char * av_timecode_make_string (const AVTimecode *tc, char *buf, int framenum)
 
char * av_timecode_make_smpte_tc_string (char *buf, uint32_t tcsmpte, int prevent_df)
 
char * av_timecode_make_mpeg_tc_string (char *buf, uint32_t tc25bit)
 
int av_timecode_init (AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx)
 
int av_timecode_init_from_string (AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
 
int av_timecode_check_frame_rate (AVRational rate)
 

Подробное описание

Timecode helpers header

См. определение в файле timecode.h

Перечисления

◆ AVTimecodeFlag

Элементы перечислений
AV_TIMECODE_FLAG_DROPFRAME 

timecode is drop frame

AV_TIMECODE_FLAG_24HOURSMAX 

timecode wraps after 24 hours

AV_TIMECODE_FLAG_ALLOWNEGATIVE 

negative time values are allowed

См. определение в файле timecode.h строка 35

35  {
39 };

Функции

◆ av_timecode_adjust_ntsc_framenum2()

int av_timecode_adjust_ntsc_framenum2 ( int  framenum,
int  fps 
)

Adjust frame number for NTSC drop frame time code.

Аргументы
framenumframe number to adjust
fpsframe per second, 30 or 60
Возвращает
adjusted frame number
Предупреждения
adjustment is only valid in NTSC 29.97 and 59.94

◆ av_timecode_get_smpte_from_framenum()

uint32_t av_timecode_get_smpte_from_framenum ( const AVTimecode tc,
int  framenum 
)

Convert frame number to SMPTE 12M binary representation.

Аргументы
tctimecode data correctly initialized
framenumframe number
Возвращает
the SMPTE binary representation
Заметки
Frame number adjustment is automatically done in case of drop timecode, you do NOT have to call av_timecode_adjust_ntsc_framenum2().
The frame number is relative to tc->start.
Color frame (CF), binary group flags (BGF) and biphase mark polarity correction (PC) bits are set to zero.

◆ av_timecode_make_string()

char* av_timecode_make_string ( const AVTimecode tc,
char *  buf,
int  framenum 
)

Load timecode string in buf.

Аргументы
bufdestination buffer, must be at least AV_TIMECODE_STR_SIZE long
tctimecode data correctly initialized
framenumframe number
Возвращает
the buf parameter
Заметки
Timecode representation can be a negative timecode and have more than 24 hours, but will only be honored if the flags are correctly set.
The frame number is relative to tc->start.

◆ av_timecode_make_smpte_tc_string()

char* av_timecode_make_smpte_tc_string ( char *  buf,
uint32_t  tcsmpte,
int  prevent_df 
)

Get the timecode string from the SMPTE timecode format.

Аргументы
bufdestination buffer, must be at least AV_TIMECODE_STR_SIZE long
tcsmptethe 32-bit SMPTE timecode
prevent_dfprevent the use of a drop flag when it is known the DF bit is arbitrary
Возвращает
the buf parameter

◆ av_timecode_make_mpeg_tc_string()

char* av_timecode_make_mpeg_tc_string ( char *  buf,
uint32_t  tc25bit 
)

Get the timecode string from the 25-bit timecode format (MPEG GOP format).

Аргументы
bufdestination buffer, must be at least AV_TIMECODE_STR_SIZE long
tc25bitthe 25-bits timecode
Возвращает
the buf parameter

◆ av_timecode_init()

int av_timecode_init ( AVTimecode tc,
AVRational  rate,
int  flags,
int  frame_start,
void log_ctx 
)

Init a timecode struct with the passed parameters.

Аргументы
log_ctxa pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log)
tcpointer to an allocated AVTimecode
rateframe rate in rational form
flagsmiscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag)
frame_startthe first frame number
Возвращает
0 on success, AVERROR otherwise

◆ av_timecode_init_from_string()

int av_timecode_init_from_string ( AVTimecode tc,
AVRational  rate,
const char *  str,
void log_ctx 
)

Parse timecode representation (hh:mm:ss[:;.]ff).

Аргументы
log_ctxa pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log).
tcpointer to an allocated AVTimecode
rateframe rate in rational form
strtimecode string which will determine the frame start
Возвращает
0 on success, AVERROR otherwise

◆ av_timecode_check_frame_rate()

int av_timecode_check_frame_rate ( AVRational  rate)

Check if the timecode feature is available for the given frame rate

Возвращает
0 if supported, <0 otherwise
AV_TIMECODE_FLAG_24HOURSMAX
@ AV_TIMECODE_FLAG_24HOURSMAX
timecode wraps after 24 hours
Definition: timecode.h:37
AV_TIMECODE_FLAG_ALLOWNEGATIVE
@ AV_TIMECODE_FLAG_ALLOWNEGATIVE
negative time values are allowed
Definition: timecode.h:38
AV_TIMECODE_FLAG_DROPFRAME
@ AV_TIMECODE_FLAG_DROPFRAME
timecode is drop frame
Definition: timecode.h:36