Skip to content

Commit a8afee3

Browse files
committed
Add VFL_DIR_M2M to v4l2-loopback-dc
This allows other programs (eg. ffmpeg) to use the v4l2_dc device
1 parent 9a8968a commit a8afee3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

v4l2loopback/v4l2loopback-dc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,14 @@ init_vdev (struct video_device *vdev)
21492149
V4L2_CAP_VIDEO_CAPTURE |
21502150
V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
21512151
#endif
2152+
2153+
/* since kernel-3.7, there is a new field 'vfl_dir' that has to be
2154+
* set to VFL_DIR_M2M for bidrectional devices.
2155+
* For DroidCam, this allows other programs like ffmpeg to write to
2156+
* the device. */
2157+
#ifdef VFL_DIR_M2M
2158+
vdev->vfl_dir = VFL_DIR_M2M;
2159+
#endif
21522160
#if DEBUG
21532161
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
21542162
vdev->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;

0 commit comments

Comments
 (0)