I try to follow the wifi display codes in Android Jelly bean 4.2. In wifi display, the PlaybackSession
class will be responsible for getting the data. And finally it will get the data from a class called SurfaceMediaSource
, which inherits from MediaSource
. The data is in BufferQueue
in SurfaceMediaSource
. But I cannot find who is responsible for write the data to the BufferQueue
. I believe the SurfaceFlinger
should do it. However, I cannot find any specific codes. Does anyone know how it works?
Asked
Active
Viewed 458 times
0

leesei
- 6,020
- 2
- 29
- 51

user1659072
- 121
- 4
- 9
-
It's using the "virtual display" feature in surfaceflinger. – fadden Aug 07 '13 at 14:44
1 Answers
0
Check onDisplayConnected()
call in wfd.cpp
and com.android.server.display.DisplayDevice
.
Both will end up in SurfaceComposerClient::setDisplaySurface()
in frameworks/native/libs/gui/SurfaceComposerClient.cpp
.
Sadly I don't understand how setting of DisplayState::eSurfaceChanged
would cause the display to be rendered to the BufferQueue
in SurfaceMediaSource
.

leesei
- 6,020
- 2
- 29
- 51