码迷,mamicode.com
首页 > 移动开发 > 详细

Android截屏--桌面同时按住power与音量-截图-截图无声音

时间:2015-05-08 13:05:52      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:android   frameworks   

问题描述:

【测试步骤】1、桌面同时按住power与音量-截图
【测试结果】截图无声音
【预期结果】不应该无声音

这是一个google common问题,问题原因如下:
decode does not complete when first capture.
solution: for audio sound pool case, skip EOS delay time to faster to send out EOS. 


修改位置:frameworks/av/media/libstagefright/AwesomePlayer.cpp

void AwesomePlayer::postCheckAudioStatusEvent(int64_t delayUs) {
    Mutex::Autolock autoLock(mAudioLock);
    if (mAudioStatusEventPending) {
        return;
    }
    mAudioStatusEventPending = true;
    // Do not honor delay when looping in order to limit audio gap
    if (mFlags & (LOOPING | AUTO_LOOPING)) {
        delayUs = 0;
    }
#ifdef MTK_AOSP_ENHANCEMENT
    // AudioCache needn't delay post EOS, just AudioOutput which with a valid UID needed
    if(!mUIDValid){
        ALOGI("AudioCache needn't delay post EOS!!!");
        //<2015.05.07> modify for start
        delayUs = 0;
        //<2015.05.07> modify for end
    }
#endif
    mQueue.postEventWithDelay(mCheckAudioStatusEvent, delayUs);
}
把delayUs = 3000;改为delayUs = 0;

Android截屏--桌面同时按住power与音量-截图-截图无声音

标签:android   frameworks   

原文地址:http://blog.csdn.net/deng0zhaotai/article/details/45576359

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!