summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/itf/IAndroidBufferQueue.c4
-rw-r--r--src/itf/IAndroidEffectCapabilities.c8
-rw-r--r--src/itf/IAndroidEffectSend.c4
-rw-r--r--src/itf/IEnvironmentalReverb.c40
-rw-r--r--src/itf/IObject.c5
-rw-r--r--src/itf/IPresetReverb.c8
-rw-r--r--src/itf/IRecord.c20
-rw-r--r--src/itf/IVolume.c16
8 files changed, 52 insertions, 53 deletions
diff --git a/src/itf/IAndroidBufferQueue.c b/src/itf/IAndroidBufferQueue.c
index b669fa7..a3f6073 100644
--- a/src/itf/IAndroidBufferQueue.c
+++ b/src/itf/IAndroidBufferQueue.c
@@ -323,9 +323,9 @@ static SLresult IAndroidBufferQueue_GetCallbackEventsMask(SLAndroidBufferQueueIt
result = SL_RESULT_PARAMETER_INVALID;
} else {
IAndroidBufferQueue *thiz = (IAndroidBufferQueue *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLuint32 callbackEventsMask = thiz->mCallbackEventsMask;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pEventFlags = callbackEventsMask;
result = SL_RESULT_SUCCESS;
}
diff --git a/src/itf/IAndroidEffectCapabilities.c b/src/itf/IAndroidEffectCapabilities.c
index c0a40d3..923b6a7 100644
--- a/src/itf/IAndroidEffectCapabilities.c
+++ b/src/itf/IAndroidEffectCapabilities.c
@@ -28,12 +28,12 @@ static SLresult IAndroidEffectCapabilities_QueryNumEffects(SLAndroidEffectCapabi
result = SL_RESULT_PARAMETER_INVALID;
} else {
IAndroidEffectCapabilities *thiz = (IAndroidEffectCapabilities *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
*pNumSupportedAudioEffects = thiz->mNumFx;
result = SL_RESULT_SUCCESS;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -50,7 +50,7 @@ static SLresult IAndroidEffectCapabilities_QueryEffect(SLAndroidEffectCapabiliti
if (index > thiz->mNumFx) {
result = SL_RESULT_PARAMETER_INVALID;
} else {
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
if (NULL != pEffectType) {
*pEffectType = (SLInterfaceID) &thiz->mFxDescriptors[index].type;
}
@@ -63,7 +63,7 @@ static SLresult IAndroidEffectCapabilities_QueryEffect(SLAndroidEffectCapabiliti
*pNameSize > len ? len : *pNameSize );
*pNameSize = len;
}
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
result = SL_RESULT_SUCCESS;
}
diff --git a/src/itf/IAndroidEffectSend.c b/src/itf/IAndroidEffectSend.c
index 5207137..b075753 100644
--- a/src/itf/IAndroidEffectSend.c
+++ b/src/itf/IAndroidEffectSend.c
@@ -122,7 +122,7 @@ static SLresult IAndroidEffectSend_GetDirectLevel(SLAndroidEffectSendItf self,
result = SL_RESULT_PARAMETER_INVALID;
} else {
IAndroidEffectSend *thiz = (IAndroidEffectSend *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
CAudioPlayer *ap = (SL_OBJECTID_AUDIOPLAYER == InterfaceToObjectID(thiz)) ?
(CAudioPlayer *) thiz->mThis : NULL;
if (NULL != ap) {
@@ -132,7 +132,7 @@ static SLresult IAndroidEffectSend_GetDirectLevel(SLAndroidEffectSendItf self,
SL_LOGE("invalid interface: not attached to an AudioPlayer");
result = SL_RESULT_PARAMETER_INVALID;
}
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
diff --git a/src/itf/IEnvironmentalReverb.c b/src/itf/IEnvironmentalReverb.c
index 8ef71d3..22cbcf1 100644
--- a/src/itf/IEnvironmentalReverb.c
+++ b/src/itf/IEnvironmentalReverb.c
@@ -76,7 +76,7 @@ static SLresult IEnvironmentalReverb_GetRoomLevel(SLEnvironmentalReverbItf self,
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -90,7 +90,7 @@ static SLresult IEnvironmentalReverb_GetRoomLevel(SLEnvironmentalReverbItf self,
#endif
*pRoom = thiz->mProperties.roomLevel;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
@@ -138,7 +138,7 @@ static SLresult IEnvironmentalReverb_GetRoomHFLevel(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -152,7 +152,7 @@ static SLresult IEnvironmentalReverb_GetRoomHFLevel(
#endif
*pRoomHF = thiz->mProperties.roomHFLevel;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -197,7 +197,7 @@ static SLresult IEnvironmentalReverb_GetDecayTime(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -211,7 +211,7 @@ static SLresult IEnvironmentalReverb_GetDecayTime(
#endif
*pDecayTime = thiz->mProperties.decayTime;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -256,7 +256,7 @@ static SLresult IEnvironmentalReverb_GetDecayHFRatio(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -270,7 +270,7 @@ static SLresult IEnvironmentalReverb_GetDecayHFRatio(
#endif
*pDecayHFRatio = thiz->mProperties.decayHFRatio;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -317,7 +317,7 @@ static SLresult IEnvironmentalReverb_GetReflectionsLevel(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -331,7 +331,7 @@ static SLresult IEnvironmentalReverb_GetReflectionsLevel(
#endif
*pReflectionsLevel = thiz->mProperties.reflectionsLevel;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -376,7 +376,7 @@ static SLresult IEnvironmentalReverb_GetReflectionsDelay(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -390,7 +390,7 @@ static SLresult IEnvironmentalReverb_GetReflectionsDelay(
#endif
*pReflectionsDelay = thiz->mProperties.reflectionsDelay;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -437,7 +437,7 @@ static SLresult IEnvironmentalReverb_GetReverbLevel(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -451,7 +451,7 @@ static SLresult IEnvironmentalReverb_GetReverbLevel(
#endif
*pReverbLevel = thiz->mProperties.reverbLevel;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -496,7 +496,7 @@ static SLresult IEnvironmentalReverb_GetReverbDelay(
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -510,7 +510,7 @@ static SLresult IEnvironmentalReverb_GetReverbDelay(
#endif
*pReverbDelay = thiz->mProperties.reverbDelay;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -555,7 +555,7 @@ static SLresult IEnvironmentalReverb_GetDiffusion(SLEnvironmentalReverbItf self,
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -569,7 +569,7 @@ static SLresult IEnvironmentalReverb_GetDiffusion(SLEnvironmentalReverbItf self,
#endif
*pDiffusion = thiz->mProperties.diffusion;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
@@ -613,7 +613,7 @@ static SLresult IEnvironmentalReverb_GetDensity(SLEnvironmentalReverbItf self,
result = SL_RESULT_PARAMETER_INVALID;
} else {
IEnvironmentalReverb *thiz = (IEnvironmentalReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
#else
@@ -627,7 +627,7 @@ static SLresult IEnvironmentalReverb_GetDensity(SLEnvironmentalReverbItf self,
#endif
*pDensity = thiz->mProperties.density;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
}
SL_LEAVE_INTERFACE
diff --git a/src/itf/IObject.c b/src/itf/IObject.c
index f87c941..97d226a 100644
--- a/src/itf/IObject.c
+++ b/src/itf/IObject.c
@@ -289,10 +289,9 @@ static SLresult IObject_GetState(SLObjectItf self, SLuint32 *pState)
result = SL_RESULT_PARAMETER_INVALID;
} else {
IObject *thiz = (IObject *) self;
- // Note that the state is immediately obsolete, so a peek lock is safe
- object_lock_peek(thiz);
+ object_lock_shared(thiz);
SLuint8 state = thiz->mState;
- object_unlock_peek(thiz);
+ object_unlock_shared(thiz);
// Re-map the realizing, resuming, and suspending states
switch (state) {
case SL_OBJECT_STATE_REALIZING_1:
diff --git a/src/itf/IPresetReverb.c b/src/itf/IPresetReverb.c
index 540d892..25bd8c9 100644
--- a/src/itf/IPresetReverb.c
+++ b/src/itf/IPresetReverb.c
@@ -40,7 +40,7 @@ static SLresult IPresetReverb_SetPreset(SLPresetReverbItf self, SLuint16 preset)
case SL_REVERBPRESET_MEDIUMHALL:
case SL_REVERBPRESET_LARGEHALL:
case SL_REVERBPRESET_PLATE:
- interface_lock_poke(thiz);
+ interface_lock_exclusive(thiz);
thiz->mPreset = preset;
#if !defined(ANDROID)
result = SL_RESULT_SUCCESS;
@@ -52,7 +52,7 @@ static SLresult IPresetReverb_SetPreset(SLPresetReverbItf self, SLuint16 preset)
result = android_fx_statusToResult(status);
}
#endif
- interface_unlock_poke(thiz);
+ interface_unlock_exclusive(thiz);
break;
default:
result = SL_RESULT_PARAMETER_INVALID;
@@ -70,7 +70,7 @@ static SLresult IPresetReverb_GetPreset(SLPresetReverbItf self, SLuint16 *pPrese
result = SL_RESULT_PARAMETER_INVALID;
} else {
IPresetReverb *thiz = (IPresetReverb *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLuint16 preset = SL_REVERBPRESET_NONE;
#if !defined(ANDROID)
preset = thiz->mPreset;
@@ -83,7 +83,7 @@ static SLresult IPresetReverb_GetPreset(SLPresetReverbItf self, SLuint16 *pPrese
result = android_fx_statusToResult(status);
}
#endif
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pPreset = preset;
}
diff --git a/src/itf/IRecord.c b/src/itf/IRecord.c
index 79233f6..8d241f3 100644
--- a/src/itf/IRecord.c
+++ b/src/itf/IRecord.c
@@ -29,12 +29,12 @@ static SLresult IRecord_SetRecordState(SLRecordItf self, SLuint32 state)
case SL_RECORDSTATE_RECORDING:
{
IRecord *thiz = (IRecord *) self;
- interface_lock_poke(thiz);
+ interface_lock_exclusive(thiz);
thiz->mState = state;
#ifdef ANDROID
android_audioRecorder_setRecordState(InterfaceToCAudioRecorder(thiz), state);
#endif
- interface_unlock_poke(thiz);
+ interface_unlock_exclusive(thiz);
result = SL_RESULT_SUCCESS;
}
break;
@@ -55,9 +55,9 @@ static SLresult IRecord_GetRecordState(SLRecordItf self, SLuint32 *pState)
if (NULL == pState) {
result = SL_RESULT_PARAMETER_INVALID;
} else {
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLuint32 state = thiz->mState;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pState = state;
result = SL_RESULT_SUCCESS;
}
@@ -165,9 +165,9 @@ static SLresult IRecord_GetCallbackEventsMask(SLRecordItf self, SLuint32 *pEvent
result = SL_RESULT_PARAMETER_INVALID;
} else {
IRecord *thiz = (IRecord *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLuint32 callbackEventsMask = thiz->mCallbackEventsMask;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pEventFlags = callbackEventsMask;
result = SL_RESULT_SUCCESS;
}
@@ -220,9 +220,9 @@ static SLresult IRecord_GetMarkerPosition(SLRecordItf self, SLmillisecond *pMsec
result = SL_RESULT_PARAMETER_INVALID;
} else {
IRecord *thiz = (IRecord *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLmillisecond markerPosition = thiz->mMarkerPosition;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pMsec = markerPosition;
result = SL_RESULT_SUCCESS;
}
@@ -261,9 +261,9 @@ static SLresult IRecord_GetPositionUpdatePeriod(SLRecordItf self, SLmillisecond
result = SL_RESULT_PARAMETER_INVALID;
} else {
IRecord *thiz = (IRecord *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLmillisecond positionUpdatePeriod = thiz->mPositionUpdatePeriod;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pMsec = positionUpdatePeriod;
result = SL_RESULT_SUCCESS;
}
diff --git a/src/itf/IVolume.c b/src/itf/IVolume.c
index b5438d6..52f4da4 100644
--- a/src/itf/IVolume.c
+++ b/src/itf/IVolume.c
@@ -49,9 +49,9 @@ static SLresult IVolume_GetVolumeLevel(SLVolumeItf self, SLmillibel *pLevel)
result = SL_RESULT_PARAMETER_INVALID;
} else {
IVolume *thiz = (IVolume *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLmillibel level = thiz->mLevel;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pLevel = level;
result = SL_RESULT_SUCCESS;
}
@@ -102,9 +102,9 @@ static SLresult IVolume_GetMute(SLVolumeItf self, SLboolean *pMute)
result = SL_RESULT_PARAMETER_INVALID;
} else {
IVolume *thiz = (IVolume *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLboolean mute = thiz->mMute;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pMute = mute;
result = SL_RESULT_SUCCESS;
}
@@ -141,9 +141,9 @@ static SLresult IVolume_IsEnabledStereoPosition(SLVolumeItf self, SLboolean *pEn
result = SL_RESULT_PARAMETER_INVALID;
} else {
IVolume *thiz = (IVolume *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLboolean enable = thiz->mEnableStereoPosition;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pEnable = enable;
result = SL_RESULT_SUCCESS;
}
@@ -182,9 +182,9 @@ static SLresult IVolume_GetStereoPosition(SLVolumeItf self, SLpermille *pStereoP
result = SL_RESULT_PARAMETER_INVALID;
} else {
IVolume *thiz = (IVolume *) self;
- interface_lock_peek(thiz);
+ interface_lock_shared(thiz);
SLpermille stereoPosition = thiz->mStereoPosition;
- interface_unlock_peek(thiz);
+ interface_unlock_shared(thiz);
*pStereoPosition = stereoPosition;
result = SL_RESULT_SUCCESS;
}