tools/testing/selftests/media_tests/video_device_test.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/media_tests/video_device_test.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/media_tests/video_device_test.c
Extension
.c
Size
3797 bytes
Lines
157
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (opt) {
		case 'd':
			strncpy(video_dev, optarg, sizeof(video_dev) - 1);
			video_dev[sizeof(video_dev)-1] = '\0';
			break;
		default:
			printf("Usage: %s [-d </dev/videoX>]\n", argv[0]);
			exit(-1);
		}
	}

	/* Open Video device and keep it open */
	fd = open(video_dev, O_RDWR);
	if (fd == -1) {
		printf("Video Device open errno %s\n", strerror(errno));
		exit(-1);
	}

	test_result = priority_test(fd);
	if (!test_result)
		printf("Priority test - PASSED\n");
	else
		printf("Priority test - FAILED\n");

	loop_test(fd);
}

Annotation

Implementation Notes