9.0 自定义横屏播放开机动画,开机铃声不同步问题

MTK-onlin上面有关于自定义开机动画铃声的FAQ,介绍的很详细,[FAQ21245]l;
但是横屏播放开机动画没有做介绍;
下面是介绍开机动画旋转的问题:
应为要预置开机铃声,在bootanimation里面压缩开机铃声系统是不支持的;所以要按照P版本开机动画的预制方式,使用Mtkbootanimation;

Mtkbootanimation  是走vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
而控制Rect(dinfo.h, dinfo.w)  播放方向的是在BootAnimation.cpp
status_t BootAnimation::readyToRun() {
默认控制是竖屏播放的,并且宽度和高度也要调整
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
           dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
           ----改为
 sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
           dinfo.h, dinfo.w, PIXEL_FORMAT_RGB_565); 
       eOrientation270根据实际情况修改,Rect(dinfo.h, dinfo.w)和上面一致
 t.setDisplayProjection(dtoken, DisplayState::eOrientation270, Rect(dinfo.h, dinfo.w), Rect(dinfo.h, dinfo.w));

以上便是Mtkbootanimation播放方向的问题;

然后就是开机铃声不同步问题:
网上尝试了很多方法,最后终结下

frameworks/av/media/libmediaplayerservice/MediaPlayerService.cpp
-    BatteryNotifier::getInstance().noteResetVideo();
+    //BatteryNotifier::getInstance().noteResetVideo();
frameworks/av/services/audioflinger/AudioFlinger.cpp
-      mSystemReady(false)
+      mSystemReady(true)
frameworks/av/services/audioflinger/Threads.cpp
     status_t status = NO_ERROR;
 
-    if (event->mRequiresSystemReady && !mSystemReady) {
+   /* if (event->mRequiresSystemReady && !mSystemReady) {
         event->mWaitStatus = false;
         mPendingConfigEvents.add(event);
         return status;
-    }
+    }*/
     mConfigEvents.add(event);
     ALOGV("sendConfigEvent_l() num events %zu event %d", mConfigEvents.size(), event->mType);
     mWaitWorkCV.signal();
@@ -973,7 +973,7 @@ void AudioFlinger::ThreadBase::releaseWakeLock_l()
 }
 
 void AudioFlinger::ThreadBase::getPowerManager_l() {
-    if (mSystemReady && mPowerManager == 0) {
+    if ( mPowerManager == 0) {
         // use checkService() to avoid blocking if power service is not up yet
         sp<IBinder> binder =
             defaultServiceManager()->checkService(String16("power"));
@@ -2929,6 +2929,9 @@ void AudioFlinger::PlaybackThread::checkSilentMode_l()
 // shared by MIXER and DIRECT, overridden by DUPLICATING
 ssize_t AudioFlinger::PlaybackThread::threadLoop_write()
 {
+       if (mPowerManager == 0)    
+       acquireWakeLock();
vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
-            status_t err = mCondition.waitRelative(mMyLock, s2ns(4));
+            status_t err = mCondition.waitRelative(mMyLock, s2ns(40));
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

心有纤纤结

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值