Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0
0002 
0003 Digital TV Common functions
0004 ---------------------------
0005 
0006 Math functions
0007 ~~~~~~~~~~~~~~
0008 
0009 Provide some commonly-used math functions, usually required in order to
0010 estimate signal strength and signal to noise measurements in dB.
0011 
0012 .. kernel-doc:: include/media/dvb_math.h
0013 
0014 
0015 DVB devices
0016 ~~~~~~~~~~~
0017 
0018 Those functions are responsible for handling the DVB device nodes.
0019 
0020 .. kernel-doc:: include/media/dvbdev.h
0021 
0022 Digital TV Ring buffer
0023 ~~~~~~~~~~~~~~~~~~~~~~
0024 
0025 Those routines implement ring buffers used to handle digital TV data and
0026 copy it from/to userspace.
0027 
0028 .. note::
0029 
0030   1) For performance reasons read and write routines don't check buffer sizes
0031      and/or number of bytes free/available. This has to be done before these
0032      routines are called. For example:
0033 
0034    .. code-block:: c
0035 
0036         /* write @buflen: bytes */
0037         free = dvb_ringbuffer_free(rbuf);
0038         if (free >= buflen)
0039                 count = dvb_ringbuffer_write(rbuf, buffer, buflen);
0040         else
0041                 /* do something */
0042 
0043         /* read min. 1000, max. @bufsize: bytes */
0044         avail = dvb_ringbuffer_avail(rbuf);
0045         if (avail >= 1000)
0046                 count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
0047         else
0048                 /* do something */
0049 
0050   2) If there is exactly one reader and one writer, there is no need
0051      to lock read or write operations.
0052      Two or more readers must be locked against each other.
0053      Flushing the buffer counts as a read operation.
0054      Resetting the buffer counts as a read and write operation.
0055      Two or more writers must be locked against each other.
0056 
0057 .. kernel-doc:: include/media/dvb_ringbuffer.h
0058 
0059 Digital TV VB2 handler
0060 ~~~~~~~~~~~~~~~~~~~~~~
0061 
0062 .. kernel-doc:: include/media/dvb_vb2.h