Who provide the data for wifi display?

477 views Asked by At

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?

1

There are 1 answers

0
leesei On

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.