Skip to contentSkip to conversation

v4l2loopback: new package

PATCH Superseded Alexandre Esse 2 participants 2 messages Jun 19, 2017 – Jun 20, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v4l2loopback: new package

This package provides a kernel module and utilities in order to use v4l2loopback virtual devices.
This module allows you to create "virtual video devices" normal (v4l2) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application.

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/v4l2loopback/Config.in         | 23 +++++++++++++++++++++++
 package/v4l2loopback/v4l2loopback.hash |  2 ++
 package/v4l2loopback/v4l2loopback.mk   | 19 +++++++++++++++++++
 5 files changed, 46 insertions(+)
 create mode 100644 package/v4l2loopback/Config.in
 create mode 100644 package/v4l2loopback/v4l2loopback.hash
 create mode 100644 package/v4l2loopback/v4l2loopback.mk
DEVELOPERS +1 -0
index afc4596..c9f3559 100644
@@ -66,6 +66,7 @@ F:	package/tz/
 
 N:	Alexandre Esse <[email protected]>
 F:	package/kvazaar/
+F:	package/v4l2loopback/
 
 N:	Alistair Francis <[email protected]>
 F:	package/xen/
package/Config.in +1 -0
index 9df0b42..db6c197 100644
@@ -49,6 +49,7 @@ menu "Audio and video applications"
 	source "package/udpxy/Config.in"
 	source "package/upmpdcli/Config.in"
 	source "package/v4l2grab/Config.in"
+	source "package/v4l2loopback/Config.in"
 	source "package/vlc/Config.in"
 	source "package/vorbis-tools/Config.in"
 	source "package/wavpack/Config.in"
package/v4l2loopback/Config.in new file +23 -0
new file mode 100644
index 0000000..157bd20
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_V4L2LOOPBACK
+	bool "v4l2loopback"
+	help
+	  This module allows you to create "virtual video devices".
+	  Normal (v4l2) applications will read these devices as if they
+	  were ordinary video devices, but the video will not be read
+	  from e.g. a capture card but instead it is generated by
+	  another application.
+
+if BR2_PACKAGE_V4L2LOOPBACK
+
+config BR2_PACKAGE_V4L2LOOPBACK_UTILS
+	bool "v4l2loopback-utils"
+	  select BR2_PACKAGE_BASH #runtine dependency
+	  select BR2_PACKAGE_SUDO #runtime dependency
+	help
+	  This package contains applications to interact with
+	  v4l2-loopback devices ("virtual video devices").
+	  Currently there is only a single command line utility:
+	  v4l2loopback-ctl: tool to set framerate, format and timeout
+	  image.
+
+endif
package/v4l2loopback/v4l2loopback.hash new file +2 -0
new file mode 100644
index 0000000..2b69fd7
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 9bb1e8d544019bead20813877415ae974fbc22f87c69772984a4abac433f36dd  v4l2loopback-v0.10.0.tar.gz
package/v4l2loopback/v4l2loopback.mk new file +19 -0
new file mode 100644
index 0000000..2dec9c4
@@ -0,0 +1,19 @@
+################################################################################
+#
+# v4l2loopback
+#
+################################################################################
+
+V4L2LOOPBACK_VERSION = v0.10.0
+V4L2LOOPBACK_SITE = $(call github,umlaeute,v4l2loopback,$(V4L2LOOPBACK_VERSION))
+V4L2LOOPBACK_LICENSE = GPL-2.0
+V4L2LOOPBACK_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_V4L2LOOPBACK_UTILS),y)
+define V4L2LOOPBACK_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/utils/v4l2loopback-ctl $(TARGET_DIR)/usr/bin/v4l2loopback-ctl
+endef
+endif
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 v4l2loopback: new package

Alexandre, All,

On 2017-06-19 22:51 +0200, Alexandre Esse spake thusly:

Quoted 6 lines

This package provides a kernel module and utilities in order to use v4l2loopback virtual devices.
This module allows you to create "virtual video devices" normal (v4l2) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application.

Thank you for this contribution, it is very much interesting! :-)

See some comments below...

Quoted 42 lines
---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/v4l2loopback/Config.in         | 23 +++++++++++++++++++++++
 package/v4l2loopback/v4l2loopback.hash |  2 ++
 package/v4l2loopback/v4l2loopback.mk   | 19 +++++++++++++++++++
 5 files changed, 46 insertions(+)
 create mode 100644 package/v4l2loopback/Config.in
 create mode 100644 package/v4l2loopback/v4l2loopback.hash
 create mode 100644 package/v4l2loopback/v4l2loopback.mk
