summaryrefslogtreecommitdiffstats
path: root/dom/media/bridge
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/media/bridge
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/bridge')
-rw-r--r--dom/media/bridge/IPeerConnection.idl58
-rw-r--r--dom/media/bridge/MediaModule.cpp16
-rw-r--r--dom/media/bridge/components.conf25
-rw-r--r--dom/media/bridge/moz.build36
4 files changed, 135 insertions, 0 deletions
diff --git a/dom/media/bridge/IPeerConnection.idl b/dom/media/bridge/IPeerConnection.idl
new file mode 100644
index 0000000000..2986ef8b81
--- /dev/null
+++ b/dom/media/bridge/IPeerConnection.idl
@@ -0,0 +1,58 @@
+#include "nsIThread.idl"
+#include "nsIDOMWindow.idl"
+#include "nsIPropertyBag2.idl"
+
+/* Do not confuse with nsIDOMRTCPeerConnection. This interface is purely for
+ * communication between the PeerConnection JS DOM binding and the C++
+ * implementation in SIPCC.
+ *
+ * See media/webrtc/signaling/include/PeerConnectionImpl.h
+ */
+[scriptable, uuid(d7dfe148-0416-446b-a128-66a7c71ae8d3)]
+interface IPeerConnectionObserver : nsISupports
+{
+};
+
+[scriptable, uuid(14afc8e7-e421-4d0c-99a5-69308d871481)]
+interface IPeerConnection : nsISupports
+{
+ const unsigned long kHintAudio = 0x00000001;
+ const unsigned long kHintVideo = 0x00000002;
+
+ const long kActionNone = -1;
+ const long kActionOffer = 0;
+ const long kActionAnswer = 1;
+ const long kActionPRAnswer = 2;
+ const long kActionRollback = 3;
+
+ const long kIceGathering = 0;
+ const long kIceWaiting = 1;
+ const long kIceChecking = 2;
+ const long kIceConnected = 3;
+ const long kIceFailed = 4;
+
+ /* for readyState on Peer Connection */
+ const long kNew = 0;
+ const long kNegotiating = 1;
+ const long kActive = 2;
+ const long kClosing = 3;
+ const long kClosed = 4;
+
+ /* for 'type' in DataChannelInit dictionary */
+ const unsigned short kDataChannelReliable = 0;
+ const unsigned short kDataChannelPartialReliableRexmit = 1;
+ const unsigned short kDataChannelPartialReliableTimed = 2;
+
+ /* Constants for 'name' in error callbacks */
+ const unsigned long kNoError = 0; // Test driver only
+ const unsigned long kInvalidCandidate = 2;
+ const unsigned long kInvalidMediastreamTrack = 3;
+ const unsigned long kInvalidState = 4;
+ const unsigned long kInvalidSessionDescription = 5;
+ const unsigned long kIncompatibleSessionDescription = 6;
+ const unsigned long kIncompatibleMediaStreamTrack = 8;
+ const unsigned long kInternalError = 9;
+ const unsigned long kTypeError = 10;
+ const unsigned long kOperationError = 11;
+ const unsigned long kMaxErrorType = 11; // Same as final error
+};
diff --git a/dom/media/bridge/MediaModule.cpp b/dom/media/bridge/MediaModule.cpp
new file mode 100644
index 0000000000..ff67751f10
--- /dev/null
+++ b/dom/media/bridge/MediaModule.cpp
@@ -0,0 +1,16 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/Components.h"
+
+#ifdef MOZ_WEBRTC
+# include "PeerConnectionImpl.h"
+
+using namespace mozilla;
+
+NS_IMPL_COMPONENT_FACTORY(mozilla::PeerConnectionImpl) {
+ return do_AddRef(new PeerConnectionImpl()).downcast<nsISupports>();
+}
+
+#endif
diff --git a/dom/media/bridge/components.conf b/dom/media/bridge/components.conf
new file mode 100644
index 0000000000..258d111752
--- /dev/null
+++ b/dom/media/bridge/components.conf
@@ -0,0 +1,25 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+Classes = [
+ {
+ 'cid': '{b93af7a1-3411-44a8-bd0a-8af3dde4d8d8}',
+ 'contract_ids': ['@mozilla.org/peerconnection;1'],
+ 'type': 'mozilla::PeerConnectionImpl',
+ },
+ {
+ 'cid': '{9fea635a-2fc2-4d08-9721-d238d3f52f92}',
+ 'contract_ids': ['@mozilla.org/network/tcp-filter-handler;1?name=stun'],
+ 'type': 'nsStunTCPSocketFilterHandler',
+ 'headers': ['transport/stun_socket_filter.h'],
+ },
+ {
+ 'cid': '{3e43ee93-829e-4ea6-a34e-62d9e4c9f993}',
+ 'contract_ids': ['@mozilla.org/network/udp-filter-handler;1?name=stun'],
+ 'type': 'nsStunUDPSocketFilterHandler',
+ 'headers': ['transport/stun_socket_filter.h'],
+ },
+]
diff --git a/dom/media/bridge/moz.build b/dom/media/bridge/moz.build
new file mode 100644
index 0000000000..969953ef2f
--- /dev/null
+++ b/dom/media/bridge/moz.build
@@ -0,0 +1,36 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+XPIDL_SOURCES += [
+ "IPeerConnection.idl",
+]
+
+XPIDL_MODULE = "peerconnection"
+
+SOURCES += [
+ "MediaModule.cpp",
+]
+
+LOCAL_INCLUDES += [
+ "!/ipc/ipdl/_ipdlheaders",
+ "/dom/media/webrtc/",
+ "/dom/media/webrtc/common/time_profiling",
+ "/dom/media/webrtc/jsapi",
+ "/dom/media/webrtc/libwebrtcglue",
+ "/dom/media/webrtc/transport",
+ "/dom/media/webrtc/transportbridge",
+ "/ipc/chromium/src",
+ "/media/webrtc/",
+ "/third_party/libwebrtc",
+ "/third_party/libwebrtc/third_party/abseil-cpp",
+]
+
+if CONFIG["MOZ_WEBRTC"]:
+ XPCOM_MANIFESTS += [
+ "components.conf",
+ ]
+
+FINAL_LIBRARY = "xul"