• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef ANDROID_DVR_DISPLAY_MANAGER_CLIENT_H_
2 #define ANDROID_DVR_DISPLAY_MANAGER_CLIENT_H_
3 
4 #include <string>
5 #include <vector>
6 
7 #include <pdx/client.h>
8 #include <pdx/status.h>
9 #include <private/dvr/display_protocol.h>
10 
11 namespace android {
12 namespace dvr {
13 
14 class IonBuffer;
15 class ConsumerQueue;
16 
17 namespace display {
18 
19 class DisplayManagerClient : public pdx::ClientBase<DisplayManagerClient> {
20  public:
21   ~DisplayManagerClient() override;
22 
23   pdx::Status<std::vector<SurfaceState>> GetSurfaceState();
24   pdx::Status<std::unique_ptr<IonBuffer>> SetupNamedBuffer(
25       const std::string& name, size_t size, uint64_t usage);
26   pdx::Status<std::unique_ptr<ConsumerQueue>> GetSurfaceQueue(int surface_id,
27                                                               int queue_id);
28 
29   using Client::event_fd;
30 
GetEventMask(int events)31   pdx::Status<int> GetEventMask(int events) {
32     if (auto* client_channel = GetChannel())
33       return client_channel->GetEventMask(events);
34     else
35       return pdx::ErrorStatus(EINVAL);
36   }
37 
38  private:
39   friend BASE;
40 
41   DisplayManagerClient();
42 
43   DisplayManagerClient(const DisplayManagerClient&) = delete;
44   void operator=(const DisplayManagerClient&) = delete;
45 };
46 
47 }  // namespace display
48 }  // namespace dvr
49 }  // namespace android
50 
51 #endif  // ANDROID_DVR_DISPLAY_MANAGER_CLIENT_H_
52