aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffmpeg/Time.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-19 09:49:29 +0100
committerMax Kellermann <max@duempel.org>2014-12-19 09:49:29 +0100
commitd0c481e44e031e9668f06fdb2efcc84621704be8 (patch)
treeea95bdf9b1e0524e955d8cab447754e5c8f3f615 /src/lib/ffmpeg/Time.hxx
parent67e2d9f9e1b8718406b3081751a57f3575823e0e (diff)
downloadmpd-d0c481e44e031e9668f06fdb2efcc84621704be8.tar.gz
mpd-d0c481e44e031e9668f06fdb2efcc84621704be8.tar.xz
mpd-d0c481e44e031e9668f06fdb2efcc84621704be8.zip
lib/ffmpeg/Time: add API documentation
Diffstat (limited to 'src/lib/ffmpeg/Time.hxx')
-rw-r--r--src/lib/ffmpeg/Time.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ffmpeg/Time.hxx b/src/lib/ffmpeg/Time.hxx
index fb845d7d9..0e6ba2e84 100644
--- a/src/lib/ffmpeg/Time.hxx
+++ b/src/lib/ffmpeg/Time.hxx
@@ -36,6 +36,9 @@ extern "C" {
#undef SampleFormat
#endif
+/**
+ * Convert a FFmpeg time stamp to a floating point value (in seconds).
+ */
gcc_const
static inline double
FfmpegTimeToDouble(int64_t t, const AVRational time_base)
@@ -46,6 +49,9 @@ FfmpegTimeToDouble(int64_t t, const AVRational time_base)
/ (double)1024;
}
+/**
+ * Convert a std::ratio to a #AVRational.
+ */
template<typename Ratio>
static inline constexpr AVRational
RatioToAVRational()
@@ -53,6 +59,9 @@ RatioToAVRational()
return { Ratio::num, Ratio::den };
}
+/**
+ * Convert a #SongTime to a FFmpeg time stamp with the given base.
+ */
gcc_const
static inline int64_t
ToFfmpegTime(SongTime t, const AVRational time_base)