DEVELOPERS +1 -0
index afc4596..c9f3559 100644
@@ -66,6 +66,7 @@ F:	package/tz/
 
 N:	Alexandre Esse <[email protected]>
 F:	package/kvazaar/
+F:	package/v4l2loopback/
 
 N:	Alistair Francis <[email protected]>
 F:	package/xen/
package/Config.in +1 -0
index 9df0b42..db6c197 100644
@@ -49,6 +49,7 @@ menu "Audio and video applications"
 	source "package/udpxy/Config.in"
 	source "package/upmpdcli/Config.in"
 	source "package/v4l2grab/Config.in"
+	source "package/v4l2loopback/Config.in"
 	source "package/vlc/Config.in"
 	source "package/vorbis-tools/Config.in"
 	source "package/wavpack/Config.in"
package/v4l2loopback/Config.in new file +0 -0
new file mode 100644
index 0000000..157bd20

package/v4l2loopback/Config.in line 8

Quoted 8 lines
package/v4l2loopback/Config.in new file +8 -0
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_V4L2LOOPBACK
+	bool "v4l2loopback"
+	help
+	  This module allows you to create "virtual video devices".
+	  Normal (v4l2) applications will read these devices as if they
+	  were ordinary video devices, but the video will not be read
+	  from e.g. a capture card but instead it is generated by
+	  another application.

So if I understand correctly, this is a kernel module, so you need to depend on a kernel being built:

depends on BR2_LINUX_KERNEL

package/v4l2loopback/Config.in line 15

Quoted 6 lines
package/v4l2loopback/Config.in new file +6 -0
+if BR2_PACKAGE_V4L2LOOPBACK
+
+config BR2_PACKAGE_V4L2LOOPBACK_UTILS
+	bool "v4l2loopback-utils"
+	  select BR2_PACKAGE_BASH #runtine dependency
+	  select BR2_PACKAGE_SUDO #runtime dependency

Spurious two-space after tab.

Besides, you can not select bash like that, because bash has dependencies, so you need to propagate those dependencies:

depends on BR2_USE_MMU # bash
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash
select BR2_PACKAGE_BASH

See e.g. package/tovid/Config.in.

So, because it has requirements, you need to add a comment stating why it may not be available:

config BR2_PACKAGE_V4L2LOOPBACK
bool "v4l2loopback"
depends on BR2_LINUX_KERNEL
help
blablabla

if BR2_PACKAGE_V4L2LOOPBACK

config BR2_PACKAGE_V4L2LOOPBACK_UTILS
bool "v4l2loopback-utils"
depends on BR2_USE_MMU # bash
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash select BR2_PACKAGE_BASH

endif

comment "v4l2loopback needs a Linux kernel to be built"
depends on !BR2_LINUX_KERNEL

Quoted 22 lines
package/v4l2loopback/Config.in new file +8 -0
+	help
+	  This package contains applications to interact with
+	  v4l2-loopback devices ("virtual video devices").
+	  Currently there is only a single command line utility:
+	  v4l2loopback-ctl: tool to set framerate, format and timeout
+	  image.
+
+endif
package/v4l2loopback/v4l2loopback.hash new file +2 -0
new file mode 100644
index 0000000..2b69fd7
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 9bb1e8d544019bead20813877415ae974fbc22f87c69772984a4abac433f36dd  v4l2loopback-v0.10.0.tar.gz
package/v4l2loopback/v4l2loopback.mk new file +0 -0
new file mode 100644
index 0000000..2dec9c4

package/v4l2loopback/v4l2loopback.mk line 9

Quoted 9 lines
package/v4l2loopback/v4l2loopback.mk new file +9 -0
@@ -0,0 +1,19 @@
+################################################################################
+#
+# v4l2loopback
+#
+################################################################################
+
+V4L2LOOPBACK_VERSION = v0.10.0
+V4L2LOOPBACK_SITE = $(call github,umlaeute,v4l2loopback,$(V4L2LOOPBACK_VERSION))
+V4L2LOOPBACK_LICENSE = GPL-2.0

It is "version 2 of the License, or (at your option) any later version",
so: GPL-2.0+

Regards,
Yann E. MORIN.

Quoted 17 lines
package/v4l2loopback/v4l2loopback.mk new file +10 -0
+V4L2LOOPBACK_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_V4L2LOOPBACK_UTILS),y)
+define V4L2LOOPBACK_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/utils/v4l2loopback-ctl $(TARGET_DIR)/usr/bin/v4l2loopback-ctl
+endef
+endif
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 6 lines
2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'