2023-10-16 16:16:52 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
|
|
use crate::signaller::Signallable;
|
webrtc: janus: handle (stopped-)talking events
Expose those events using a signal.
Fix those errors when joining a Janus room configured with
'audiolevel_event: true'.
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 37.939998626708984
}
}
}
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "stopped-talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 40.400001525878906
}
}
}
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1481>
2024-02-28 14:48:09 +00:00
|
|
|
use gst::{glib, glib::prelude::*, glib::subclass::prelude::*};
|
2023-10-16 16:16:52 +00:00
|
|
|
|
|
|
|
mod imp;
|
|
|
|
|
2024-03-05 13:04:43 +00:00
|
|
|
// base class
|
2023-10-16 16:16:52 +00:00
|
|
|
glib::wrapper! {
|
|
|
|
pub struct JanusVRSignaller(ObjectSubclass<imp::Signaller>) @implements Signallable;
|
|
|
|
}
|
|
|
|
|
webrtc: janus: handle (stopped-)talking events
Expose those events using a signal.
Fix those errors when joining a Janus room configured with
'audiolevel_event: true'.
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 37.939998626708984
}
}
}
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "stopped-talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 40.400001525878906
}
}
}
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1481>
2024-02-28 14:48:09 +00:00
|
|
|
trait JanusVRSignallerImpl: ObjectImpl {
|
|
|
|
fn emit_talking(&self, talking: bool, id: imp::JanusId, audio_level: f32);
|
|
|
|
}
|
2024-03-05 13:04:43 +00:00
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct JanusVRSignallerClass {
|
|
|
|
parent: glib::object::ObjectClass,
|
webrtc: janus: handle (stopped-)talking events
Expose those events using a signal.
Fix those errors when joining a Janus room configured with
'audiolevel_event: true'.
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 37.939998626708984
}
}
}
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "stopped-talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 40.400001525878906
}
}
}
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1481>
2024-02-28 14:48:09 +00:00
|
|
|
|
|
|
|
// virtual methods
|
|
|
|
emit_talking: fn(&JanusVRSignaller, talking: bool, id: imp::JanusId, audio_level: f32),
|
2024-03-05 13:04:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl ClassStruct for JanusVRSignallerClass {
|
|
|
|
type Type = imp::Signaller;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::ops::Deref for JanusVRSignallerClass {
|
|
|
|
type Target = glib::Class<<<Self as ClassStruct>::Type as ObjectSubclass>::ParentType>;
|
|
|
|
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
unsafe { &*(&self.parent as *const _ as *const _) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl<T: JanusVRSignallerImpl> IsSubclassable<T> for JanusVRSignaller {
|
|
|
|
fn class_init(class: &mut glib::Class<Self>) {
|
|
|
|
Self::parent_class_init::<T>(class);
|
webrtc: janus: handle (stopped-)talking events
Expose those events using a signal.
Fix those errors when joining a Janus room configured with
'audiolevel_event: true'.
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 37.939998626708984
}
}
}
ERROR webrtc-janusvr-signaller imp.rs:408:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg:<GstJanusVRWebRTCSignaller@0x560cf2a55100> Unknown message from server: {
"janus": "event",
"session_id": 2384862538500481,
"sender": 1867822625190966,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "stopped-talking",
"room": 7564250471742314,
"id": 6815475717947398,
"mindex": 0,
"mid": "0",
"audio-level-dBov-avg": 40.400001525878906
}
}
}
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1481>
2024-02-28 14:48:09 +00:00
|
|
|
|
|
|
|
let class = class.as_mut();
|
|
|
|
|
|
|
|
class.emit_talking = |obj, talking, id, audio_level| unsafe {
|
|
|
|
let imp = obj.unsafe_cast_ref::<T::Type>().imp();
|
|
|
|
imp.emit_talking(talking, id, audio_level)
|
|
|
|
};
|
2024-03-05 13:04:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-16 16:16:52 +00:00
|
|
|
impl Default for JanusVRSignaller {
|
|
|
|
fn default() -> Self {
|
|
|
|
glib::Object::new()
|
|
|
|
}
|
|
|
|
}
|
2024-03-05 13:04:43 +00:00
|
|
|
|
|
|
|
// default signaller using `u64` ids
|
|
|
|
glib::wrapper! {
|
|
|
|
pub struct JanusVRSignallerU64(ObjectSubclass<imp::signaller_u64::SignallerU64>) @extends JanusVRSignaller, @implements Signallable;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for JanusVRSignallerU64 {
|
|
|
|
fn default() -> Self {
|
|
|
|
glib::Object::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// signaller using strings ids, used when `use-string-ids=true` is set on `janusvrwebrtcsink`
|
|
|
|
glib::wrapper! {
|
|
|
|
pub struct JanusVRSignallerStr(ObjectSubclass<imp::signaller_str::SignallerStr>) @extends JanusVRSignaller, @implements Signallable;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for JanusVRSignallerStr {
|
|
|
|
fn default() -> Self {
|
|
|
|
glib::Object::new()
|
|
|
|
}
|
|
|
|
}
|