*参照元 [#s9674da0] #backlinks *説明 [#p4ea68e4] -パス: [[linux-4.4.1/drivers/media/usb/uvc/uvc_driver.c]] -FIXME: これは何? --説明 **引数 [#i0692913] -struct uvc_device *dev -- --[[linux-4.4.1/uvc_device]] -struct uvc_streaming *stream -- --[[linux-4.4.1/uvc_streaming]] **返り値 [#l861db66] -int -- **参考 [#i2d099e5] *実装 [#g5434178] static int uvc_register_video(struct uvc_device *dev, struct uvc_streaming *stream) { struct video_device *vdev = &stream->vdev; int ret; - --[[linux-4.4.1/video_device]] /* Initialize the video buffers queue. */ ret = uvc_queue_init(&stream->queue, stream->type, !uvc_no_drop_param); if (ret) return ret; - --[[linux-4.4.1/uvc_queue_init()]] /* Initialize the streaming interface with default streaming * parameters. */ ret = uvc_video_init(stream); if (ret < 0) { uvc_printk(KERN_ERR, "Failed to initialize the device " "(%d).\n", ret); return ret; } - --[[linux-4.4.1/uvc_video_init()]] uvc_debugfs_init_stream(stream); - --[[linux-4.4.1/uvc_debugfs_init_stream()]] /* Register the device with V4L. */ /* We already hold a reference to dev->udev. The video device will be * unregistered before the reference is released, so we don't need to * get another one. */ vdev->v4l2_dev = &dev->vdev; vdev->fops = &uvc_fops; vdev->ioctl_ops = &uvc_ioctl_ops; vdev->release = uvc_release; vdev->prio = &stream->chain->prio; if (stream->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) vdev->vfl_dir = VFL_DIR_TX; strlcpy(vdev->name, dev->name, sizeof vdev->name); - --[[linux-4.4.1/uvc_fops(global)]] --[[linux-4.4.1/uvc_ioctl_ops(global)]] --[[linux-4.4.1/uvc_release()]] --[[linux-4.4.1/strlcpy()]] /* Set the driver data before calling video_register_device, otherwise * uvc_v4l2_open might race us. */ video_set_drvdata(vdev, stream); - --[[linux-4.4.1/video_set_drvdata()]] ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); if (ret < 0) { uvc_printk(KERN_ERR, "Failed to register video device (%d).\n", ret); return ret; } - --[[linux-4.4.1/video_register_device()]] --[[linux-4.4.1/uvc_printk()]] if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) stream->chain->caps |= V4L2_CAP_VIDEO_CAPTURE; else stream->chain->caps |= V4L2_CAP_VIDEO_OUTPUT; atomic_inc(&dev->nstreams); - --[[linux-4.4.1/atomic_inc()]] return 0; } *コメント [#l3dfc099]