unsigned int sizes[], struct device *alloc_devs[])
{
struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
- struct uvc_streaming *stream;
+ struct uvc_streaming *stream = uvc_queue_to_stream(queue, vq->type);
unsigned int size;
switch (vq->type) {
break;
default:
- stream = uvc_queue_to_stream(queue);
size = stream->ctrl.dwMaxVideoFrameSize;
break;
}
if (vb->type == V4L2_BUF_TYPE_VIDEO_OUTPUT &&
vb2_get_plane_payload(vb, 0) > vb2_plane_size(vb, 0)) {
- uvc_dbg(uvc_queue_to_stream(queue)->dev, CAPTURE,
+ uvc_dbg(uvc_queue_to_stream(queue, vb->type)->dev, CAPTURE,
"[E] Bytes used out of bounds\n");
return -EINVAL;
}
{
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
struct uvc_video_queue *queue = vb2_get_drv_priv(vb->vb2_queue);
- struct uvc_streaming *stream = uvc_queue_to_stream(queue);
+ struct uvc_streaming *stream = uvc_queue_to_stream(queue, vb->type);
struct uvc_buffer *buf = uvc_vbuf_to_buffer(vbuf);
if (vb->state == VB2_BUF_STATE_DONE)
static int uvc_start_streaming_video(struct vb2_queue *vq, unsigned int count)
{
struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
- struct uvc_streaming *stream = uvc_queue_to_stream(queue);
+ struct uvc_streaming *stream = uvc_queue_to_stream(queue, vq->type);
int ret;
lockdep_assert_irqs_enabled();
static void uvc_stop_streaming_video(struct vb2_queue *vq)
{
struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
- struct uvc_streaming *stream = uvc_queue_to_stream(queue);
+ struct uvc_streaming *stream = uvc_queue_to_stream(queue, vq->type);
lockdep_assert_irqs_enabled();
- uvc_video_stop_streaming(uvc_queue_to_stream(queue));
+ uvc_video_stop_streaming(stream);
uvc_pm_put(stream->dev);
}
static inline struct uvc_streaming *
-uvc_queue_to_stream(struct uvc_video_queue *queue)
+uvc_queue_to_stream(struct uvc_video_queue *queue, unsigned int type)
{
+ if (type == V4L2_BUF_TYPE_META_CAPTURE)
+ return container_of(queue, struct uvc_streaming, meta.queue);
return container_of(queue, struct uvc_streaming, queue);
}