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,
14                       SLuint32 numOptions,
15                       const SLEngineOption * pEngineOptions,
16                       SLuint32 numInterfaces,
17                       const SLInterfaceID * pInterfaceIds,
18                       const SLboolean * pInterfaceRequired)
19 {
20   return slCreateEngine(pEngine,
21                         numOptions,
22                         pEngineOptions,
23                         numInterfaces,
24                         pInterfaceIds,
25                         pInterfaceRequired);
26 }
27 
28 static void
cubeb_destroy_sles_engine(SLObjectItf * self)29 cubeb_destroy_sles_engine(SLObjectItf * self)
30 {
31   if (*self != NULL) {
32       (**self)->Destroy(*self);
33       *self = NULL;
34   }
35 }
36 
37 static SLresult
cubeb_realize_sles_engine(SLObjectItf self)38 cubeb_realize_sles_engine(SLObjectItf self)
39 {
40   return (*self)->Realize(self, SL_BOOLEAN_FALSE);
41 }
42 
43 #endif
44