132a6e48fSopenharmony_ci/*
232a6e48fSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
332a6e48fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
432a6e48fSopenharmony_ci * you may not use this file except in compliance with the License.
532a6e48fSopenharmony_ci * You may obtain a copy of the License at
632a6e48fSopenharmony_ci *
732a6e48fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
832a6e48fSopenharmony_ci *
932a6e48fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1032a6e48fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1132a6e48fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1232a6e48fSopenharmony_ci * See the License for the specific language governing permissions and
1332a6e48fSopenharmony_ci * limitations under the License.
1432a6e48fSopenharmony_ci */
1532a6e48fSopenharmony_ci
1632a6e48fSopenharmony_ci#ifndef INCLUDE_BUFFER_HANDLE_H
1732a6e48fSopenharmony_ci#define INCLUDE_BUFFER_HANDLE_H
1832a6e48fSopenharmony_ci
1932a6e48fSopenharmony_ci#include <stdint.h>
2032a6e48fSopenharmony_ci
2132a6e48fSopenharmony_ci#ifdef __cplusplus
2232a6e48fSopenharmony_ciextern "C" {
2332a6e48fSopenharmony_ci#endif
2432a6e48fSopenharmony_ci
2532a6e48fSopenharmony_citypedef struct {
2632a6e48fSopenharmony_ci    int32_t fd;           /**< buffer fd, -1 if not supported */
2732a6e48fSopenharmony_ci    int32_t width;        /**< the width of memory */
2832a6e48fSopenharmony_ci    int32_t stride;       /**< the stride of memory */
2932a6e48fSopenharmony_ci    int32_t height;       /**< the height of memory */
3032a6e48fSopenharmony_ci    int32_t size;         /* < size of memory */
3132a6e48fSopenharmony_ci    int32_t format;       /**< the format of memory */
3232a6e48fSopenharmony_ci    uint64_t usage;        /**< the usage of memory */
3332a6e48fSopenharmony_ci    void *virAddr;        /**< Virtual address of memory  */
3432a6e48fSopenharmony_ci    uint64_t phyAddr;     /**< Physical address */
3532a6e48fSopenharmony_ci    uint32_t reserveFds;  /**< the number of reserved fd value */
3632a6e48fSopenharmony_ci    uint32_t reserveInts; /**< the number of reserved integer value */
3732a6e48fSopenharmony_ci    int32_t reserve[0];   /**< the data */
3832a6e48fSopenharmony_ci} BufferHandle;
3932a6e48fSopenharmony_ci
4032a6e48fSopenharmony_ci#ifdef __cplusplus
4132a6e48fSopenharmony_ci}
4232a6e48fSopenharmony_ci#endif
4332a6e48fSopenharmony_ci
4432a6e48fSopenharmony_ci#endif // INCLUDE_BUFFER_HANDLE_H
45