Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIDIOC_ENUMINPUT returns status OK when no input signal is present #511

Closed
pinefan opened this issue Nov 12, 2022 · 0 comments
Closed

VIDIOC_ENUMINPUT returns status OK when no input signal is present #511

pinefan opened this issue Nov 12, 2022 · 0 comments
Assignees

Comments

@pinefan
Copy link

pinefan commented Nov 12, 2022

Hello umlaeute

Thank you for your excellent work.

Would you please consider setting the input status in vidioc_enum_input() to correctly report the absence of an input signal? Below is a suggested implementation:

*** 1426,1431 ****                                                                  
--- 1426,1433 ----                                                                  
  static int vidioc_enum_input(struct file *file, void *fh,                         
                             struct v4l2_input *inp)                                
  {                                                                                 
+       struct v4l2_loopback_device *dev = v4l2loopback_getdevice(file);
+ 
        __u32 index = inp->index;
        MARK();
  
***************
*** 1441,1446 ****
--- 1443,1451 ----
        inp->audioset = 0;
        inp->tuner = 0;
        inp->status = 0;
+       if (!dev->ready_for_capture) {
+               inp->status |= V4L2_IN_ST_NO_SIGNAL;
+       }
  
  #ifdef V4L2LOOPBACK_WITH_STD
        inp->std = V4L2_STD_ALL;

Environment:

  • v4l2loopback version: 0.12.7 (main)
  • kernel version: 5.15.0-52-generic
  • Distribution (+version): Ubuntu 22.04.1 LTS

Steps to reproduce:

  • sudo modprobe v4l2loopback exclusive_caps=0
  • v4l2-ctl -d /dev/video1 --list-input

Observed Results:
ioctl: VIDIOC_ENUMINPUT
Input : 0
Name : loopback
Type : 0x00000002 (Camera)
Audioset : 0x00000000
Tuner : 0x00000000
Standard : 0x0000000000000000 ()
Status : 0x00000000 (ok)
Capabilities: 0x00000000 (not defined)

Expected Results:
ioctl: VIDIOC_ENUMINPUT
Input : 0
Name : loopback
Type : 0x00000002 (Camera)
Audioset : 0x00000000
Tuner : 0x00000000
Standard : 0x0000000000000000 ()
Status : 0x00000002 (no signal)
Capabilities: 0x00000000 (not defined)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants