Permalink
Browse files

Initial commit

Change-Id: I62e26c8497f76edbb9a05d8e4a3aa4dfeb68b2b6
  • Loading branch information...
superdump committed Oct 2, 2014
1 parent 021bf2f commit 793982a925d32970a5103aae49db0b0e22c672f3
Showing with 18,154 additions and 0 deletions.
  1. +3 −0 .gitmodules
  2. 0 AUTHORS
  3. +22 −0 COPYING
  4. 0 ChangeLog
  5. +32 −0 Makefile.am
  6. 0 NEWS
  7. 0 README
  8. +25 −0 autogen.sh
  9. +52 −0 bridge/Makefile.am
  10. +14 −0 bridge/client/Makefile.am
  11. +190 −0 bridge/client/domutils.js
  12. +477 −0 bridge/client/sdp.js
  13. +1,234 −0 bridge/client/webrtc.js
  14. +37 −0 bridge/daemon.c
  15. +13 −0 bridge/openwebrtc-bridge-0.1.pc
  16. +433 −0 bridge/owr_bridge.c
  17. +42 −0 bridge/owr_bridge.h
  18. +14 −0 bridge/seed/Makefile.am
  19. +523 −0 bridge/seed/websocket.js
  20. +44 −0 bridge/seed/workerinit.js
  21. +135 −0 bridge/seed/workerutils.js
  22. +12 −0 bridge/shared/Makefile.am
  23. +337 −0 bridge/shared/wbjsonrpc.js
  24. +13 −0 bridge/worker/Makefile.am
  25. +165 −0 bridge/worker/bridgeserver.js
  26. +251 −0 bridge/worker/peerhandler.js
  27. +141 −0 build.sh
  28. +71 −0 configure.ac
  29. +4 −0 docs/Makefile.am
  30. +3 −0 docs/reference/Makefile.am
  31. +108 −0 docs/reference/owr/Makefile.am
  32. +182 −0 git.mk
  33. +13 −0 git_hooks/chain_hook
  34. +19 −0 git_hooks/install_hooks.sh
  35. +55 −0 git_hooks/pre-commit
  36. +55 −0 git_hooks/pre-push
  37. +3,892 −0 libopenwebrtc.exp
  38. +48 −0 local/Makefile.am
  39. +216 −0 local/owr_audio_renderer.c
  40. +65 −0 local/owr_audio_renderer.h
  41. +454 −0 local/owr_image_renderer.c
  42. +65 −0 local/owr_image_renderer.h
  43. +45 −0 local/owr_image_renderer_private.h
  44. +321 −0 local/owr_image_server.c
  45. +70 −0 local/owr_image_server.h
  46. +155 −0 local/owr_local.c
  47. +41 −0 local/owr_local.h
  48. +525 −0 local/owr_local_media_source.c
  49. +67 −0 local/owr_local_media_source.h
  50. +51 −0 local/owr_local_media_source_private.h
  51. +256 −0 local/owr_media_renderer.c
  52. +72 −0 local/owr_media_renderer.h
  53. +47 −0 local/owr_media_renderer_private.h
  54. +351 −0 local/owr_video_renderer.c
  55. +65 −0 local/owr_video_renderer.h
  56. +136 −0 owr/Makefile.am
  57. +13 −0 owr/openwebrtc-0.1.pc.in
  58. +377 −0 owr/owr.c
  59. +39 −0 owr/owr.h
  60. +251 −0 owr/owr_media_source.c
  61. +70 −0 owr/owr_media_source.h
  62. +59 −0 owr/owr_media_source_private.h
  63. +50 −0 owr/owr_private.h
  64. +90 −0 owr/owr_types.c
  65. +69 −0 owr/owr_types.h
  66. +198 −0 owr/owr_utils.c
  67. +50 −0 owr/owr_utils.h
  68. +42 −0 owr/symbols_to_source.py
  69. +1 −0 scripts
  70. +56 −0 transport/Makefile.am
  71. +169 −0 transport/owr_audio_payload.c
  72. +68 −0 transport/owr_audio_payload.h
  73. +492 −0 transport/owr_candidate.c
  74. +85 −0 transport/owr_candidate.h
  75. +47 −0 transport/owr_candidate_private.h
  76. +592 −0 transport/owr_media_session.c
  77. +86 −0 transport/owr_media_session.h
  78. +56 −0 transport/owr_media_session_private.h
  79. +510 −0 transport/owr_payload.c
  80. +68 −0 transport/owr_payload.h
  81. +51 −0 transport/owr_payload_private.h
  82. +128 −0 transport/owr_remote_media_source.c
  83. +65 −0 transport/owr_remote_media_source.h
  84. +47 −0 transport/owr_remote_media_source_private.h
  85. +434 −0 transport/owr_session.c
  86. +79 −0 transport/owr_session.h
  87. +47 −0 transport/owr_session_private.h
  88. +1,738 −0 transport/owr_transport_agent.c
  89. +79 −0 transport/owr_transport_agent.h
  90. +217 −0 transport/owr_video_payload.c
  91. +70 −0 transport/owr_video_payload.h
