24 #ifndef AVUTIL_TIMESTAMP_H 25 #define AVUTIL_TIMESTAMP_H 29 #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) 30 #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS 33 #define AV_TS_MAX_STRING_SIZE 32 43 static inline char *av_ts_make_string(
char *buf, int64_t ts)
45 if (ts ==
AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE,
"NOPTS");
46 else snprintf(buf, AV_TS_MAX_STRING_SIZE,
"%" PRId64, ts);
54 #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts) 65 static inline char *av_ts_make_time_string(
char *buf, int64_t ts,
AVRational *tb)
67 if (ts ==
AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE,
"NOPTS");
68 else snprintf(buf, AV_TS_MAX_STRING_SIZE,
"%.6g", av_q2d(*tb) * ts);
76 #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) Rational number (pair of numerator and denominator).
Definition: rational.h:58
common internal and external API header
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248