def test_capture_raw(camera, mode, raw_format, use_video_port, burst): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') stream = io.BytesIO() camera.capture(stream, format=raw_format, use_video_port=use_video_port) verify_raw(stream, raw_format, resolution)
def test_capture_sequence_raw(camera, mode, raw_format, use_video_port): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') if resolution == (2592, 1944) and raw_format in ('rgb', 'bgr'): pytest.xfail('Camera times out with this combination') streams = [io.BytesIO() for i in range(3)] camera.capture_sequence(streams, format=raw_format, use_video_port=use_video_port) for stream in streams: verify_raw(stream, raw_format, resolution)
def test_capture_raw(camera, mode, raw_format, use_video_port): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') if resolution == (2592, 1944) and raw_format in ('rgb', 'bgr'): pytest.xfail('Camera times out with this combination') stream = io.BytesIO() camera.capture(stream, format=raw_format, use_video_port=use_video_port) verify_raw(stream, raw_format, resolution)
def test_capture_raw(camera, mode, raw_format, use_video_port): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera crashes with this combination') if resolution == (2592, 1944) and raw_format in ('rgb', 'bgr'): pytest.xfail('Camera times out with this combination') if resolution == (100, 100) and raw_format != 'yuv': pytest.xfail('Camera fails to set resizer output port format') stream = io.BytesIO() camera.capture(stream, format=raw_format, use_video_port=use_video_port) verify_raw(stream, raw_format, resolution)
def test_capture_continuous_raw(camera, mode, raw_format, use_video_port): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') if resolution == (2592, 1944) and raw_format in ('rgb', 'bgr'): pytest.xfail('Camera times out with this combination') for i, stream in enumerate(camera.capture_continuous( io.BytesIO(), format=raw_format, use_video_port=use_video_port)): if i == 3: break verify_raw(stream, raw_format, resolution) stream.seek(0) stream.truncate()
def test_capture_sequence_raw(camera, mode, raw_format, use_video_port, burst): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') streams = [io.BytesIO() for i in range(3)] try: camera.capture_sequence( streams, format=raw_format, use_video_port=use_video_port, burst=burst) for stream in streams: verify_raw(stream, raw_format, resolution) except picamera.PiCameraRuntimeError: assert use_video_port and burst
def test_capture_sequence_raw(camera, mode, raw_format, use_video_port): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera crashes with this combination') if resolution == (2592, 1944) and raw_format in ('rgb', 'bgr'): pytest.xfail('Camera times out with this combination') if resolution == (2592, 1944) and raw_format == 'yuv' and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') if resolution == (100, 100) and raw_format != 'yuv': pytest.xfail('Camera fails to set resizer output port format') streams = [io.BytesIO() for i in range(3)] camera.capture_sequence(streams, format=raw_format, use_video_port=use_video_port) for stream in streams: verify_raw(stream, raw_format, resolution)
def test_capture_continuous_raw(camera, mode, raw_format, use_video_port): resolution, framerate = mode if resolution == (2592, 1944) and raw_format in ('rgba', 'bgra') and not use_video_port: pytest.xfail('Camera runs out of memory with this combination') if resolution == (2592, 1944) and raw_format in ('rgb', 'bgr'): pytest.xfail('Camera times out with this combination') for i, stream in enumerate( camera.capture_continuous(io.BytesIO(), format=raw_format, use_video_port=use_video_port)): if i == 3: break verify_raw(stream, raw_format, resolution) stream.seek(0) stream.truncate()