aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2018-02-09 05:51:19 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-02-23 05:28:41 -0500
commit9c171cdf22d1486da1608abd7612fabe2a8262ca (patch)
tree74b81eaf1e56fc9f0aa47681940acaf5a37d6a20
parent0b23498aacc658e4d0f6b240f0b905908695a132 (diff)
media: dvb: add continuity error indicators for memory mapped buffers
While userspace can detect discontinuity errors, it is useful to also let Kernelspace reporting discontinuity, as it can help to identify if the data loss happened either at Kernel or userspace side. Update documentation accordingly. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--Documentation/media/dmx.h.rst.exceptions14
-rw-r--r--Documentation/media/uapi/dvb/dmx-qbuf.rst7
-rw-r--r--include/uapi/linux/dvb/dmx.h35
3 files changed, 49 insertions, 7 deletions
diff --git a/Documentation/media/dmx.h.rst.exceptions b/Documentation/media/dmx.h.rst.exceptions
index 63f55a9ae2b1..a8c4239ed95b 100644
--- a/Documentation/media/dmx.h.rst.exceptions
+++ b/Documentation/media/dmx.h.rst.exceptions
@@ -50,9 +50,15 @@ replace typedef dmx_filter_t :c:type:`dmx_filter`
50replace typedef dmx_pes_type_t :c:type:`dmx_pes_type` 50replace typedef dmx_pes_type_t :c:type:`dmx_pes_type`
51replace typedef dmx_input_t :c:type:`dmx_input` 51replace typedef dmx_input_t :c:type:`dmx_input`
52 52
53ignore symbol DMX_OUT_DECODER 53replace symbol DMX_BUFFER_FLAG_HAD_CRC32_DISCARD :c:type:`dmx_buffer_flags`
54ignore symbol DMX_OUT_TAP 54replace symbol DMX_BUFFER_FLAG_TEI :c:type:`dmx_buffer_flags`
55ignore symbol DMX_OUT_TS_TAP 55replace symbol DMX_BUFFER_PKT_COUNTER_MISMATCH :c:type:`dmx_buffer_flags`
56ignore symbol DMX_OUT_TSDEMUX_TAP 56replace symbol DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED :c:type:`dmx_buffer_flags`
57replace symbol DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR :c:type:`dmx_buffer_flags`
58
59replace symbol DMX_OUT_DECODER :c:type:`dmx_output`
60replace symbol DMX_OUT_TAP :c:type:`dmx_output`
61replace symbol DMX_OUT_TS_TAP :c:type:`dmx_output`
62replace symbol DMX_OUT_TSDEMUX_TAP :c:type:`dmx_output`
57 63
58replace ioctl DMX_DQBUF dmx_qbuf 64replace ioctl DMX_DQBUF dmx_qbuf
diff --git a/Documentation/media/uapi/dvb/dmx-qbuf.rst b/Documentation/media/uapi/dvb/dmx-qbuf.rst
index b48c4931658e..be5a4c6f1904 100644
--- a/Documentation/media/uapi/dvb/dmx-qbuf.rst
+++ b/Documentation/media/uapi/dvb/dmx-qbuf.rst
@@ -51,9 +51,10 @@ out to disk. Buffers remain locked until dequeued, until the
51the device is closed. 51the device is closed.
52 52
53Applications call the ``DMX_DQBUF`` ioctl to dequeue a filled 53Applications call the ``DMX_DQBUF`` ioctl to dequeue a filled
54(capturing) buffer from the driver's outgoing queue. They just set the ``reserved`` field array to zero. When ``DMX_DQBUF`` is called with a 54(capturing) buffer from the driver's outgoing queue.
55pointer to this structure, the driver fills the remaining fields or 55They just set the ``index`` field withe the buffer ID to be queued.
56returns an error code. 56When ``DMX_DQBUF`` is called with a pointer to struct :c:type:`dmx_buffer`,
57the driver fills the remaining fields or returns an error code.
57 58
58By default ``DMX_DQBUF`` blocks when no buffer is in the outgoing 59By default ``DMX_DQBUF`` blocks when no buffer is in the outgoing
59queue. When the ``O_NONBLOCK`` flag was given to the 60queue. When the ``O_NONBLOCK`` flag was given to the
diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h
index 5f3c5a918f00..b4112f0b6dd3 100644
--- a/include/uapi/linux/dvb/dmx.h
+++ b/include/uapi/linux/dvb/dmx.h
@@ -212,6 +212,32 @@ struct dmx_stc {
212}; 212};
213 213
214/** 214/**
215 * enum dmx_buffer_flags - DMX memory-mapped buffer flags
216 *
217 * @DMX_BUFFER_FLAG_HAD_CRC32_DISCARD:
218 * Indicates that the Kernel discarded one or more frames due to wrong
219 * CRC32 checksum.
220 * @DMX_BUFFER_FLAG_TEI:
221 * Indicates that the Kernel has detected a Transport Error indicator
222 * (TEI) on a filtered pid.
223 * @DMX_BUFFER_PKT_COUNTER_MISMATCH:
224 * Indicates that the Kernel has detected a packet counter mismatch
225 * on a filtered pid.
226 * @DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED:
227 * Indicates that the Kernel has detected one or more frame discontinuity.
228 * @DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR:
229 * Received at least one packet with a frame discontinuity indicator.
230 */
231
232enum dmx_buffer_flags {
233 DMX_BUFFER_FLAG_HAD_CRC32_DISCARD = 1 << 0,
234 DMX_BUFFER_FLAG_TEI = 1 << 1,
235 DMX_BUFFER_PKT_COUNTER_MISMATCH = 1 << 2,
236 DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED = 1 << 3,
237 DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR = 1 << 4,
238};
239
240/**
215 * struct dmx_buffer - dmx buffer info 241 * struct dmx_buffer - dmx buffer info
216 * 242 *
217 * @index: id number of the buffer 243 * @index: id number of the buffer
@@ -220,15 +246,24 @@ struct dmx_stc {
220 * offset from the start of the device memory for this plane, 246 * offset from the start of the device memory for this plane,
221 * (or a "cookie" that should be passed to mmap() as offset) 247 * (or a "cookie" that should be passed to mmap() as offset)
222 * @length: size in bytes of the buffer 248 * @length: size in bytes of the buffer
249 * @flags: bit array of buffer flags as defined by &enum dmx_buffer_flags.
250 * Filled only at &DMX_DQBUF.
251 * @count: monotonic counter for filled buffers. Helps to identify
252 * data stream loses. Filled only at &DMX_DQBUF.
223 * 253 *
224 * Contains data exchanged by application and driver using one of the streaming 254 * Contains data exchanged by application and driver using one of the streaming
225 * I/O methods. 255 * I/O methods.
256 *
257 * Please notice that, for &DMX_QBUF, only @index should be filled.
258 * On &DMX_DQBUF calls, all fields will be filled by the Kernel.
226 */ 259 */
227struct dmx_buffer { 260struct dmx_buffer {
228 __u32 index; 261 __u32 index;
229 __u32 bytesused; 262 __u32 bytesused;
230 __u32 offset; 263 __u32 offset;
231 __u32 length; 264 __u32 length;
265 __u32 flags;
266 __u32 count;
232}; 267};
233 268
234/** 269/**