17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci#ifndef OPENSLES_OPENHARMONY_H 177777dab0Sopenharmony_ci#define OPENSLES_OPENHARMONY_H 187777dab0Sopenharmony_ci 197777dab0Sopenharmony_ci#ifdef __cplusplus 207777dab0Sopenharmony_ciextern "C" { 217777dab0Sopenharmony_ci#endif 227777dab0Sopenharmony_ci 237777dab0Sopenharmony_ci#include "OpenSLES.h" 247777dab0Sopenharmony_ci#include "OpenSLES_Platform.h" 257777dab0Sopenharmony_ci 267777dab0Sopenharmony_ci/*---------------------------------------------------------------------------*/ 277777dab0Sopenharmony_ci/* OH Buffer Queue Interface */ 287777dab0Sopenharmony_ci/*---------------------------------------------------------------------------*/ 297777dab0Sopenharmony_ci 307777dab0Sopenharmony_ciextern const SLInterfaceID SL_IID_OH_BUFFERQUEUE; 317777dab0Sopenharmony_ci 327777dab0Sopenharmony_cistruct SLOHBufferQueueItf_; 337777dab0Sopenharmony_citypedef const struct SLOHBufferQueueItf_ * const * SLOHBufferQueueItf; 347777dab0Sopenharmony_ci 357777dab0Sopenharmony_citypedef void (SLAPIENTRY *SlOHBufferQueueCallback)( 367777dab0Sopenharmony_ci SLOHBufferQueueItf caller, 377777dab0Sopenharmony_ci void *pContext, 387777dab0Sopenharmony_ci SLuint32 size 397777dab0Sopenharmony_ci); 407777dab0Sopenharmony_ci 417777dab0Sopenharmony_ci/** OH Buffer queue state **/ 427777dab0Sopenharmony_ci 437777dab0Sopenharmony_citypedef struct SLOHBufferQueueState_ { 447777dab0Sopenharmony_ci SLuint32 count; 457777dab0Sopenharmony_ci SLuint32 index; 467777dab0Sopenharmony_ci} SLOHBufferQueueState; 477777dab0Sopenharmony_ci 487777dab0Sopenharmony_ci 497777dab0Sopenharmony_cistruct SLOHBufferQueueItf_ { 507777dab0Sopenharmony_ci SLresult (*Enqueue) ( 517777dab0Sopenharmony_ci SLOHBufferQueueItf self, 527777dab0Sopenharmony_ci const void *buffer, 537777dab0Sopenharmony_ci SLuint32 size 547777dab0Sopenharmony_ci ); 557777dab0Sopenharmony_ci SLresult (*Clear) ( 567777dab0Sopenharmony_ci SLOHBufferQueueItf self 577777dab0Sopenharmony_ci ); 587777dab0Sopenharmony_ci SLresult (*GetState) ( 597777dab0Sopenharmony_ci SLOHBufferQueueItf self, 607777dab0Sopenharmony_ci SLOHBufferQueueState *state 617777dab0Sopenharmony_ci ); 627777dab0Sopenharmony_ci SLresult (*GetBuffer) ( 637777dab0Sopenharmony_ci SLOHBufferQueueItf self, 647777dab0Sopenharmony_ci SLuint8** buffer, 657777dab0Sopenharmony_ci SLuint32* size 667777dab0Sopenharmony_ci ); 677777dab0Sopenharmony_ci SLresult (*RegisterCallback) ( 687777dab0Sopenharmony_ci SLOHBufferQueueItf self, 697777dab0Sopenharmony_ci SlOHBufferQueueCallback callback, 707777dab0Sopenharmony_ci void* pContext 717777dab0Sopenharmony_ci ); 727777dab0Sopenharmony_ci}; 737777dab0Sopenharmony_ci 747777dab0Sopenharmony_ci#ifdef __cplusplus 757777dab0Sopenharmony_ci} /* extern "C" */ 767777dab0Sopenharmony_ci#endif 777777dab0Sopenharmony_ci 787777dab0Sopenharmony_ci#endif /* OPENSLES_OPENHARMONY_H */ 79