Comments (10)
This is not an issue in these examples but in webrtcbin itself or with libnice. Issues for those components are tracked at https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad and https://gitlab.freedesktop.org/libnice/libnice respectively.
from gstwebrtc-demos.
You can attach a notify signal with a callback on all the *state
properties instead of polling but yes, that is probably the best option. The callback will happen in a different thread than any your application owns so synchronisation would be required.
from gstwebrtc-demos.
E.g. example in C
static void
on_state_notify (gpointer webrtcbin, GParamSpec * pspec, gpointer user_data)
{
/* do things */
}
// on setup
g_signal_connect (webrtcbin, "notify::connection-state", G_CALLBACK(on_state_notify), some_user_data);
from gstwebrtc-demos.
Thanks @ystreet for your info and the example!
My polling approach of the webrtc element properties did not result in changing states (connection-state
and ice-connection-state
always remained the initial state), so I guess i have to try the signal approach.
But may be my polling approach is wrong? I tried:
thread::spawn(move || {
let one_sec = time::Duration::from_millis(1000);
loop {
let mut state = None;
{
let mut lock = app_control_polling.0.lock().unwrap();
let mut webrtc = lock.pipeline.get_by_name("sendrecv");
webrtc = match webrtc {
Some(w) => {
match w.get_property("connection-state") {
Ok(r) => {
state = Some(r.clone());
},
Err(_) => { }
};
Some(w)
}
None => None,
};
lock.webrtc = webrtc;
}
match state {
Some(s) => {
println!("{:?}", s);
}
None => {}
}
thread::sleep(one_sec);
}
});
from gstwebrtc-demos.
Hrm, connection-state
isn't quite hooked up correctly yet. The DTLS implementation currently doesn't notify us about connection state changes.
I thought ice-connection-state
was hooked up though.
That rust code looks fine
from gstwebrtc-demos.
Hey I just checked the ice-connection-state
again and I found my mistake:
So at first it is GST_WEBRTC_ICE_CONNECTION_STATE_NEW
and then it is changed to GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED
. But if I disconnect with the browser the ice-connection-state
remains GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED
. Is this intended behavior? I thought it should be GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED
after the peer disconnects.
Sorry for the misinformation!
from gstwebrtc-demos.
That would indicate that libnice doesn't tell us that the connection is not valid anymore and is a fun debugging job.
from gstwebrtc-demos.
Why did you close this topic? This problem remains in GStreamer 1.16.1
from gstwebrtc-demos.
I concur, this shouldn't be closed. This issue presents a pretty nasty problem for using GstWebRtc in production code.
from gstwebrtc-demos.
Here's the relevant issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/758
Thanks @ystreet !
from gstwebrtc-demos.
Related Issues (20)
- I am using 1.14.5 gst version, cpu usage is very high for the simple examples(recvonly) HOT 1
- Improving stream performance for 4k video HOT 5
- multiparty-sendrecv, file description(socket) leak HOT 1
- Change the video source from 'videotestsrc' to rtsp. HOT 4
- Too many connection attempts, aborting. Refresh page to try again HOT 1
- How to use js/ directory instantiation locally https://webrtc.nirbheek.in/ HOT 1
- DTLS error on RaspberryPi HOT 1
- Multiple webrtcbin not showing streams HOT 3
- Sendrecv demo fails HOT 1
- webrtc-unidirectional-h264 no video on browser HOT 3
- Webrtc not working on chrome without disabling chrome flags. HOT 1
- When webrtc sends a real-time stream to the browser, the real-time stream is disconnected HOT 2
- webrtc-sendrecv work only in localhost HOT 2
- Used gstreamer 1.18.1 to run demo code got error!!! HOT 1
- sendrecv implements voice calls, using local signaling, the sound on the client side is normal, but there is no sound on the web side HOT 3
- Cannot get it working HOT 1
- (python3:12664): libnice-CRITICAL **: 16:56:58.187: nice_agent_parse_remote_candidate_sdp: assertion 'sdp != NULL' failed HOT 1
- InvalidStateError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Called in wrong state: stable HOT 1
- Connection fails when trying to connect to webRTC stream on a remote system browser HOT 1
- for vp9, profile-id=2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gstwebrtc-demos.