60 lines
2.0 KiB
Common Lisp
60 lines
2.0 KiB
Common Lisp
(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
|