View
@@ -0,0 +1,3 @@
[submodule "scripts"]
path = scripts
url = https://github.com/EricssonResearch/openwebrtc-build-scripts.git
View
No changes.
View
22 COPYING
@@ -0,0 +1,22 @@
Copyright (c) 2014, Ericsson AB. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
View
No changes.
View
@@ -0,0 +1,32 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = transport local owr bridge docs
if OWR_DEBUG
DEBUG_CFLAGS = "-g"
else
DEBUG_CFLAGS =
endif
export DEBUG_CFLAGS
openwebrtcdocdir = ${prefix}/share/doc/libopenwebrtc
openwebrtcdoc_DATA = \
README \
COPYING \
AUTHORS \
ChangeLog \
INSTALL \
NEWS
EXTRA_DIST = $(openwebrtcdoc_DATA)
GITIGNOREFILES = openwebrtc-deps-* build out .build_successful_tag_file.txt
DISTCLEANFILES = aclocal.m4 config.guess config.h.in config.sub \
depcomp gtk-doc.make m4 install-sh ltmain.sh missing
# Remove doc directory on uninstall
uninstall-local:
-rm -r $(openwebrtcdocdir)
-include $(top_srcdir)/git.mk
View
0 NEWS
No changes.
View
0 README
No changes.
View
@@ -0,0 +1,25 @@
#!/bin/bash
# you can either set the environment variables AUTOCONF, AUTOHEADER, AUTOMAKE,
# ACLOCAL, AUTOPOINT and/or LIBTOOLIZE to the right versions, or leave them
# unset and get the defaults
srcdir=`dirname $0`
(test -d $srcdir/m4) || mkdir $srcdir/m4
pushd $srcdir > /dev/null
gtkdocize && \
autoreconf --verbose --force --install --make || {
echo 'autogen.sh failed';
exit 1;
}
popd > /dev/null
$srcdir/configure $* || {
echo 'configure failed';
exit 1;
}
echo
echo "Now type 'make' to compile this module."
echo
View
@@ -0,0 +1,52 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = client seed shared worker
AM_CPPFLAGS = \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \
$(GLIB_CFLAGS) \
$(SEED_CFLAGS) \
-I$(top_srcdir)/owr \
-I$(top_builddir)/owr \
-I$(top_builddir)/bridge
AM_CFLAGS = \
-Wall \
-Wextra \
-Werror \
-pedantic \
$(DEBUG_CFLAGS)
lib_LTLIBRARIES = libopenwebrtc_bridge.la
libopenwebrtc_bridge_la_SOURCES = \
owr_bridge.c
libopenwebrtc_bridge_la_LIBADD = \
$(GLIB_LIBS) \
$(SEED_LIBS) \
$(top_builddir)/owr/libopenwebrtc.la
libopenwebrtc_bridge_la_DEPENDENCIES = \
$(top_builddir)/owr/libopenwebrtc.la
libopenwebrtc_bridge_la_CFLAGS = $(AM_CFLAGS) -ansi
libopenwebrtc_bridge_la_LDFLAGS = -export-dynamic
bin_PROGRAMS = daemon
daemon_SOURCES = daemon.c
daemon_LDFLAGS = -static -export-dynamic $(SEED_LIBS) libopenwebrtc_bridge.la
includedir = $(prefix)/include/owr
include_HEADERS = \
owr_bridge.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = openwebrtc-bridge-0.1.pc
EXTRA_DIST = \
openwebrtc-bridge-0.1.pc.in
-include $(top_srcdir)/git.mk
View
@@ -0,0 +1,14 @@
## Process this file with automake to produce Makefile.in
BUILT_SOURCES = \
domutils.js.h \
sdp.js.h \
webrtc.js.h
%.js_: %.js
cp $< $@
%.js.h: %.js_
xxd -i $< > $@
-include $(top_srcdir)/git.mk
View
@@ -0,0 +1,190 @@
/*
* Copyright (C) 2014 Ericsson AB. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
"use strict";
var domObject = (function () {
function createAttributeDescriptor(name, attributes) {
return {
"get": function () {
var attribute = attributes[name];
return typeof attribute == "function" ? attribute() : attribute;
},
"enumerable": true
};
}
return {
"addReadOnlyAttributes": function (target, attributes) {
for (var name in attributes)
Object.defineProperty(target, name, createAttributeDescriptor(name, attributes));
},
"addConstants": function (target, constants) {
for (var name in constants)
Object.defineProperty(target, name, {
"value": constants[name],
"enumerable": true
});
}
};
})();
function EventTarget(attributes) {
var _this = this;
var listenersMap = {};
if (attributes)
addEventListenerAttributes(this, attributes);
this.addEventListener = function (type, listener, useCapture) {
if (typeof(listener) != "function")
throw new TypeError("listener argument (" + listener + ") is not a function");
var listeners = listenersMap[type];
if (!listeners)
listeners = listenersMap[type] = [];
if (listeners.indexOf(listener) < 0)
listeners.push(listener);
};
this.removeEventListener = function (type, listener, useCapture) {
var listeners = listenersMap[type];
if (!listeners)
return;
var i = listeners.indexOf(listener);
if (i >= 0)
listeners.splice(i, 1);
};
this.dispatchEvent = function (evt) {
var listeners = [];
var attributeListener = _this["on" + evt.type];
if (attributeListener)
listeners.push(attributeListener);
if (listenersMap[evt.type])
Array.prototype.push.apply(listeners, listenersMap[evt.type]);
var errors = [];
var result = true;
listeners.forEach(function (listener) {
try {
result = !(listener(evt) === false) && result;
} catch (e) {
errors.push(e);
}
});
errors.forEach(function (e) {
setTimeout(function () {
throw e;
});
});
return result;
};
function addEventListenerAttributes(target, attributes) {
for (var name in attributes)
Object.defineProperty(target, name, createEventListenerDescriptor(name, attributes));
}
function createEventListenerDescriptor(name, attributes) {
return {
"get": function () { return attributes[name]; },
"set": function (cb) { attributes[name] = (typeof(cb) == "function") ? cb : null; },
"enumerable": true
};
}
}
function checkDictionary(name, dict, typeMap) {
for (var memberName in dict) {
if (!dict.hasOwnProperty(memberName) || !typeMap.hasOwnProperty(memberName))
continue;
var message = name + ": Dictionary member " + memberName;
checkType(message, dict[memberName], typeMap[memberName]);
}
}
function checkArguments(name, argsTypeTemplate, numRequired, args) {
if (args.length < numRequired) {
throw new TypeError(name + ": Too few arguments (got " + args.length + " expected " +
numRequired + ")");
}
var typeTemplates = argsTypeTemplate.split(/\s*,\s*/);
for (var i = 0; i < args.length && i < typeTemplates.length; i++) {
var message = name + ": Argument " + (i + 1);
checkType(message, args[i], typeTemplates[i]);
}
}
function checkType(name, value, typeTemplate) {
var expetedTypes = typeTemplate.split(/\s*\|\s*/);
if (!canConvert(value, expetedTypes)) {
throw new TypeError(name + " is of wrong type (expected " +
expetedTypes.join(" or ") + ")");
}
}
function canConvert(value, expetedTypes) {
var type = typeof value;
for (var i = 0; i < expetedTypes.length; i++) {
var expetedType = expetedTypes[i];
if (expetedType == "string" || expetedType == "boolean")
return true; // type conversion will never throw
if (expetedType == "number") {
var asNumber = +value;
if (!isNaN(asNumber) && asNumber != -Infinity && asNumber != Infinity)
return true;
}
if (type == "object") {
if (expetedType == "object")
return true;
// could be a specific object type or host object (e.g. Array)
var constructor = self[expetedType];
if (constructor && value instanceof constructor)
return true;
}
if (type == expetedType && expetedType == "function")
return true;
}
return false;
}
function randomString() {
var randomValues = new Uint8Array(27);
crypto.getRandomValues(randomValues);
return btoa(String.fromCharCode.apply(null, randomValues));
}
Oops, something went wrong.

0 comments on commit 793982a

Please sign in to comment.