// SPDX-License-Identifier: GPL-2.0 /* * A virtual stateless decoder device for stateless uAPI development purposes. * * This tool's objective is to help the development and testing of userspace * applications that use the V4L2 stateless API to decode media. * * A userspace implementation can use visl to run a decoding loop even when no * hardware is available or when the kernel uAPI for the codec has not been * upstreamed yet. This can reveal bugs at an early stage. * * This driver can also trace the contents of the V4L2 controls submitted to it. * It can also dump the contents of the vb2 buffers through a debugfs * interface. This is in many ways similar to the tracing infrastructure * available for other popular encode/decode APIs out there and can help develop * a userspace application by using another (working) one as a reference. * * Note that no actual decoding of video frames is performed by visl. The V4L2 * test pattern generator is used to write various debug information to the * capture buffers instead. * * Copyright (C) 2022 Collabora, Ltd. * * Based on the vim2m driver, that is: * * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. * Pawel Osciak, <pawel@osciak.com> * Marek Szyprowski, <m.szyprowski@samsung.com> * * Based on the vicodec driver, that is: * * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved. * * Based on the Cedrus VPU driver, that is: * * Copyright (C) 2016 Florent Revest <florent.revest@free-electrons.com> * Copyright (C) 2018 Paul Kocialkowski <paul.kocialkowski@bootlin.com> * Copyright (C) 2018 Bootlin
*/
unsignedint visl_transtime_ms;
module_param(visl_transtime_ms, uint, 0644);
MODULE_PARM_DESC(visl_transtime_ms, " simulated process time in milliseconds.");
/* * dprintk can be slow through serial. This lets one limit the tracing to a * particular number of frames
*/ int visl_dprintk_frame_start = -1;
module_param(visl_dprintk_frame_start, int, 0444);
MODULE_PARM_DESC(visl_dprintk_frame_start, " a frame number to start tracing with dprintk");
unsignedint visl_dprintk_nframes;
module_param(visl_dprintk_nframes, uint, 0444);
MODULE_PARM_DESC(visl_dprintk_nframes, " the number of frames to trace with dprintk");
bool keep_bitstream_buffers;
module_param(keep_bitstream_buffers, bool, 0444);
MODULE_PARM_DESC(keep_bitstream_buffers, " keep bitstream buffers in debugfs after streaming is stopped");
int bitstream_trace_frame_start = -1;
module_param(bitstream_trace_frame_start, int, 0444);
MODULE_PARM_DESC(bitstream_trace_frame_start, " a frame number to start dumping the bitstream through debugfs");
unsignedint bitstream_trace_nframes;
module_param(bitstream_trace_nframes, uint, 0444);
MODULE_PARM_DESC(bitstream_trace_nframes, " the number of frames to dump the bitstream through debugfs");
bool tpg_verbose;
module_param(tpg_verbose, bool, 0644);
MODULE_PARM_DESC(tpg_verbose, " add more verbose information on the generated output frames");
ret = video_register_device(vfd, VFL_TYPE_VIDEO, -1); if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); goto error_m2m;
}
v4l2_info(&dev->v4l2_dev, "Device registered as /dev/video%d\n", vfd->num);
ret = v4l2_m2m_register_media_controller(dev->m2m_dev, vfd,
MEDIA_ENT_F_PROC_VIDEO_DECODER); if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to init mem2mem media controller\n"); goto error_v4l2;
}
ret = media_device_register(&dev->mdev); if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to register mem2mem media device\n"); goto error_m2m_mc;
}
rc = visl_debugfs_init(dev); if (rc)
dprintk(dev, "visl_debugfs_init failed: %d\n" "Continuing without debugfs support\n", rc);
return 0;
error_m2m_mc:
v4l2_m2m_unregister_media_controller(dev->m2m_dev);
error_v4l2:
video_unregister_device(&dev->vfd); /* visl_device_release called by video_unregister_device to release various objects */ return ret;
error_m2m:
v4l2_m2m_release(dev->m2m_dev);
error_dev:
v4l2_device_unregister(&dev->v4l2_dev);
error_visl_dev:
kfree(dev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.