#define ANDROID_SL_MILLIBEL_MAX 0
#include <binder/ProcessState.h>
#include "android/android_sles_conversions.h"
-#include "android/android_OutputMix.h"
#include "android/android_defs.h"
#include "android/android_SfPlayer.h"
-#include "android/android_AudioRecorder.h"
#endif
#ifdef USE_OUTPUTMIXEXT
} ClassTable;
// BufferHeader describes each element of a BufferQueue, other than the data
-
typedef struct {
const void *mBuffer;
SLuint32 mSize;
} BufferHeader;
-#ifdef __cplusplus
-#define this this_
+#ifdef ANDROID
+// Holds information about all commands that can be passed alongside an MPEG-2 TS buffer
+// Is used with buffers of type kAndroidBufferTypeMpeg2Ts
+typedef struct {
+ SLuint32 mTsCmdCode;
+ SLAuint64 mPts;
+} Mpeg2TsCommands;
+
+// Union of the different structures to hold items stored in an AdvancedBufferHeader
+// when an item comes from an AndroidBufferQueue as the data source, it's a command
+// when an item is output to an AndroidBufferQueue as the data sink, it's a message (or metadata)
+typedef union {
+ Mpeg2TsCommands mTsCmdData;
+} AdvancedBufferItems;
+
+// AdvancedBufferHeader describes each element of an AndroidBufferQueue, other than the data
+// and associated messages
+typedef struct {
+ const void *mDataBuffer;
+ SLuint32 mDataSize;
+ SLuint32 mDataSizeConsumed;
+ AdvancedBufferItems mItems;
+ const void *mBufferContext;
+ SLuint32 mBufferState;
+} AdvancedBufferHeader;
#endif
#ifdef USE_SNDFILE
#ifdef ANDROID
// FIXME this include is done here so the effect structures and enums have been defined. Messy.
#include "android/android_Effect.h"
-#include "android/android_AVPlayer.h"
+#include "android/android_GenericPlayer.h"
+#include "android/android_GenericMediaPlayer.h"
+#include "android/android_AudioSfDecoder.h"
+#include "android/android_AudioToCbRenderer.h"
#include "android/android_StreamPlayer.h"
#include "android/android_LocAVPlayer.h"
#endif
extern /*static*/ int IID_to_MPH(const SLInterfaceID iid);
extern /*static*/ const struct MPH_init MPH_init_table[MPH_MAX];
-extern SLresult checkInterfaces(const ClassTable *class__,
+extern SLresult checkInterfaces(const ClassTable *clazz,
SLuint32 numInterfaces, const SLInterfaceID *pInterfaceIds,
const SLboolean *pInterfaceRequired, unsigned *pExposedMask);
-extern IObject *construct(const ClassTable *class__,
+extern IObject *construct(const ClassTable *clazz,
unsigned exposedMask, SLEngineItf engine);
extern const ClassTable *objectIDtoClass(SLuint32 objectID);
extern const struct SLInterfaceID_ SL_IID_array[MPH_MAX];
extern SLuint32 IObjectToObjectID(IObject *object);
-extern void IObject_Publish(IObject *this);
+extern void IObject_Publish(IObject *thiz);
extern void IObject_Destroy(SLObjectItf self);
// Map an interface to it's "object ID" (which is really a class ID).
// Note: this operation is undefined on IObject, as it lacks an mThis.
// If you have an IObject, then use IObjectToObjectID directly.
-#define InterfaceToObjectID(this) IObjectToObjectID((this)->mThis)
+#define InterfaceToObjectID(thiz) IObjectToObjectID((thiz)->mThis)
// Map an interface to it's corresponding IObject.
// Note: this operation is undefined on IObject, as it lacks an mThis.
// If you have an IObject, then you're done -- you already have what you need.
-#define InterfaceToIObject(this) ((this)->mThis)
+#define InterfaceToIObject(thiz) ((thiz)->mThis)
-#define InterfaceToCAudioPlayer(this) (((CAudioPlayer*)InterfaceToIObject(this)))
+#define InterfaceToCAudioPlayer(thiz) (((CAudioPlayer*)InterfaceToIObject(thiz)))
-#define InterfaceToCAudioRecorder(this) (((CAudioRecorder*)InterfaceToIObject(this)))
+#define InterfaceToCAudioRecorder(thiz) (((CAudioRecorder*)InterfaceToIObject(thiz)))
#ifdef ANDROID
-#include "android/android_Player.h"
-#include "android/android_AudioPlayer.h"
+#include "android/MediaPlayer_to_android.h"
+#include "android/OutputMix_to_android.h"
+#include "android/AudioPlayer_to_android.h"
+#include "android/AudioRecorder_to_android.h"
#endif
extern predestroy_t C3DGroup_PreDestroy(void *self);
#define ATTR_NONE ((unsigned) 0x0) // none
#define ATTR_GAIN ((unsigned) 0x1 << 0) // player volume, channel mute, channel solo,
// player stereo position, player mute
-#define ATTR_TRANSPORT ((unsigned) 0x1 << 1) // play state, looping
-#define ATTR_POSITION ((unsigned) 0x1 << 2) // requested position (a.k.a. seek position)
-#define ATTR_ENQUEUE ((unsigned) 0x1 << 3) // buffer queue became non-empty and in playing state
+#define ATTR_TRANSPORT ((unsigned) 0x1 << 1) // play state, looping
+#define ATTR_POSITION ((unsigned) 0x1 << 2) // requested position (a.k.a. seek position)
+#define ATTR_BQ_ENQUEUE ((unsigned) 0x1 << 3) // buffer queue became non-empty and in playing state
+#define ATTR_ABQ_ENQUEUE ((unsigned) 0x1 << 4) // Android buffer queue became non-empty and
+ // in playing state
#include "trace.h"
extern SLresult IBufferQueue_RegisterCallback(SLBufferQueueItf self,
slBufferQueueCallback callback, void *pContext);
-extern bool IsInterfaceInitialized(IObject *this, unsigned MPH);
+extern bool IsInterfaceInitialized(IObject *thiz, unsigned MPH);
extern SLresult AcquireStrongRef(IObject *object, SLuint32 expectedObjectID);
extern void ReleaseStrongRef(IObject *object);
extern void ReleaseStrongRefAndUnlockExclusive(IObject *object);
extern CEngine *theOneTrueEngine;
extern pthread_mutex_t theOneTrueMutex;
extern unsigned theOneTrueRefCount;
+
+extern LI_API SLresult liCreateEngine(SLObjectItf *pEngine, SLuint32 numOptions,
+ const SLEngineOption *pEngineOptions, SLuint32 numInterfaces,
+ const SLInterfaceID *pInterfaceIds, const SLboolean *pInterfaceRequired,
+ const ClassTable *pCEngine_class);
+extern LI_API SLresult liQueryNumSupportedInterfaces(SLuint32 *pNumSupportedInterfaces,
+ const ClassTable *clazz);
+extern LI_API SLresult liQuerySupportedInterfaces(SLuint32 index, SLInterfaceID *pInterfaceId,
+ const ClassTable *clazz);