• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef CODEC_BUFFER_WRAPPER_H
16 #define CODEC_BUFFER_WRAPPER_H
17 
18 #include "v4_0/codec_types.h"
19 #include "buffer_helper.h"
20 
21 namespace OHOS::Codec::Omx {
22 namespace CodecHDI = OHOS::HDI::Codec::V4_0;
23 
24 struct OmxCodecBuffer {
25     uint32_t bufferId;
26     uint32_t bufferType;
27     sptr<NativeBuffer> bufferhandle;
28     std::shared_ptr<UniqueFd> fd;
29     uint32_t allocLen;
30     uint32_t filledLen;
31     uint32_t offset;
32     std::shared_ptr<UniqueFd> fenceFd;
33     CodecHDI::ShareMemTypes type;
34     int64_t pts;
35     uint32_t flag;
36     std::vector<uint8_t> alongParam;
37 };
38 
39 OmxCodecBuffer Convert(const CodecHDI::OmxCodecBuffer& src, bool isIpcMode);
40 CodecHDI::OmxCodecBuffer Convert(const OmxCodecBuffer& src, bool isIpcMode);
41 
42 }
43 #endif