Source
x
int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int non_blocking);
/*
* SPDX-License-Identifier: GPL-2.0
*
* dvb-vb2.h - DVB driver helper framework for streaming I/O
*
* Copyright (C) 2015 Samsung Electronics
*
* Author: jh1009.sung@samsung.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*/
/**
* enum dvb_buf_type - types of Digital TV memory-mapped buffers
*
* @DVB_BUF_TYPE_CAPTURE: buffer is filled by the Kernel,
* with a received Digital TV stream
*/
enum dvb_buf_type {
DVB_BUF_TYPE_CAPTURE = 1,
};
/**
* enum dvb_vb2_states - states to control VB2 state machine
* @DVB_VB2_STATE_NONE:
* VB2 engine not initialized yet, init failed or VB2 was released.
* @DVB_VB2_STATE_INIT:
* VB2 engine initialized.
* @DVB_VB2_STATE_REQBUFS:
* Buffers were requested
* @DVB_VB2_STATE_STREAMON:
* VB2 is streaming. Callers should not check it directly. Instead,
* they should use dvb_vb2_is_streaming().
*
* Note:
*
* Callers should not touch at the state machine directly. This
* is handled inside dvb_vb2.c.
*/
enum dvb_vb2_states {
DVB_VB2_STATE_NONE = 0x0,
DVB_VB2_STATE_INIT = 0x1,
DVB_VB2_STATE_REQBUFS = 0x2,
DVB_VB2_STATE_STREAMON = 0x4,
};
/**
* struct dvb_buffer - video buffer information for v4l2.
*
* @vb: embedded struct &vb2_buffer.
* @list: list of &struct dvb_buffer.
*/
struct dvb_buffer {
struct vb2_buffer vb;
struct list_head list;
};
/**
* struct dvb_vb2_ctx - control struct for VB2 handler
* @vb_q: pointer to &struct vb2_queue with videobuf2 queue.
* @mutex: mutex to serialize vb2 operations. Used by
* vb2 core %wait_prepare and %wait_finish operations.
* @slock: spin lock used to protect buffer filling at dvb_vb2.c.
* @dvb_q: List of buffers that are not filled yet.
* @buf: Pointer to the buffer that are currently being filled.
* @offset: index to the next position at the @buf to be filled.
* @remain: How many bytes are left to be filled at @buf.
* @state: bitmask of buffer states as defined by &enum dvb_vb2_states.
* @buf_siz: size of each VB2 buffer.
* @buf_cnt: number of VB2 buffers.
* @nonblocking:
* If different than zero, device is operating on non-blocking
* mode.
* @flags: buffer flags as defined by &enum dmx_buffer_flags.
* Filled only at &DMX_DQBUF. &DMX_QBUF should zero this field.
* @count: monotonic counter for filled buffers. Helps to identify
* data stream loses. Filled only at &DMX_DQBUF. &DMX_QBUF should
* zero this field.