summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-22 01:28:18 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-22 01:28:18 +0000
commitad71caf25e31ecfc4ecf2c925e38fd87905fbc8e (patch)
tree74b759675cdc008e10e9b4fa94344e9dd54f8868 /media
parentacbd9492996348bf4565fbaa5a14772f0f4ace38 (diff)
parent3b6da6bfb50a1c0324fb4c87326d3a477944d5fe (diff)
downloadframeworks_av-ad71caf25e31ecfc4ecf2c925e38fd87905fbc8e.zip
frameworks_av-ad71caf25e31ecfc4ecf2c925e38fd87905fbc8e.tar.gz
frameworks_av-ad71caf25e31ecfc4ecf2c925e38fd87905fbc8e.tar.bz2
am 3b6da6bf: Merge "Move frameworks/av off private API."
* commit '3b6da6bfb50a1c0324fb4c87326d3a477944d5fe': Move frameworks/av off private API.
Diffstat (limited to 'media')
-rw-r--r--media/libmedia/AudioTrackShared.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp
index beb8547..d5b0b07 100644
--- a/media/libmedia/AudioTrackShared.cpp
+++ b/media/libmedia/AudioTrackShared.cpp
@@ -19,9 +19,9 @@
#include <private/media/AudioTrackShared.h>
#include <utils/Log.h>
-extern "C" {
-#include "../private/bionic_futex.h"
-}
+
+#include <linux/futex.h>
+#include <sys/syscall.h>
namespace android {
@@ -206,12 +206,12 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques
}
int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex);
if (!(old & CBLK_FUTEX_WAKE)) {
- int rc;
if (measure && !beforeIsValid) {
clock_gettime(CLOCK_MONOTONIC, &before);
beforeIsValid = true;
}
- int ret = __futex_syscall4(&cblk->mFutex,
+ errno = 0;
+ (void) syscall(__NR_futex, &cblk->mFutex,
mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts);
// update total elapsed time spent waiting
if (measure) {
@@ -230,16 +230,16 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques
before = after;
beforeIsValid = true;
}
- switch (ret) {
- case 0: // normal wakeup by server, or by binderDied()
- case -EWOULDBLOCK: // benign race condition with server
- case -EINTR: // wait was interrupted by signal or other spurious wakeup
- case -ETIMEDOUT: // time-out expired
+ switch (errno) {
+ case 0: // normal wakeup by server, or by binderDied()
+ case EWOULDBLOCK: // benign race condition with server
+ case EINTR: // wait was interrupted by signal or other spurious wakeup
+ case ETIMEDOUT: // time-out expired
// FIXME these error/non-0 status are being dropped
break;
default:
- ALOGE("%s unexpected error %d", __func__, ret);
- status = -ret;
+ status = errno;
+ ALOGE("%s unexpected error %s", __func__, strerror(status));
goto end;
}
}
@@ -295,8 +295,8 @@ void ClientProxy::binderDied()
audio_track_cblk_t* cblk = mCblk;
if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) {
// it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process
- (void) __futex_syscall4(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
- 1, NULL);
+ (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
+ 1);
}
}
@@ -304,8 +304,8 @@ void ClientProxy::interrupt()
{
audio_track_cblk_t* cblk = mCblk;
if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) {
- (void) __futex_syscall4(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
- 1, NULL);
+ (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
+ 1);
}
}
@@ -435,18 +435,18 @@ status_t AudioTrackClientProxy::waitStreamEndDone(const struct timespec *request
}
int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex);
if (!(old & CBLK_FUTEX_WAKE)) {
- int rc;
- int ret = __futex_syscall4(&cblk->mFutex,
+ errno = 0;
+ (void) syscall(__NR_futex, &cblk->mFutex,
mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts);
- switch (ret) {
- case 0: // normal wakeup by server, or by binderDied()
- case -EWOULDBLOCK: // benign race condition with server
- case -EINTR: // wait was interrupted by signal or other spurious wakeup
- case -ETIMEDOUT: // time-out expired
+ switch (errno) {
+ case 0: // normal wakeup by server, or by binderDied()
+ case EWOULDBLOCK: // benign race condition with server
+ case EINTR: // wait was interrupted by signal or other spurious wakeup
+ case ETIMEDOUT: // time-out expired
break;
default:
- ALOGE("%s unexpected error %d", __func__, ret);
- status = -ret;
+ status = errno;
+ ALOGE("%s unexpected error %s", __func__, strerror(status));
goto end;
}
}
@@ -535,8 +535,8 @@ status_t ServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush)
if (front != rear) {
int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex);
if (!(old & CBLK_FUTEX_WAKE)) {
- (void) __futex_syscall4(&cblk->mFutex,
- mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL);
+ (void) syscall(__NR_futex, &cblk->mFutex,
+ mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1);
}
}
front = rear;
@@ -638,8 +638,8 @@ void ServerProxy::releaseBuffer(Buffer* buffer)
ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum);
int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex);
if (!(old & CBLK_FUTEX_WAKE)) {
- (void) __futex_syscall4(&cblk->mFutex,
- mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL);
+ (void) syscall(__NR_futex, &cblk->mFutex,
+ mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1);
}
}
@@ -682,8 +682,8 @@ bool AudioTrackServerProxy::setStreamEndDone() {
bool old =
(android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0;
if (!old) {
- (void) __futex_syscall4(&mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
- 1, NULL);
+ (void) syscall(__NR_futex, &mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
+ 1);
}
return old;
}