You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.6 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2019-2020. All rights reserved.
* Description: overlay create win/queue buffer by VO
* Author: Original Media Software Group
* Create: 2019-07-15
*/
#ifndef OVERLAY_ADAPTER_H
#define OVERLAY_ADAPTER_H
#include <hardware/hwcomposer2.h>
#include <hardware/hwcomposer_defs.h>
#include <vector>
#include <mutex>
namespace android {
class VendorWindowAdp;
using OverlayRect = struct {
int left;
int top;
int right;
int bottom;
};
using LayerInfo = struct {
int visible;
int displayId;
buffer_handle_t handle;
int sequence;
};
class OverlayAdapter {
public:
OverlayAdapter();
virtual ~OverlayAdapter();
/**
* Interfaces used in HWC
* prepare overlay layers
*/
int PrepareOverlayLayer(const LayerInfo &info);
/**
* queue a buffer handle to overlay device for displaying.
*/
int QueueBuffer(buffer_handle_t handle, int &releaseFence, const int &dataSpace);
/**
* area of the source to consider, the origin is the top-left corner of
* the buffer.
*/
int SetCrop(const OverlayRect &sourceCrop) const;
int SetPosition(const OverlayRect &displayFrame) const;
int SetTransform(uint32_t transform) const;
int SetZorder(int32_t zorder) const;
/**
* get displayID
*/
int GetDisplayID() const;
private:
int displayId;
std::unique_ptr<VendorWindowAdp> impl;
};
}
#endif /* OVERLAY_ADAPTER_H */