Lines Matching refs:buf

117     struct v4l2_buffer         buf;  in camera_source_init()  local
225 buf = (struct v4l2_buffer) {0}; in camera_source_init()
226 buf.type = type; in camera_source_init()
227 buf.memory = V4L2_MEMORY_MMAP; in camera_source_init()
228 buf.index = i; in camera_source_init()
231 buf.m.planes = planes; in camera_source_init()
232 buf.length = FMT_NUM_PLANES; in camera_source_init()
235 if (-1 == camera_source_ioctl(ctx->fd, VIDIOC_QUERYBUF, &buf)) { in camera_source_init()
240 if (V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE == buf.type) { in camera_source_init()
242 buf_len = buf.m.planes[0].length; in camera_source_init()
245 buf.m.planes[0].length, in camera_source_init()
248 ctx->fd, buf.m.planes[0].m.mem_offset); in camera_source_init()
250 buf_len = buf.length; in camera_source_init()
253 buf.length, in camera_source_init()
256 ctx->fd, buf.m.offset); in camera_source_init()
289 buf = (struct v4l2_buffer) {0}; in camera_source_init()
290 buf.type = type; in camera_source_init()
291 buf.memory = V4L2_MEMORY_MMAP; in camera_source_init()
292 buf.index = i; in camera_source_init()
295 buf.m.planes = planes; in camera_source_init()
296 buf.length = FMT_NUM_PLANES; in camera_source_init()
299 if (-1 == camera_source_ioctl(ctx->fd, VIDIOC_QBUF, &buf)) { in camera_source_init()
329 struct v4l2_buffer buf; in camera_source_deinit() local
346 buf = (struct v4l2_buffer) {0}; in camera_source_deinit()
347 buf.type = type; in camera_source_deinit()
348 buf.memory = V4L2_MEMORY_MMAP; in camera_source_deinit()
349 buf.index = i; in camera_source_deinit()
350 camera_source_ioctl(ctx->fd, VIDIOC_QUERYBUF, &buf); in camera_source_deinit()
351 if (ctx->fbuf[buf.index].buffer) { in camera_source_deinit()
352 mpp_buffer_put(ctx->fbuf[buf.index].buffer); in camera_source_deinit()
354 munmap(ctx->fbuf[buf.index].start, ctx->fbuf[buf.index].length); in camera_source_deinit()
367 struct v4l2_buffer buf; in camera_source_get_frame() local
371 buf = (struct v4l2_buffer) {0}; in camera_source_get_frame()
372 buf.type = type; in camera_source_get_frame()
373 buf.memory = V4L2_MEMORY_MMAP; in camera_source_get_frame()
377 buf.m.planes = planes; in camera_source_get_frame()
378 buf.length = FMT_NUM_PLANES; in camera_source_get_frame()
381 if (-1 == camera_source_ioctl(ctx->fd, VIDIOC_DQBUF, &buf)) { in camera_source_get_frame()
386 if (buf.index > ctx->bufcnt) { in camera_source_get_frame()
392 buf.bytesused = buf.m.planes[0].bytesused; in camera_source_get_frame()
394 return buf.index; in camera_source_get_frame()
400 struct v4l2_buffer buf; in camera_source_put_frame() local
407 buf = (struct v4l2_buffer) {0}; in camera_source_put_frame()
408 buf.type = type; in camera_source_put_frame()
409 buf.memory = V4L2_MEMORY_MMAP; in camera_source_put_frame()
410 buf.index = idx; in camera_source_put_frame()
414 buf.m.planes = planes; in camera_source_put_frame()
415 buf.length = FMT_NUM_PLANES; in camera_source_put_frame()
419 if (-1 == camera_source_ioctl(ctx->fd, VIDIOC_QBUF, &buf)) { in camera_source_put_frame()
429 MppBuffer buf = NULL; in camera_frame_to_buf() local
432 return buf; in camera_frame_to_buf()
434 buf = ctx->fbuf[idx].buffer; in camera_frame_to_buf()
435 if (buf) in camera_frame_to_buf()
436 mpp_buffer_sync_end(buf); in camera_frame_to_buf()
438 return buf; in camera_frame_to_buf()