aboutsummaryrefslogtreecommitdiff
path: root/main/src/plugins/rtp/participant.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2026-10-04 14:42:16 +0200
committerMarvin W <git@larma.de>2026-10-23 16:59:59 +0200
commitdba577f39c489b9db29960f2bf5cc78ac4f29d7b (patch)
treea8354c9fc328c1442d5e8c5c2adec4b428c92f44 /main/src/plugins/rtp/participant.vala
parent2413442905e31f34cb0f77c9167003b3725760fe (diff)
Move OMEMO, OpenPGP and RTP plugins into main/libdino
Diffstat (limited to 'main/src/plugins/rtp/participant.vala')
-rw-r--r--main/src/plugins/rtp/participant.vala39
1 files changed, 39 insertions, 0 deletions
diff --git a/main/src/plugins/rtp/participant.vala b/main/src/plugins/rtp/participant.vala
new file mode 100644
index 00000000..1ca13191
--- /dev/null
+++ b/main/src/plugins/rtp/participant.vala
@@ -0,0 +1,39 @@
+using Gee;
+using Xmpp;
+
+public class Dino.Plugins.Rtp.Participant {
+ public Jid full_jid { get; private set; }
+
+ protected Gst.Pipeline pipe;
+ private Map<Stream, uint32> ssrcs = new HashMap<Stream, uint32>();
+
+ public Participant(Gst.Pipeline pipe, Jid full_jid) {
+ this.pipe = pipe;
+ this.full_jid = full_jid;
+ }
+
+ public uint32 get_ssrc(Stream stream) {
+ if (ssrcs.has_key(stream)) {
+ return ssrcs[stream];
+ }
+ return 0;
+ }
+
+ public void set_ssrc(Stream stream, uint32 ssrc) {
+ if (ssrcs.has_key(stream)) {
+ warning("Learning ssrc %ul for %s in %s when it is already known as %ul", ssrc, full_jid.to_string(), stream.to_string(), ssrcs[stream]);
+ } else {
+ stream.on_destroy.connect(unset_ssrc);
+ }
+ ssrcs[stream] = ssrc;
+ }
+
+ public void unset_ssrc(Stream stream) {
+ ssrcs.unset(stream);
+ stream.on_destroy.disconnect(unset_ssrc);
+ }
+
+ public string to_string() {
+ return @"participant $full_jid";
+ }
+} \ No newline at end of file