Hello @mpromonet , Thanks again for solving the issue #603 , I met another problem: video & audio capture devices mismatch from getMediaList.
Describe the bug
Below are clues I found, but I couldn't figure out solutions by now.
In PeerConnectionManager.cpp, m_videoaudiomap now can pair the videocap:// & audiocap:// correctly.
videocap:// & audiocap:// are from /sys/class/video4linux(or sound)
as for the api 'getMediaList', the list is made of 3 parts: GetVideoCaptureDeviceList, GetVideoSourceList, config.json.
in the 1st part, GetVideoCaptureDeviceList: It will call 'CapturerFactory::GetVideoCaptureDeviceList(...)' to get videocap://n, webrtc::VideoCaptureFactory::CreateDeviceInfo(), DeviceInfoV4l2::DeviceInfoV4l2()
then back to the 1st part of api 'getMediaList'. it tries to find the audiocap:// from m_videoaudiomap.
it find one, maybe videocap://1 => audiocap://1
when we try to setup a stream with media devices from 'getMediaList', {video: videocap://1, audiocap://1, options: options}, it could be a wrong pair.
I guess: the pair comes from m_videoaudiomap, but when connecting, the device name is related to the api 'const Json::Value PeerConnectionManager::getAudioDeviceList()'.
the audiocap://1 in m_videoaudiomap(/sys/class/sound) and audiocap://1 in CapturerFactory::GetAudioCaptureDeviceList(...)(webrtc::AudioDeviceModule::RecordingDevices()) may represent different devices.
Then video & audio doesn't match from api 'getMediaList'.
Screenshots
Desktop (please complete the following information):
Hello @mpromonet , Thanks again for solving the issue #603 , I met another problem: video & audio capture devices mismatch from getMediaList.
Describe the bug Below are clues I found, but I couldn't figure out solutions by now.
In PeerConnectionManager.cpp, m_videoaudiomap now can pair the videocap:// & audiocap:// correctly.
videocap:// & audiocap:// are from /sys/class/video4linux(or sound)
as for the api 'getMediaList', the list is made of 3 parts: GetVideoCaptureDeviceList, GetVideoSourceList, config.json.
in the 1st part, GetVideoCaptureDeviceList: It will call 'CapturerFactory::GetVideoCaptureDeviceList(...)' to get videocap://n, webrtc::VideoCaptureFactory::CreateDeviceInfo(), DeviceInfoV4l2::DeviceInfoV4l2()
then back to the 1st part of api 'getMediaList'. it tries to find the audiocap:// from m_videoaudiomap.
it find one, maybe videocap://1 => audiocap://1
when we try to setup a stream with media devices from 'getMediaList', {video: videocap://1, audiocap://1, options: options}, it could be a wrong pair.
I guess: the pair comes from m_videoaudiomap, but when connecting, the device name is related to the api 'const Json::Value PeerConnectionManager::getAudioDeviceList()'.
the audiocap://1 in m_videoaudiomap(/sys/class/sound) and audiocap://1 in CapturerFactory::GetAudioCaptureDeviceList(...)(webrtc::AudioDeviceModule::RecordingDevices()) may represent different devices.
Then video & audio doesn't match from api 'getMediaList'.
Screenshots
![image](https://github.com/mpromonet/webrtc-streamer/assets/15117363/eb43041f-2bb8-482a-bc87-70e7a818f852)
Desktop (please complete the following information):