design: audiosinks: fix missing markup

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2017-06-15 23:29:58 -07:00
parent 69010fa4ee
commit 8f5a43d8e7

View File

@ -27,6 +27,7 @@
The design is based on a set of base classes and the concept of a The design is based on a set of base classes and the concept of a
ringbuffer of samples. ringbuffer of samples.
```
+-----------+ - provide preroll, rendering, timing +-----------+ - provide preroll, rendering, timing
+ basesink + - caps nego + basesink + - caps nego
+-----+-----+ +-----+-----+
@ -40,10 +41,12 @@ ringbuffer of samples.
+-----V------+ - default ringbuffer implementation with a GThread +-----V------+ - default ringbuffer implementation with a GThread
+ audiosink + - subclasses provide open/read/close methods + audiosink + - subclasses provide open/read/close methods
+------------+ +------------+
```
The ringbuffer is a contiguous piece of memory divided into segtotal The ringbuffer is a contiguous piece of memory divided into segtotal
pieces of segments. Each segment has segsize bytes. pieces of segments. Each segment has segsize bytes.
```
play position play position
v v
+---+---+---+-------------------------------------+----------+ +---+---+---+-------------------------------------+----------+
@ -51,17 +54,18 @@ pieces of segments. Each segment has segsize bytes.
+---+---+---+-------------------------------------+----------+ +---+---+---+-------------------------------------+----------+
<---> <--->
segsize bytes = N samples * bytes_per_sample. segsize bytes = N samples * bytes_per_sample.
```
The ringbuffer has a play position, which is expressed in segments. The The ringbuffer has a play position, which is expressed in segments. The
play position is where the device is currently reading samples from the play position is where the device is currently reading samples from the
buffer. buffer.
The ringbuffer can be put to the PLAYING or STOPPED state. The ringbuffer can be put to the `PLAYING` or `STOPPED` state.
In the STOPPED state no samples are played to the device and the play In the `STOPPED` state no samples are played to the device and the play
pointer does not advance. pointer does not advance.
In the PLAYING state samples are written to the device and the In the `PLAYING` state samples are written to the device and the
ringbuffer should call a configurable callback after each segment is ringbuffer should call a configurable callback after each segment is
written to the device. In this state the play pointer is advanced after written to the device. In this state the play pointer is advanced after
each segment is written. each segment is written.
@ -79,7 +83,7 @@ possible.
Whenever new samples are to be put into the ringbuffer, the position of Whenever new samples are to be put into the ringbuffer, the position of
the read pointer is taken. The required write position is taken and the the read pointer is taken. The required write position is taken and the
diff is made between the required and actual position. If the difference diff is made between the required and actual position. If the difference
is \<0, the sample is too late. If the difference is bigger than is `< 0`, the sample is too late. If the difference is bigger than
segtotal, the writing part has to wait for the play pointer to advance. segtotal, the writing part has to wait for the play pointer to advance.
### Scheduling ### Scheduling
@ -115,8 +119,8 @@ the samples and the actual writing of the samples to the device.
#### DMA mode #### DMA mode
Elements that can do DMA based access to the audio device have to Elements that can do DMA based access to the audio device have to
subclass from the GstAudioBaseSink class and wrap the DMA ringbuffer subclass from the `GstAudioBaseSink` class and wrap the DMA ringbuffer
in a subclass of GstRingBuffer. in a subclass of `GstRingBuffer`.
The ringbuffer subclass should trigger a callback after writing or The ringbuffer subclass should trigger a callback after writing or
playing each sample to the device. This callback can be triggered playing each sample to the device. This callback can be triggered
@ -124,6 +128,6 @@ from a thread or from a signal from the audio device.
### Clocks ### Clocks
The GstAudioBaseSink class will use the ringbuffer to act as a clock The `GstAudioBaseSink` class will use the ringbuffer to act as a clock
provider. It can do this by using the play pointer and the delay to provider. It can do this by using the play pointer and the delay to
calculate the clock time. calculate the clock time.