1 | use ffi::*; |
---|---|
2 | use Error; |
3 | |
4 | #[inline(always)] |
5 | pub fn current() -> i64 { |
6 | unsafe { av_gettime() } |
7 | } |
8 | |
9 | #[inline(always)] |
10 | pub fn relative() -> i64 { |
11 | unsafe { av_gettime_relative() } |
12 | } |
13 | |
14 | #[inline(always)] |
15 | pub fn is_monotonic() -> bool { |
16 | unsafe { av_gettime_relative_is_monotonic() != 0 } |
17 | } |
18 | |
19 | #[inline(always)] |
20 | pub fn sleep(usec: u32) -> Result<(), Error> { |
21 | unsafe { |
22 | match av_usleep(usec) { |
23 | 0 => Ok(()), |
24 | e: i32 => Err(Error::from(e)), |
25 | } |
26 | } |
27 | } |
28 |