20 #ifndef MIR_FRONTEND_SESSION_MEDIATOR_H_
21 #define MIR_FRONTEND_SESSION_MEDIATOR_H_
23 #include "mir_protobuf.pb.h"
26 #include <unordered_map>
37 class GraphicBufferAllocator;
48 class SessionMediatorReport;
49 class ClientBufferTracker;
58 std::shared_ptr<Shell>
const& shell,
59 std::shared_ptr<graphics::Platform>
const& graphics_platform,
60 std::shared_ptr<frontend::DisplayChanger>
const& display_changer,
61 std::shared_ptr<graphics::GraphicBufferAllocator>
const& buffer_allocator,
62 std::shared_ptr<SessionMediatorReport>
const& report,
63 std::shared_ptr<EventSink>
const& event_sink,
64 std::shared_ptr<ResourceCache>
const& resource_cache);
69 void connect(::google::protobuf::RpcController* controller,
70 const ::mir::protobuf::ConnectParameters* request,
71 ::mir::protobuf::Connection* response,
72 ::google::protobuf::Closure* done)
override;
75 const mir::protobuf::SurfaceParameters* request,
76 mir::protobuf::Surface* response,
77 google::protobuf::Closure* done)
override;
80 google::protobuf::RpcController* controller,
82 mir::protobuf::Buffer* response,
83 google::protobuf::Closure* done)
override;
88 google::protobuf::Closure* done)
override;
90 void disconnect(google::protobuf::RpcController* controller,
91 const mir::protobuf::Void* request,
92 mir::protobuf::Void* response,
93 google::protobuf::Closure* done)
override;
96 const mir::protobuf::SurfaceSetting*,
97 mir::protobuf::SurfaceSetting*,
98 google::protobuf::Closure* done)
override;
101 const ::mir::protobuf::DisplayConfiguration* request,
102 ::mir::protobuf::DisplayConfiguration* response,
103 ::google::protobuf::Closure* done)
override;
107 const mir::protobuf::DRMMagic* request,
108 mir::protobuf::DRMAuthMagicStatus* response,
109 google::protobuf::Closure* done)
override;
112 void pack_protobuf_buffer(protobuf::Buffer& protobuf_buffer,
113 std::shared_ptr<graphics::Buffer>
const& graphics_buffer,
116 std::shared_ptr<Shell>
const shell;
117 std::shared_ptr<graphics::Platform>
const graphics_platform;
120 std::shared_ptr<graphics::GraphicBufferAllocator>
const buffer_allocator;
122 std::shared_ptr<frontend::DisplayChanger>
const display_changer;
123 std::shared_ptr<SessionMediatorReport>
const report;
124 std::shared_ptr<EventSink>
const event_sink;
125 std::shared_ptr<ResourceCache>
const resource_cache;
127 std::unordered_map<SurfaceId,std::shared_ptr<graphics::Buffer>> client_buffer_resource;
129 std::mutex session_mutex;
130 std::weak_ptr<Session> weak_session;