added gstreamer and gboxed types support
This commit is contained in:
parent
f3a8dcfdbe
commit
c2b13b0b90
9 changed files with 350 additions and 3220 deletions
20
examples/gtk3/gstBasicTutorial1.nim
Normal file
20
examples/gtk3/gstBasicTutorial1.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c
|
||||
# nim c gstBasicTutorial1.nim
|
||||
import gintro/gst
|
||||
|
||||
proc main =
|
||||
var pipeline: gst.Element
|
||||
var bus: gst.Bus
|
||||
var msg: gst.Message
|
||||
## Initialize GStreamer
|
||||
gst.init()
|
||||
## Build the pipeline
|
||||
pipeline = gst.parseLaunch("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm")
|
||||
## Start playing
|
||||
discard gst.setState(pipeline, gst.State.playing)
|
||||
## Wait until error or EOS
|
||||
bus = gst.getBus(pipeline)
|
||||
msg = gst.timedPopFiltered(bus, gst.Clock_Time_None, {gst.MessageFlag.error, gst.MessageFlag.eos})
|
||||
discard gst.setState(pipeline, gst.State.null) # is this necessary?
|
||||
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue