• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 
16 #ifndef OPENSLES_OPENHARMONY_H
17 #define OPENSLES_OPENHARMONY_H
18 
19 #include<OpenSLES.h>
20 #include<OpenSLES_Platform.h>
21 
22 /*---------------------------------------------------------------------------*/
23 /* OH Buffer Queue Interface                                                    */
24 /*---------------------------------------------------------------------------*/
25 
26 extern const SLInterfaceID SL_IID_OH_BUFFERQUEUE;
27 
28 struct SLOHBufferQueueItf_;
29 typedef const struct SLOHBufferQueueItf_ * const * SLOHBufferQueueItf;
30 
31 typedef void (SLAPIENTRY *SlOHBufferQueueCallback)(
32     SLOHBufferQueueItf caller,
33     void *pContext,
34     SLuint32 size
35 );
36 
37 /** OH Buffer queue state **/
38 
39 typedef struct SLOHBufferQueueState_ {
40     SLuint32 count;
41     SLuint32 index;
42 } SLOHBufferQueueState;
43 
44 
45 struct SLOHBufferQueueItf_ {
46     SLresult (*Enqueue) (
47         SLOHBufferQueueItf self,
48         const void *buffer,
49         SLuint32 size
50     );
51     SLresult (*Clear) (
52         SLOHBufferQueueItf self
53     );
54     SLresult (*GetState) (
55         SLOHBufferQueueItf self,
56         SLOHBufferQueueState *state
57     );
58     SLresult (*GetBuffer) (
59         SLOHBufferQueueItf self,
60         SLuint8** buffer,
61         SLuint32& size
62     );
63     SLresult (*RegisterCallback) (
64         SLOHBufferQueueItf self,
65         SlOHBufferQueueCallback callback,
66         void* pContext
67     );
68 };
69 #endif
70