Commit d0c481e4 authored by Max Kellermann's avatar Max Kellermann

lib/ffmpeg/Time: add API documentation

parent 67e2d9f9
...@@ -36,6 +36,9 @@ extern "C" { ...@@ -36,6 +36,9 @@ extern "C" {
#undef SampleFormat #undef SampleFormat
#endif #endif
/**
* Convert a FFmpeg time stamp to a floating point value (in seconds).
*/
gcc_const gcc_const
static inline double static inline double
FfmpegTimeToDouble(int64_t t, const AVRational time_base) FfmpegTimeToDouble(int64_t t, const AVRational time_base)
...@@ -46,6 +49,9 @@ FfmpegTimeToDouble(int64_t t, const AVRational time_base) ...@@ -46,6 +49,9 @@ FfmpegTimeToDouble(int64_t t, const AVRational time_base)
/ (double)1024; / (double)1024;
} }
/**
* Convert a std::ratio to a #AVRational.
*/
template<typename Ratio> template<typename Ratio>
static inline constexpr AVRational static inline constexpr AVRational
RatioToAVRational() RatioToAVRational()
...@@ -53,6 +59,9 @@ RatioToAVRational() ...@@ -53,6 +59,9 @@ RatioToAVRational()
return { Ratio::num, Ratio::den }; return { Ratio::num, Ratio::den };
} }
/**
* Convert a #SongTime to a FFmpeg time stamp with the given base.
*/
gcc_const gcc_const
static inline int64_t static inline int64_t
ToFfmpegTime(SongTime t, const AVRational time_base) ToFfmpegTime(SongTime t, const AVRational time_base)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment