mt6735 视频播放器播放视频时,在立体声与单声道之间切换无变化
时间:10-02
整理:3721RD
点击:
[Audio App]视频播放器播放视频时,在立体声与单声道之间切换无变化
[DESCRIPTION]
部分客户客户使用第三方视频播放器,有立体声与单声道之间切换,发现切换后无作用
原因是由于在HAL层默认没有处理上层发的stereo 转mono的命令,所以会没有效果,
[SOLUTION]
可按如下修改,添加相关处理:
1修改AudiomtkHardware.cpp
添加:static String8 keySetStereo2MonoMode = String8("EnableStereoOutput");
2.修改status_t AudioMTKHardware::setParameters(const String8 &keyValuePairs)
在EXIT_SETPARAMETERS:
之前添加:
if (param.getInt(keySetStereo2MonoMode, value) == NO_ERROR) {
ALOGD("setParameters(): %s value=%d", keyValuePairs.string(),value);
((AudioMTKStreamManager*)mAudioMTKStreamManager)->ForceSterer2Mono(value);
}
2.修改AudioMTKStreamManager.h
添加public方法定义:status_t ForceSterer2Mono(bool flag);
status_t AudioMTKStreamManager::ForceSterer2Mono(bool flag)
{
// force all stream to standby
ALOGD("ForceSterer2Mono = %d",flag);
if (mStreamOutVector.size()) {
for (size_t i = 0; i < mStreamOutVector.size() ; i++) {
AudioMTKStreamOut *pTempOut = (AudioMTKStreamOut *)mStreamOutVector.valueAt(i);
pTempOut->SetStereoToMonoFlagForce(flag);
}
}
return NO_ERROR;
}
3.修改AudioMTKStreamOut.h
t添加定义: status_t SetStereoToMonoFlagForce(bool flag);
status_t AudioMTKStreamOut::SetStereoToMonoFlagForce(bool flag)
{
ALOGD("SetStereoToMonoFlagForce = %d",flag);
mSteroToMono = flag;
return NO_ERROR;
}
[DESCRIPTION]
部分客户客户使用第三方视频播放器,有立体声与单声道之间切换,发现切换后无作用
原因是由于在HAL层默认没有处理上层发的stereo 转mono的命令,所以会没有效果,
[SOLUTION]
可按如下修改,添加相关处理:
1修改AudiomtkHardware.cpp
添加:static String8 keySetStereo2MonoMode = String8("EnableStereoOutput");
2.修改status_t AudioMTKHardware::setParameters(const String8 &keyValuePairs)
在EXIT_SETPARAMETERS:
之前添加:
if (param.getInt(keySetStereo2MonoMode, value) == NO_ERROR) {
ALOGD("setParameters(): %s value=%d", keyValuePairs.string(),value);
((AudioMTKStreamManager*)mAudioMTKStreamManager)->ForceSterer2Mono(value);
}
2.修改AudioMTKStreamManager.h
添加public方法定义:status_t ForceSterer2Mono(bool flag);
status_t AudioMTKStreamManager::ForceSterer2Mono(bool flag)
{
// force all stream to standby
ALOGD("ForceSterer2Mono = %d",flag);
if (mStreamOutVector.size()) {
for (size_t i = 0; i < mStreamOutVector.size() ; i++) {
AudioMTKStreamOut *pTempOut = (AudioMTKStreamOut *)mStreamOutVector.valueAt(i);
pTempOut->SetStereoToMonoFlagForce(flag);
}
}
return NO_ERROR;
}
3.修改AudioMTKStreamOut.h
t添加定义: status_t SetStereoToMonoFlagForce(bool flag);
status_t AudioMTKStreamOut::SetStereoToMonoFlagForce(bool flag)
{
ALOGD("SetStereoToMonoFlagForce = %d",flag);
mSteroToMono = flag;
return NO_ERROR;
}