diff options
author | Glenn Kasten <gkasten@google.com> | 2012-03-06 11:22:01 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-03-06 11:43:55 -0800 |
commit | 012ca6b4f69fb24385025c0e84b8f816525a3032 (patch) | |
tree | 707f045a8e82983d1650184a4be92493133a3148 /services/audioflinger | |
parent | 70a1577d42c6e222c98f0245e7b81b0e8bc238f7 (diff) | |
download | frameworks_av-012ca6b4f69fb24385025c0e84b8f816525a3032.zip frameworks_av-012ca6b4f69fb24385025c0e84b8f816525a3032.tar.gz frameworks_av-012ca6b4f69fb24385025c0e84b8f816525a3032.tar.bz2 |
Rename fields of AudioSessionRef
Change-Id: I9f2a66094135c4ac6bec2d3e9db3ac5fbf988ede
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 28 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 11 |
2 files changed, 19 insertions, 20 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index b972548..639e958 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -310,10 +310,10 @@ status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args) } result.append("Global session refs:\n"); - result.append(" session pid cnt\n"); + result.append(" session pid count\n"); for (size_t i = 0; i < mAudioSessionRefs.size(); i++) { AudioSessionRef *r = mAudioSessionRefs[i]; - snprintf(buffer, SIZE, " %7d %3d %3d\n", r->sessionid, r->pid, r->cnt); + snprintf(buffer, SIZE, " %7d %3d %3d\n", r->mSessionid, r->mPid, r->mCnt); result.append(buffer); } write(fd, result.string(), result.size()); @@ -1036,9 +1036,9 @@ void AudioFlinger::removeNotificationClient(pid_t pid) bool removed = false; for (size_t i = 0; i< num; ) { AudioSessionRef *ref = mAudioSessionRefs.itemAt(i); - ALOGV(" pid %d @ %d", ref->pid, i); - if (ref->pid == pid) { - ALOGV(" removing entry for pid %d session %d", pid, ref->sessionid); + ALOGV(" pid %d @ %d", ref->mPid, i); + if (ref->mPid == pid) { + ALOGV(" removing entry for pid %d session %d", pid, ref->mSessionid); mAudioSessionRefs.removeAt(i); delete ref; removed = true; @@ -5700,9 +5700,9 @@ void AudioFlinger::acquireAudioSessionId(int audioSession) size_t num = mAudioSessionRefs.size(); for (size_t i = 0; i< num; i++) { AudioSessionRef *ref = mAudioSessionRefs.editItemAt(i); - if (ref->sessionid == audioSession && ref->pid == caller) { - ref->cnt++; - ALOGV(" incremented refcount to %d", ref->cnt); + if (ref->mSessionid == audioSession && ref->mPid == caller) { + ref->mCnt++; + ALOGV(" incremented refcount to %d", ref->mCnt); return; } } @@ -5718,10 +5718,10 @@ void AudioFlinger::releaseAudioSessionId(int audioSession) size_t num = mAudioSessionRefs.size(); for (size_t i = 0; i< num; i++) { AudioSessionRef *ref = mAudioSessionRefs.itemAt(i); - if (ref->sessionid == audioSession && ref->pid == caller) { - ref->cnt--; - ALOGV(" decremented refcount to %d", ref->cnt); - if (ref->cnt == 0) { + if (ref->mSessionid == audioSession && ref->mPid == caller) { + ref->mCnt--; + ALOGV(" decremented refcount to %d", ref->mCnt); + if (ref->mCnt == 0) { mAudioSessionRefs.removeAt(i); delete ref; purgeStaleEffects_l(); @@ -5766,9 +5766,9 @@ void AudioFlinger::purgeStaleEffects_l() { bool found = false; for (size_t k = 0; k < numsessionrefs; k++) { AudioSessionRef *ref = mAudioSessionRefs.itemAt(k); - if (ref->sessionid == sessionid) { + if (ref->mSessionid == sessionid) { ALOGV(" session %d still exists for %d with %d refs", - sessionid, ref->pid, ref->cnt); + sessionid, ref->mPid, ref->mCnt); found = true; break; } diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index c7ac0a8..5d597e9 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -1570,12 +1570,11 @@ mutable Mutex mLock; // mutex for process, commands and handl // for mAudioSessionRefs only struct AudioSessionRef { - // FIXME rename parameter names when fields get "m" prefix - AudioSessionRef(int sessionid_, pid_t pid_) : - sessionid(sessionid_), pid(pid_), cnt(1) {} - const int sessionid; - const pid_t pid; - int cnt; + AudioSessionRef(int sessionid, pid_t pid) : + mSessionid(sessionid), mPid(pid), mCnt(1) {} + const int mSessionid; + const pid_t mPid; + int mCnt; }; friend class RecordThread; |