mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-09-26 20:01:22 +08:00
32 lines
841 B
Go
32 lines
841 B
Go
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
// Use of this source code is governed by a MIT
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package ffmpeg
|
|
|
|
/*
|
|
#include <libavutil/time.h>
|
|
*/
|
|
import "C"
|
|
|
|
// AvGettime gets the current time in microseconds.
|
|
func AvGettime() int64 {
|
|
return (int64)(C.av_gettime())
|
|
}
|
|
|
|
// AvGettimeRelative gets the current time in microseconds since some unspecified starting point.
|
|
func AvGettimeRelative() int64 {
|
|
return (int64)(C.av_gettime_relative())
|
|
}
|
|
|
|
// AvGettimeRelativeIsMonotonic indicates with a boolean result if the AvGettimeRelative() time source
|
|
// is monotonic.
|
|
func AvGettimeRelativeIsMonotonic() int32 {
|
|
return (int32)(C.av_gettime_relative_is_monotonic())
|
|
}
|
|
|
|
// AvUsleep sleeps for a period of time.
|
|
func AvUsleep(usec uint32) int32 {
|
|
return (int32)(C.av_usleep((C.uint)(usec)))
|
|
}
|