-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
86 lines (72 loc) · 1.66 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
builddir = builddir
container_tag = gnome-latam-workshop
# Using $(shell pwd) because $(PWD) is failing inside docker :/
prefix = $(shell pwd)/prefix
.PHONY: all configure compile install test
define GST_LAUNCH_PIPELINE_VIDEOTESTSRC
gst-launch-1.0 \
videotestsrc \
pattern=ball \
! video/x-raw,format=I420,width=1280,height=720 \
! v4l2sink \
device=/dev/video6
endef
define GST_LAUNCH_PIPELINE_V4L2SRC
gst-launch-1.0 \
v4l2src \
device=/dev/video4 \
! 'image/jpeg' \
! jpegdec \
! videoconvert \
! cheesefilter \
! v4l2sink \
device=/dev/video6
endef
all: compile
test: install
GST_DEBUG=cheese_filter:5 \
GST_PLUGIN_PATH=$(prefix) \
XDG_DATA_HOME=$(shell pwd) \
cheese
install: configure
cd "$(builddir)" && meson install
compile: configure
cd "$(builddir)" && meson compile
configure: $(builddir)/build.ninja
$(builddir)/build.ninja:
rm -fr "$(builddir)"
meson setup \
--prefix "$(prefix)" \
"$(builddir)"
container_test:
container_install:
container_compile:
container_%: .container_built
./x11docker \
--share=$(PWD) \
--webcam \
$(container_tag) \
-- \
make -C "$(PWD)" $*
.container_built: Dockerfile
docker build ./ --tag "$(container_tag)" && touch "$@"
v4l2_start: .v4l2_pid
v4l2_stop:
kill $$(cat .v4l2_pid)
.v4l2_pid: v4l2_modprobe install
GST_PLUGIN_PATH=$(prefix) \
$(GST_LAUNCH_PIPELINE_V4L2SRC) > /dev/null \
& echo $$! > $@
v4l2_modprobe:
lsmod | grep v4l2loopback || \
sudo modprobe v4l2loopback \
devices=1 \
max_buffers=2 \
exclusive_caps=1 \
card_label="VirtualCam"
clean:
-rm -fr "$(builddir)"
-rm -f .container_built
-rm -fr "$(prefix)"
mrproper: clean
-docker image rm "$(container_tag)"