summaryrefslogtreecommitdiff
path: root/src/cam
AgeCommit message (Expand)Author
2019-05-23libcamera: camera: Return a pointer from generateConfiguration()Laurent Pinchart
2019-05-23libcamera: Refactor the camera configuration storage and APILaurent Pinchart
2019-05-23libcamera: Use stream roles directly instead of StreamUsageLaurent Pinchart
2019-05-23libcamera: camera: Rename configureStreams() and streamConfiguration()Laurent Pinchart
2019-04-30libcamera: Use the Size class through libcameraLaurent Pinchart
2019-04-26cam: options: Fix string concatenationLaurent Pinchart
2019-04-26cam: options: Don't initialise variable-length arraysLaurent Pinchart
2019-04-18Install the cam and qcam utilitiesLaurent Pinchart
2019-04-09cam: Allow cameras with more than one streamNiklas Söderlund
2019-04-09cam: Extend request completion handler to deal with multiple streamsNiklas Söderlund
2019-04-09cam: Add support to specify multiple stream configurations with rolesNiklas Söderlund
2019-04-09cam: Extend BufferWriter to include a stream name in file pathNiklas Söderlund
2019-04-09cam: Rename --format to --streamNiklas Söderlund
2019-04-09libcamera: Switch to CameraConfigurationNiklas Söderlund
2019-04-05libcamera: camera: Add support for stream usagesNiklas Söderlund
2019-04-04cam: Rework how streams configuration is preparedNiklas Söderlund
2019-03-27cam: Separate options valid() and empty()Laurent Pinchart
2019-03-27cam: options: Add support for repeatable optionsNiklas Söderlund
2019-03-27cam: options: Add an array data type to OptionValueNiklas Söderlund
2019-03-25cam: options: Create separate enum for OptionValue typesNiklas Söderlund
2019-03-01cam: Don't requeue requests when stopping streamLaurent Pinchart
2019-02-28libcamera: store stream pointers in sets instead of a vectorsNiklas Söderlund
2019-02-28cam: fix order camera is operated onNiklas Söderlund
2019-02-25cam: Improve when usage information is printedNiklas Söderlund
2019-02-25cam: fix printing of camera nameNiklas Söderlund
2019-02-25cam: improve error checking when capturingNiklas Söderlund
2019-02-25cam: free allocated buffers when done capturingNiklas Söderlund
2019-02-25cam: fix return type of configureStreams()Niklas Söderlund
2019-02-13cam: options: Fix coding style issue related to templatesLaurent Pinchart
2019-02-06cam: Add option to write raw frames to diskNiklas Söderlund
2019-02-06cam: Add BufferWriter helperNiklas Söderlund
2019-02-06cam: Add capture operationNiklas Söderlund
2019-02-01cam: options: Add explicit conversion methods to OptionValueLaurent Pinchart
2019-02-01cam: Add --format option to configure a streamNiklas Söderlund
2019-02-01cam: options: Add a key=value parserNiklas Söderlund
2019-02-01cam: options: Add option type handling to options parserLaurent Pinchart
2019-02-01cam: options: Store options in a list instead of a vectorLaurent Pinchart
2019-02-01cam: options: Return whether addOption() succeeds or notNiklas Söderlund
2019-02-01cam: options: Create a template class for optionsNiklas Söderlund
2019-02-01cam: options: Move struct OptionLaurent Pinchart
2019-02-01cam: options: Move enum OptionArgumentNiklas Söderlund
2019-01-27cam: options: Indent multi-line help message correctlyLaurent Pinchart
2019-01-25cam: options: optional arguments needs to be specified as --foo=barNiklas Söderlund
2019-01-25cam: Add event loopLaurent Pinchart
2019-01-22cam: options: Don't implement move semantics for OptionsParser::OptionsLaurent Pinchart
2019-01-22cam: Extract option parser to separate fileLaurent Pinchart
2019-01-22cam: add utility to control camerasNiklas Söderlund
an>) ret['driver'] = res[0].split()[2] return ret def test_v4l2_compliance(v4l2_compliance, v4l2_compat, device, base_driver): ret, output = run_with_stdout(v4l2_compliance, '-s', '-d', device, env={'LD_PRELOAD': v4l2_compat}) if ret < 0: output.append(f'Test for {device} terminated due to signal {signal.Signals(-ret).name}') return TestFail, output result = extract_result(output[-2]) if result['failed'] == 0: return TestPass, None # vimc will fail s_fmt because it only supports framesizes that are # multiples of 3 if base_driver == 'vimc' and result['failed'] == 1: failures = grep('fail', output) if re.search('S_FMT cannot handle an invalid format', failures[0]) is None: return TestFail, output return TestPass, None return TestFail, output def main(argv): parser = argparse.ArgumentParser() parser.add_argument('-a', '--all', action='store_true', help='Test all available cameras') parser.add_argument('v4l2_compat', type=str, help='Path to v4l2-compat.so') args = parser.parse_args(argv[1:]) v4l2_compat = args.v4l2_compat v4l2_compliance = shutil.which('v4l2-compliance') if v4l2_compliance is None: print('v4l2-compliance is not available') return TestSkip ret, out = run_with_stdout(v4l2_compliance, '--version') if ret != 0 or version.parse(out[0].split()[-1]) < MIN_V4L_UTILS_VERSION: print('v4l2-compliance version >= 1.21.0 required') return TestSkip v4l2_ctl = shutil.which('v4l2-ctl') if v4l2_ctl is None: print('v4l2-ctl is not available') return TestSkip ret, out = run_with_stdout(v4l2_ctl, '--version') if ret != 0 or version.parse(out[0].split()[-1]) < MIN_V4L_UTILS_VERSION: print('v4l2-ctl version >= 1.21.0 required') return TestSkip dev_nodes = glob.glob('/dev/video*') if len(dev_nodes) == 0: print('no video nodes available to test with') return TestSkip failed = [] drivers_tested = {} for device in dev_nodes: ret, out = run_with_stdout(v4l2_ctl, '-D', '-d', device, env={'LD_PRELOAD': v4l2_compat}) if ret < 0: failed.append(device) print(f'v4l2-ctl failed on {device} with v4l2-compat') continue driver = grep('Driver name', out)[0].split(':')[-1].strip() if driver != "libcamera": continue ret, out = run_with_stdout(v4l2_ctl, '-D', '-d', device) if ret < 0: failed.append(device) print(f'v4l2-ctl failed on {device} without v4l2-compat') continue driver = grep('Driver name', out)[0].split(':')[-1].strip() if driver not in supported_pipelines: continue if not args.all and driver in drivers_tested: continue print(f'Testing {device} with {driver} driver... ', end='') ret, msg = test_v4l2_compliance(v4l2_compliance, v4l2_compat, device, driver) if ret == TestFail: failed.append(device) print('failed') print('\n'.join(msg)) else: print('success') drivers_tested[driver] = True if len(failed) > 0: print(f'Failed {len(failed)} tests:') for device in failed: print(f'- {device}') return TestPass if not failed else TestFail if __name__ == '__main__': sys.exit(main(sys.argv))