3.1.Digital TV Common functions¶
3.1.1.DVB devices¶
Those functions are responsible for handling the DVB device nodes.
- enumdvb_device_type¶
type of the Digital TV device
Constants
DVB_DEVICE_SECDigital TV standalone Common Interface (CI)
DVB_DEVICE_FRONTENDDigital TV frontend.
DVB_DEVICE_DEMUXDigital TV demux.
DVB_DEVICE_DVRDigital TV digital video record (DVR).
DVB_DEVICE_CADigital TV Conditional Access (CA).
DVB_DEVICE_NETDigital TV network.
DVB_DEVICE_VIDEODigital TV video decoder.Deprecated. Used only on av7110-av.
DVB_DEVICE_AUDIODigital TV audio decoder.Deprecated. Used only on av7110-av.
DVB_DEVICE_OSDDigital TV On Screen Display (OSD).Deprecated. Used only on av7110.
- structdvb_adapter¶
represents a Digital TV adapter using Linux DVB API
Definition:
struct dvb_adapter { int num; struct list_head list_head; struct list_head device_list; const char *name; u8 proposed_mac [6]; void* priv; struct device *device; struct module *module; int mfe_shared; struct dvb_device *mfe_dvbdev; struct mutex mfe_lock;#if defined(CONFIG_MEDIA_CONTROLLER_DVB); struct mutex mdev_lock; struct media_device *mdev; struct media_entity *conn; struct media_pad *conn_pads;#endif;};Members
numNumber of the adapter
list_headList with the DVB adapters
device_listList with the DVB devices
nameName of the adapter
proposed_macproposed MAC address for the adapter
privprivate data
devicepointer to
structdevicemodulepointer to
structmodulemfe_sharedindicates mutually exclusive frontends.1 = legacy exclusion behavior: blocking any open() call2 = enhanced exclusion behavior, emulating the standardbehavior of busy frontends: allowing read-only sharingand otherwise returning immediately with -EBUSY when anyof the frontends is already opened with write access.
mfe_dvbdevFrontend device in use, in the case of MFE
mfe_lockLock to prevent using the other frontends when MFE isused.
mdev_lockProtect access to the mdev pointer.
mdevpointer to
structmedia_device, used when the mediacontroller is used.connRF connector. Used only if the device has no separatetuner.
conn_padspointer to
structmedia_padassociated withconn;
- structdvb_device¶
represents a DVB device node
Definition:
struct dvb_device { struct list_head list_head; struct kref ref; const struct file_operations *fops; struct dvb_adapter *adapter; enum dvb_device_type type; int minor; u32 id; int readers; int writers; int users; wait_queue_head_t wait_queue; int (*kernel_ioctl)(struct file *file, unsigned int cmd, void *arg);#if defined(CONFIG_MEDIA_CONTROLLER_DVB); const char *name; struct media_intf_devnode *intf_devnode; unsigned tsout_num_entities; struct media_entity *entity, *tsout_entity; struct media_pad *pads, *tsout_pads;#endif; void *priv;};Members
list_headList head with all DVB devices
refreference count for this device
fopspointer to
structfile_operationsadapterpointer to the adapter that holds this device node
typetype of the device, as defined by
enumdvb_device_type.minordevnode minor number. Major number is always DVB_MAJOR.
iddevice ID number, inside the adapter
readersInitialized by the caller. Each call to open() in Read Only modedecreases this counter by one.
writersInitialized by the caller. Each call to open() in Read/Writemode decreases this counter by one.
usersInitialized by the caller. Each call to open() in any modedecreases this counter by one.
wait_queuewait queue, used to wait for certain events inside one ofthe DVB API callers
kernel_ioctlcallback function used to handle ioctl calls from userspace.
nameName to be used for the device at the Media Controller
intf_devnodePointer to media_intf_devnode. Used by the dvbdev core tostore the MC device node interface
tsout_num_entitiesNumber of Transport Stream output entities
entitypointer to
structmedia_entityassociated with the device nodetsout_entityarray with MC entities associated to each TS output node
padspointer to
structmedia_padassociated withentity;tsout_padsarray with the source pads for eachtsout_entity
privprivate data
Description
This structure is used by the DVB core (frontend, CA, net, demux) inorder to create the device nodes. Usually, driver should not initializethisstructdiretly.
- structdvbdevfops_node¶
fops nodes registered in dvbdevfops_list
Definition:
struct dvbdevfops_node { struct file_operations *fops; enum dvb_device_type type; const struct dvb_device *template; struct list_head list_head;};Members
fopsDynamically allocated fops for ->owner registration
typetype of dvb_device
templatedvb_device used for registration
list_headlist_head for dvbdevfops_list
- structdvb_device*dvb_device_get(structdvb_device*dvbdev)¶
Increase dvb_device reference
Parameters
structdvb_device*dvbdevpointer to
structdvb_device
- voiddvb_device_put(structdvb_device*dvbdev)¶
Decrease dvb_device reference
Parameters
structdvb_device*dvbdevpointer to
structdvb_device
- intdvb_register_adapter(structdvb_adapter*adap,constchar*name,structmodule*module,structdevice*device,short*adapter_nums)¶
Registers a new DVB adapter
Parameters
structdvb_adapter*adappointer to
structdvb_adapterconstchar*nameAdapter’s name
structmodule*moduleinitialized with THIS_MODULE at the caller
structdevice*devicepointer to
structdevicethat corresponds to the device drivershort*adapter_numsArray with a list of the numbers fordvb_register_adapter;to select among them. Typically, initialized with:DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nums)
- intdvb_unregister_adapter(structdvb_adapter*adap)¶
Unregisters a DVB adapter
Parameters
structdvb_adapter*adappointer to
structdvb_adapter
- intdvb_register_device(structdvb_adapter*adap,structdvb_device**pdvbdev,conststructdvb_device*template,void*priv,enumdvb_device_typetype,intdemux_sink_pads)¶
Registers a new DVB device
Parameters
structdvb_adapter*adappointer to
structdvb_adapterstructdvb_device**pdvbdevpointer to the place where the new
structdvb_devicewill bestoredconststructdvb_device*templateTemplate used to create
pdvbdev;void*privprivate data
enumdvb_device_typetypetype of the device, as defined by
enumdvb_device_type.intdemux_sink_padsNumber of demux outputs, to be used to create the TSoutputs via the Media Controller.
- voiddvb_remove_device(structdvb_device*dvbdev)¶
Remove a registered DVB device
Parameters
structdvb_device*dvbdevpointer to
structdvb_device
Description
This does not free memory.dvb_free_device() will do that whenreference counter is empty
- voiddvb_unregister_device(structdvb_device*dvbdev)¶
Unregisters a DVB device
Parameters
structdvb_device*dvbdevpointer to
structdvb_device
- intdvb_create_media_graph(structdvb_adapter*adap,boolcreate_rf_connector)¶
Creates media graph for the Digital TV part of the device.
Parameters
structdvb_adapter*adappointer to
structdvb_adapterboolcreate_rf_connectorif true, it creates the RF connector too
Description
This function checks all DVB-related functions at the media controllerentities and creates the needed links for the media graph. It iscapable of working with multiple tuners or multiple frontends, but itwon’t create links if the device has multiple tuners and multiple frontendsor if the device has multiple muxes. In such case, the caller driver shouldmanually create the remaining links.
- voiddvb_register_media_controller(structdvb_adapter*adap,structmedia_device*mdev)¶
registers a media controller at DVB adapter
Parameters
structdvb_adapter*adappointer to
structdvb_adapterstructmedia_device*mdevpointer to
structmedia_device
- structmedia_device*dvb_get_media_controller(structdvb_adapter*adap)¶
gets the associated media controller
Parameters
structdvb_adapter*adappointer to
structdvb_adapter
- intdvb_generic_open(structinode*inode,structfile*file)¶
Digital TV open function, used by DVB devices
Parameters
structinode*inodepointer to
structinode.structfile*filepointer to
structfile.
Description
Checks if a DVB devnode is still valid, and if the permissions areOK and increment negative use count.
- intdvb_generic_release(structinode*inode,structfile*file)¶
Digital TV close function, used by DVB devices
Parameters
structinode*inodepointer to
structinode.structfile*filepointer to
structfile.
Description
Checks if a DVB devnode is still valid, and if the permissions areOK and decrement negative use count.
- longdvb_generic_ioctl(structfile*file,unsignedintcmd,unsignedlongarg)¶
Digital TV close function, used by DVB devices
Parameters
structfile*filepointer to
structfile.unsignedintcmdIoctl name.
unsignedlongargIoctl argument.
Description
Checks if a DVB devnode andstructdvbdev.kernel_ioctl is still valid.If so, callsdvb_usercopy().
- intdvb_usercopy(structfile*file,unsignedintcmd,unsignedlongarg,int(*func)(structfile*file,unsignedintcmd,void*arg))¶
copies data from/to userspace memory when an ioctl is issued.
Parameters
structfile*filePointer to struct
file.unsignedintcmdIoctl name.
unsignedlongargIoctl argument.
int(*func)(structfile*file,unsignedintcmd,void*arg)function that will actually handle the ioctl
Description
Ancillary function that uses ioctl direction and size to copy fromuserspace. Then, it callsfunc, and, if needed, data is copied backto userspace.
- structi2c_client*dvb_module_probe(constchar*module_name,constchar*name,structi2c_adapter*adap,unsignedcharaddr,void*platform_data)¶
helper routine to probe an I2C module
Parameters
constchar*module_nameName of the I2C module to be probed
constchar*nameOptional name for the I2C module. Used for debug purposes.If
NULL, defaults tomodule_name.structi2c_adapter*adappointer to
structi2c_adapterthat describes the I2C adapter wherethe module will be bound.unsignedcharaddrI2C address of the adapter, in 7-bit notation.
void*platform_dataPlatform data to be passed to the I2C module probed.
Description
This function binds an I2C device into the DVB core. Should be used byall drivers that use I2C bus to control the hardware. A module boundwithdvb_module_probe() should usedvb_module_release() to unbind.
Note
In the past, DVB modules (mainly, frontends) were bound viadvb_attach()macro, with does an ugly hack, using I2C low level functions. Suchusage is deprecated and will be removed soon. Instead, use this routine.
Return
On success, return anstructi2c_client, pointing to the boundI2C device.NULL otherwise.
- voiddvb_module_release(structi2c_client*client)¶
releases an I2C device allocated with
dvb_module_probe().
Parameters
structi2c_client*clientpointer to
structi2c_clientwith the I2C client to be released.can beNULL.
Description
This function should be used to free all resources reserved bydvb_module_probe() and unbinding the I2C hardware.
- dvb_attach¶
dvb_attach(FUNCTION,ARGS...)
attaches a DVB frontend into the DVB core.
Parameters
FUNCTIONfunction on a frontend module to be called.
ARGS...FUNCTION arguments.
Description
This ancillary function loads a frontend module in runtime and runstheFUNCTION function there, withARGS.As it increments symbol usage cont, at unregister,dvb_detach()should be called.
Note
In the past, DVB modules (mainly, frontends) were bound viadvb_attach()macro, with does an ugly hack, using I2C low level functions. Suchusage is deprecated and will be removed soon. Instead, you should usedvb_module_probe().
- dvb_detach¶
dvb_detach(FUNC)
detaches a DVB frontend loaded via
dvb_attach()
Parameters
FUNCattach function
Description
Decrements usage count for a function previously called viadvb_attach().
3.1.2.Digital TV Ring buffer¶
Those routines implement ring buffers used to handle digital TV data andcopy it from/to userspace.
Note
For performance reasons read and write routines don’t check buffer sizesand/or number of bytes free/available. This has to be done before theseroutines are called. For example:
/* write @buflen: bytes */free=dvb_ringbuffer_free(rbuf);if(free>=buflen)count=dvb_ringbuffer_write(rbuf,buffer,buflen);else/* do something *//* read min. 1000, max. @bufsize: bytes */avail=dvb_ringbuffer_avail(rbuf);if(avail>=1000)count=dvb_ringbuffer_read(rbuf,buffer,min(avail,bufsize));else/* do something */
If there is exactly one reader and one writer, there is no needto lock read or write operations.Two or more readers must be locked against each other.Flushing the buffer counts as a read operation.Resetting the buffer counts as a read and write operation.Two or more writers must be locked against each other.
- structdvb_ringbuffer¶
Describes a ring buffer used at DVB framework
Definition:
struct dvb_ringbuffer { u8 *data; ssize_t size; ssize_t pread; ssize_t pwrite; int error; wait_queue_head_t queue; spinlock_t lock;};Members
dataArea were the ringbuffer data is written
sizesize of the ringbuffer
preadnext position to read
pwritenext position to write
errorused by ringbuffer clients to indicate that an error happened.
queueWait queue used by ringbuffer clients to indicate when bufferwas filled
lockSpinlock used to protect the ringbuffer
- voiddvb_ringbuffer_init(structdvb_ringbuffer*rbuf,void*data,size_tlen)¶
initialize ring buffer, lock and queue
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffervoid*datapointer to the buffer where the data will be stored
size_tlenbytes from ring buffer intobuf
- intdvb_ringbuffer_empty(structdvb_ringbuffer*rbuf)¶
test whether buffer is empty
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffer
- ssize_tdvb_ringbuffer_free(structdvb_ringbuffer*rbuf)¶
returns the number of free bytes in the buffer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffer
Return
number of free bytes in the buffer
- ssize_tdvb_ringbuffer_avail(structdvb_ringbuffer*rbuf)¶
returns the number of bytes waiting in the buffer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffer
Return
number of bytes waiting in the buffer
- voiddvb_ringbuffer_reset(structdvb_ringbuffer*rbuf)¶
resets the ringbuffer to initial state
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffer
Description
Resets the read and write pointers to zero and flush the buffer.
This counts as a read and write operation
- voiddvb_ringbuffer_flush(structdvb_ringbuffer*rbuf)¶
flush buffer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffer
- voiddvb_ringbuffer_flush_spinlock_wakeup(structdvb_ringbuffer*rbuf)¶
flush buffer protected by spinlock and wake-up waiting task(s)
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbuffer
- DVB_RINGBUFFER_PEEK¶
DVB_RINGBUFFER_PEEK(rbuf,offs)
peek at byteoffs in the buffer
Parameters
rbufpointer to
structdvb_ringbufferoffsoffset inside the ringbuffer
- DVB_RINGBUFFER_SKIP¶
DVB_RINGBUFFER_SKIP(rbuf,num)
advance read ptr bynum bytes
Parameters
rbufpointer to
structdvb_ringbuffernumnumber of bytes to advance
- ssize_tdvb_ringbuffer_read_user(structdvb_ringbuffer*rbuf,u8__user*buf,size_tlen)¶
Reads a buffer into a user pointer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbufferu8__user*bufpointer to the buffer where the data will be stored
size_tlenbytes from ring buffer intobuf
Description
This variant assumes that the buffer is a memory at the userspace. So,it will internally callcopy_to_user().
Return
number of bytes transferred or -EFAULT
- voiddvb_ringbuffer_read(structdvb_ringbuffer*rbuf,u8*buf,size_tlen)¶
Reads a buffer into a pointer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbufferu8*bufpointer to the buffer where the data will be stored
size_tlenbytes from ring buffer intobuf
Description
This variant assumes that the buffer is a memory at the Kernel space
Return
number of bytes transferred or -EFAULT
- DVB_RINGBUFFER_WRITE_BYTE¶
DVB_RINGBUFFER_WRITE_BYTE(rbuf,byte)
write single byte to ring buffer
Parameters
rbufpointer to
structdvb_ringbufferbytebyte to write
- ssize_tdvb_ringbuffer_write(structdvb_ringbuffer*rbuf,constu8*buf,size_tlen)¶
Writes a buffer into the ringbuffer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbufferconstu8*bufpointer to the buffer where the data will be read
size_tlenbytes from ring buffer intobuf
Description
This variant assumes that the buffer is a memory at the Kernel space
Return
number of bytes transferred or -EFAULT
- ssize_tdvb_ringbuffer_write_user(structdvb_ringbuffer*rbuf,constu8__user*buf,size_tlen)¶
Writes a buffer received via a user pointer
Parameters
structdvb_ringbuffer*rbufpointer to
structdvb_ringbufferconstu8__user*bufpointer to the buffer where the data will be read
size_tlenbytes from ring buffer intobuf
Description
This variant assumes that the buffer is a memory at the userspace. So,it will internally callcopy_from_user().
Return
number of bytes transferred or -EFAULT
- ssize_tdvb_ringbuffer_pkt_write(structdvb_ringbuffer*rbuf,u8*buf,size_tlen)¶
Write a packet into the ringbuffer.
Parameters
structdvb_ringbuffer*rbufRingbuffer to write to.
u8*bufBuffer to write.
size_tlenLength of buffer (currently limited to 65535 bytes max).
Return
Number of bytes written, or -EFAULT, -ENOMEM, -EINVAL.
- ssize_tdvb_ringbuffer_pkt_read_user(structdvb_ringbuffer*rbuf,size_tidx,intoffset,u8__user*buf,size_tlen)¶
Read from a packet in the ringbuffer.
Parameters
structdvb_ringbuffer*rbufRingbuffer concerned.
size_tidxPacket index as returned by
dvb_ringbuffer_pkt_next().intoffsetOffset into packet to read from.
u8__user*bufDestination buffer for data.
size_tlenSize of destination buffer.
Return
Number of bytes read, or -EFAULT.
Description
Note
unlikedvb_ringbuffer_read(), this doesNOT update the read pointerin the ringbuffer. You must usedvb_ringbuffer_pkt_dispose() to mark apacket as no longer required.
- ssize_tdvb_ringbuffer_pkt_read(structdvb_ringbuffer*rbuf,size_tidx,intoffset,u8*buf,size_tlen)¶
Read from a packet in the ringbuffer.
Parameters
structdvb_ringbuffer*rbufRingbuffer concerned.
size_tidxPacket index as returned by
dvb_ringbuffer_pkt_next().intoffsetOffset into packet to read from.
u8*bufDestination buffer for data.
size_tlenSize of destination buffer.
Note
unlikedvb_ringbuffer_read_user(), this DOES update the read pointerin the ringbuffer.
Return
Number of bytes read, or -EFAULT.
- voiddvb_ringbuffer_pkt_dispose(structdvb_ringbuffer*rbuf,size_tidx)¶
Dispose of a packet in the ring buffer.
Parameters
structdvb_ringbuffer*rbufRing buffer concerned.
size_tidxPacket index as returned by
dvb_ringbuffer_pkt_next().
- ssize_tdvb_ringbuffer_pkt_next(structdvb_ringbuffer*rbuf,size_tidx,size_t*pktlen)¶
Get the index of the next packet in a ringbuffer.
Parameters
structdvb_ringbuffer*rbufRingbuffer concerned.
size_tidxPrevious packet index, or -1 to return the first packet index.
size_t*pktlenOn success, will be updated to contain the length of the packetin bytes.returns Packet index (if >=0), or -1 if no packets available.
3.1.3.Digital TV VB2 handler¶
- enumdvb_buf_type¶
types of Digital TV memory-mapped buffers
Constants
DVB_BUF_TYPE_CAPTUREbuffer is filled by the Kernel,with a received Digital TV stream
- enumdvb_vb2_states¶
states to control VB2 state machine
Constants
DVB_VB2_STATE_NONEVB2 engine not initialized yet, init failed or VB2 was released.
DVB_VB2_STATE_INITVB2 engine initialized.
DVB_VB2_STATE_REQBUFSBuffers were requested
DVB_VB2_STATE_STREAMONVB2 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. Thisis handled inside dvb_vb2.c.
- structdvb_buffer¶
video buffer information for v4l2.
Definition:
struct dvb_buffer { struct vb2_buffer vb; struct list_head list;};Members
vbembedded struct
vb2_buffer.listlist of
structdvb_buffer.
- structdvb_vb2_ctx¶
control struct for VB2 handler
Definition:
struct dvb_vb2_ctx { struct vb2_queue vb_q; struct mutex mutex; spinlock_t slock; struct list_head dvb_q; struct dvb_buffer *buf; int offset; int remain; int state; int buf_siz; int buf_cnt; int nonblocking; enum dmx_buffer_flags flags; u32 count; char name[DVB_VB2_NAME_MAX + 1];};Members
vb_qpointer to
structvb2_queuewith videobuf2 queue.mutexmutex to serialize vb2 operations. Used byvb2 core
wait_prepareandwait_finishoperations.slockspin lock used to protect buffer filling at dvb_vb2.c.
dvb_qList of buffers that are not filled yet.
bufPointer to the buffer that are currently being filled.
offsetindex to the next position at thebuf to be filled.
remainHow many bytes are left to be filled atbuf.
statebitmask of buffer states as defined by
enumdvb_vb2_states.buf_sizsize of each VB2 buffer.
buf_cntnumber of VB2 buffers.
nonblockingIf different than zero, device is operating on non-blockingmode.
flagsbuffer flags as defined by
enumdmx_buffer_flags.Filled only atDMX_DQBUF.DMX_QBUFshould zero this field.countmonotonic counter for filled buffers. Helps to identifydata stream loses. Filled only at
DMX_DQBUF.DMX_QBUFshouldzero this field.namename of the device type. Currently, it can either be“dvr” or “demux_filter”.
- intdvb_vb2_init(structdvb_vb2_ctx*ctx,constchar*name,intnon_blocking)¶
initializes VB2 handler
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
constchar*namename for the VB2 handler
intnon_blockingif not zero, it means that the device is at non-blocking mode
- intdvb_vb2_release(structdvb_vb2_ctx*ctx)¶
Releases the VB2 handler allocated resources and putctx at DVB_VB2_STATE_NONE state.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
- intdvb_vb2_is_streaming(structdvb_vb2_ctx*ctx)¶
checks if the VB2 handler is streaming
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
Return
0 if not streaming, 1 otherwise.
- intdvb_vb2_fill_buffer(structdvb_vb2_ctx*ctx,constunsignedchar*src,intlen,enumdmx_buffer_flags*buffer_flags)¶
fills a VB2 buffer
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
constunsignedchar*srcplace where the data is stored
intlennumber of bytes to be copied fromsrc
enumdmx_buffer_flags*buffer_flagspointer to buffer flags as defined by
enumdmx_buffer_flags.can be NULL.
- __poll_tdvb_vb2_poll(structdvb_vb2_ctx*ctx,structfile*file,poll_table*wait)¶
Wrapper to
vb2_core_streamon()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structfile*filestructfileargument passed to the pollfile operation handler.poll_table*waitpoll_tablewait argument passed to the pollfile operation handler.
Description
Implements pollsyscall() logic.
- intdvb_vb2_stream_on(structdvb_vb2_ctx*ctx)¶
Wrapper to
vb2_core_streamon()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
Description
Starts dvb streaming
- intdvb_vb2_stream_off(structdvb_vb2_ctx*ctx)¶
Wrapper to
vb2_core_streamoff()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
Description
Stops dvb streaming
- intdvb_vb2_reqbufs(structdvb_vb2_ctx*ctx,structdmx_requestbuffers*req)¶
Wrapper to
vb2_core_reqbufs()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structdmx_requestbuffers*reqstructdmx_requestbufferspassed from userspace inorder to handleDMX_REQBUFS.
Description
Initiate streaming by requesting a number of buffers. Also used tofree previously requested buffers, isreq->count is zero.
- intdvb_vb2_querybuf(structdvb_vb2_ctx*ctx,structdmx_buffer*b)¶
Wrapper to
vb2_core_querybuf()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structdmx_buffer*bstructdmx_bufferpassed from userspace inorder to handleDMX_QUERYBUF.
- intdvb_vb2_expbuf(structdvb_vb2_ctx*ctx,structdmx_exportbuffer*exp)¶
Wrapper to
vb2_core_expbuf()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structdmx_exportbuffer*expstructdmx_exportbufferpassed from userspace inorder to handleDMX_EXPBUF.
Description
Export a buffer as a file descriptor.
- intdvb_vb2_qbuf(structdvb_vb2_ctx*ctx,structdmx_buffer*b)¶
Wrapper to
vb2_core_qbuf()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structdmx_buffer*bstructdmx_bufferpassed from userspace inorder to handleDMX_QBUF.
Description
Queue a Digital TV buffer as requested by userspace
- intdvb_vb2_dqbuf(structdvb_vb2_ctx*ctx,structdmx_buffer*b)¶
Wrapper to
vb2_core_dqbuf()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structdmx_buffer*bstructdmx_bufferpassed from userspace inorder to handleDMX_DQBUF.
Description
Dequeue a Digital TV buffer to the userspace
- intdvb_vb2_mmap(structdvb_vb2_ctx*ctx,structvm_area_struct*vma)¶
Wrapper to
vb2_mmap()for Digital TV buffer handling.
Parameters
structdvb_vb2_ctx*ctxcontrol struct for VB2 handler
structvm_area_struct*vmapointer to
structvm_area_structwith the vma passedto the mmap file operation handler in the driver.
Description
map Digital TV video buffers into application address space.