summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShashi Kumar <sulege@codeaurora.org>2012-03-27 16:24:29 +0530
committerGiulio Cervera <giulio.cervera@gmail.com>2012-08-01 22:11:16 +0200
commit79ba28cd297aaf12bf1d5e1101ba01238012fe1d (patch)
treed0996aef4d653ef1858c6ed20046e84563d3dda4
parenta140247172bfb4f2ebeaa4f922e8fa374aabc27f (diff)
downloadandroid_frameworks_base-79ba28cd297aaf12bf1d5e1101ba01238012fe1d.tar.gz
android_frameworks_base-79ba28cd297aaf12bf1d5e1101ba01238012fe1d.tar.bz2
android_frameworks_base-79ba28cd297aaf12bf1d5e1101ba01238012fe1d.zip
frameworks/base: Added more log messages in LPAPlayer
- Added more log messages in LPAPlayer for better debugging (cherry picked from commit 585d32158ab2c13009dbb015f47551c235cdb1f3) Change-Id: I8f7968da367aaefe2ead70b848237cdc452e8842
-rw-r--r--media/libstagefright/LPAPlayer.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/media/libstagefright/LPAPlayer.cpp b/media/libstagefright/LPAPlayer.cpp
index 1359d3f3343..0ee527b6bae 100644
--- a/media/libstagefright/LPAPlayer.cpp
+++ b/media/libstagefright/LPAPlayer.cpp
@@ -743,10 +743,13 @@ void LPAPlayer::decoderThreadEntry() {
audio_register_memory();
while (1) {
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
-
+ LOGV("mem_request_mutex locked: %d", __LINE__);
if (killDecoderThread) {
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
break;
}
@@ -760,22 +763,30 @@ void LPAPlayer::decoderThreadEntry() {
mReachedEOS, bIsA2DPEnabled, mAudioSinkOpen, asyncReset, mIsDriverStarted);
LOGV("decoderThreadEntry: waiting on decoder_cv");
pthread_cond_wait(&decoder_cv, &mem_request_mutex);
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
LOGV("decoderThreadEntry: received a signal to wake up");
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
continue;
}
List<BuffersAllocated>::iterator it = memBuffersRequestQueue.begin();
BuffersAllocated buf = *it;
memBuffersRequestQueue.erase(it);
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
//Queue the buffers back to Request queue
if (mReachedEOS || (bIsA2DPEnabled && !mAudioSinkOpen) || asyncReset || a2dpDisconnectPause) {
LOGV("%s: mReachedEOS %d bIsA2DPEnabled %d ", __func__, mReachedEOS, bIsA2DPEnabled);
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
+ LOGV("mem_request_mutex locked: %d", __LINE__);
memBuffersRequestQueue.push_back(buf);
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
}
//Queue up the buffers for writing either for A2DP or LPA Driver
else {
@@ -817,9 +828,13 @@ void LPAPlayer::decoderThreadEntry() {
}
} else {
/* Put the buffer back into requestQ */
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
+ LOGV("mem_request_mutex locked: %d", __LINE__);
memBuffersRequestQueue.push_back(buf);
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
/* This is zero byte buffer - no need to put in response Q*/
if (mObserver && mReachedEOS && memBuffersResponseQueue.empty()) {
LOGV("Posting EOS event to AwesomePlayer");
@@ -975,9 +990,13 @@ void LPAPlayer::eventThreadEntry() {
pthread_mutex_unlock(&mem_response_mutex);
// Post buffer to request Q
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
+ LOGV("mem_request_mutex locked: %d", __LINE__);
memBuffersRequestQueue.push_back(buf);
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
pthread_cond_signal(&decoder_cv);
}
@@ -1086,7 +1105,9 @@ void LPAPlayer::A2DPThreadEntry() {
LOGV("A2DPThreadEntry:: received signal to wake up");
// A2DP got disabled -- Queue up everything back to Request Queue
if (!bIsA2DPEnabled) {
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
+ LOGV("mem_request_mutex locked: %d", __LINE__);
while (!memBuffersResponseQueue.empty()) {
LOGV("BUF transfer");
List<BuffersAllocated>::iterator it = memBuffersResponseQueue.begin();
@@ -1094,7 +1115,9 @@ void LPAPlayer::A2DPThreadEntry() {
memBuffersRequestQueue.push_back(buf);
memBuffersResponseQueue.erase(it);
}
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
}
pthread_mutex_unlock(&mem_response_mutex);
}
@@ -1178,10 +1201,14 @@ void LPAPlayer::A2DPThreadEntry() {
LOGV("Posting EOS event to AwesomePlayer");
mObserver->postAudioEOS();
}
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
+ LOGV("mem_request_mutex locked: %d", __LINE__);
memBuffersRequestQueue.push_back(buf);
if (killA2DPThread) {
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
break;
}
//flush out old buffer
@@ -1197,7 +1224,9 @@ void LPAPlayer::A2DPThreadEntry() {
}
pthread_mutex_unlock(&mem_response_mutex);
}
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
// Signal decoder thread when a buffer is put back to request Q
pthread_cond_signal(&decoder_cv);
}
@@ -1557,10 +1586,14 @@ void LPAPlayer::requestAndWaitForDecoderThreadExit() {
if (!decoderThreadAlive)
return;
+ LOGV("mem_request_mutex locking: %d", __LINE__);
pthread_mutex_lock(&mem_request_mutex);
+ LOGV("mem_request_mutex locked: %d", __LINE__);
killDecoderThread = true;
pthread_cond_signal(&decoder_cv);
+ LOGV("mem_request_mutex unlocking: %d", __LINE__);
pthread_mutex_unlock(&mem_request_mutex);
+ LOGV("mem_request_mutex unlocked: %d", __LINE__);
pthread_join(decoderThread,NULL);
LOGV("decoder thread killed");