34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/autobanh-src/autobahn-android/doc/contents.rst:
--------------------------------------------------------------------------------
1 | :tocdepth: 0
2 | :orphan:
3 |
4 | .. _site_contents:
5 |
6 | Site Contents
7 | =============
8 |
9 | .. toctree::
10 | :maxdepth: 3
11 |
12 | index
13 | gettingstarted
14 | examples
15 | _gen/packages
16 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/autobanh-src/autobahn-android/doc/examples.rst:
--------------------------------------------------------------------------------
1 | Examples
2 | =========
3 |
4 | .. container:: legacynotice
5 |
6 | |ab| implements version 1 of WAMP.
7 |
8 | This is incompatible with version 2 of WAMP which is already implemented in Autobahn|Python as well as Autobahn|JS
9 |
10 | Migration of |ab| to WAMP v2 is coming, but we cannot guarantee a release date.
11 |
12 |
13 | Tutorials and examples are here to showcase specific areas of Autobahn|Android . They include self-contained, fully working code, but may not cover all features available. For the latter, please consult the :doc:`API reference `.
14 |
15 | All tutorials and examples are hosted on `GitHub `_.
16 |
17 | WebSocket Programming
18 | ------------------------
19 |
20 | * `Hello world: WebSocket Echo `_
21 | * `Broadcasting over WebSocket `_
22 | * `AutobahnTestsuite client `_
23 |
24 | WAMP Programming
25 | -------------------
26 |
27 | * `Remote Procedure Calls with AutobahnAndroid `_
28 | * `Publish & Subscribe with AutobahnAndroid `_
29 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/autobanh-src/autobahn-android/doc/serve.py:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | ##
3 | ## Copyright (C) 2014 Tavendo GmbH
4 | ##
5 | ## Licensed under the Apache License, Version 2.0 (the "License");
6 | ## you may not use this file except in compliance with the License.
7 | ## You may obtain a copy of the License at
8 | ##
9 | ## http://www.apache.org/licenses/LICENSE-2.0
10 | ##
11 | ## Unless required by applicable law or agreed to in writing, software
12 | ## distributed under the License is distributed on an "AS IS" BASIS,
13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | ## See the License for the specific language governing permissions and
15 | ## limitations under the License.
16 | ##
17 | ###############################################################################
18 |
19 | if __name__ == "__main__":
20 |
21 | import sys
22 | import argparse
23 | import mimetypes
24 |
25 | from twisted.python import log
26 | from twisted.internet import reactor
27 | from twisted.web.server import Site
28 | from twisted.web.static import File
29 | from twisted.internet.endpoints import serverFromString
30 |
31 | mimetypes.add_type('image/svg+xml', '.svg')
32 | mimetypes.add_type('text/javascript', '.jgz')
33 |
34 | parser = argparse.ArgumentParser()
35 |
36 | parser.add_argument("--root", type = str, default = ".",
37 | help = 'Web document root directory')
38 |
39 | parser.add_argument("--endpoint", type = str, default = "tcp:8080",
40 | help = 'Twisted server endpoint descriptor, e.g. "tcp:8080" or "unix:/tmp/mywebsocket".')
41 |
42 | parser.add_argument("-s", "--silence", action = "store_true",
43 | help = "Disable access logging.")
44 |
45 | args = parser.parse_args()
46 | log.startLogging(sys.stdout)
47 |
48 | factory = Site(File(args.root))
49 | if args.silence:
50 | factory.log = lambda _: None
51 | factory.noisy = False
52 |
53 | server = serverFromString(reactor, args.endpoint)
54 | server.listen(factory)
55 |
56 | reactor.run()
57 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/autobanh-src/autobahn-android/doc/spelling_wordlist.txt:
--------------------------------------------------------------------------------
1 | Twisted
2 | asyncio
3 | Trollius
4 | inlineCallbacks
5 | Deferreds
6 | inline
7 | excludeMe
8 | wxPython
9 | Tox
10 | CPython
11 | stdlib
12 | timestamp
13 | Lua
14 | rawsocket
15 | serializer
16 | subprotocol
17 | subprotocols
18 | Hybi
19 | Hixie
20 | args
21 | kwargs
22 | unserialized
23 | unserialize
24 | serializable
25 | Testee
26 | Jython
27 | wallclock
28 | walltime
29 | mixin
30 | Mixin
31 | hostname
32 | serializers
33 | app
34 | apps
35 | util
36 | wamp
37 | WAMP
38 | Ctor
39 | Iff
40 | iff
41 | ping
42 | pong
43 | openHandshakeTimeout
44 | closeHandshakeTimeout
45 | wasClean
46 | logOctets
47 | logFrames
48 | reasonUtf
49 | sendMessage
50 | websocket
51 | validator
52 | Bjoern
53 | Hoehrmann
54 | codepoint
55 | currentIndex
56 | totalIndex
57 | websocket
58 | xormasker
59 | localhost
60 | polyfill
61 | useragent
62 | sendPing
63 | sendPong
64 | sendClose
65 | Nagle
66 | endsOnCodePoint
67 | Changelog
68 | changelog
69 | docstrings
70 | websockify
71 | ws
72 | wss
73 | slowsquare
74 | plugin
75 | pubsub
76 | Peticolas
77 | isSecure
78 | permessage
79 | Nagle
80 | endsOnCodePoint
81 | blog
82 | backport
83 | backports
84 | twistd
85 | frontend
86 | backend
87 | frontends
88 | backends
89 | setProtocolOptions
90 | serverConnectionDropTimeout
91 | reasonRaw
92 | serverStatus
93 | onConnect
94 | namespace
95 | unsubscribe
96 | bzip
97 | http
98 | uri
99 | longpoll
100 | choosereactor
101 | flashpolicy
102 | autoimport
103 | longpoll
104 | chopsize
105 | lifecycle
106 | Lifecycle
107 | Callees
108 | callees
109 | Testsuite
110 | testsuite
111 | Subpackages
112 | subpath
113 | subpaths
114 | pongs
115 | pings
116 | params
117 | unescaped
118 | utf
119 | acknowledgement
120 | unregistration
121 | unregister
122 | unregistered
123 | unsubscription
124 | unsubscribe
125 | unsubscribed
126 | deserialization
127 | deserialize
128 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/base_java-src/OWNERS:
--------------------------------------------------------------------------------
1 | magjed@webrtc.org
2 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/base_java-src/README.md:
--------------------------------------------------------------------------------
1 | ### base_java.jar源码
2 |
3 | 来自项目,路径为`/src/webrtc/base/java/src/org/webrtc`
4 |
5 | ### 分析
6 |
7 | #### Logging
8 |
9 | 日志输出类
10 |
11 | #### Size
12 |
13 | TODO 工具类,大小。
14 |
15 | #### ThreadUtils
16 |
17 | 检查方法是否运行在现在的进程中。
18 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/base_java-src/Size.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /**
14 | * Class for representing size of an object. Very similar to android.util.Size but available on all
15 | * devices.
16 | */
17 | public class Size {
18 | public int width;
19 | public int height;
20 |
21 | public Size(int width, int height) {
22 | this.width = width;
23 | this.height = height;
24 | }
25 |
26 | @Override
27 | public String toString() {
28 | return width + "x" + height;
29 | }
30 |
31 | @Override
32 | public boolean equals(Object other) {
33 | if (!(other instanceof Size)) {
34 | return false;
35 | }
36 | final Size otherSize = (Size) other;
37 | return width == otherSize.width && height == otherSize.height;
38 | }
39 |
40 | @Override
41 | public int hashCode() {
42 | // Use prime close to 2^16 to avoid collisions for normal values less than 2^16.
43 | return 1 + 65537 * width + height;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/AudioSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /**
14 | * Java wrapper for a C++ AudioSourceInterface. Used as the source for one or
15 | * more {@code AudioTrack} objects.
16 | */
17 | public class AudioSource extends MediaSource {
18 | public AudioSource(long nativeSource) {
19 | super(nativeSource);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/AudioTrack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Java wrapper for a C++ AudioTrackInterface */
14 | public class AudioTrack extends MediaStreamTrack {
15 | public AudioTrack(long nativeTrack) {
16 | super(nativeTrack);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/CallSessionFileRotatingLogSink.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | public class CallSessionFileRotatingLogSink {
14 | static {
15 | System.loadLibrary("jingle_peerconnection_so");
16 | }
17 |
18 | private long nativeSink;
19 |
20 | public static byte[] getLogData(String dirPath) {
21 | return nativeGetLogData(dirPath);
22 | }
23 |
24 | public CallSessionFileRotatingLogSink(
25 | String dirPath, int maxFileSize, Logging.Severity severity) {
26 | nativeSink = nativeAddSink(dirPath, maxFileSize, severity.ordinal());
27 | }
28 |
29 | public void dispose() {
30 | if (nativeSink != 0) {
31 | nativeDeleteSink(nativeSink);
32 | nativeSink = 0;
33 | }
34 | }
35 |
36 | private static native long nativeAddSink(String dirPath, int maxFileSize, int severity);
37 | private static native void nativeDeleteSink(long nativeSink);
38 | private static native byte[] nativeGetLogData(String dirPath);
39 | }
40 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/Camera1Capturer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
14 |
15 | import android.content.Context;
16 |
17 | import java.util.List;
18 |
19 | public class Camera1Capturer extends CameraCapturer {
20 | private final boolean captureToTexture;
21 |
22 | public Camera1Capturer(
23 | String cameraName, CameraEventsHandler eventsHandler, boolean captureToTexture) {
24 | super(cameraName, eventsHandler, new Camera1Enumerator(captureToTexture));
25 |
26 | this.captureToTexture = captureToTexture;
27 | }
28 |
29 | @Override
30 | protected void createCameraSession(CameraSession.CreateSessionCallback createSessionCallback,
31 | CameraSession.Events events, Context applicationContext,
32 | SurfaceTextureHelper surfaceTextureHelper, String cameraName, int width, int height,
33 | int framerate) {
34 | Camera1Session.create(createSessionCallback, events, captureToTexture, applicationContext,
35 | surfaceTextureHelper, Camera1Enumerator.getCameraIndex(cameraName), width, height,
36 | framerate);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/Camera2Capturer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import android.annotation.TargetApi;
14 | import android.content.Context;
15 | import android.hardware.camera2.CameraManager;
16 |
17 | @TargetApi(21)
18 | public class Camera2Capturer extends CameraCapturer {
19 | private final Context context;
20 | private final CameraManager cameraManager;
21 |
22 | public Camera2Capturer(Context context, String cameraName, CameraEventsHandler eventsHandler) {
23 | super(cameraName, eventsHandler, new Camera2Enumerator(context));
24 |
25 | this.context = context;
26 | cameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
27 | }
28 |
29 | @Override
30 | protected void createCameraSession(CameraSession.CreateSessionCallback createSessionCallback,
31 | CameraSession.Events events, Context applicationContext,
32 | SurfaceTextureHelper surfaceTextureHelper, String cameraName, int width, int height,
33 | int framerate) {
34 | Camera2Session.create(createSessionCallback, events, applicationContext, cameraManager,
35 | surfaceTextureHelper, cameraName, width, height, framerate);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/CameraEnumerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
14 |
15 | import java.util.List;
16 |
17 | public interface CameraEnumerator {
18 | public String[] getDeviceNames();
19 | public boolean isFrontFacing(String deviceName);
20 | public boolean isBackFacing(String deviceName);
21 | public List getSupportedFormats(String deviceName);
22 |
23 | public CameraVideoCapturer createCapturer(
24 | String deviceName, CameraVideoCapturer.CameraEventsHandler eventsHandler);
25 | }
26 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/CameraSession.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | public interface CameraSession {
14 | // Callbacks are fired on the camera thread.
15 | public interface CreateSessionCallback {
16 | void onDone(CameraSession session);
17 | void onFailure(String error);
18 | }
19 |
20 | // Events are fired on the camera thread.
21 | public interface Events {
22 | void onCameraOpening();
23 | void onCameraError(CameraSession session, String error);
24 | void onCameraDisconnected(CameraSession session);
25 | void onCameraClosed(CameraSession session);
26 | void onByteBufferFrameCaptured(
27 | CameraSession session, byte[] data, int width, int height, int rotation, long timestamp);
28 | void onTextureFrameCaptured(CameraSession session, int width, int height, int oesTextureId,
29 | float[] transformMatrix, int rotation, long timestamp);
30 | }
31 |
32 | /**
33 | * Stops the capture. Waits until no more calls to capture observer will be made.
34 | * If waitCameraStop is true, also waits for the camera to stop.
35 | */
36 | void stop();
37 | }
38 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/GlUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import android.opengl.GLES20;
14 |
15 | import java.nio.ByteBuffer;
16 | import java.nio.ByteOrder;
17 | import java.nio.FloatBuffer;
18 |
19 | /**
20 | * Some OpenGL static utility functions.
21 | */
22 | public class GlUtil {
23 | private GlUtil() {}
24 |
25 | // Assert that no OpenGL ES 2.0 error has been raised.
26 | public static void checkNoGLES2Error(String msg) {
27 | int error = GLES20.glGetError();
28 | if (error != GLES20.GL_NO_ERROR) {
29 | throw new RuntimeException(msg + ": GLES20 error: " + error);
30 | }
31 | }
32 |
33 | public static FloatBuffer createFloatBuffer(float[] coords) {
34 | // Allocate a direct ByteBuffer, using 4 bytes per float, and copy coords into it.
35 | ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * 4);
36 | bb.order(ByteOrder.nativeOrder());
37 | FloatBuffer fb = bb.asFloatBuffer();
38 | fb.put(coords);
39 | fb.position(0);
40 | return fb;
41 | }
42 |
43 | /**
44 | * Generate texture with standard parameters.
45 | */
46 | public static int generateTexture(int target) {
47 | final int textureArray[] = new int[1];
48 | GLES20.glGenTextures(1, textureArray, 0);
49 | final int textureId = textureArray[0];
50 | GLES20.glBindTexture(target, textureId);
51 | GLES20.glTexParameterf(target, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
52 | GLES20.glTexParameterf(target, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
53 | GLES20.glTexParameterf(target, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
54 | GLES20.glTexParameterf(target, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
55 | checkNoGLES2Error("generateTexture");
56 | return textureId;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/Histogram.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /**
14 | * Class for holding the native pointer of a histogram. Since there is no way to destroy a
15 | * histogram, please don't create unnecessary instances of this object. This class is thread safe.
16 | *
17 | * Usage example:
18 | * private static final Histogram someMetricHistogram =
19 | * Histogram.createCounts("WebRTC.Video.SomeMetric", 1, 10000, 50);
20 | * someMetricHistogram.addSample(someVariable);
21 | */
22 | class Histogram {
23 | private final long handle;
24 |
25 | private Histogram(long handle) {
26 | this.handle = handle;
27 | }
28 |
29 | static public Histogram createCounts(String name, int min, int max, int bucketCount) {
30 | return new Histogram(nativeCreateCounts(name, min, max, bucketCount));
31 | }
32 |
33 | static public Histogram createEnumeration(String name, int max) {
34 | return new Histogram(nativeCreateEnumeration(name, max));
35 | }
36 |
37 | public void addSample(int sample) {
38 | nativeAddSample(handle, sample);
39 | }
40 |
41 | private static native long nativeCreateCounts(String name, int min, int max, int bucketCount);
42 | private static native long nativeCreateEnumeration(String name, int max);
43 | private static native void nativeAddSample(long handle, int sample);
44 | }
45 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/IceCandidate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /**
14 | * Representation of a single ICE Candidate, mirroring
15 | * {@code IceCandidateInterface} in the C++ API.
16 | */
17 | public class IceCandidate {
18 | public final String sdpMid;
19 | public final int sdpMLineIndex;
20 | public final String sdp;
21 |
22 | public IceCandidate(String sdpMid, int sdpMLineIndex, String sdp) {
23 | this.sdpMid = sdpMid;
24 | this.sdpMLineIndex = sdpMLineIndex;
25 | this.sdp = sdp;
26 | }
27 |
28 | public String toString() {
29 | return sdpMid + ":" + sdpMLineIndex + ":" + sdp;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/MediaConstraints.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import java.util.LinkedList;
14 | import java.util.List;
15 |
16 | /**
17 | * Description of media constraints for {@code MediaStream} and
18 | * {@code PeerConnection}.
19 | */
20 | public class MediaConstraints {
21 | /** Simple String key/value pair. */
22 | public static class KeyValuePair {
23 | private final String key;
24 | private final String value;
25 |
26 | public KeyValuePair(String key, String value) {
27 | this.key = key;
28 | this.value = value;
29 | }
30 |
31 | public String getKey() {
32 | return key;
33 | }
34 |
35 | public String getValue() {
36 | return value;
37 | }
38 |
39 | public String toString() {
40 | return key + ": " + value;
41 | }
42 |
43 | @Override
44 | public boolean equals(Object other) {
45 | if (this == other) {
46 | return true;
47 | }
48 | if (other == null || getClass() != other.getClass()) {
49 | return false;
50 | }
51 | KeyValuePair that = (KeyValuePair) other;
52 | return key.equals(that.key) && value.equals(that.value);
53 | }
54 |
55 | @Override
56 | public int hashCode() {
57 | return key.hashCode() + value.hashCode();
58 | }
59 | }
60 |
61 | public final List mandatory;
62 | public final List optional;
63 |
64 | public MediaConstraints() {
65 | mandatory = new LinkedList();
66 | optional = new LinkedList();
67 | }
68 |
69 | private static String stringifyKeyValuePairList(List list) {
70 | StringBuilder builder = new StringBuilder("[");
71 | for (KeyValuePair pair : list) {
72 | if (builder.length() > 1) {
73 | builder.append(", ");
74 | }
75 | builder.append(pair.toString());
76 | }
77 | return builder.append("]").toString();
78 | }
79 |
80 | public String toString() {
81 | return "mandatory: " + stringifyKeyValuePairList(mandatory) + ", optional: "
82 | + stringifyKeyValuePairList(optional);
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/MediaSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Java wrapper for a C++ MediaSourceInterface. */
14 | public class MediaSource {
15 | /** Tracks MediaSourceInterface.SourceState */
16 | public enum State { INITIALIZING, LIVE, ENDED, MUTED }
17 |
18 | final long nativeSource; // Package-protected for PeerConnectionFactory.
19 |
20 | public MediaSource(long nativeSource) {
21 | this.nativeSource = nativeSource;
22 | }
23 |
24 | public State state() {
25 | return nativeState(nativeSource);
26 | }
27 |
28 | public void dispose() {
29 | free(nativeSource);
30 | }
31 |
32 | private static native State nativeState(long pointer);
33 |
34 | private static native void free(long nativeSource);
35 | }
36 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/MediaStreamTrack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Java wrapper for a C++ MediaStreamTrackInterface. */
14 | public class MediaStreamTrack {
15 | /** Tracks MediaStreamTrackInterface.TrackState */
16 | public enum State { LIVE, ENDED }
17 |
18 | final long nativeTrack;
19 |
20 | public MediaStreamTrack(long nativeTrack) {
21 | this.nativeTrack = nativeTrack;
22 | }
23 |
24 | public String id() {
25 | return nativeId(nativeTrack);
26 | }
27 |
28 | public String kind() {
29 | return nativeKind(nativeTrack);
30 | }
31 |
32 | public boolean enabled() {
33 | return nativeEnabled(nativeTrack);
34 | }
35 |
36 | public boolean setEnabled(boolean enable) {
37 | return nativeSetEnabled(nativeTrack, enable);
38 | }
39 |
40 | public State state() {
41 | return nativeState(nativeTrack);
42 | }
43 |
44 | public void dispose() {
45 | free(nativeTrack);
46 | }
47 |
48 | private static native String nativeId(long nativeTrack);
49 |
50 | private static native String nativeKind(long nativeTrack);
51 |
52 | private static native boolean nativeEnabled(long nativeTrack);
53 |
54 | private static native boolean nativeSetEnabled(long nativeTrack, boolean enabled);
55 |
56 | private static native State nativeState(long nativeTrack);
57 |
58 | private static native void free(long nativeTrack);
59 | }
60 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/OWNERS:
--------------------------------------------------------------------------------
1 | per-file Camera*=sakal@webrtc.org
2 | per-file Histogram.java=sakal@webrtc.org
3 | per-file Metrics.java=sakal@webrtc.org
4 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/RtpParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import java.util.LinkedList;
14 |
15 | /**
16 | * The parameters for an {@code RtpSender}, as defined in
17 | * http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface.
18 | */
19 | public class RtpParameters {
20 | public static class Encoding {
21 | public boolean active = true;
22 | // A null value means "no maximum bitrate".
23 | public Integer maxBitrateBps;
24 | }
25 |
26 | public static class Codec {
27 | int payloadType;
28 | String mimeType;
29 | int clockRate;
30 | int channels = 1;
31 | }
32 |
33 | public final LinkedList encodings;
34 | public final LinkedList codecs;
35 |
36 | public RtpParameters() {
37 | encodings = new LinkedList();
38 | codecs = new LinkedList();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/RtpReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Java wrapper for a C++ RtpReceiverInterface. */
14 | public class RtpReceiver {
15 | final long nativeRtpReceiver;
16 |
17 | private MediaStreamTrack cachedTrack;
18 |
19 | public RtpReceiver(long nativeRtpReceiver) {
20 | this.nativeRtpReceiver = nativeRtpReceiver;
21 | long track = nativeGetTrack(nativeRtpReceiver);
22 | // We can assume that an RtpReceiver always has an associated track.
23 | cachedTrack = new MediaStreamTrack(track);
24 | }
25 |
26 | public MediaStreamTrack track() {
27 | return cachedTrack;
28 | }
29 |
30 | public boolean setParameters(RtpParameters parameters) {
31 | return nativeSetParameters(nativeRtpReceiver, parameters);
32 | }
33 |
34 | public RtpParameters getParameters() {
35 | return nativeGetParameters(nativeRtpReceiver);
36 | }
37 |
38 | public String id() {
39 | return nativeId(nativeRtpReceiver);
40 | }
41 |
42 | public void dispose() {
43 | cachedTrack.dispose();
44 | free(nativeRtpReceiver);
45 | }
46 |
47 | // This should increment the reference count of the track.
48 | // Will be released in dispose().
49 | private static native long nativeGetTrack(long nativeRtpReceiver);
50 |
51 | private static native boolean nativeSetParameters(
52 | long nativeRtpReceiver, RtpParameters parameters);
53 |
54 | private static native RtpParameters nativeGetParameters(long nativeRtpReceiver);
55 |
56 | private static native String nativeId(long nativeRtpReceiver);
57 |
58 | private static native void free(long nativeRtpReceiver);
59 | };
60 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/ScreenBase.java:
--------------------------------------------------------------------------------
1 | package org.webrtc;
2 |
3 | /**
4 | * Screen Base, if you want to use screen capture, you should implement this ScreenBase.
5 | */
6 | public interface ScreenBase {
7 | class ScreenBaseHealper {
8 | public static ScreenCapturer screenCapturer = null;
9 | public static final int START_SCREEN = 1;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/ScreenBaseActivity.java:
--------------------------------------------------------------------------------
1 | package org.webrtc;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 |
6 | /**
7 | * 屏幕录像基本Activity,若继承该Activity,
8 | */
9 | public class ScreenBaseActivity extends Activity implements ScreenBase {
10 | /**
11 | * 提示用户请求录屏权限
12 | */
13 | @Override
14 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
15 | super.onActivityResult(requestCode, resultCode, data);
16 | if (requestCode == ScreenBaseHealper.START_SCREEN) {
17 | if (resultCode == RESULT_OK) {
18 | ScreenBaseHealper.screenCapturer.startCapturerBegin(resultCode, data);
19 | }
20 | }
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/ScreenBaseFragmentActivity.java:
--------------------------------------------------------------------------------
1 | package org.webrtc;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 |
6 | public class ScreenBaseFragmentActivity extends Activity {
7 | public ScreenCapturer screenCapturer;
8 |
9 | private final int START_SCREEN = 1;
10 |
11 | /**
12 | * 提示用户请求录屏权限
13 | */
14 | @Override
15 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
16 | super.onActivityResult(requestCode, resultCode, data);
17 | if (requestCode == START_SCREEN) {
18 | if (resultCode == RESULT_OK) {
19 | screenCapturer.startCapturerBegin(resultCode, data);
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/SdpObserver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Interface for observing SDP-related events. */
14 | public interface SdpObserver {
15 | /** Called on success of Create{Offer,Answer}(). */
16 | public void onCreateSuccess(SessionDescription sdp);
17 |
18 | /** Called on success of Set{Local,Remote}Description(). */
19 | public void onSetSuccess();
20 |
21 | /** Called on error of Create{Offer,Answer}(). */
22 | public void onCreateFailure(String error);
23 |
24 | /** Called on error of Set{Local,Remote}Description(). */
25 | public void onSetFailure(String error);
26 | }
27 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/SessionDescription.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /**
14 | * Description of an RFC 4566 Session.
15 | * SDPs are passed as serialized Strings in Java-land and are materialized
16 | * to SessionDescriptionInterface as appropriate in the JNI layer.
17 | */
18 | public class SessionDescription {
19 | /** Java-land enum version of SessionDescriptionInterface's type() string. */
20 | public static enum Type {
21 | OFFER,
22 | PRANSWER,
23 | ANSWER;
24 |
25 | public String canonicalForm() {
26 | return name().toLowerCase();
27 | }
28 |
29 | public static Type fromCanonicalForm(String canonical) {
30 | return Type.valueOf(Type.class, canonical.toUpperCase());
31 | }
32 | }
33 |
34 | public final Type type;
35 | public final String description;
36 |
37 | public SessionDescription(Type type, String description) {
38 | this.type = type;
39 | this.description = description;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/StatsObserver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Interface for observing Stats reports (see webrtc::StatsObservers). */
14 | public interface StatsObserver {
15 | /** Called when the reports are ready.*/
16 | public void onComplete(StatsReport[] reports);
17 | }
18 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/StatsReport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /** Java version of webrtc::StatsReport. */
14 | public class StatsReport {
15 | /** Java version of webrtc::StatsReport::Value. */
16 | public static class Value {
17 | public final String name;
18 | public final String value;
19 |
20 | public Value(String name, String value) {
21 | this.name = name;
22 | this.value = value;
23 | }
24 |
25 | public String toString() {
26 | StringBuilder builder = new StringBuilder();
27 | builder.append("[").append(name).append(": ").append(value).append("]");
28 | return builder.toString();
29 | }
30 | }
31 |
32 | public final String id;
33 | public final String type;
34 | // Time since 1970-01-01T00:00:00Z in milliseconds.
35 | public final double timestamp;
36 | public final Value[] values;
37 |
38 | public StatsReport(String id, String type, double timestamp, Value[] values) {
39 | this.id = id;
40 | this.type = type;
41 | this.timestamp = timestamp;
42 | this.values = values;
43 | }
44 |
45 | public String toString() {
46 | StringBuilder builder = new StringBuilder();
47 | builder.append("id: ")
48 | .append(id)
49 | .append(", type: ")
50 | .append(type)
51 | .append(", timestamp: ")
52 | .append(timestamp)
53 | .append(", values: ");
54 | for (int i = 0; i < values.length; ++i) {
55 | builder.append(values[i].toString()).append(", ");
56 | }
57 | return builder.toString();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/VideoSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | /**
14 | * Java wrapper of native AndroidVideoTrackSource.
15 | */
16 | public class VideoSource extends MediaSource {
17 | public VideoSource(long nativeSource) {
18 | super(nativeSource);
19 | }
20 |
21 | /**
22 | * Calling this function will cause frames to be scaled down to the requested resolution. Also,
23 | * frames will be cropped to match the requested aspect ratio, and frames will be dropped to match
24 | * the requested fps. The requested aspect ratio is orientation agnostic and will be adjusted to
25 | * maintain the input orientation, so it doesn't matter if e.g. 1280x720 or 720x1280 is requested.
26 | */
27 | public void adaptOutputFormat(int width, int height, int fps) {
28 | nativeAdaptOutputFormat(nativeSource, width, height, fps);
29 | }
30 |
31 | private static native void nativeAdaptOutputFormat(
32 | long nativeSource, int width, int height, int fps);
33 | }
34 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/VideoTrack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc;
12 |
13 | import java.util.LinkedList;
14 |
15 | /** Java version of VideoTrackInterface. */
16 | public class VideoTrack extends MediaStreamTrack {
17 | private final LinkedList renderers = new LinkedList();
18 |
19 | public VideoTrack(long nativeTrack) {
20 | super(nativeTrack);
21 | }
22 |
23 | public void addRenderer(VideoRenderer renderer) {
24 | renderers.add(renderer);
25 | nativeAddRenderer(nativeTrack, renderer.nativeVideoRenderer);
26 | }
27 |
28 | public void removeRenderer(VideoRenderer renderer) {
29 | if (!renderers.remove(renderer)) {
30 | return;
31 | }
32 | nativeRemoveRenderer(nativeTrack, renderer.nativeVideoRenderer);
33 | renderer.dispose();
34 | }
35 |
36 | public void dispose() {
37 | while (!renderers.isEmpty()) {
38 | removeRenderer(renderers.getFirst());
39 | }
40 | super.dispose();
41 | }
42 |
43 | private static native void free(long nativeTrack);
44 |
45 | private static native void nativeAddRenderer(long nativeTrack, long nativeRenderer);
46 |
47 | private static native void nativeRemoveRenderer(long nativeTrack, long nativeRenderer);
48 | }
49 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_java-src/voiceengine/BuildInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | package org.webrtc.voiceengine;
12 |
13 | import android.os.Build;
14 |
15 | /**
16 | * 编译系统相关
17 | */
18 | public final class BuildInfo {
19 | public static String getDevice() {
20 | return Build.DEVICE;
21 | }
22 |
23 | public static String getDeviceModel() {
24 | return Build.MODEL;
25 | }
26 |
27 | public static String getProduct() {
28 | return Build.PRODUCT;
29 | }
30 |
31 | public static String getBrand() {
32 | return Build.BRAND;
33 | }
34 |
35 | public static String getDeviceManufacturer() {
36 | return Build.MANUFACTURER;
37 | }
38 |
39 | public static String getAndroidBuildId() {
40 | return Build.ID;
41 | }
42 |
43 | public static String getBuildType() {
44 | return Build.TYPE;
45 | }
46 |
47 | public static String getBuildRelease() {
48 | return Build.VERSION.RELEASE;
49 | }
50 |
51 | public static String getSdkVersion() {
52 | return Integer.toString(Build.VERSION.SDK_INT);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_so-src/OWNERS:
--------------------------------------------------------------------------------
1 | per-file androidhistogram_jni.cc=sakal@webrtc.org
2 | per-file androidmetrics_jni.cc=sakal@webrtc.org
3 | per-file androidvideotracksource.*=sakal@webrtc.org
4 | per-file androidvideotracksource_jni.cc=sakal@webrtc.org
5 |
--------------------------------------------------------------------------------
/RAppRTC-libs-src/libjingle_peerconnection_so-src/androidhistogram_jni.cc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | #include