Lines Matching +full:video +full:- +full:mem

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * uvc_isight.c -- USB Video Class driver - iSight support
5 * Copyright (C) 2006-2007
6 * Ivan N. Zlatev <contact@i-nz.net>
7 * Copyright (C) 2008-2009
18 * Built-in iSight webcams implements most of UVC 1.0 except a
25 * ------------------------------------------------------------------
27 * 0x01 1 Flags (UVC-compliant)
32 * The header can be prefixed by an optional, unknown-purpose byte.
46 u8 *mem; in isight_decode() local
54 uvc_dbg(stream->dev, FRAME, "iSight header found\n"); in isight_decode()
59 if (buf->state != UVC_BUF_STATE_ACTIVE) { in isight_decode()
61 uvc_dbg(stream->dev, FRAME, in isight_decode()
66 buf->state = UVC_BUF_STATE_ACTIVE; in isight_decode()
75 if (is_header && buf->bytesused != 0) { in isight_decode()
76 buf->state = UVC_BUF_STATE_DONE; in isight_decode()
77 return -EAGAIN; in isight_decode()
81 * Copy the video data to the buffer. Skip header packets, as they in isight_decode()
85 maxlen = buf->length - buf->bytesused; in isight_decode()
86 mem = buf->mem + buf->bytesused; in isight_decode()
88 memcpy(mem, data, nbytes); in isight_decode()
89 buf->bytesused += nbytes; in isight_decode()
91 if (len > maxlen || buf->bytesused == buf->length) { in isight_decode()
92 uvc_dbg(stream->dev, FRAME, in isight_decode()
94 buf->state = UVC_BUF_STATE_DONE; in isight_decode()
104 struct urb *urb = uvc_urb->urb; in uvc_video_decode_isight()
105 struct uvc_streaming *stream = uvc_urb->stream; in uvc_video_decode_isight()
108 for (i = 0; i < urb->number_of_packets; ++i) { in uvc_video_decode_isight()
109 if (urb->iso_frame_desc[i].status < 0) { in uvc_video_decode_isight()
110 uvc_dbg(stream->dev, FRAME, in uvc_video_decode_isight()
112 urb->iso_frame_desc[i].status); in uvc_video_decode_isight()
126 ret = isight_decode(&stream->queue, buf, in uvc_video_decode_isight()
127 urb->transfer_buffer + in uvc_video_decode_isight()
128 urb->iso_frame_desc[i].offset, in uvc_video_decode_isight()
129 urb->iso_frame_desc[i].actual_length); in uvc_video_decode_isight()
134 if (buf->state == UVC_BUF_STATE_DONE || in uvc_video_decode_isight()
135 buf->state == UVC_BUF_STATE_ERROR) in uvc_video_decode_isight()
136 buf = uvc_queue_next_buffer(&stream->queue, in uvc_video_decode_isight()
138 } while (ret == -EAGAIN); in uvc_video_decode_isight()