gstreamer examples hello-world
something gets opened
This commit is contained in:
59
gstreamer/tutorial-hello-world.lisp
Normal file
59
gstreamer/tutorial-hello-world.lisp
Normal file
@@ -0,0 +1,59 @@
|
||||
(load (sb-ext:posix-getenv "ASDF"))
|
||||
(asdf:load-system 'cl-cffi-gtk)
|
||||
(asdf:load-system 'cl-gobject-introspection)
|
||||
|
||||
(defpackage :tutorial-hello-world
|
||||
(:use :cl))
|
||||
|
||||
(in-package :tutorial-hello-world)
|
||||
|
||||
(gir:require-namespace "GLib")
|
||||
(defvar *gtk* (gir:require-namespace "Gtk" "3.0"))
|
||||
(gir:nget *gtk* "WindowType" :toplevel) ; get enum value
|
||||
|
||||
;; name wildly from
|
||||
;; https://stackoverflow.com/questions/36296165/python-bindings-for-gstreamer-how-to-import-typelib
|
||||
(defvar *gstreamer* (gir:require-namespace "Gst"))
|
||||
|
||||
;; overall capacities of this Glib bindings
|
||||
;; https://github.com/andy128k/cl-gobject-introspection
|
||||
|
||||
;; back to hello-world
|
||||
;; how'd i figure out what are the names to call, sad
|
||||
|
||||
(gir:nget *gstreamer* 'init )
|
||||
(gir:nget *gstreamer* 'parse-launch)
|
||||
(gir:nget *gstreamer* "State" :playing)
|
||||
(gir:nget *gstreamer* "Element" 'set-state)
|
||||
(gir:nget *gstreamer* "Element")
|
||||
|
||||
(progn
|
||||
(gir:invoke (*gstreamer* 'init) '())
|
||||
(let ((pipeline (gir:invoke (*gstreamer* 'parse-launch)
|
||||
"playbin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm"
|
||||
)))
|
||||
(gir:invoke (pipeline 'set-state)
|
||||
(gir:nget *gstreamer* "State" :playing))))
|
||||
|
||||
(defun tutorial-main ()
|
||||
(gir:invoke (*gstreamer* 'init) '())
|
||||
(let ((pipeline (gir:invoke (*gstreamer* 'parse-launch)
|
||||
"videotestsrc ! videoconvert ! autovideosink"
|
||||
;"playbin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm"
|
||||
)))
|
||||
(gir:invoke (pipeline 'set-state)
|
||||
(gir:nget *gstreamer* "State" :playing))
|
||||
;; (let* ((bus (gir:invoke (pipeline 'get-bus)))
|
||||
;; (msg (gir:invoke (bus 'timed-pop-filtered)
|
||||
;; (gir:nget *gstreamer* :clock-time-none)
|
||||
;; (list
|
||||
;; (gir:nget *gstreamer* "MessageType" :error)
|
||||
;; (gir:nget *gstreamer* "MessageType" :eos))))))
|
||||
(gir:invoke (pipeline 'set-state)
|
||||
(gir:nget *gstreamer* "State" :paused))))
|
||||
;; call
|
||||
|
||||
;; so, it's only uri stuff didn't work
|
||||
;; videotestsc worked
|
||||
;; and error i got was from trying to set :null ? but it should be correct enum
|
||||
;; oh well, ok
|
||||
Reference in New Issue
Block a user