// A gralloc 4.0 buffer that has been imported in the current process and // that will be released upon destruction. Users must ensure that the Gralloc // instance that this buffer is created with out lives this buffer. class GrallocBuffer { public:
GrallocBuffer(Gralloc* gralloc, buffer_handle_t buffer); virtual ~GrallocBuffer();
// Returns the stride of the buffer if it is a single plane buffer or fails // and returns nullopt if the buffer is for a multi plane buffer.
std::optional<uint32_t> GetMonoPlanarStrideBytes();
class Gralloc { public: virtual ~Gralloc() = default;
// Imports the given buffer handle into the current process and returns an // imported buffer which can be used for reading. Users must ensure that the // Gralloc instance outlives any GrallocBuffers.
std::optional<GrallocBuffer> Import(buffer_handle_t buffer);
private: // The below functions are made available only to GrallocBuffer so that // users only call gralloc functions on *imported* buffers. friendclass GrallocBuffer;
// See GrallocBuffer::Release. void Release(buffer_handle_t buffer);
// See GrallocBuffer::Lock.
std::optional<void*> Lock(buffer_handle_t buffer);
// See GrallocBuffer::LockYCbCr.
std::optional<android_ycbcr> LockYCbCr(buffer_handle_t buffer);
// See GrallocBuffer::Unlock. void Unlock(buffer_handle_t buffer);
// See GrallocBuffer::GetWidth.
std::optional<uint32_t> GetWidth(buffer_handle_t buffer);
// See GrallocBuffer::GetHeight.
std::optional<uint32_t> GetHeight(buffer_handle_t buffer);
// See GrallocBuffer::GetDrmFormat.
std::optional<uint32_t> GetDrmFormat(buffer_handle_t buffer);
// See GrallocBuffer::GetPlaneLayouts.
std::optional<std::vector<aidl::android::hardware::graphics::common::PlaneLayout>>
GetPlaneLayouts(buffer_handle_t buffer);
// Returns the stride of the buffer if it is a single plane buffer or fails // and returns nullopt if the buffer is for a multi plane buffer.
std::optional<uint32_t> GetMonoPlanarStrideBytes(buffer_handle_t);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.