• Hans Verkuil's avatar
    [media] v4l2-ioctl.c: improve cropcap compatibility code · 95dd7b7e
    Hans Verkuil authored
    - Add a check for the case that both the cropcap and g_selection ops
      are NULL. This shouldn't happen, but I feel happier if the code
      guards against this.
    
    - If g_selection exists, then ignore ENOTTY and ENOIOCTLCMD error
      codes from cropcap. Just assume square pixelaspect ratio in that
      case. This situation can happen if the bridge driver's cropcap op
      calls the corresponding subdev's op. So the cropcap ioctl is set,
      but it might return ENOIOCTLCMD anyway. In the past this would
      just return an error which is wrong.
    
    - Call cropcap first and let g_selection overwrite the bounds and
      defrect. This safeguards against subdev cropcap implementations
      that set those rectangles as well. What g_selection returns has
      priority over what such cropcap implementations return.
    Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
    95dd7b7e
v4l2-ioctl.c 91.3 KB