#ifndef ANDROID_DVR_DISPLAY_CLIENT_H_ #define ANDROID_DVR_DISPLAY_CLIENT_H_ #include #include #include #include #include #include namespace android { namespace dvr { namespace display { class Surface : public pdx::ClientBase { public: // Utility named constructor. This can be removed once ClientBase::Create is // refactored to return Status types. static pdx::Status> CreateSurface( const SurfaceAttributes& attributes) { int error; pdx::Status> status; if (auto surface = Create(attributes, &error)) status.SetValue(std::move(surface)); else status.SetError(error); return status; } int surface_id() const { return surface_id_; } int z_order() const { return z_order_; } bool visible() const { return visible_; } pdx::Status SetVisible(bool visible); pdx::Status SetZOrder(int z_order); pdx::Status SetAttributes(const SurfaceAttributes& attributes); // Creates an empty queue. pdx::Status> CreateQueue(uint32_t width, uint32_t height, uint32_t format, size_t metadata_size); // Creates a queue and populates it with |capacity| buffers of the specified // parameters. pdx::Status> CreateQueue(uint32_t width, uint32_t height, uint32_t layer_count, uint32_t format, uint64_t usage, size_t capacity, size_t metadata_size); private: friend BASE; int surface_id_ = -1; int z_order_ = 0; bool visible_ = false; // TODO(eieio,avakulenko): Remove error param once pdx::ClientBase::Create() // returns Status. explicit Surface(const SurfaceAttributes& attributes, int* error = nullptr); explicit Surface(pdx::LocalChannelHandle channel_handle, int* error = nullptr); Surface(const Surface&) = delete; void operator=(const Surface&) = delete; }; class DisplayClient : public pdx::ClientBase { public: pdx::Status GetDisplayMetrics(); pdx::Status GetConfigurationData(ConfigFileType config_type); pdx::Status> SetupGlobalBuffer( DvrGlobalBufferKey key, size_t size, uint64_t usage); pdx::Status DeleteGlobalBuffer(DvrGlobalBufferKey key); pdx::Status> GetGlobalBuffer( DvrGlobalBufferKey key); pdx::Status> CreateSurface( const SurfaceAttributes& attributes); // Temporary query for current VR status. Will be removed later. pdx::Status IsVrAppRunning(); private: friend BASE; explicit DisplayClient(int* error = nullptr); DisplayClient(const DisplayClient&) = delete; void operator=(const DisplayClient&) = delete; }; } // namespace display } // namespace dvr } // namespace android #endif // ANDROID_DVR_DISPLAY_CLIENT_H_