1.1 Bufferqueue Detailed
We've seen the bufferqueue in the previous section, which is the key to surfacetextureclient implementing the local window. Logically, Bufferqueue should reside in the process of the Surfaceflinger side. The doubts we need to address further are:
Each application can correspond to a few bufferqueue, are they a pair of one, One-to-many or One-to-many?
Who is assigned the drawing space that the application needs?
In the learning of audio systems, we know that Audiotrack and Audioflinger are passed in the form of shared memory, so is the display system similar?
How applications and Surfaceflinger mutually exclusive shared data areas
As with the problems encountered in the audio system, we are faced with the classic "producer-consumer" model. How does the display system reconcile the mutually exclusive access between the two?
The internal principle of 1.1.1 Bufferqueue
First, the inner structure of the lower bufferqueue is parsed, as shown in the following illustration:
Figure 11?12 Bufferqueue Internal variables