• 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 CODEC_OEM_IF_H
17 #define CODEC_OEM_IF_H
18 
19 #include "hdf_base.h"
20 #include "codec_type.h"
21 
22 #ifdef __cplusplus
23 #if __cplusplus
24 extern "C" {
25 #endif
26 #endif /* __cplusplus */
27 
28 typedef int32_t (*CodecInitType)(void);
29 typedef int32_t (*CodecDeinitType)(void);
30 typedef int32_t (*CodecCreateType)(const char* name, CODEC_HANDLETYPE *handle);
31 typedef int32_t (*CodecDestroyType)(CODEC_HANDLETYPE handle);
32 typedef int32_t (*CodecSetPortModeType)(CODEC_HANDLETYPE handle, DirectionType direct,
33     AllocateBufferMode mode, BufferType type);
34 typedef int32_t (*CodecGetPortModeType)(CODEC_HANDLETYPE handle, DirectionType direct,
35     AllocateBufferMode *mode, BufferType *type);
36 typedef int32_t (*CodecSetParameterType)(CODEC_HANDLETYPE handle, const Param *params, int32_t paramCnt);
37 typedef int32_t (*CodecGetParameterType)(CODEC_HANDLETYPE handle, Param *params, int32_t paramCnt);
38 typedef int32_t (*CodecStartType)(CODEC_HANDLETYPE handle);
39 typedef int32_t (*CodecStopType)(CODEC_HANDLETYPE handle);
40 typedef int32_t (*CodecFlushType)(CODEC_HANDLETYPE handle, DirectionType directType);
41 typedef int32_t (*CodecSetCallbackType)(CODEC_HANDLETYPE handle, const CodecCallback *cb, UINTPTR instance);
42 typedef int32_t (*CodecDecodeType)(CODEC_HANDLETYPE handle, CodecBuffer *inputData, CodecBuffer *outInfo,
43     uint32_t timeoutMs);
44 typedef int32_t (*CodecEncodeType)(CODEC_HANDLETYPE handle, CodecBuffer *inputData, CodecBuffer *outInfo,
45     uint32_t timeoutMs);
46 typedef int32_t (*CodecEncodeHeaderType)(CODEC_HANDLETYPE handle, CodecBuffer outInfo, uint32_t timeoutMs);
47 
48 struct CodecOemIf {
49     CodecInitType codecInit;
50     CodecDeinitType codecDeinit;
51     CodecCreateType codecCreate;
52     CodecDestroyType codecDestroy;
53     CodecSetPortModeType codecSetPortMode;
54     CodecSetParameterType codecSetParameter;
55     CodecGetParameterType codecGetParameter;
56     CodecStartType codecStart;
57     CodecStopType codecStop;
58     CodecFlushType codecFlush;
59     CodecSetCallbackType codecSetCallback;
60     CodecDecodeType codecDecode;
61     CodecEncodeType codecEncode;
62     CodecEncodeHeaderType codecEncodeHeader;
63 };
64 
65 #ifdef __cplusplus
66 #if __cplusplus
67 }
68 #endif
69 #endif /* __cplusplus */
70 #endif  // CODEC_OEM_IF_H