OSDN Git Service

Add some logging to track down where ANR happens during MediaPlayer._release().
authorJames Dong <jdong@google.com>
Thu, 19 May 2011 22:56:50 +0000 (15:56 -0700)
committerJames Dong <jdong@google.com>
Mon, 23 May 2011 16:36:31 +0000 (09:36 -0700)
o add a log message in AwesomePlayer::reset before acquiring the lock

Change-Id: I9f228f615f99c03c394e9d0dd78c855c0b9fcfbb
related-to-bug: 4409547

media/libstagefright/AwesomePlayer.cpp
media/libstagefright/OMXCodec.cpp

index a8e0a4d..5962454 100644 (file)
@@ -400,6 +400,7 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
 }
 
 void AwesomePlayer::reset() {
+    LOGI("reset");
     Mutex::Autolock autoLock(mLock);
     reset_l();
 }
@@ -413,8 +414,10 @@ void AwesomePlayer::reset_l() {
                     Playback::STOP, 0);
             mDecryptHandle = NULL;
             mDrmManagerClient = NULL;
+            LOGI("DRM manager client stopped");
     }
 
+
     if (mFlags & PLAYING) {
         uint32_t params = IMediaPlayerService::kBatteryDataTrackDecoder;
         if ((mAudioSource != NULL) && (mAudioSource != mAudioTrack)) {
@@ -447,6 +450,7 @@ void AwesomePlayer::reset_l() {
         mPreparedCondition.wait(mLock);
     }
 
+    LOGI("cancel player events");
     cancelPlayerEvents();
 
     mWVMExtractor.clear();
@@ -496,6 +500,7 @@ void AwesomePlayer::reset_l() {
             usleep(1000);
         }
         IPCThreadState::self()->flushCommands();
+        LOGI("video decoder shutdown completed");
     }
 
     mDurationUs = -1;
index 5d26fd5..e96ce28 100644 (file)
@@ -3339,7 +3339,7 @@ status_t OMXCodec::start(MetaData *meta) {
 }
 
 status_t OMXCodec::stop() {
-    CODEC_LOGV("stop mState=%d", mState);
+    CODEC_LOGI("stop mState=%d", mState);
 
     Mutex::Autolock autoLock(mLock);
 
@@ -3401,6 +3401,7 @@ status_t OMXCodec::stop() {
         mLeftOverBuffer = NULL;
     }
 
+    CODEC_LOGI("stopping video source");
     mSource->stop();
 
     CODEC_LOGI("stopped in state %d", mState);