before trying to create elements separately

This commit is contained in:
efim
2024-08-16 10:34:42 +00:00
parent 1e06e2e476
commit 32451a783f
2 changed files with 85 additions and 16 deletions

View File

@@ -61,23 +61,16 @@
;; videotestsc worked
;; and error i got was from trying to set :null ? but it should be correct enum
;; oh well, ok
(defun for-screencast ()
(defun for-screencast (stream-num)
(gir:invoke (*gstreamer* 'init) '())
(let ((pipeline (gir:invoke (*gstreamer* 'parse-launch)
"pipewiresrc path=46 ! 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))
))
(let* ((pipeline
(gir:invoke (*gstreamer* 'parse-launch)
(format nil "pipewiresrc path=~A ! videoconvert ! videobox name=move ! autovideosink" stream-num)
;"playbin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm"
))
(move-element (gir:invoke (pipeline 'get-by-name) "move")))
(gir:invoke (pipeline 'set-state) (gir:nget *gstreamer* "State" :playing))
(values pipeline move-element)))
;; well, pipewire is not part of what's added to env
;; not sure if i can add it
@@ -87,3 +80,17 @@
;; i can try to add pipewire, but then would it work with the screen share running on system server?
;; it did work. wowy. ok
;; cool. now i'm kind of at the point of python example :D
;; let's generalize, when stream is not passed, use the testsrc
(defun moving-cast (&optional stream-num)
(gir:invoke (*gstreamer* 'init) '())
(let* ((source (if stream-num
(format nil "pipewiresrc path=~A" stream-num)
"videotestsrc"))
(pipeline
(gir:invoke (*gstreamer* 'parse-launch)
(format nil "~A ! videoconvert ! videobox name=move ! autovideosink" source))))
; (format t "~A" (gir:nget pipeline 'get-state))
(gir:invoke (pipeline 'set-state) (gir:nget *gstreamer* "State" :playing))
pipeline))