Closed nanguantong closed 2 years ago
@devopvoid can you please help to fix this bug and then release the maven or gradle jar packet to public repo?
For gradle please see How to fetch the jni libs with gradle #23.
For gradle please see How to fetch the jni libs with gradle #23.
Yeah, got it.
@devopvoid can you please help to fix this bug and then release the maven or gradle jar packet to public repo?
But this is realy a bug to call CoCreateInstance
before COM CoInitialize
, so hope to fix that.
This is not a bug. I'm not sure where you found the ComInitializer
.
This is not a bug. I'm not sure where you found the
ComInitializer
.
- WindowsAudio/VideoDeviceManager are based on Media Foundation.
- WindowsAudioDeviceManager.h initializes MFInitializer.
- MFInitializer calls MFStartup
- Then WindowsAudioDeviceManager constructor is executed
- Where CoCreateInstance works fine
In webrtc-jni\src\main\cpp\src\platform\windows\ComInitializer.cpp
call HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
I just only call in my maven test project on windows as following:
<dependency>
<groupId>dev.onvoid.webrtc</groupId>
<artifactId>webrtc-java</artifactId>
<version>0.4.0-SNAPSHOT</version>
</dependency>
Your error actually points to AudioProcessing
, not MediaDevices.getAudioCaptureDevices()
.
Could you provide your test-class?
In the meantime you can try 0.5.0-SNAPSHOT.
Your error actually points to
AudioProcessing
, notMediaDevices.getAudioCaptureDevices()
.Could you provide your test-class?
In the meantime you can try 0.5.0-SNAPSHOT.
0.5.0-SNAPSHOT used ok.
But 0.4.0 and (SNAPSHOT) still have this problem.
I won't fix it for 0.4.0-SNAPSHOT since 0.4.0 is released. The next snapshot version is 0.5.0-SNAPSHOT.
I won't fix it for 0.4.0-SNAPSHOT since 0.4.0 is released. The next snapshot version is 0.5.0-SNAPSHOT.
Yeh, no problem.
And then when use maven project, it's ok to run this jar, but error happened while running
List<AudioDevice> captureDevices = MediaDevices.getAudioCaptureDevices();
the native code not called when WindowsAudioDeviceManager inited as following
in
WebRTCContext::initialize
void WebRTCContext::initDeviceManagers() {ifdef _WIN32
endif
}
in
WindowsAudioDeviceManager