mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-06 16:36:51 +08:00
28 lines
400 B
Go
28 lines
400 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/tinyzimmer/go-gst/gst"
|
|
)
|
|
|
|
func wait() {
|
|
gst.Init(nil)
|
|
|
|
clock := gst.ObtainSystemClock()
|
|
|
|
id := clock.NewSingleShotID(clock.GetTime() + gst.ClockTime(time.Minute.Nanoseconds()))
|
|
|
|
go func() {
|
|
res, _ := id.Wait()
|
|
if res != gst.ClockOK {
|
|
panic(res)
|
|
}
|
|
fmt.Println("I waited")
|
|
}()
|
|
|
|
fmt.Println("I am waiting")
|
|
time.Sleep(time.Minute)
|
|
}
|