If I have a PeerConnection that outlived it usefulness (failed, disconnected, etc), I'd like to close it and be able to connect to new client. When new client connects I'm getting the following error panic: invalid state: driver is already opened.
I've read that it is caused by having media tracks not being closed. I tried the following things:
Closing PeerConnection. (Close method there attempts to close RTPTransceivers which should also close media tracks)
Not closing PeerConnection and manually stopping (it seems that x264/mmal are not being initialized in that case)
Both closing PeerConnection and stopping tracks (of course this crashes due to double-release).
It seems that there is some issue in initialization/deinitialization of device. I tried both mmal/x264 on Raspberry PI and USB camera with x264 on Quartz64.
I'm not trying to change any video settings on existing client, instead I'm trying to allow multiple clients to connect sequentially.
What did you do?
I used my own signaling server allowing to connect multiple times. I close PeerConnection when client disconnects.
What did you expect?
I expected that second call to GetUserMedia should return media tracks.
What happened?
I'm getting the following error panic: invalid state: driver is already opened.
defer track.Close() in combination with better management for ICE candidates resolve my issue. This finally stopped the drivers and allowed me to reconnect and rerun GetUserMedia.
First of all, thanks for a great library!
Your environment.
If I have a PeerConnection that outlived it usefulness (failed, disconnected, etc), I'd like to close it and be able to connect to new client. When new client connects I'm getting the following error
panic: invalid state: driver is already opened
.I've read that it is caused by having media tracks not being closed. I tried the following things:
It seems that there is some issue in initialization/deinitialization of device. I tried both mmal/x264 on Raspberry PI and USB camera with x264 on Quartz64.
I'm not trying to change any video settings on existing client, instead I'm trying to allow multiple clients to connect sequentially.
What did you do?
I used my own signaling server allowing to connect multiple times. I close PeerConnection when client disconnects.
What did you expect?
I expected that second call to GetUserMedia should return media tracks.
What happened?
I'm getting the following error
panic: invalid state: driver is already opened
.