Beispiel #1
0
 def test_set_standard(fd, input_or_output):
     original_std_id = v4l2.v4l2_std_id()
     try:
         ioctl(fd, v4l2.VIDIOC_G_STD, original_std_id)
     except IOError, e:
         assert e.errno == errno.EINVAL
         return
Beispiel #2
0
 def test_query_standard(fd, input_):
     std_id = v4l2.v4l2_std_id()
     try:
         ioctl(fd, v4l2.VIDIOC_QUERYSTD, std_id)
     except IOError, e:
         # this ioctl might not be supported on this device
         assert e.errno == errno.EINVAL
         return
Beispiel #3
0
 def test_get_standard(fd, input_or_output):
     std_id = v4l2.v4l2_std_id()
     try:
         ioctl(fd, v4l2.VIDIOC_G_STD, std_id)
     except IOError, e:
         assert e.errno == errno.EINVAL
         # input/output may not support a standard
         return
Beispiel #4
0
    def test_set_standard(fd, input_or_output):
        original_std_id = v4l2.v4l2_std_id()
        try:
            ioctl(fd, v4l2.VIDIOC_G_STD, original_std_id)
        except IOError as e:
            assert e.errno == errno.EINVAL
            return

        for std in get_device_standards(fd):
            std_id = v4l2.v4l2_std_id(std.id)
            ioctl(fd, v4l2.VIDIOC_S_STD, std_id)

        bad_std_id = v4l2.v4l2_std_id(1 << 31)
        try:
            ioctl(fd, v4l2.VIDIOC_S_STD, bad_std_id)
        except IOError as e:
            assert e.errno == errno.EINVAL

        ioctl(fd, v4l2.VIDIOC_S_STD, original_std_id)
Beispiel #5
0
def test_VIDIOC_S_STD(fd):
    cap = v4l2.v4l2_capability()
    ioctl(fd, v4l2.VIDIOC_QUERYCAP, cap)

    def test_set_standard(fd, input_or_output):
        original_std_id = v4l2.v4l2_std_id()
        try:
            ioctl(fd, v4l2.VIDIOC_G_STD, original_std_id)
        except IOError, e:
            assert e.errno == errno.EINVAL
            return

        for std in get_device_standards(fd):
            std_id = v4l2.v4l2_std_id(std.id)
            ioctl(fd, v4l2.VIDIOC_S_STD, std_id)

        bad_std_id = v4l2.v4l2_std_id(1 << 31)
        try:
            ioctl(fd, v4l2.VIDIOC_S_STD, bad_std_id)
        except IOError, e:
            assert e.errno == errno.EINVAL