Home | History | Annotate | Download | only in src
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifdef ANDROID
     18 #include "media/AudioEffect.h"
     19 #include "hardware/audio_effect.h"
     20 #endif
     21 
     22 /* Interface structures */
     23 
     24 typedef struct Object_interface {
     25     const struct SLObjectItf_ *mItf;    // const
     26     // field mThis would be redundant within an IObject, so we substitute mEngine
     27     CEngine *mEngine;               // const
     28     const ClassTable *mClass;       // const
     29     SLuint32 mInstanceID;           // const for debugger and for RPC, 0 means unpublished
     30     slObjectCallback mCallback;
     31     void *mContext;
     32     unsigned mGottenMask;           ///< bit-mask of interfaces exposed or added, then gotten
     33     unsigned mLossOfControlMask;    // interfaces with loss of control enabled
     34     unsigned mAttributesMask;       // attributes which have changed since last sync
     35 #if USE_PROFILES & USE_PROFILES_BASE
     36     SLint32 mPriority;
     37 #endif
     38     pthread_mutex_t mMutex;
     39 #ifdef USE_DEBUG
     40     // Only keep the pthread_t, not the kernel tid, because pthread_self() is very fast
     41     // (typically just arithmetic on the stack pointer). But a gettid() is a kernel call
     42     // and so too slow to do every time a mutex is acquired. However, we can determine
     43     // the kernel tid from the pthread_t.
     44     pthread_t mOwner;
     45     const char *mFile;
     46     int mLine;
     47     volatile int32_t mGeneration;   // read without a lock, incremented with a lock
     48 #endif
     49     pthread_cond_t mCond;
     50     SLuint8 mState;                 // really SLuint32, but SLuint8 to save space
     51 #if USE_PROFILES & USE_PROFILES_BASE
     52     SLuint8 mPreemptable;           // really SLboolean, but SLuint8 to save space
     53 #else
     54     SLuint8 mPadding;
     55 #endif
     56     SLuint8 mStrongRefCount;        // number of strong references to this object
     57     // (object cannot be destroyed as long as > 0, and referrers _prefer_ it stay in Realized state)
     58     // for best alignment, do not add any fields here
     59 #define INTERFACES_Default 1
     60     SLuint8 mInterfaceStates[INTERFACES_Default];    // state of each of interface
     61     // do not add any fields here
     62 } IObject;
     63 
     64 #include "locks.h"
     65 
     66 typedef struct {
     67     const struct SL3DCommitItf_ *mItf;
     68     IObject *mThis;
     69     SLboolean mDeferred;
     70     SLuint32 mGeneration;   // incremented each master clock cycle
     71     SLuint32 mWaiting;      // number of threads waiting in Commit
     72 } I3DCommit;
     73 
     74 enum CartesianSphericalActive {
     75     CARTESIAN_COMPUTED_SPHERICAL_SET,
     76     CARTESIAN_REQUESTED_SPHERICAL_SET,
     77     CARTESIAN_UNKNOWN_SPHERICAL_SET,
     78     CARTESIAN_SET_SPHERICAL_COMPUTED,   // not in 1.0.1
     79     CARTESIAN_SET_SPHERICAL_REQUESTED,  // not in 1.0.1
     80     CARTESIAN_SET_SPHERICAL_UNKNOWN
     81 };
     82 
     83 typedef struct {
     84     const struct SL3DDopplerItf_ *mItf;
     85     IObject *mThis;
     86     // The API allows client to specify either Cartesian and spherical velocities.
     87     // But an implementation will likely prefer one or the other. So for
     88     // maximum portablity, we maintain both units and an indication of which
     89     // unit was set most recently. In addition, we keep a flag saying whether
     90     // the other unit has been derived yet. It can take significant time
     91     // to compute the other unit, so this may be deferred to another thread.
     92     // For this reason we also keep an indication of whether the secondary
     93     // has been computed yet, and its accuracy.
     94     // Though only one unit is primary at a time, a union is inappropriate:
     95     // the application might read in both units (not in 1.0.1),
     96     // and due to multi-threading concerns.
     97     SLVec3D mVelocityCartesian;
     98     struct {
     99         SLmillidegree mAzimuth;
    100         SLmillidegree mElevation;
    101         SLmillidegree mSpeed;
    102     } mVelocitySpherical;
    103     enum CartesianSphericalActive mVelocityActive;
    104     SLpermille mDopplerFactor;
    105 } I3DDoppler;
    106 
    107 typedef struct {
    108     const struct SL3DGroupingItf_ *mItf;
    109     IObject *mThis;
    110     C3DGroup *mGroup;   // strong reference to associated group or NULL
    111 } I3DGrouping;
    112 
    113 enum AnglesVectorsActive {
    114     ANGLES_COMPUTED_VECTORS_SET,    // not in 1.0.1
    115     ANGLES_REQUESTED_VECTORS_SET,   // not in 1.0.1
    116     ANGLES_UNKNOWN_VECTORS_SET,
    117     ANGLES_SET_VECTORS_COMPUTED,
    118     ANGLES_SET_VECTORS_REQUESTED,
    119     ANGLES_SET_VECTORS_UNKNOWN
    120 };
    121 
    122 typedef struct {
    123     const struct SL3DLocationItf_ *mItf;
    124     IObject *mThis;
    125     SLVec3D mLocationCartesian;
    126     struct {
    127         SLmillidegree mAzimuth;
    128         SLmillidegree mElevation;
    129         SLmillimeter mDistance;
    130     } mLocationSpherical;
    131     enum CartesianSphericalActive mLocationActive;
    132     struct {
    133         SLmillidegree mHeading;
    134         SLmillidegree mPitch;
    135         SLmillidegree mRoll;
    136     } mOrientationAngles;
    137     struct {
    138         SLVec3D mFront;
    139         SLVec3D mAbove;
    140         SLVec3D mUp;
    141     } mOrientationVectors;
    142     enum AnglesVectorsActive mOrientationActive;
    143     // Rotations can be slow, so are deferred.
    144     SLmillidegree mTheta;
    145     SLVec3D mAxis;
    146     SLboolean mRotatePending;
    147 } I3DLocation;
    148 
    149 typedef struct {
    150     const struct SL3DMacroscopicItf_ *mItf;
    151     IObject *mThis;
    152     struct {
    153         SLmillimeter mWidth;
    154         SLmillimeter mHeight;
    155         SLmillimeter mDepth;
    156     } mSize;
    157     struct {
    158         SLmillimeter mHeading;
    159         SLmillimeter mPitch;
    160         SLmillimeter mRoll;
    161     } mOrientationAngles;
    162     struct {
    163         SLVec3D mFront;
    164         SLVec3D mAbove;
    165         SLVec3D mUp;
    166     } mOrientationVectors;
    167     enum AnglesVectorsActive mOrientationActive;
    168     // Rotations can be slow, so are deferred.
    169     SLmillidegree mTheta;
    170     SLVec3D mAxis;
    171     SLboolean mRotatePending;
    172 } I3DMacroscopic;
    173 
    174 typedef struct {
    175     const struct SL3DSourceItf_ *mItf;
    176     IObject *mThis;
    177     SLboolean mHeadRelative;
    178     SLboolean mRolloffMaxDistanceMute;
    179     SLmillimeter mMaxDistance;
    180     SLmillimeter mMinDistance;
    181     SLmillidegree mConeInnerAngle;
    182     SLmillidegree mConeOuterAngle;
    183     SLmillibel mConeOuterLevel;
    184     SLpermille mRolloffFactor;
    185     SLpermille mRoomRolloffFactor;
    186     SLuint8 mDistanceModel;
    187 } I3DSource;
    188 
    189 typedef struct {
    190     const struct SLAudioDecoderCapabilitiesItf_ *mItf;
    191     IObject *mThis;
    192 } IAudioDecoderCapabilities;
    193 
    194 typedef struct {
    195     const struct SLAudioEncoderItf_ *mItf;
    196     IObject *mThis;
    197     SLAudioEncoderSettings mSettings;
    198 } IAudioEncoder;
    199 
    200 typedef struct {
    201     const struct SLAudioEncoderCapabilitiesItf_ *mItf;
    202     IObject *mThis;
    203 } IAudioEncoderCapabilities;
    204 
    205 typedef struct {
    206     const struct SLAudioIODeviceCapabilitiesItf_ *mItf;
    207     IObject *mThis;
    208     slAvailableAudioInputsChangedCallback mAvailableAudioInputsChangedCallback;
    209     void *mAvailableAudioInputsChangedContext;
    210     slAvailableAudioOutputsChangedCallback mAvailableAudioOutputsChangedCallback;
    211     void *mAvailableAudioOutputsChangedContext;
    212     slDefaultDeviceIDMapChangedCallback mDefaultDeviceIDMapChangedCallback;
    213     void *mDefaultDeviceIDMapChangedContext;
    214 } IAudioIODeviceCapabilities;
    215 
    216 typedef struct {
    217     const struct SLBassBoostItf_ *mItf;
    218     IObject *mThis;
    219     SLboolean mEnabled;
    220     SLpermille mStrength;
    221 #if defined(ANDROID)
    222     effect_descriptor_t mBassBoostDescriptor;
    223     android::sp<android::AudioEffect> mBassBoostEffect;
    224 #endif
    225 } IBassBoost;
    226 
    227 typedef struct BufferQueue_interface {
    228     const struct SLBufferQueueItf_ *mItf;
    229     IObject *mThis;
    230     SLBufferQueueState mState;
    231     slBufferQueueCallback mCallback;
    232     void *mContext;
    233     // originally SLuint32, but range-checked down to SLuint16
    234     SLuint16 mNumBuffers;
    235     /*SLboolean*/ SLuint16 mClearRequested;
    236     BufferHeader *mArray;
    237     BufferHeader *mFront, *mRear;
    238 #ifdef ANDROID
    239     SLuint32 mSizeConsumed;
    240     bool mCallbackPending;
    241 #endif
    242     // saves a malloc in the typical case
    243 #define BUFFER_HEADER_TYPICAL 4
    244     BufferHeader mTypical[BUFFER_HEADER_TYPICAL+1];
    245 } IBufferQueue;
    246 
    247 #define MAX_DEVICE 2    // hard-coded array size for default in/out
    248 
    249 typedef struct {
    250     const struct SLDeviceVolumeItf_ *mItf;
    251     IObject *mThis;
    252     SLint32 mVolume[MAX_DEVICE];
    253 } IDeviceVolume;
    254 
    255 typedef struct {
    256     const struct SLDynamicInterfaceManagementItf_ *mItf;
    257     IObject *mThis;
    258     slDynamicInterfaceManagementCallback mCallback;
    259     void *mContext;
    260 } IDynamicInterfaceManagement;
    261 
    262 typedef struct {
    263     const struct SLDynamicSourceItf_ *mItf;
    264     IObject *mThis;
    265     SLDataSource *mDataSource;
    266 } IDynamicSource;
    267 
    268 // private
    269 
    270 struct EnableLevel {
    271     SLboolean mEnable;
    272     SLmillibel mSendLevel;
    273 };
    274 
    275 // indexes into IEffectSend.mEnableLevels
    276 
    277 #define AUX_ENVIRONMENTALREVERB 0
    278 #define AUX_PRESETREVERB        1
    279 #define AUX_MAX                 2
    280 
    281 typedef struct {
    282     const struct SLEffectSendItf_ *mItf;
    283     IObject *mThis;
    284     struct EnableLevel mEnableLevels[AUX_MAX];  // wet enable and volume per effect type
    285 } IEffectSend;
    286 
    287 typedef struct Engine_interface {
    288     const struct SLEngineItf_ *mItf;
    289     IObject *mThis;
    290     SLboolean mLossOfControlGlobal;
    291 #ifdef USE_SDL
    292     COutputMix *mOutputMix; // SDL pulls PCM from an arbitrary IOutputMixExt
    293 #endif
    294     // Each engine is its own universe.
    295     SLuint32 mInstanceCount;
    296     unsigned mInstanceMask; // 1 bit per active object
    297     unsigned mChangedMask;  // objects which have changed since last sync
    298 #define MAX_INSTANCE 32     // maximum active objects per engine, see mInstanceMask
    299     IObject *mInstances[MAX_INSTANCE];
    300     SLboolean mShutdown;
    301     SLboolean mShutdownAck;
    302     // SLuint32 mVersion;      // 0xXXYYZZ where XX=major, YY=minor, ZZ=step
    303 } IEngine;
    304 
    305 typedef struct {
    306     const struct SLEngineCapabilitiesItf_ *mItf;
    307     IObject *mThis;
    308     SLboolean mThreadSafe;
    309     // const
    310     SLuint32 mMaxIndexLED;
    311     SLuint32 mMaxIndexVibra;
    312 } IEngineCapabilities;
    313 
    314 typedef struct {
    315     const struct SLEnvironmentalReverbItf_ *mItf;
    316     IObject *mThis;
    317     SLEnvironmentalReverbSettings mProperties;
    318 #if defined(ANDROID)
    319     effect_descriptor_t mEnvironmentalReverbDescriptor;
    320     android::sp<android::AudioEffect> mEnvironmentalReverbEffect;
    321 #endif
    322 } IEnvironmentalReverb;
    323 
    324 struct EqualizerBand {
    325     SLmilliHertz mMin;
    326     SLmilliHertz mCenter;
    327     SLmilliHertz mMax;
    328 };
    329 
    330 #if defined(ANDROID)
    331 #define MAX_EQ_BANDS 0
    332 #else
    333 #define MAX_EQ_BANDS 4  // compile-time limit, runtime limit may be smaller
    334 #endif
    335 
    336 typedef struct {
    337     const struct SLEqualizerItf_ *mItf;
    338     IObject *mThis;
    339     SLboolean mEnabled;
    340     SLuint16 mPreset;
    341 #if 0 < MAX_EQ_BANDS
    342     SLmillibel mLevels[MAX_EQ_BANDS];
    343 #endif
    344     // const to end of struct
    345     SLuint16 mNumPresets;
    346     SLuint16 mNumBands;
    347 #if !defined(ANDROID)
    348     const struct EqualizerBand *mBands;
    349     const struct EqualizerPreset *mPresets;
    350 #endif
    351     SLmillibel mBandLevelRangeMin;
    352     SLmillibel mBandLevelRangeMax;
    353 #if defined(ANDROID)
    354     effect_descriptor_t mEqDescriptor;
    355     android::sp<android::AudioEffect> mEqEffect;
    356 #endif
    357 } IEqualizer;
    358 
    359 #define MAX_LED_COUNT 32
    360 
    361 typedef struct {
    362     const struct SLLEDArrayItf_ *mItf;
    363     IObject *mThis;
    364     SLuint32 mLightMask;
    365     SLHSL mColors[MAX_LED_COUNT];
    366     // const
    367     SLuint8 mCount;
    368 } ILEDArray;
    369 
    370 typedef struct {
    371     const struct SLMetadataExtractionItf_ *mItf;
    372     IObject *mThis;
    373     SLuint32 mKeySize;
    374     const void *mKey;
    375     SLuint32 mKeyEncoding;
    376     const SLchar *mValueLangCountry;
    377     SLuint32 mValueEncoding;
    378     SLuint8 mFilterMask;
    379     int mKeyFilter;
    380 } IMetadataExtraction;
    381 
    382 typedef struct {
    383     const struct SLMetadataTraversalItf_ *mItf;
    384     IObject *mThis;
    385     SLuint32 mIndex;
    386     SLuint32 mMode;
    387     SLuint32 mCount;
    388     SLuint32 mSize;
    389 } IMetadataTraversal;
    390 
    391 typedef struct {
    392     const struct SLMIDIMessageItf_ *mItf;
    393     IObject *mThis;
    394     slMetaEventCallback mMetaEventCallback;
    395     void *mMetaEventContext;
    396     slMIDIMessageCallback mMessageCallback;
    397     void *mMessageContext;
    398     SLuint8 mMessageTypes;
    399 } IMIDIMessage;
    400 
    401 typedef struct {
    402     const struct SLMIDIMuteSoloItf_ *mItf;
    403     IObject *mThis;
    404     SLuint16 mChannelMuteMask;
    405     SLuint16 mChannelSoloMask;
    406     SLuint32 mTrackMuteMask;
    407     SLuint32 mTrackSoloMask;
    408     // const
    409     SLuint16 mTrackCount;
    410 } IMIDIMuteSolo;
    411 
    412 typedef struct {
    413     const struct SLMIDITempoItf_ *mItf;
    414     IObject *mThis;
    415     SLuint32 mTicksPerQuarterNote;
    416     SLuint32 mMicrosecondsPerQuarterNote;
    417 } IMIDITempo;
    418 
    419 typedef struct {
    420     const struct SLMIDITimeItf_ *mItf;
    421     IObject *mThis;
    422     SLuint32 mDuration;
    423     SLuint32 mPosition;
    424     SLuint32 mStartTick;
    425     SLuint32 mNumTicks;
    426 } IMIDITime;
    427 
    428 typedef struct {
    429     const struct SLMuteSoloItf_ *mItf;
    430     IObject *mThis;
    431     // fields that were formerly here are now at CAudioPlayer
    432 } IMuteSolo;
    433 
    434 #define MAX_TRACK 32        // see mActiveMask
    435 
    436 typedef struct {
    437     const struct SLOutputMixItf_ *mItf;
    438     IObject *mThis;
    439     slMixDeviceChangeCallback mCallback;
    440     void *mContext;
    441 } IOutputMix;
    442 
    443 #ifdef USE_OUTPUTMIXEXT
    444 typedef struct {
    445     const struct SLOutputMixExtItf_ *mItf;
    446     IObject *mThis;
    447     unsigned mActiveMask;   // 1 bit per active track
    448     Track mTracks[MAX_TRACK];
    449     SLboolean mDestroyRequested;    ///< Mixer to acknowledge application's call to Object::Destroy
    450 } IOutputMixExt;
    451 #endif
    452 
    453 typedef struct {
    454     const struct SLPitchItf_ *mItf;
    455     IObject *mThis;
    456     SLpermille mPitch;
    457     // const
    458     SLpermille mMinPitch;
    459     SLpermille mMaxPitch;
    460 } IPitch;
    461 
    462 typedef struct Play_interface {
    463     const struct SLPlayItf_ *mItf;
    464     IObject *mThis;
    465     SLuint32 mState;
    466     // next 2 fields are read-only to application
    467     SLmillisecond mDuration;
    468     SLmillisecond mPosition;
    469     slPlayCallback mCallback;
    470     void *mContext;
    471     SLuint32 mEventFlags;
    472     // the ISeek trick of using a distinct value doesn't work here because it's readable by app
    473     SLmillisecond mMarkerPosition;
    474     SLmillisecond mPositionUpdatePeriod; // Zero means do not do position updates (FIXME ~0)
    475 #ifdef USE_OUTPUTMIXEXT
    476     SLuint32 mFrameUpdatePeriod;         // mPositionUpdatePeriod in frame units
    477     SLmillisecond mLastSeekPosition;     // Last known accurate position, set at Seek
    478     SLuint32 mFramesSinceLastSeek;       // Frames mixed since last known accurate position
    479     SLuint32 mFramesSincePositionUpdate; // Frames mixed since last position update callback
    480 #endif
    481 } IPlay;
    482 
    483 typedef struct {
    484     const struct SLPlaybackRateItf_ *mItf;
    485     IObject *mThis;
    486     SLpermille mRate;
    487     SLuint32 mProperties;
    488     // const after initialization
    489     SLpermille mMinRate;
    490     SLpermille mMaxRate;
    491     SLpermille mStepSize;
    492     SLuint32 mCapabilities;
    493 } IPlaybackRate;
    494 
    495 typedef struct {
    496     const struct SLPrefetchStatusItf_ *mItf;
    497     IObject *mThis;
    498     SLuint32 mStatus;
    499     SLpermille mLevel;
    500     slPrefetchCallback mCallback;
    501     void *mContext;
    502     SLuint32 mCallbackEventsMask;
    503     SLpermille mFillUpdatePeriod;
    504 #ifdef ANDROID
    505     /** FIXME used to call PrefetchStatus callback with object unlocked prior to return from API */
    506     slPrefetchCallback mDeferredPrefetchCallback;
    507     void *mDeferredPrefetchContext;
    508     SLuint32 mDeferredPrefetchEvents;
    509 #endif
    510 } IPrefetchStatus;
    511 
    512 typedef struct {
    513     const struct SLPresetReverbItf_ *mItf;
    514     IObject *mThis;
    515     SLuint16 mPreset;
    516 #if defined(ANDROID)
    517     effect_descriptor_t mPresetReverbDescriptor;
    518     android::sp<android::AudioEffect> mPresetReverbEffect;
    519 #endif
    520 } IPresetReverb;
    521 
    522 typedef struct {
    523     const struct SLRatePitchItf_ *mItf;
    524     IObject *mThis;
    525     SLpermille mRate;
    526     // const
    527     SLpermille mMinRate;
    528     SLpermille mMaxRate;
    529 } IRatePitch;
    530 
    531 typedef struct {
    532     const struct SLRecordItf_ *mItf;
    533     IObject *mThis;
    534     SLuint32 mState;
    535     SLmillisecond mDurationLimit;
    536     SLmillisecond mPosition;
    537     slRecordCallback mCallback;
    538     void *mContext;
    539     SLuint32 mCallbackEventsMask;
    540     SLmillisecond mMarkerPosition;
    541     SLmillisecond mPositionUpdatePeriod;
    542 } IRecord;
    543 
    544 typedef struct {
    545     const struct SLSeekItf_ *mItf;
    546     IObject *mThis;
    547     SLmillisecond mPos;     // mPos != SL_TIME_UNKNOWN means pending seek request
    548     SLboolean mLoopEnabled;
    549     SLmillisecond mStartPos;
    550     SLmillisecond mEndPos;
    551 } ISeek;
    552 
    553 typedef struct {
    554     const struct SLThreadSyncItf_ *mItf;
    555     IObject *mThis;
    556     SLboolean mInCriticalSection;
    557     SLuint32 mWaiting;  // number of threads waiting
    558     pthread_t mOwner;
    559 } IThreadSync;
    560 
    561 typedef struct {
    562     const struct SLVibraItf_ *mItf;
    563     IObject *mThis;
    564     SLboolean mVibrate;
    565     SLmilliHertz mFrequency;
    566     SLpermille mIntensity;
    567 } IVibra;
    568 
    569 typedef struct {
    570     const struct SLVirtualizerItf_ *mItf;
    571     IObject *mThis;
    572     SLboolean mEnabled;
    573     SLpermille mStrength;
    574 #if defined(ANDROID)
    575     effect_descriptor_t mVirtualizerDescriptor;
    576     android::sp<android::AudioEffect> mVirtualizerEffect;
    577 #endif
    578 } IVirtualizer;
    579 
    580 typedef struct {
    581     const struct SLVisualizationItf_ *mItf;
    582     IObject *mThis;
    583     slVisualizationCallback mCallback;
    584     void *mContext;
    585     SLmilliHertz mRate;
    586 } IVisualization;
    587 
    588 typedef struct /*Volume_interface*/ {
    589     const struct SLVolumeItf_ *mItf;
    590     IObject *mThis;
    591     // Values as specified by the application
    592     SLmillibel mLevel;
    593     SLpermille mStereoPosition;
    594     SLuint8 /*SLboolean*/ mMute;
    595     SLuint8 /*SLboolean*/ mEnableStereoPosition;
    596 } IVolume;
    597 
    598 typedef struct {
    599     const struct XAEngineItf_ *mItf;
    600     IObject *mThis;
    601 } IXAEngine;
    602 
    603 #define NB_SUPPORTED_STREAMS 1 // only one (video) stream supported in this implementation
    604 typedef struct {
    605     const struct XAStreamInformationItf_ *mItf;
    606     IObject *mThis;
    607     xaStreamEventChangeCallback mCallback;
    608     void *mContext;
    609     XAboolean mActiveStreams[NB_SUPPORTED_STREAMS];
    610 #ifdef ANDROID
    611     android::Vector<StreamInfo> mStreamInfoTable;
    612 #endif
    613 } IStreamInformation;
    614 
    615 typedef struct {
    616     const struct XAVideoDecoderCapabilitiesItf_ *mItf;
    617     IObject *mThis;
    618 } IVideoDecoderCapabilities;
    619 
    620 /* Class structures */
    621 
    622 /*typedef*/ struct C3DGroup_struct {
    623     IObject mObject;
    624 #define INTERFACES_3DGroup 6 // see MPH_to_3DGroup in MPH_to.c for list of interfaces
    625     SLuint8 mInterfaceStates2[INTERFACES_3DGroup - INTERFACES_Default];
    626     IDynamicInterfaceManagement mDynamicInterfaceManagement;
    627     I3DLocation m3DLocation;
    628     I3DDoppler m3DDoppler;
    629     I3DSource m3DSource;
    630     I3DMacroscopic m3DMacroscopic;
    631     // remaining are per-instance private fields not associated with an interface
    632     unsigned mMemberMask;   // set of member objects
    633 } /*C3DGroup*/;
    634 
    635 #ifdef ANDROID
    636 
    637 // FIXME Move these into the I... section above
    638 
    639 typedef struct {
    640     const struct SLAndroidEffectItf_ *mItf;
    641     IObject *mThis;
    642     android::KeyedVector<SLuint32, android::AudioEffect* > *mEffects;
    643 } IAndroidEffect;
    644 
    645 typedef struct {
    646     const struct SLAndroidEffectCapabilitiesItf_ *mItf;
    647     IObject *mThis;
    648     SLuint32 mNumFx;
    649     effect_descriptor_t* mFxDescriptors;
    650 } IAndroidEffectCapabilities;
    651 
    652 typedef struct {
    653     const struct SLAndroidEffectSendItf_ *mItf;
    654     IObject *mThis;
    655     // only one send per interface for now (1 bus)
    656     SLboolean mEnabled;
    657     SLmillibel mSendLevel; //android::KeyedVector<SLuint32, SLmillibel> mSendLevels;
    658 } IAndroidEffectSend;
    659 
    660 typedef struct {
    661     const struct SLAndroidConfigurationItf_ *mItf;
    662     IObject *mThis;
    663 } IAndroidConfiguration;
    664 
    665 typedef struct {
    666     const struct SLAndroidBufferQueueItf_ *mItf;
    667     IObject *mThis;
    668     SLAndroidBufferQueueState mState;
    669     slAndroidBufferQueueCallback mCallback;
    670     SLuint32 mCallbackEventsMask;
    671     void *mContext;
    672     SLuint16 mNumBuffers;
    673     AndroidBufferType_type mBufferType;
    674     AdvancedBufferHeader *mBufferArray;
    675     AdvancedBufferHeader *mFront, *mRear;
    676     bool mEOS;  // whether EOS has been enqueued; never reset
    677 } IAndroidBufferQueue;
    678 
    679 typedef struct {
    680     const struct SLAndroidAcousticEchoCancellationItf_ *mItf;
    681     IObject *mThis;
    682     SLboolean mEnabled;
    683     effect_descriptor_t mAECDescriptor;
    684     android::sp<android::AudioEffect> mAECEffect;
    685 } IAndroidAcousticEchoCancellation;
    686 
    687 typedef struct {
    688     const struct SLAndroidAutomaticGainControlItf_ *mItf;
    689     IObject *mThis;
    690     SLboolean mEnabled;
    691      effect_descriptor_t mAGCDescriptor;
    692      android::sp<android::AudioEffect> mAGCEffect;
    693 } IAndroidAutomaticGainControl;
    694 
    695 typedef struct {
    696     const struct SLAndroidNoiseSuppressionItf_ *mItf;
    697     IObject *mThis;
    698     SLboolean mEnabled;
    699     effect_descriptor_t mNSDescriptor;
    700     android::sp<android::AudioEffect> mNSEffect;
    701 } IAndroidNoiseSuppression;
    702 
    703 #endif
    704