1 /*
2  * Copyright © 2016 Mozilla Foundation
3  *
4  * This program is made available under an ISC-style license.  See the
5  * accompanying file LICENSE for details.
6  */
7 
8 #ifndef _CUBEB_SLES_H_
9 #define _CUBEB_SLES_H_
10 #include <SLES/OpenSLES.h>
11 
12 static SLresult
cubeb_get_sles_engine(SLObjectItf * pEngine,SLuint32 numOptions,const SLEngineOption * pEngineOptions,SLuint32 numInterfaces,const SLInterfaceID * pInterfaceIds,const SLboolean * pInterfaceRequired)13 cubeb_get_sles_engine(SLObjectItf * pEngine, SLuint32 numOptions,
14                       const SLEngineOption * pEngineOptions,
15                       SLuint32 numInterfaces,
16                       const SLInterfaceID * pInterfaceIds,
17                       const SLboolean * pInterfaceRequired)
18 {
19   return slCreateEngine(pEngine, numOptions, pEngineOptions, numInterfaces,
20                         pInterfaceIds, pInterfaceRequired);
21 }
22 
23 static void
cubeb_destroy_sles_engine(SLObjectItf * self)24 cubeb_destroy_sles_engine(SLObjectItf * self)
25 {
26   if (*self != NULL) {
27     (**self)->Destroy(*self);
28     *self = NULL;
29   }
30 }
31 
32 static SLresult
cubeb_realize_sles_engine(SLObjectItf self)33 cubeb_realize_sles_engine(SLObjectItf self)
34 {
35   return (*self)->Realize(self, SL_BOOLEAN_FALSE);
36 }
37 
38 #endif
39