• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Shenzhen Kaihong DID 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 
16 #ifndef BUFFER_MANAGER_WRAPPER_H
17 #define BUFFER_MANAGER_WRAPPER_H
18 
19 #include "codec_type.h"
20 
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25 
26 struct BufferManagerWrapper {
27     void *inputBufferManager;
28     void *outputBufferManager;
29 
30     bool (*IsInputDataBufferReady)(const struct BufferManagerWrapper *bufferManagerWrapper, uint32_t timeoutMs);
31     CodecBuffer* (*GetInputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, uint32_t timeoutMs);
32     CodecBuffer* (*GetUsedInputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, uint32_t timeoutMs);
33     void (*PutInputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, CodecBuffer *info);
34     void (*PutUsedInputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, CodecBuffer *info);
35 
36     bool (*IsUsedOutputDataBufferReady)(const struct BufferManagerWrapper *bufferManagerWrapper, uint32_t timeoutMs);
37     CodecBuffer* (*GetOutputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, uint32_t timeoutMs);
38     CodecBuffer* (*GetUsedOutputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper,
39                   uint32_t timeoutMs);
40     void (*PutOutputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, CodecBuffer *info);
41     void (*PutUsedOutputDataBuffer)(const struct BufferManagerWrapper *bufferManagerWrapper, CodecBuffer *info);
42 };
43 
44 struct BufferManagerWrapper* GetBufferManager(void);
45 void DeleteBufferManager(struct BufferManagerWrapper **ppBufferManager);
46 
47 #ifdef __cplusplus
48 }
49 #endif
50 #endif  // BUFFER_MANAGER_WRAPPER_H
51