SDL中文论坛

标题: webrtc修改汇总 [打印本页]

作者: ancientcc    时间: 2017-1-3 10:35
标题: webrtc修改汇总
本帖最后由 ancientcc 于 2018-10-21 11:52 编辑

<webrtc>/common_audio/signal_processing/dot_product_with_scale.cc改名为dot_product_with_scale1.cc。——在NDK编译时,用dot_product_with_scale.cc总是被认为dot_product_with_scale.c,然后出了找不到源文件错。


作者: ancientcc    时间: 2017-2-24 22:03
本帖最后由 ancientcc 于 2017-2-24 22:06 编辑

webrtc-20170224,个人认为Windows平台的的声音设备AudioDeviceWindowCore有BUG!_ptrClientOut->IsFormatSupported会失败。

AudioDeviceWindowCore::CoreAudioIsSupported中的p->PlayoutDevices()返回2,#0时执行以下语句
  1. hr = _ptrClientOut->GetMixFormat(&pWfxOut);
复制代码
hr是S_OK,pWfxOut是以下格式。
  1. (webrtcvoiceengine.cc:1019): webrtc: wFormatTag     : 0xFFFE (65534)
  2. (webrtcvoiceengine.cc:1019): webrtc: nChannels      : 2
  3. (webrtcvoiceengine.cc:1019): webrtc: nSamplesPerSec : 44100
  4. (webrtcvoiceengine.cc:1019): webrtc: nAvgBytesPerSec: 352800
  5. (webrtcvoiceengine.cc:1019): webrtc: nBlockAlign    : 8
  6. (webrtcvoiceengine.cc:1019): webrtc: wBitsPerSample : 32
  7. (webrtcvoiceengine.cc:1019): webrtc: cbSize         : 22
复制代码
_ptrClientOut->IsFormatSupported能成功。

但在#1,GetMixFormat返回的hr是S_OK,pWfxOut是以下格式。
  1. (webrtcvoiceengine.cc:1019): webrtc: wFormatTag     : 0xFFFE (65534)
  2. (webrtcvoiceengine.cc:1019): webrtc: nChannels      : 4
  3. (webrtcvoiceengine.cc:1019): webrtc: nSamplesPerSec : 48000
  4. (webrtcvoiceengine.cc:1019): webrtc: nAvgBytesPerSec: 768000
  5. (webrtcvoiceengine.cc:1019): webrtc: nBlockAlign    : 16
  6. (webrtcvoiceengine.cc:1019): webrtc: wBitsPerSample : 32
  7. (webrtcvoiceengine.cc:1019): webrtc: cbSize         : 22
复制代码

_ptrClientOut->IsFormatSupported却失败了!试过把IsFormatSupported前去尝试Wfx.nChannels,但还是失败。

这个失改会导致AudioDeviceModuleImpl::CreatePlatformSpecificObjects()时不能创建ptrAudioDevice,程序非法退出。

解决这问题有两种办法,一是重用Webrtc旧版本的AudioDeviceWindowsWave,二是用我自个写的基于SDL的AudioDeviceSDL。考虑到要向后兼容,决定使用AudioDeviceSDL。AudioDeviceSDL在Android是有问题的,为此只是用在Windows。




欢迎光临 SDL中文论坛 (http://www.libsdl.cn/bbs/) Powered by Discuz! X3.3