Get the supported codecs for both sending and receiving audio and video
- *
Display detailed information about each codec
- *
- *
- * @author Alex Andres
- */
-public class CodecListExample {
-
- public static void main(String[] args) {
- PeerConnectionFactory factory = new PeerConnectionFactory();
-
- try {
- // Get receiver capabilities for audio and video.
- System.out.println("\nRECEIVER CAPABILITIES:");
- System.out.println("---------------------");
-
- System.out.println("\nAudio Receiver Codecs:");
- RTCRtpCapabilities audioReceiverCapabilities = factory.getRtpReceiverCapabilities(MediaType.AUDIO);
- printCodecInfo(audioReceiverCapabilities.getCodecs());
-
- System.out.println("\nVideo Receiver Codecs:");
- RTCRtpCapabilities videoReceiverCapabilities = factory.getRtpReceiverCapabilities(MediaType.VIDEO);
- printCodecInfo(videoReceiverCapabilities.getCodecs());
-
- // Get sender capabilities for audio and video.
- System.out.println("\nSENDER CAPABILITIES:");
- System.out.println("-------------------");
-
- System.out.println("\nAudio Sender Codecs:");
- RTCRtpCapabilities audioSenderCapabilities = factory.getRtpSenderCapabilities(MediaType.AUDIO);
- printCodecInfo(audioSenderCapabilities.getCodecs());
-
- System.out.println("\nVideo Sender Codecs:");
- RTCRtpCapabilities videoSenderCapabilities = factory.getRtpSenderCapabilities(MediaType.VIDEO);
- printCodecInfo(videoSenderCapabilities.getCodecs());
- }
- finally {
- // Dispose the factory when done.
- factory.dispose();
- }
- }
-
- /**
- * Prints detailed information about each codec in the provided list.
- * All information for a codec is printed in a single line for conciseness.
- *
- * @param codecs List of codec capabilities to display.
- */
- private static void printCodecInfo(List codecs) {
- if (codecs.isEmpty()) {
- System.out.println(" No codecs found.");
- return;
- }
-
- for (int i = 0; i < codecs.size(); i++) {
- RTCRtpCodecCapability codec = codecs.get(i);
- StringBuilder sb = new StringBuilder();
-
- sb.append(" Codec #").append(i + 1).append(": ");
- sb.append("MIME Type: ").append(codec.getMimeType()).append(" | ");
- sb.append("Media Type: ").append(codec.getMediaType()).append(" | ");
- sb.append("Name: ").append(codec.getName()).append(" | ");
- sb.append("Clock Rate: ").append(codec.getClockRate()).append(" Hz");
-
- if (codec.getMediaType() == MediaType.AUDIO) {
- int channels = codec.getChannels();
- sb.append(" | Channels: ").append(channels)
- .append(channels == 1 ? " (mono)" : channels == 2 ? " (stereo)" : "");
- }
-
- // Add SDP format parameters if available.
- Map sdpFmtp = codec.getSDPFmtp();
- if (sdpFmtp != null && !sdpFmtp.isEmpty()) {
- sb.append(" | SDP Params: {");
- boolean first = true;
- for (Map.Entry entry : sdpFmtp.entrySet()) {
- if (!first) {
- sb.append(", ");
- }
- sb.append(entry.getKey()).append("=").append(entry.getValue());
- first = false;
- }
- sb.append("}");
- }
-
- System.out.println(sb);
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/DesktopVideoExample.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/DesktopVideoExample.java
deleted file mode 100644
index ee95938..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/DesktopVideoExample.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import dev.onvoid.webrtc.PeerConnectionFactory;
-import dev.onvoid.webrtc.PeerConnectionObserver;
-import dev.onvoid.webrtc.RTCConfiguration;
-import dev.onvoid.webrtc.RTCDataChannel;
-import dev.onvoid.webrtc.RTCIceCandidate;
-import dev.onvoid.webrtc.RTCIceConnectionState;
-import dev.onvoid.webrtc.RTCIceGatheringState;
-import dev.onvoid.webrtc.RTCIceServer;
-import dev.onvoid.webrtc.RTCPeerConnection;
-import dev.onvoid.webrtc.RTCPeerConnectionState;
-import dev.onvoid.webrtc.RTCRtpReceiver;
-import dev.onvoid.webrtc.RTCRtpTransceiver;
-import dev.onvoid.webrtc.RTCSignalingState;
-import dev.onvoid.webrtc.media.MediaStream;
-import dev.onvoid.webrtc.media.MediaStreamTrack;
-import dev.onvoid.webrtc.media.video.VideoDesktopSource;
-import dev.onvoid.webrtc.media.video.VideoTrack;
-import dev.onvoid.webrtc.media.video.desktop.DesktopSource;
-import dev.onvoid.webrtc.media.video.desktop.ScreenCapturer;
-import dev.onvoid.webrtc.media.video.desktop.WindowCapturer;
-
-/**
- * Example demonstrating how to set up a peer connection with a desktop video source.
- *
- * This example shows how to:
- *
- *
Create a PeerConnectionFactory
- *
Get available desktop sources (screens and windows)
- *
Create a VideoDesktopSource for capturing screen or window content
- *
Configure the VideoDesktopSource properties
- *
Create a video track with the desktop source
- *
Set up a peer connection
- *
- *
- * Note: This example focuses only on setting up the local peer connection with
- * a desktop video source for bidirectional media transfer. In a real application,
- * you would need to establish a connection with a remote peer through a signaling
- * channel (e.g., WebSocket).
- *
- * @author Alex Andres
- */
-public class DesktopVideoExample {
-
- public static void main(String[] args) {
- // Create a PeerConnectionFactory, which is the main entry point for WebRTC.
- PeerConnectionFactory factory = new PeerConnectionFactory();
-
- try {
- LocalPeer localPeer = new LocalPeer(factory);
-
- // Keep the application running to observe state changes.
- System.out.println("Press Enter to exit...");
- System.in.read();
-
- // Clean up.
- localPeer.dispose();
- }
- catch (Exception e) {
- Logger.getLogger(DesktopVideoExample.class.getName())
- .log(Level.SEVERE, "Error in DesktopVideoExample", e);
- }
- finally {
- // Dispose the factory when done.
- factory.dispose();
- }
- }
-
- /**
- * Represents a peer connection with audio and desktop video tracks.
- */
- private static class LocalPeer implements PeerConnectionObserver {
-
- private final RTCPeerConnection peerConnection;
- private final VideoDesktopSource videoSource;
-
-
- public LocalPeer(PeerConnectionFactory factory) {
- // Create a basic configuration for the peer connection.
- RTCConfiguration config = new RTCConfiguration();
-
- // Add a STUN server to help with NAT traversal.
- RTCIceServer iceServer = new RTCIceServer();
- iceServer.urls.add("stun:stun.l.google.com:19302");
- config.iceServers.add(iceServer);
-
- // Create the peer connection.
- peerConnection = factory.createPeerConnection(config, this);
-
- // Get available desktop sources.
- System.out.println("Getting available desktop sources...");
-
- // Get available screens.
- ScreenCapturer screenCapturer = new ScreenCapturer();
- List screens = screenCapturer.getDesktopSources();
- System.out.println("\nAvailable screens:");
- for (DesktopSource screen : screens) {
- System.out.printf(" Screen: %s (ID: %d)%n", screen.title, screen.id);
- }
-
- // Get available windows.
- WindowCapturer windowCapturer = new WindowCapturer();
- List windows = windowCapturer.getDesktopSources();
- System.out.println("\nAvailable windows:");
- for (DesktopSource window : windows) {
- System.out.printf(" Window: %s (ID: %d)%n", window.title, window.id);
- }
-
- // Clean up the capturers as we only needed them to get the sources.
- screenCapturer.dispose();
- windowCapturer.dispose();
-
- // Create a desktop video source.
- videoSource = new VideoDesktopSource();
-
- // Configure the desktop video source.
- // Set frame rate (e.g., 30 fps).
- videoSource.setFrameRate(30);
-
- // Set maximum frame size (e.g., 1920x1080).
- videoSource.setMaxFrameSize(1920, 1080);
-
- // Select a source to capture.
- // For this example; we'll use the first available screen if there is one.
- if (!screens.isEmpty()) {
- DesktopSource selectedScreen = screens.get(0);
- System.out.printf("%nSelected screen for capture: %s (ID: %d)%n",
- selectedScreen.title, selectedScreen.id);
- videoSource.setSourceId(selectedScreen.id, false);
- }
- // Otherwise, use the first available window if there is one.
- else if (!windows.isEmpty()) {
- DesktopSource selectedWindow = windows.get(0);
- System.out.printf("%nSelected window for capture: %s (ID: %d)%n",
- selectedWindow.title, selectedWindow.id);
- videoSource.setSourceId(selectedWindow.id, true);
- }
- // If no sources are available, fall back to a default (primary screen).
- else {
- System.out.println("\nNo desktop sources found. Using default (primary screen).");
- videoSource.setSourceId(0, false);
- }
-
- // Start capturing.
- videoSource.start();
-
- // Create a video track with the desktop source.
- VideoTrack videoTrack = factory.createVideoTrack("video0", videoSource);
-
- // Add the tracks to the peer connection.
- List streamIds = new ArrayList<>();
- streamIds.add("stream1");
- peerConnection.addTrack(videoTrack, streamIds);
-
- System.out.println("LocalPeer: Created with a desktop video track");
- }
-
- /**
- * Closes the peer connection and releases resources.
- */
- public void dispose() {
- if (videoSource != null) {
- // Stop capturing before disposing.
- videoSource.stop();
- videoSource.dispose();
- }
- if (peerConnection != null) {
- peerConnection.close();
- }
- }
-
- // PeerConnectionObserver implementation.
-
- @Override
- public void onIceCandidate(RTCIceCandidate candidate) {
- System.out.println("LocalPeer: New ICE candidate: " + candidate.sdp);
- // In a real application, you would send this candidate to the remote peer
- // through your signaling channel.
- }
-
- @Override
- public void onConnectionChange(RTCPeerConnectionState state) {
- System.out.println("LocalPeer: Connection state changed to: " + state);
- }
-
- @Override
- public void onIceConnectionChange(RTCIceConnectionState state) {
- System.out.println("LocalPeer: ICE connection state changed to: " + state);
- }
-
- @Override
- public void onIceGatheringChange(RTCIceGatheringState state) {
- System.out.println("LocalPeer: ICE gathering state changed to: " + state);
- }
-
- @Override
- public void onSignalingChange(RTCSignalingState state) {
- System.out.println("LocalPeer: Signaling state changed to: " + state);
- }
-
- @Override
- public void onDataChannel(RTCDataChannel dataChannel) {
- System.out.println("LocalPeer: Data channel created: " + dataChannel.getLabel());
- }
-
- @Override
- public void onRenegotiationNeeded() {
- System.out.println("LocalPeer: Renegotiation needed");
- // In a real application, you would create an offer and set it as the local description.
- }
-
- @Override
- public void onAddTrack(RTCRtpReceiver receiver, MediaStream[] mediaStreams) {
- System.out.println("LocalPeer: Track added: " + receiver.getTrack().getKind());
- }
-
- @Override
- public void onRemoveTrack(RTCRtpReceiver receiver) {
- System.out.println("LocalPeer: Track removed: " + receiver.getTrack().getKind());
- }
-
- @Override
- public void onTrack(RTCRtpTransceiver transceiver) {
- MediaStreamTrack track = transceiver.getReceiver().getTrack();
-
- System.out.println("LocalPeer: Transceiver track added: " + track.getKind());
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/PeerConnectionExample.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/PeerConnectionExample.java
deleted file mode 100644
index 2c670cd..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/PeerConnectionExample.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import dev.onvoid.webrtc.PeerConnectionFactory;
-import dev.onvoid.webrtc.PeerConnectionObserver;
-import dev.onvoid.webrtc.RTCConfiguration;
-import dev.onvoid.webrtc.RTCDataChannel;
-import dev.onvoid.webrtc.RTCIceCandidate;
-import dev.onvoid.webrtc.RTCIceConnectionState;
-import dev.onvoid.webrtc.RTCIceGatheringState;
-import dev.onvoid.webrtc.RTCIceServer;
-import dev.onvoid.webrtc.RTCPeerConnection;
-import dev.onvoid.webrtc.RTCPeerConnectionState;
-import dev.onvoid.webrtc.RTCRtpReceiver;
-import dev.onvoid.webrtc.RTCRtpTransceiver;
-import dev.onvoid.webrtc.RTCSignalingState;
-import dev.onvoid.webrtc.media.MediaStream;
-import dev.onvoid.webrtc.media.MediaStreamTrack;
-import dev.onvoid.webrtc.media.audio.AudioOptions;
-import dev.onvoid.webrtc.media.audio.AudioTrack;
-import dev.onvoid.webrtc.media.audio.AudioTrackSink;
-import dev.onvoid.webrtc.media.audio.AudioTrackSource;
-import dev.onvoid.webrtc.media.video.VideoDeviceSource;
-import dev.onvoid.webrtc.media.video.VideoFrame;
-import dev.onvoid.webrtc.media.video.VideoTrack;
-import dev.onvoid.webrtc.media.video.VideoTrackSink;
-
-/**
- * Example demonstrating how to set up a peer connection with audio and video tracks
- * to be able to send and receive media.
- *
- * This example shows how to:
- *
- *
Create a PeerConnectionFactory
- *
Create audio and video tracks
- *
Set up a peer connection
- *
Add tracks to the peer connection for sending media
- *
Implement callbacks to receive incoming audio and video frames
- *
- *
- * Note: This example focuses only on setting up the local peer connection with
- * audio and video tracks for bidirectional media transfer. In a real application,
- * you would need to establish a connection with a remote peer through a signaling
- * channel (e.g., WebSocket).
- *
- * @author Alex Andres
- */
-public class PeerConnectionExample {
-
- public static void main(String[] args) {
- // Create a PeerConnectionFactory, which is the main entry point for WebRTC.
- PeerConnectionFactory factory = new PeerConnectionFactory();
-
- try {
- LocalPeer localPeer = new LocalPeer(factory);
-
- // Keep the application running to observe state changes.
- System.out.println("Press Enter to exit...");
- System.in.read();
-
- // Clean up.
- localPeer.dispose();
- }
- catch (Exception e) {
- Logger.getLogger(PeerConnectionExample.class.getName())
- .log(Level.SEVERE, "Error in PeerConnectionExample", e);
- }
- finally {
- // Dispose the factory when done
- factory.dispose();
- }
- }
-
- /**
- * Represents a peer connection with audio and video tracks.
- */
- private static class LocalPeer implements PeerConnectionObserver {
-
- private final RTCPeerConnection peerConnection;
- private final AudioTrack audioTrack;
- private final VideoTrack videoTrack;
- private final AudioFrameLogger audioFrameLogger = new AudioFrameLogger();
- private final VideoFrameLogger videoFrameLogger = new VideoFrameLogger();
-
-
- public LocalPeer(PeerConnectionFactory factory) {
- // Create a basic configuration for the peer connection.
- RTCConfiguration config = new RTCConfiguration();
-
- // Add a STUN server to help with NAT traversal.
- RTCIceServer iceServer = new RTCIceServer();
- iceServer.urls.add("stun:stun.l.google.com:19302");
- config.iceServers.add(iceServer);
-
- // Create the peer connection.
- peerConnection = factory.createPeerConnection(config, this);
-
- // Create an audio source with options.
- AudioOptions audioOptions = new AudioOptions();
- audioOptions.echoCancellation = true;
- audioOptions.autoGainControl = true;
- audioOptions.noiseSuppression = true;
-
- AudioTrackSource audioSource = factory.createAudioSource(audioOptions);
- audioTrack = factory.createAudioTrack("audio0", audioSource);
-
- VideoDeviceSource videoSource = new VideoDeviceSource();
- videoTrack = factory.createVideoTrack("video0", videoSource);
-
- // Add the tracks to the peer connection.
- List streamIds = new ArrayList<>();
- streamIds.add("stream1");
- peerConnection.addTrack(audioTrack, streamIds);
- peerConnection.addTrack(videoTrack, streamIds);
-
- System.out.println("LocalPeer: Created with audio and video tracks");
- }
-
- /**
- * Closes the peer connection and releases resources.
- */
- public void dispose() {
- if (audioTrack != null) {
- audioTrack.removeSink(audioFrameLogger);
- }
- if (videoTrack != null) {
- videoTrack.removeSink(videoFrameLogger);
- }
- if (peerConnection != null) {
- peerConnection.close();
- }
- }
-
- // PeerConnectionObserver implementation.
-
- @Override
- public void onIceCandidate(RTCIceCandidate candidate) {
- System.out.println("LocalPeer: New ICE candidate: " + candidate.sdp);
- // In a real application, you would send this candidate to the remote peer
- // through your signaling channel.
- }
-
- @Override
- public void onConnectionChange(RTCPeerConnectionState state) {
- System.out.println("LocalPeer: Connection state changed to: " + state);
- }
-
- @Override
- public void onIceConnectionChange(RTCIceConnectionState state) {
- System.out.println("LocalPeer: ICE connection state changed to: " + state);
- }
-
- @Override
- public void onIceGatheringChange(RTCIceGatheringState state) {
- System.out.println("LocalPeer: ICE gathering state changed to: " + state);
- }
-
- @Override
- public void onSignalingChange(RTCSignalingState state) {
- System.out.println("LocalPeer: Signaling state changed to: " + state);
- }
-
- @Override
- public void onDataChannel(RTCDataChannel dataChannel) {
- System.out.println("LocalPeer: Data channel created: " + dataChannel.getLabel());
- }
-
- @Override
- public void onRenegotiationNeeded() {
- System.out.println("LocalPeer: Renegotiation needed");
- // In a real application, you would create an offer and set it as the local description.
- }
-
- @Override
- public void onAddTrack(RTCRtpReceiver receiver, MediaStream[] mediaStreams) {
- System.out.println("LocalPeer: Track added: " + receiver.getTrack().getKind());
- }
-
- @Override
- public void onRemoveTrack(RTCRtpReceiver receiver) {
- System.out.println("LocalPeer: Track removed: " + receiver.getTrack().getKind());
- }
-
- @Override
- public void onTrack(RTCRtpTransceiver transceiver) {
- MediaStreamTrack track = transceiver.getReceiver().getTrack();
- String kind = track.getKind();
-
- if (kind.equals(MediaStreamTrack.AUDIO_TRACK_KIND)) {
- AudioTrack audioTrack = (AudioTrack) track;
- audioTrack.addSink(audioFrameLogger);
- }
- if (kind.equals(MediaStreamTrack.VIDEO_TRACK_KIND)) {
- VideoTrack videoTrack = (VideoTrack) track;
- videoTrack.addSink(videoFrameLogger);
- }
-
- System.out.println("LocalPeer: Transceiver track added: " + kind);
- }
- }
-
-
-
- /**
- * A simple implementation of VideoTrackSink that logs information about received frames.
- */
- private static class VideoFrameLogger implements VideoTrackSink {
-
- private static final long LOG_INTERVAL_MS = 1000; // Log every second
- private int frameCount = 0;
- private long lastLogTime = System.currentTimeMillis();
-
-
- @Override
- public void onVideoFrame(VideoFrame frame) {
- frameCount++;
-
- long now = System.currentTimeMillis();
- if (now - lastLogTime >= LOG_INTERVAL_MS) {
- System.out.printf("Received %d video frames in the last %.1f seconds%n",
- frameCount, (now - lastLogTime) / 1000.0);
- System.out.printf("Last frame: %dx%d, rotation: %d, timestamp: %dms%n",
- frame.buffer.getWidth(), frame.buffer.getHeight(), frame.rotation,
- frame.timestampNs / 1000000);
-
- frameCount = 0;
- lastLogTime = now;
- }
-
- // Release the native resources associated with this frame to prevent memory leaks.
- frame.release();
- }
- }
-
-
-
- /**
- * A simple implementation of AudioTrackSink that logs information about received audio data.
- */
- private static class AudioFrameLogger implements AudioTrackSink {
-
- private static final long LOG_INTERVAL_MS = 1000; // Log every second
- private int frameCount = 0;
- private long lastLogTime = System.currentTimeMillis();
-
-
- @Override
- public void onData(byte[] data, int bitsPerSample, int sampleRate, int channels, int frames) {
- frameCount++;
-
- long now = System.currentTimeMillis();
- if (now - lastLogTime >= LOG_INTERVAL_MS) {
- System.out.printf("Received %d audio frames in the last %.1f seconds%n",
- frameCount, (now - lastLogTime) / 1000.0);
- System.out.printf("Last audio data: %d bytes, %d bits/sample, %d Hz, %d channels, %d frames%n",
- data.length, bitsPerSample, sampleRate, channels, frames);
-
- frameCount = 0;
- lastLogTime = now;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/WhepExample.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/WhepExample.java
deleted file mode 100644
index 46a49c9..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/WhepExample.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples;
-
-import java.net.URI;
-import java.net.http.HttpClient;
-import java.net.http.HttpRequest;
-import java.net.http.HttpResponse;
-import java.time.Duration;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import dev.onvoid.webrtc.*;
-import dev.onvoid.webrtc.media.MediaStream;
-import dev.onvoid.webrtc.media.MediaStreamTrack;
-import dev.onvoid.webrtc.media.video.VideoDeviceSource;
-import dev.onvoid.webrtc.media.video.VideoTrack;
-
-/**
- * Example implementation of WebRTC HTTP Egress Protocol (WHEP) client.
- *
- * This class demonstrates:
- *
- *
Setting up a WebRTC peer connection
- *
Creating and sending an SDP offer to a WHEP endpoint
- *
Receiving and processing an SDP answer
- *
Establishing media streaming over WebRTC
- *
- *
- * The example creates a receive-only peer connection that can accept
- * incoming video streams from a WHEP-compatible server.
- *
- * @see WHEP Specification
- *
- * @author Alex Andres
- */
-public class WhepExample {
-
- private static final String WHEP_ENDPOINT_URL = "http://localhost:8889/mystream/whep";
-
- /** Factory for creating peer connections and media objects. */
- private PeerConnectionFactory factory;
-
- /** The WebRTC peer connection that handles media communication. */
- private RTCPeerConnection peerConnection;
-
- /** The local SDP offer to be sent to the remote endpoint. */
- private RTCSessionDescription localOffer;
-
- // Synchronization objects for async operations.
- private final CountDownLatch offerCreatedLatch = new CountDownLatch(1);
- private final CountDownLatch localDescriptionSetLatch = new CountDownLatch(1);
- private final CountDownLatch remoteDescriptionSetLatch = new CountDownLatch(1);
-
-
- public static void main(String[] args) {
- WhepExample example = new WhepExample();
-
- try {
- example.run();
- }
- catch (Exception e) {
- Logger.getLogger("WHEPExample").log(Level.SEVERE, "Error running WHEP example", e);
- }
- finally {
- example.cleanup();
- }
- }
-
- public void run() throws Exception {
- System.out.println("Starting WebRTC Peer Connection Example");
-
- initializePeerConnectionFactory();
- createPeerConnection();
- createOffer();
-
- // Wait for the offer to be created.
- if (!offerCreatedLatch.await(5, TimeUnit.SECONDS)) {
- throw new IllegalStateException("Timeout waiting for offer creation.");
- }
-
- // Set the local description (the offer).
- setLocalDescription(localOffer);
-
- // Wait for the local description to be set.
- if (!localDescriptionSetLatch.await(5, TimeUnit.SECONDS)) {
- throw new IllegalStateException("Timeout waiting for local description to be set.");
- }
-
- System.out.println("Local offer created and set.");
- //System.out.println("SDP Offer: " + localOffer.sdp);
- System.out.println("Sending local offer to the remote endpoint.");
-
- String answerSdp = sendOfferEndpoint(localOffer.sdp);
-
- //System.out.println("SDP Answer: " + answerSdp);
-
- // Set the remote description (the answer).
- setRemoteDescription(new RTCSessionDescription(RTCSdpType.ANSWER, answerSdp));
-
- // Wait for the remote description to be set.
- if (!remoteDescriptionSetLatch.await(5, TimeUnit.SECONDS)) {
- throw new IllegalStateException("Timeout waiting for remote description to be set.");
- }
-
- System.out.println("Remote answer set. Peer connection established!");
- System.out.println("Media should now be exchanged between peers.");
-
- // Wait a bit to see connection state changes.
- Thread.sleep(10000);
-
- System.out.println("WebRTC Peer Connection Example completed.");
- }
-
- private void initializePeerConnectionFactory() {
- System.out.println("Initializing PeerConnectionFactory.");
- factory = new PeerConnectionFactory();
- }
-
- private void createPeerConnection() {
- System.out.println("Creating peer connection.");
-
- // Create ICE servers configuration.
- RTCConfiguration config = new RTCConfiguration();
-
- // Add Google's public STUN server.
- RTCIceServer iceServer = new RTCIceServer();
- iceServer.urls.add("stun:stun.l.google.com:19302");
- config.iceServers.add(iceServer);
-
- // Create the peer connection with our observer.
- peerConnection = factory.createPeerConnection(config, new PeerConnectionObserverImpl());
-
- // Create a video track from a video device source (e.g., webcam).
- // Since we are only receiving video in this example, the source will be a dummy video source.
- VideoDeviceSource videoSource = new VideoDeviceSource();
- VideoTrack videoTrack = factory.createVideoTrack("videoTrack", videoSource);
- videoTrack.addSink(videoFrame -> System.out.println("Received video frame: " + videoFrame));
-
- // Only interested in receiving video, so we set up a transceiver for that.
- RTCRtpTransceiverInit transceiverInit = new RTCRtpTransceiverInit();
- transceiverInit.direction = RTCRtpTransceiverDirection.RECV_ONLY;
-
- // Add the transceiver to the peer connection with the video track.
- RTCRtpTransceiver transceiver = peerConnection.addTransceiver(videoTrack, transceiverInit);
-
- // Set up a sink to handle incoming video frames.
- MediaStreamTrack track = transceiver.getReceiver().getTrack();
- if (track instanceof VideoTrack vTrack) {
- vTrack.addSink(videoFrame -> {
- System.out.println("Received video frame: " + videoFrame);
-
- // IMPORTANT: Always release the frame when done to prevent memory leaks
- videoFrame.release();
- });
- }
- }
-
- private void createOffer() {
- System.out.println("Creating offer.");
-
- // Create offer options (use default options).
- RTCOfferOptions options = new RTCOfferOptions();
-
- // Create the offer.
- peerConnection.createOffer(options, new CreateSessionDescriptionObserver() {
- @Override
- public void onSuccess(RTCSessionDescription description) {
- System.out.println("Offer created successfully.");
- localOffer = description;
- offerCreatedLatch.countDown();
- }
-
- @Override
- public void onFailure(String error) {
- System.err.println("Failed to create offer: " + error);
- offerCreatedLatch.countDown();
- }
- });
- }
-
- private void setLocalDescription(RTCSessionDescription description) {
- System.out.println("Setting local description.");
-
- peerConnection.setLocalDescription(description, new SetSessionDescriptionObserver() {
- @Override
- public void onSuccess() {
- System.out.println("Local description set successfully.");
- localDescriptionSetLatch.countDown();
- }
-
- @Override
- public void onFailure(String error) {
- System.err.println("Failed to set local description: " + error);
- localDescriptionSetLatch.countDown();
- }
- });
- }
-
- private String sendOfferEndpoint(String sdpOffer) throws Exception {
- HttpClient client = HttpClient.newBuilder()
- .connectTimeout(Duration.ofSeconds(10))
- .build();
-
- HttpRequest request = HttpRequest.newBuilder()
- .uri(URI.create(WHEP_ENDPOINT_URL))
- .header("Content-Type", "application/sdp")
- .POST(HttpRequest.BodyPublishers.ofString(sdpOffer))
- .timeout(Duration.ofSeconds(30))
- .build();
-
- HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
-
- if (response.statusCode() == 200 || response.statusCode() == 201) {
- System.out.println("WHEP request successful");
- return response.body();
- }
- else {
- throw new RuntimeException("WHEP request failed with status: " + response.statusCode());
- }
- }
-
- private void setRemoteDescription(RTCSessionDescription description) {
- System.out.println("Setting remote description.");
-
- peerConnection.setRemoteDescription(description, new SetSessionDescriptionObserver() {
- @Override
- public void onSuccess() {
- System.out.println("Remote description set successfully.");
- remoteDescriptionSetLatch.countDown();
- }
-
- @Override
- public void onFailure(String error) {
- System.err.println("Failed to set remote description: " + error);
- remoteDescriptionSetLatch.countDown();
- }
- });
- }
-
- private void cleanup() {
- System.out.println("Cleaning up resources.");
-
- if (peerConnection != null) {
- peerConnection.close();
- peerConnection = null;
- }
-
- if (factory != null) {
- factory.dispose();
- factory = null;
- }
- }
-
-
-
- /**
- * Implementation of PeerConnectionObserver to handle events from the peer connection.
- */
- private static class PeerConnectionObserverImpl implements PeerConnectionObserver {
-
- @Override
- public void onIceCandidate(RTCIceCandidate candidate) {
- System.out.println("ICE candidate: " + candidate.sdp);
- // In a real application, we would send this candidate to the remote peer
- }
-
- @Override
- public void onConnectionChange(RTCPeerConnectionState state) {
- System.out.println("Connection state changed: " + state);
- }
-
- @Override
- public void onIceConnectionChange(RTCIceConnectionState state) {
- System.out.println("ICE connection state changed: " + state);
- }
-
- @Override
- public void onIceGatheringChange(RTCIceGatheringState state) {
- System.out.println("ICE gathering state changed: " + state);
- }
-
- @Override
- public void onSignalingChange(RTCSignalingState state) {
- System.out.println("Signaling state changed: " + state);
- }
-
- @Override
- public void onDataChannel(RTCDataChannel dataChannel) {
- System.out.println("Data channel created: " + dataChannel.getLabel());
- }
-
- @Override
- public void onRenegotiationNeeded() {
- System.out.println("Renegotiation needed.");
- }
-
- @Override
- public void onAddTrack(RTCRtpReceiver receiver, MediaStream[] mediaStreams) {
- System.out.println("Track added.");
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/util/MediaFrameLogger.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/util/MediaFrameLogger.java
deleted file mode 100644
index ae1f748..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/util/MediaFrameLogger.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.util;
-
-import dev.onvoid.webrtc.media.audio.AudioTrackSink;
-import dev.onvoid.webrtc.media.video.VideoFrame;
-import dev.onvoid.webrtc.media.video.VideoTrackSink;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class for logging audio and video frame information.
- *
- * @author Alex Andres
- */
-public class MediaFrameLogger {
-
- private static final Logger LOG = LoggerFactory.getLogger(MediaFrameLogger.class);
-
-
- /**
- * Creates a new audio track sink that logs information about received audio data.
- *
- * @return An AudioTrackSink that logs audio frame information.
- */
- public static AudioTrackSink createAudioLogger() {
- return new AudioFrameLogger();
- }
-
- /**
- * Creates a new video track sink that logs information about received video frames.
- *
- * @return A VideoTrackSink that logs video frame information.
- */
- public static VideoTrackSink createVideoLogger() {
- return new VideoFrameLogger();
- }
-
-
-
- /**
- * A simple implementation of AudioTrackSink that logs information about received audio data.
- */
- private static class AudioFrameLogger implements AudioTrackSink {
-
- private static final long LOG_INTERVAL_MS = 1000; // Log every second
- private int frameCount = 0;
- private long lastLogTime = System.currentTimeMillis();
-
- @Override
- public void onData(byte[] data, int bitsPerSample, int sampleRate, int channels, int frames) {
- frameCount++;
-
- long now = System.currentTimeMillis();
- if (now - lastLogTime >= LOG_INTERVAL_MS) {
- LOG.info(String.format("Received %d audio frames in the last %.1f seconds",
- frameCount, (now - lastLogTime) / 1000.0));
- LOG.info(String.format("Last audio data: %d bytes, %d bits/sample, %d Hz, %d channels, %d frames",
- data.length, bitsPerSample, sampleRate, channels, frames));
-
- frameCount = 0;
- lastLogTime = now;
- }
- }
- }
-
-
-
- /**
- * A simple implementation of VideoTrackSink that logs information about received frames.
- */
- private static class VideoFrameLogger implements VideoTrackSink {
-
- private static final long LOG_INTERVAL_MS = 1000; // Log every second
- private int frameCount = 0;
- private long lastLogTime = System.currentTimeMillis();
-
- @Override
- public void onVideoFrame(VideoFrame frame) {
- frameCount++;
-
- long now = System.currentTimeMillis();
- if (now - lastLogTime >= LOG_INTERVAL_MS) {
- LOG.info(String.format("Received %d video frames in the last %.1f seconds",
- frameCount, (now - lastLogTime) / 1000.0));
- LOG.info(String.format("Last frame: %dx%d, rotation: %d, timestamp: %dms",
- frame.buffer.getWidth(), frame.buffer.getHeight(), frame.rotation,
- frame.timestampNs / 1000000));
-
- frameCount = 0;
- lastLogTime = now;
- }
-
- // Release the native resources associated with this frame to prevent memory leaks.
- frame.release();
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/WebClientExample.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/WebClientExample.java
deleted file mode 100644
index 80efc98..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/WebClientExample.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.util.logging.LogManager;
-
-import dev.onvoid.webrtc.examples.web.model.LeaveMessage;
-import dev.onvoid.webrtc.media.MediaStreamTrack;
-
-import dev.onvoid.webrtc.examples.web.client.SignalingManager;
-import dev.onvoid.webrtc.examples.web.connection.PeerConnectionManager;
-import dev.onvoid.webrtc.examples.web.media.MediaManager;
-import dev.onvoid.webrtc.examples.web.model.JoinMessage;
-import dev.onvoid.webrtc.examples.util.MediaFrameLogger;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Example demonstrating how to combine WebSocket signaling with WebRTC peer connections.
- *
- * This example shows how to:
- *
- *
Connect to a signaling server using WebSockets
- *
Set up media tracks
- *
Establish a WebRTC peer connection with audio and video
- *
- *
- * @author Alex Andres
- */
-public class WebClientExample {
-
- static {
- setupLogging();
- }
-
- private static final Logger LOG = LoggerFactory.getLogger(WebClientExample.class);
-
- /** Manages communication with the signaling server. */
- private final SignalingManager signaling;
-
- /** Handles WebRTC peer connection setup and management. */
- private final PeerConnectionManager peerConnectionManager;
-
- /** Manages audio and video tracks and devices. */
- private final MediaManager mediaManager;
-
-
- /**
- * Creates a new WebClientExample that combines WebSocket signaling with WebRTC.
- *
- * @param signalingUri The URI of the signaling server.
- * @param subprotocol The WebSocket subprotocol to use.
- */
- public WebClientExample(URI signalingUri, String subprotocol) {
- signaling = new SignalingManager(signalingUri, subprotocol);
- signaling.setUserId("java-client");
-
- peerConnectionManager = new PeerConnectionManager();
-
- mediaManager = new MediaManager();
- mediaManager.createTracks(peerConnectionManager, true, true);
-
- setupCallbacks();
-
- LOG.info("WebClientExample created with audio and video tracks");
- }
-
- /**
- * Sets up callbacks between components.
- */
- private void setupCallbacks() {
- // Set up signaling callbacks.
- signaling.setOnOfferReceived(peerConnectionManager::handleOffer);
- signaling.setOnAnswerReceived(peerConnectionManager::handleAnswer);
- signaling.setOnCandidateReceived(peerConnectionManager::handleCandidate);
- signaling.setOnJoinReceived(this::handleJoin);
- signaling.setOnLeaveReceived(this::handleLeave);
-
- // Set up peer connection callbacks.
- peerConnectionManager.setOnLocalDescriptionCreated(signaling::sendSessionDescription);
- peerConnectionManager.setOnIceCandidateGenerated(signaling::sendIceCandidate);
- peerConnectionManager.setOnTrackReceived(this::handleTrackReceived);
- }
-
- /**
- * Handles a received media track.
- *
- * @param track The received media track.
- */
- private void handleTrackReceived(MediaStreamTrack track) {
- String kind = track.getKind();
- LOG.info("Received track: {}", kind);
-
- if (kind.equals(MediaStreamTrack.AUDIO_TRACK_KIND)) {
- mediaManager.addAudioSink(MediaFrameLogger.createAudioLogger());
- }
- else if (kind.equals(MediaStreamTrack.VIDEO_TRACK_KIND)) {
- mediaManager.addVideoSink(MediaFrameLogger.createVideoLogger());
- }
- }
-
- /**
- * Connects to the signaling server.
- *
- * @return true if the connection was successful, false otherwise.
- */
- public boolean connect() {
- return signaling.connect();
- }
-
- /**
- * Disconnects from the signaling server and closes the peer connection.
- */
- public void disconnect() {
- signaling.disconnect();
-
- if (mediaManager != null) {
- mediaManager.dispose();
- }
- if (peerConnectionManager != null) {
- peerConnectionManager.close();
- }
-
- LOG.info("Disconnected from signaling server and closed peer connection");
- }
-
- /**
- * Joins a room on the signaling server.
- *
- * This method sends a join request to the signaling server for the specified room.
- *
- * @param roomName the name of the room to join on the signaling server
- */
- public void joinRoom(String roomName) {
- if (!signaling.isConnected()) {
- LOG.warn("Cannot join room: not connected to signaling server");
- return;
- }
-
- signaling.sendJoin(roomName);
- }
-
- /**
- * Initiates a call by creating and sending an offer.
- */
- public void call() {
- if (!signaling.isConnected()) {
- LOG.warn("Cannot initiate call: not connected to signaling server");
- return;
- }
-
- peerConnectionManager.setInitiator(true);
- peerConnectionManager.createOffer();
- }
-
- /**
- * Handles an incoming join message from the remote peer.
- *
- * @param message The join message.
- */
- private void handleJoin(JoinMessage message) {
- LOG.info("Received join message from peer: {}", message.getFrom());
-
- // Remote peer wants to join a room, we need to create an offer if we're not the initiator.
- if (!peerConnectionManager.isInitiator()) {
- peerConnectionManager.createOffer();
- }
- }
-
- /**
- * Handles an incoming leave message from the remote peer.
- *
- * @param message The leave message.
- */
- private void handleLeave(LeaveMessage message) {
- LOG.info("Peer {} has left the room", message.getFrom());
-
- // Handle peer leaving logic, such as closing tracks or updating UI.
- }
-
- /**
- * Entry point to demonstrate the WebClientExample.
- */
- public static void main(String[] args) {
- try {
- WebClientExample client = new WebClientExample(
- URI.create("wss://localhost:8443/ws"),
- "ws-signaling");
-
- if (client.connect()) {
- LOG.info("Connected to signaling server");
-
- // Join a room.
- client.joinRoom("default-room");
-
- // Initiate the call.
- client.call();
-
- // Keep the application running to observe state changes.
- System.out.println("Press Enter to exit...");
- System.in.read();
- }
- else {
- LOG.error("Failed to connect to signaling server");
- }
-
- // Clean up.
- client.disconnect();
- }
- catch (Exception e) {
- LOG.error("Error in WebClientExample", e);
- }
- }
-
- /**
- * Sets up logging for the application.
- */
- public static void setupLogging() {
- try {
- InputStream configFile = WebClientExample.class.getResourceAsStream("/resources/logging.properties");
- LogManager.getLogManager().readConfiguration(configFile);
- }
- catch (IOException e) {
- System.err.println("Could not load configuration file:");
- System.err.println(e.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/client/SignalingManager.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/client/SignalingManager.java
deleted file mode 100644
index 2d6fd4e..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/client/SignalingManager.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.client;
-
-import java.net.URI;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import dev.onvoid.webrtc.RTCIceCandidate;
-import dev.onvoid.webrtc.RTCSessionDescription;
-
-import dev.onvoid.webrtc.examples.web.model.*;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Manages WebSocket signaling for WebRTC connections.
- *
- * This class handles the communication between peers during WebRTC connection establishment.
- * It manages sending and receiving:
- *
- *
Session descriptions (offers and answers)
- *
ICE candidates
- *
Join messages for room-based signaling
- *
- *
- * The manager connects to a signaling server via WebSocket and translates WebRTC-related
- * objects to JSON messages that can be transmitted over the signaling channel.
- *
- * @author Alex Andres
- */
-public class SignalingManager {
-
- private static final Logger LOG = LoggerFactory.getLogger(SignalingManager.class);
-
- /** The WebSocket client used to communicate with the signaling server. */
- private final WebSocketClient signaling;
-
- /** JSON mapper for serializing and deserializing signaling messages. */
- private final ObjectMapper jsonMapper;
-
- /** Callback that is triggered when an offer message is received from a remote peer. */
- private Consumer onOfferReceived;
-
- /** Callback that is triggered when an answer message is received from a remote peer. */
- private Consumer onAnswerReceived;
-
- /** Callback that is triggered when an ICE candidate is received from a remote peer. */
- private Consumer onCandidateReceived;
-
- /** Callback that is triggered when a join message is received. */
- private Consumer onJoinReceived;
-
- /** Callback that is triggered when a leave message is received. */
- private Consumer onLeaveReceived;
-
- private String userId = "java-client";
- private String remotePeerId = "web-client";
-
-
- /**
- * Creates a new SignalingManager with the specified URI and subprotocol.
- *
- * @param signalingUri The URI of the signaling server.
- * @param subprotocol The WebSocket subprotocol to use.
- */
- public SignalingManager(URI signalingUri, String subprotocol) {
- this.signaling = new WebSocketClient(signalingUri, subprotocol);
- this.jsonMapper = new ObjectMapper();
-
- setupSignaling();
-
- LOG.info("SignalingManager created");
- }
-
- /**
- * Connects to the signaling server.
- *
- * @return true if the connection was successful, false otherwise.
- */
- public boolean connect() {
- try {
- CountDownLatch connectLatch = new CountDownLatch(1);
-
- signaling.connect()
- .thenAccept(ws -> {
- LOG.info("Connected to signaling server");
- connectLatch.countDown();
- })
- .exceptionally(e -> {
- LOG.error("Failed to connect to signaling server", e);
- connectLatch.countDown();
- return null;
- });
-
- // Wait for connection.
- connectLatch.await(5, TimeUnit.SECONDS);
-
- return signaling.isConnected();
- }
- catch (Exception e) {
- LOG.error("Error connecting to signaling server", e);
- return false;
- }
- }
-
- /**
- * Disconnects from the signaling server.
- */
- public void disconnect() {
- if (isConnected()) {
- signaling.disconnect(1000, "Client disconnecting");
-
- LOG.info("Disconnected from signaling server");
- }
- }
-
- /**
- * Sends a join message to the signaling server.
- *
- * @param roomId The ID of the room to join.
- */
- public void sendJoin(String roomId) {
- try {
- JoinMessage joinMessage = new JoinMessage(userId, roomId, "Java Client");
-
- // Convert to JSON and send.
- String joinMessageJson = jsonMapper.writeValueAsString(joinMessage);
- signaling.sendMessage(joinMessageJson);
-
- LOG.info("Sent join message for room: {}", roomId);
- }
- catch (Exception e) {
- LOG.error("Error creating JSON join message", e);
- }
- }
-
- /**
- * Sends a session description (offer or answer) to the remote peer.
- *
- * @param sdp The session description to send.
- */
- public void sendSessionDescription(RTCSessionDescription sdp) {
- String type = sdp.sdpType.toString().toLowerCase();
-
- try {
- SessionDescriptionMessage message = new SessionDescriptionMessage(
- type,
- userId,
- remotePeerId,
- sdp.sdp
- );
-
- String messageJson = jsonMapper.writeValueAsString(message);
- signaling.sendMessage(messageJson);
-
- LOG.info("Sent {} to remote peer", type);
- }
- catch (Exception e) {
- LOG.error("Error creating JSON message", e);
- }
- }
-
- /**
- * Sends an ICE candidate to the remote peer.
- *
- * @param candidate The ICE candidate to send.
- */
- public void sendIceCandidate(RTCIceCandidate candidate) {
- try {
- IceCandidateMessage message = new IceCandidateMessage(
- userId,
- remotePeerId,
- candidate.sdp,
- candidate.sdpMid,
- candidate.sdpMLineIndex
- );
-
- String candidateJson = jsonMapper.writeValueAsString(message);
- signaling.sendMessage(candidateJson);
-
- LOG.info("Sent ICE candidate to remote peer");
- }
- catch (Exception e) {
- LOG.error("Error creating JSON message", e);
- }
- }
-
- /**
- * Sets up the WebSocket signaling to handle incoming messages.
- */
- private void setupSignaling() {
- signaling.addMessageListener(message -> {
- try {
- // Parse the message to extract the type.
- String type = jsonMapper.readTree(message).path("type").asText();
- MessageType messageType = MessageType.fromString(type);
-
- switch (messageType) {
- case OFFER -> handleOfferMessage(message);
- case ANSWER -> handleAnswerMessage(message);
- case ICE_CANDIDATE -> handleIceCandidateMessage(message);
- case JOIN -> handleJoinMessage(message);
- case LEAVE -> handleLeaveMessage(message);
- case HEARTBEAT_ACK -> LOG.info("Received: {}", type);
- default -> LOG.info("Received message with unknown type: {}", type);
- }
- }
- catch (Exception e) {
- LOG.error("Error parsing message type", e);
- }
- });
-
- signaling.addCloseListener(() -> {
- LOG.info("Signaling connection closed");
- });
-
- signaling.addErrorListener(error -> {
- LOG.error("Signaling error", error);
- });
- }
-
- /**
- * Sets a callback to be invoked when an offer is received.
- *
- * @param callback The callback to invoke.
- */
- public void setOnOfferReceived(Consumer callback) {
- this.onOfferReceived = callback;
- }
-
- /**
- * Sets a callback to be invoked when an answer is received.
- *
- * @param callback The callback to invoke.
- */
- public void setOnAnswerReceived(Consumer callback) {
- this.onAnswerReceived = callback;
- }
-
- /**
- * Sets a callback to be invoked when an ICE candidate is received.
- *
- * @param callback The callback to invoke.
- */
- public void setOnCandidateReceived(Consumer callback) {
- this.onCandidateReceived = callback;
- }
-
- /**
- * Sets a callback to be invoked when a join message is received.
- *
- * @param callback The callback to invoke.
- */
- public void setOnJoinReceived(Consumer callback) {
- this.onJoinReceived = callback;
- }
-
- /**
- * Sets a callback to be invoked when a leave message is received.
- *
- * @param callback The callback to invoke.
- */
- public void setOnLeaveReceived(Consumer callback) {
- this.onLeaveReceived = callback;
- }
-
- /**
- * Sets the user ID for this client.
- *
- * @param userId The user ID to set.
- */
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- /**
- * Sets the remote peer ID.
- *
- * @param remotePeerId The remote peer ID to set.
- */
- public void setRemotePeerId(String remotePeerId) {
- this.remotePeerId = remotePeerId;
- }
-
- /**
- * Gets the user ID for this client.
- *
- * @return The user ID.
- */
- public String getUserId() {
- return userId;
- }
-
- /**
- * Gets the remote peer ID.
- *
- * @return The remote peer ID.
- */
- public String getRemotePeerId() {
- return remotePeerId;
- }
-
- /**
- * Checks if the signaling connection is established.
- *
- * @return true if connected, false otherwise.
- */
- public boolean isConnected() {
- return signaling != null && signaling.isConnected();
- }
-
- /**
- * Handles an incoming offer message.
- *
- * @param message The JSON message containing an offer.
- */
- private void handleOfferMessage(String message) {
- if (onOfferReceived != null) {
- try {
- SessionDescriptionMessage sdpMessage = jsonMapper.readValue(message, SessionDescriptionMessage.class);
- onOfferReceived.accept(sdpMessage);
- }
- catch (Exception e) {
- LOG.error("Error parsing offer message", e);
- }
- }
- }
-
- /**
- * Handles an incoming answer message.
- *
- * @param message The JSON message containing an answer.
- */
- private void handleAnswerMessage(String message) {
- if (onAnswerReceived != null) {
- try {
- SessionDescriptionMessage sdpMessage = jsonMapper.readValue(message, SessionDescriptionMessage.class);
- onAnswerReceived.accept(sdpMessage);
- }
- catch (Exception e) {
- LOG.error("Error parsing answer message", e);
- }
- }
- }
-
- /**
- * Handles an incoming ICE candidate message.
- *
- * @param message The JSON message containing an ICE candidate.
- */
- private void handleIceCandidateMessage(String message) {
- if (onCandidateReceived != null) {
- try {
- IceCandidateMessage iceMessage = jsonMapper.readValue(message, IceCandidateMessage.class);
- onCandidateReceived.accept(iceMessage);
- }
- catch (Exception e) {
- LOG.error("Error parsing ICE candidate message", e);
- }
- }
- }
-
- /**
- * Handles an incoming join message.
- *
- * @param message The JSON message containing join information.
- */
- private void handleJoinMessage(String message) {
- if (onJoinReceived != null) {
- try {
- JoinMessage joinMessage = jsonMapper.readValue(message, JoinMessage.class);
- onJoinReceived.accept(joinMessage);
- }
- catch (Exception e) {
- LOG.error("Error parsing join message", e);
- }
- }
- }
-
- /**
- * Handles an incoming leave message.
- *
- * @param message The JSON message indicating a peer has left.
- */
- private void handleLeaveMessage(String message) {
- if (onLeaveReceived != null) {
- try {
- LeaveMessage leaveMessage = jsonMapper.readValue(message, LeaveMessage.class);
- onLeaveReceived.accept(leaveMessage);
- }
- catch (Exception e) {
- LOG.error("Error parsing join message", e);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/client/WebSocketClient.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/client/WebSocketClient.java
deleted file mode 100644
index e2a8762..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/client/WebSocketClient.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.client;
-
-import java.net.URI;
-import java.net.http.HttpClient;
-import java.net.http.WebSocket;
-import java.nio.ByteBuffer;
-import java.time.Duration;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import dev.onvoid.webrtc.examples.web.model.SignalingMessage;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A WebSocket client implementation using JDK internal WebSockets (java.net.http.WebSocket).
- * This client supports secure WebSocket connections (WSS), message sending/receiving,
- * and automatic heartbeat to keep the connection alive.
- *
- * @author Alex Andres
- */
-public class WebSocketClient {
-
- private static final Logger LOG = LoggerFactory.getLogger(WebSocketClient.class);
-
- /** The interval between heartbeat messages in seconds to keep the WebSocket connection alive. */
- private static final long HEARTBEAT_INTERVAL_SECONDS = 15;
-
- /** JSON serializer/deserializer for processing WebSocket messages. */
- private final ObjectMapper jsonMapper = new ObjectMapper();
-
- private final URI serverUri;
- private final List subprotocols;
- private final List> messageListeners;
- private final List closeListeners;
- private final List> errorListeners;
-
- private WebSocket webSocket;
- private ScheduledExecutorService heartbeatExecutor;
- private boolean connected = false;
-
-
- /**
- * Creates a new WebSocket client.
- *
- * @param serverUri The URI of the WebSocket server (e.g., "wss://localhost:8443/ws").
- * @param subprotocols The WebSocket subprotocols to use (e.g., "ws-signaling").
- */
- public WebSocketClient(URI serverUri, List subprotocols) {
- this.serverUri = serverUri;
- this.subprotocols = subprotocols;
- this.messageListeners = new CopyOnWriteArrayList<>();
- this.closeListeners = new CopyOnWriteArrayList<>();
- this.errorListeners = new CopyOnWriteArrayList<>();
- }
-
- /**
- * Creates a new WebSocket client with a single subprotocol.
- *
- * @param serverUri The URI of the WebSocket server.
- * @param subprotocol The WebSocket subprotocol to use.
- */
- public WebSocketClient(URI serverUri, String subprotocol) {
- this(serverUri, List.of(subprotocol));
- }
-
- /**
- * Connects to the WebSocket server.
- *
- * @return A CompletableFuture that completes when the connection is established.
- */
- public CompletableFuture connect() {
- if (connected) {
- return CompletableFuture.completedFuture(webSocket);
- }
-
- WebSocket.Listener listener = new WebSocketListener();
-
- // Create an HTTP client that accepts all SSL certificates (useful for self-signed certs in development).
- HttpClient client = HttpClient.newBuilder()
- .sslContext(TrustAllCertificates.createSslContext())
- .connectTimeout(Duration.ofSeconds(10))
- .build();
-
- // Build the WebSocket with our listener and subprotocols.
- WebSocket.Builder wsBuilder = client.newWebSocketBuilder()
- .connectTimeout(Duration.ofSeconds(10));
-
- // Add subprotocols if provided.
- if (subprotocols != null && !subprotocols.isEmpty()) {
- for (String protocol : subprotocols) {
- wsBuilder.subprotocols(protocol);
- }
- }
-
- LOG.info("Connecting to WebSocket server: {}", serverUri);
-
- return wsBuilder.buildAsync(serverUri, listener)
- .thenApply(ws -> {
- this.webSocket = ws;
- this.connected = true;
-
- // Start heartbeat to keep connection alive.
- startHeartbeat();
-
- LOG.info("Connected to WebSocket server: {}", serverUri);
- return ws;
- })
- .exceptionally(ex -> {
- LOG.error("Failed to connect to WebSocket server: {}", ex.getMessage());
- notifyErrorListeners(ex);
- return null;
- });
- }
-
- /**
- * Sends a text message to the WebSocket server.
- *
- * @param message The message to send.
- *
- * @return A CompletableFuture that completes when the message is sent.
- */
- public CompletableFuture sendMessage(String message) {
- if (!connected || webSocket == null) {
- return CompletableFuture.failedFuture(
- new IllegalStateException("Not connected to WebSocket server"));
- }
-
- LOG.debug("Sending message: {}", message);
-
- return webSocket.sendText(message, true);
- }
-
- /**
- * Closes the WebSocket connection.
- *
- * @param statusCode The WebSocket close status code.
- * @param reason The reason for closing.
- *
- * @return A CompletableFuture that completes when the connection is closed.
- */
- public CompletableFuture disconnect(int statusCode, String reason) {
- if (!connected || webSocket == null) {
- return CompletableFuture.completedFuture(null);
- }
-
- stopHeartbeat();
-
- LOG.info("Disconnecting from WebSocket server: {}", serverUri);
-
- return webSocket.sendClose(statusCode, reason)
- .thenApply(ws -> {
- this.connected = false;
- this.webSocket = null;
- return ws;
- });
- }
-
- /**
- * Adds a listener for incoming text messages.
- *
- * @param listener The message listener.
- */
- public void addMessageListener(Consumer listener) {
- messageListeners.add(listener);
- }
-
- /**
- * Removes a message listener.
- *
- * @param listener The message listener to remove.
- */
- public void removeMessageListener(Consumer listener) {
- messageListeners.remove(listener);
- }
-
- /**
- * Adds a listener for connection close events.
- *
- * @param listener The close listener.
- */
- public void addCloseListener(Runnable listener) {
- closeListeners.add(listener);
- }
-
- /**
- * Removes a close listener.
- *
- * @param listener The close listener to remove.
- */
- public void removeCloseListener(Runnable listener) {
- closeListeners.remove(listener);
- }
-
- /**
- * Adds a listener for connection errors.
- *
- * @param listener The error listener.
- */
- public void addErrorListener(Consumer listener) {
- errorListeners.add(listener);
- }
-
- /**
- * Removes an error listener.
- *
- * @param listener The error listener to remove.
- */
- public void removeErrorListener(Consumer listener) {
- errorListeners.remove(listener);
- }
-
- /**
- * Checks if the client is connected to the WebSocket server.
- *
- * @return true if connected, false otherwise.
- */
- public boolean isConnected() {
- return connected;
- }
-
- /**
- * Starts the heartbeat to keep the WebSocket connection alive.
- */
- private void startHeartbeat() {
- // Ensure any existing heartbeat is stopped.
- stopHeartbeat();
-
- heartbeatExecutor = Executors.newSingleThreadScheduledExecutor(r -> {
- Thread t = new Thread(r, "websocket-heartbeat");
- t.setDaemon(true);
- return t;
- });
-
- heartbeatExecutor.scheduleAtFixedRate(() -> {
- if (connected && webSocket != null) {
- LOG.debug("Sending heartbeat");
-
- sendHeartbeat();
- }
- }, HEARTBEAT_INTERVAL_SECONDS, HEARTBEAT_INTERVAL_SECONDS, TimeUnit.SECONDS);
- }
-
- /**
- * Sends a heartbeat message to the WebSocket server to keep the connection alive.
- */
- private void sendHeartbeat() {
- SignalingMessage heartbeat = new SignalingMessage("heartbeat");
- String heartbeatJson;
-
- try {
- heartbeatJson = jsonMapper.writeValueAsString(heartbeat);
- }
- catch (JsonProcessingException e) {
- LOG.error("Failed to send heartbeat", e);
- return;
- }
-
- sendMessage(heartbeatJson)
- .exceptionally(ex -> {
- LOG.error("Failed to send heartbeat: {}", ex.getMessage());
- return null;
- });
- }
-
- /**
- * Stops the heartbeat.
- */
- private void stopHeartbeat() {
- if (heartbeatExecutor != null && !heartbeatExecutor.isShutdown()) {
- heartbeatExecutor.shutdownNow();
- heartbeatExecutor = null;
- }
- }
-
- /**
- * Notifies all registered message listeners with the received message.
- * Any exceptions thrown by listeners are caught and logged to prevent
- * them from affecting other listeners or the WebSocket connection.
- *
- * @param message The message received from the WebSocket server.
- */
- private void notifyMessageListeners(String message) {
- for (Consumer listener : messageListeners) {
- try {
- listener.accept(message);
- }
- catch (Exception e) {
- LOG.error("Error in message listener", e);
- }
- }
- }
-
- /**
- * Notifies all registered close listeners that the WebSocket connection has closed.
- * Any exceptions thrown by listeners are caught and logged to prevent
- * them from affecting other listeners.
- */
- private void notifyCloseListeners() {
- for (Runnable listener : closeListeners) {
- try {
- listener.run();
- }
- catch (Exception e) {
- LOG.error("Error in close listener", e);
- }
- }
- }
-
- /**
- * Notifies all registered error listeners about a WebSocket error.
- * Any exceptions thrown by listeners are caught and logged to prevent
- * them from affecting other listeners.
- *
- * @param error The error that occurred during WebSocket communication.
- */
- private void notifyErrorListeners(Throwable error) {
- for (Consumer listener : errorListeners) {
- try {
- listener.accept(error);
- }
- catch (Exception e) {
- LOG.error("Error in error listener", e);
- }
- }
- }
-
-
-
- /**
- * WebSocket listener implementation.
- */
- private class WebSocketListener implements WebSocket.Listener {
-
- private final StringBuilder messageBuilder = new StringBuilder();
-
-
- @Override
- public void onOpen(WebSocket webSocket) {
- LOG.debug("WebSocket connection opened");
- WebSocket.Listener.super.onOpen(webSocket);
- }
-
- @Override
- public CompletionStage> onText(WebSocket webSocket, CharSequence data, boolean last) {
- messageBuilder.append(data);
-
- if (last) {
- String message = messageBuilder.toString();
- messageBuilder.setLength(0);
-
- LOG.debug("Received message: {}", message);
- notifyMessageListeners(message);
- }
-
- return WebSocket.Listener.super.onText(webSocket, data, last);
- }
-
- @Override
- public CompletionStage> onBinary(WebSocket webSocket, ByteBuffer data, boolean last) {
- LOG.debug("Received binary data, size: {}", data.remaining());
- return WebSocket.Listener.super.onBinary(webSocket, data, last);
- }
-
- @Override
- public CompletionStage> onPing(WebSocket webSocket, ByteBuffer message) {
- LOG.debug("Received ping");
- return WebSocket.Listener.super.onPing(webSocket, message);
- }
-
- @Override
- public CompletionStage> onPong(WebSocket webSocket, ByteBuffer message) {
- LOG.debug("Received pong");
- return WebSocket.Listener.super.onPong(webSocket, message);
- }
-
- @Override
- public CompletionStage> onClose(WebSocket webSocket, int statusCode, String reason) {
- LOG.info("WebSocket connection closed: {} - {}", statusCode, reason);
- connected = false;
- WebSocketClient.this.webSocket = null;
- stopHeartbeat();
- notifyCloseListeners();
- return WebSocket.Listener.super.onClose(webSocket, statusCode, reason);
- }
-
- @Override
- public void onError(WebSocket webSocket, Throwable error) {
- LOG.error("WebSocket error", error);
- notifyErrorListeners(error);
- WebSocket.Listener.super.onError(webSocket, error);
- }
- }
-
-
-
- /**
- * Utility class to create an SSL context that trusts all certificates.
- * This is useful for development with self-signed certificates.
- */
- private static class TrustAllCertificates {
-
- public static javax.net.ssl.SSLContext createSslContext() {
- try {
- javax.net.ssl.SSLContext sslContext = javax.net.ssl.SSLContext.getInstance("TLS");
- sslContext.init(null, new javax.net.ssl.TrustManager[] {
- new javax.net.ssl.X509TrustManager() {
- public java.security.cert.X509Certificate[] getAcceptedIssuers() {
- return new java.security.cert.X509Certificate[0];
- }
-
- public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
- }
-
- public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
- }
- }
- }, new java.security.SecureRandom());
-
- return sslContext;
- }
- catch (Exception e) {
- throw new RuntimeException("Failed to create SSL context", e);
- }
- }
- }
-}
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/connection/PeerConnectionManager.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/connection/PeerConnectionManager.java
deleted file mode 100644
index fbece89..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/connection/PeerConnectionManager.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.connection;
-
-import java.util.List;
-import java.util.function.Consumer;
-
-import dev.onvoid.webrtc.CreateSessionDescriptionObserver;
-import dev.onvoid.webrtc.PeerConnectionFactory;
-import dev.onvoid.webrtc.PeerConnectionObserver;
-import dev.onvoid.webrtc.RTCAnswerOptions;
-import dev.onvoid.webrtc.RTCConfiguration;
-import dev.onvoid.webrtc.RTCDataChannel;
-import dev.onvoid.webrtc.RTCIceCandidate;
-import dev.onvoid.webrtc.RTCIceConnectionState;
-import dev.onvoid.webrtc.RTCIceGatheringState;
-import dev.onvoid.webrtc.RTCIceServer;
-import dev.onvoid.webrtc.RTCOfferOptions;
-import dev.onvoid.webrtc.RTCPeerConnection;
-import dev.onvoid.webrtc.RTCPeerConnectionState;
-import dev.onvoid.webrtc.RTCRtpReceiver;
-import dev.onvoid.webrtc.RTCRtpTransceiver;
-import dev.onvoid.webrtc.RTCSdpType;
-import dev.onvoid.webrtc.RTCSessionDescription;
-import dev.onvoid.webrtc.RTCSignalingState;
-import dev.onvoid.webrtc.SetSessionDescriptionObserver;
-import dev.onvoid.webrtc.examples.web.model.IceCandidateMessage;
-import dev.onvoid.webrtc.examples.web.model.SessionDescriptionMessage;
-import dev.onvoid.webrtc.media.MediaStream;
-import dev.onvoid.webrtc.media.MediaStreamTrack;
-
-import dev.onvoid.webrtc.media.audio.AudioOptions;
-import dev.onvoid.webrtc.media.audio.AudioTrack;
-import dev.onvoid.webrtc.media.audio.AudioTrackSource;
-import dev.onvoid.webrtc.media.audio.CustomAudioSource;
-import dev.onvoid.webrtc.media.video.VideoTrack;
-import dev.onvoid.webrtc.media.video.VideoTrackSource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Manages WebRTC peer connections, including creation, configuration,
- * and session description handling. Also handles signaling messages related to
- * peer connections such as offers, answers, and ICE candidates.
- *
- * @author Alex Andres
- */
-public class PeerConnectionManager implements PeerConnectionSignalingHandler {
-
- private static final Logger LOG = LoggerFactory.getLogger(PeerConnectionManager.class);
-
- private final PeerConnectionFactory factory;
- private final RTCPeerConnection peerConnection;
-
- private Consumer onLocalDescriptionCreated;
- private Consumer onIceCandidateGenerated;
- private Consumer onTrackReceived;
-
- private boolean isInitiator = false;
-
-
- /**
- * Creates a new PeerConnectionManager.
- */
- public PeerConnectionManager() {
- factory = new PeerConnectionFactory();
-
- // Create peer connection with default configuration.
- RTCIceServer iceServer = new RTCIceServer();
- iceServer.urls.add("stun:stun.l.google.com:19302");
-
- RTCConfiguration config = new RTCConfiguration();
- config.iceServers.add(iceServer);
-
- peerConnection = factory.createPeerConnection(config, new PeerConnectionObserverImpl());
-
- LOG.info("PeerConnectionManager created");
- }
-
- /**
- * Adds a media track to the peer connection.
- *
- * @param track The media track to add.
- * @param streamIds The stream IDs to associate with the track.
- */
- public void addTrack(MediaStreamTrack track, List streamIds) {
- peerConnection.addTrack(track, streamIds);
-
- LOG.info("Added track: {}", track.getKind());
- }
-
- /**
- * Creates an audio track with the specified options and label.
- *
- * @param options Configuration options for the audio track source.
- * @param label A unique identifier for the audio track.
- *
- * @return A new AudioTrack instance configured with the provided options.
- */
- public AudioTrack createAudioTrack(AudioOptions options, String label) {
- AudioTrackSource audioSource = factory.createAudioSource(options);
-
- return factory.createAudioTrack(label, audioSource);
- }
-
- /**
- * Creates an audio track with a custom audio source that can push audio frames.
- *
- * @param source The custom audio source providing the audio frames.
- * @param label A unique identifier for the audio track.
- *
- * @return A new AudioTrack instance connected to the provided custom source.
- */
- public AudioTrack createAudioTrack(CustomAudioSource source, String label) {
- return factory.createAudioTrack(label, source);
- }
-
- /**
- * Creates a video track with the specified source and label.
- *
- * @param source The video track source providing the video frames.
- * @param label A unique identifier for the video track.
- *
- * @return A new VideoTrack instance connected to the provided source.
- */
- public VideoTrack createVideoTrack(VideoTrackSource source, String label) {
- return factory.createVideoTrack(label, source);
- }
-
- /**
- * Closes the peer connection.
- */
- public void close() {
- if (peerConnection != null) {
- peerConnection.close();
- }
-
- if (factory != null) {
- factory.dispose();
- }
-
- LOG.info("Peer connection closed");
- }
-
- /**
- * Creates an offer to initiate a connection.
- */
- public void createOffer() {
- RTCOfferOptions options = new RTCOfferOptions();
-
- peerConnection.createOffer(options, new CreateSessionDescriptionObserver() {
- @Override
- public void onSuccess(RTCSessionDescription sdp) {
- setLocalDescription(sdp);
- }
-
- @Override
- public void onFailure(String error) {
- LOG.error("Failed to create offer: {}", error);
- }
- });
- }
-
- /**
- * Creates an answer in response to an offer.
- */
- public void createAnswer() {
- RTCAnswerOptions options = new RTCAnswerOptions();
- peerConnection.createAnswer(options, new CreateSessionDescriptionObserver() {
- @Override
- public void onSuccess(RTCSessionDescription answer) {
- setLocalDescription(answer);
- }
-
- @Override
- public void onFailure(String error) {
- LOG.error("Failed to create answer: {}", error);
- }
- });
- }
-
- /**
- * Sets the local session description.
- *
- * @param sdp The session description to set.
- */
- private void setLocalDescription(RTCSessionDescription sdp) {
- peerConnection.setLocalDescription(sdp, new SetSessionDescriptionObserver() {
- @Override
- public void onSuccess() {
- LOG.info("Local description set successfully");
-
- if (onLocalDescriptionCreated != null) {
- onLocalDescriptionCreated.accept(sdp);
- }
- }
-
- @Override
- public void onFailure(String error) {
- LOG.error("Failed to set local session description: {}", error);
- }
- });
- }
-
- /**
- * Sets the remote session description.
- *
- * @param sdp The session description to set.
- * @param isOffer True if the description is an offer, false otherwise.
- */
- public void setRemoteDescription(RTCSessionDescription sdp, boolean isOffer) {
- peerConnection.setRemoteDescription(sdp, new SetSessionDescriptionObserver() {
- @Override
- public void onSuccess() {
- LOG.info("Remote description set successfully");
-
- if (isOffer) {
- createAnswer();
- }
- }
-
- @Override
- public void onFailure(String error) {
- LOG.error("Failed to set remote description: {}", error);
- }
- });
- }
-
- /**
- * Adds an ICE candidate to the peer connection.
- *
- * @param candidate The ICE candidate to add.
- */
- public void addIceCandidate(RTCIceCandidate candidate) {
- peerConnection.addIceCandidate(candidate);
- LOG.info("Added ICE candidate: {}", candidate.sdp);
- }
-
- /**
- * Sets a callback to be invoked when a local session description is created.
- *
- * @param callback The callback to invoke.
- */
- public void setOnLocalDescriptionCreated(Consumer callback) {
- this.onLocalDescriptionCreated = callback;
- }
-
- /**
- * Sets a callback to be invoked when an ICE candidate is generated.
- *
- * @param callback The callback to invoke.
- */
- public void setOnIceCandidateGenerated(Consumer callback) {
- this.onIceCandidateGenerated = callback;
- }
-
- /**
- * Sets a callback to be invoked when a media track is received.
- *
- * @param callback The callback to invoke.
- */
- public void setOnTrackReceived(Consumer callback) {
- this.onTrackReceived = callback;
- }
-
- /**
- * Sets whether this peer is the initiator of the connection.
- *
- * @param isInitiator true if this peer is the initiator, false otherwise.
- */
- public void setInitiator(boolean isInitiator) {
- this.isInitiator = isInitiator;
- }
-
- /**
- * Gets whether this peer is the initiator of the connection.
- *
- * @return true if this peer is the initiator, false otherwise.
- */
- public boolean isInitiator() {
- return isInitiator;
- }
-
- @Override
- public void handleOffer(SessionDescriptionMessage message) {
- LOG.info("Received offer");
-
- try {
- String sdpString = message.getSdp();
- String fromPeer = message.getFrom();
-
- LOG.info("Parsed offer from: {}", fromPeer);
-
- // Create remote session description.
- RTCSessionDescription sdp = new RTCSessionDescription(RTCSdpType.OFFER, sdpString);
-
- // Set remote description and create answer
- setRemoteDescription(sdp, true);
- }
- catch (Exception e) {
- LOG.error("Error parsing offer JSON", e);
- }
- }
-
- @Override
- public void handleAnswer(SessionDescriptionMessage message) {
- LOG.info("Received answer");
-
- try {
- String sdpString = message.getSdp();
-
- LOG.info("Successfully parsed answer JSON");
-
- // Create remote session description.
- RTCSessionDescription sdp = new RTCSessionDescription(RTCSdpType.ANSWER, sdpString);
-
- // Set remote description
- setRemoteDescription(sdp, false);
- }
- catch (Exception e) {
- LOG.error("Error parsing answer JSON", e);
- }
- }
-
- @Override
- public void handleCandidate(IceCandidateMessage message) {
- LOG.info("Received ICE candidate");
-
- try {
- IceCandidateMessage.IceCandidateData data = message.getData();
- String sdpMid = data.getSdpMid();
- int sdpMLineIndex = data.getSdpMLineIndex();
- String candidate = data.getCandidate();
-
- LOG.info("Successfully parsed ICE candidate JSON");
-
- RTCIceCandidate iceCandidate = new RTCIceCandidate(sdpMid, sdpMLineIndex, candidate);
- addIceCandidate(iceCandidate);
- }
- catch (Exception e) {
- LOG.error("Error parsing ICE candidate JSON", e);
- }
- }
-
-
-
- /**
- * Implementation of PeerConnectionObserver to handle WebRTC events.
- */
- private class PeerConnectionObserverImpl implements PeerConnectionObserver {
-
- @Override
- public void onIceCandidate(RTCIceCandidate candidate) {
- LOG.info("New ICE candidate: {}", candidate.sdp);
-
- if (onIceCandidateGenerated != null) {
- onIceCandidateGenerated.accept(candidate);
- }
- }
-
- @Override
- public void onConnectionChange(RTCPeerConnectionState state) {
- LOG.info("Connection state changed to: {}", state);
- }
-
- @Override
- public void onIceConnectionChange(RTCIceConnectionState state) {
- LOG.info("ICE connection state changed to: {}", state);
- }
-
- @Override
- public void onIceGatheringChange(RTCIceGatheringState state) {
- LOG.info("ICE gathering state changed to: {}", state);
- }
-
- @Override
- public void onSignalingChange(RTCSignalingState state) {
- LOG.info("Signaling state changed to: {}", state);
- }
-
- @Override
- public void onDataChannel(RTCDataChannel dataChannel) {
- LOG.info("Data channel created: {}", dataChannel.getLabel());
- }
-
- @Override
- public void onRenegotiationNeeded() {
- LOG.info("Renegotiation needed");
- createOffer();
- }
-
- @Override
- public void onAddTrack(RTCRtpReceiver receiver, MediaStream[] mediaStreams) {
- LOG.info("Track added: {}", receiver.getTrack().getKind());
- }
-
- @Override
- public void onRemoveTrack(RTCRtpReceiver receiver) {
- LOG.info("Track removed: {}", receiver.getTrack().getKind());
- }
-
- @Override
- public void onTrack(RTCRtpTransceiver transceiver) {
- MediaStreamTrack track = transceiver.getReceiver().getTrack();
- String kind = track.getKind();
-
- LOG.info("{} track added to transceiver", kind);
-
- if (onTrackReceived != null) {
- onTrackReceived.accept(track);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/connection/PeerConnectionSignalingHandler.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/connection/PeerConnectionSignalingHandler.java
deleted file mode 100644
index fda95cb..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/connection/PeerConnectionSignalingHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.connection;
-
-import dev.onvoid.webrtc.examples.web.model.IceCandidateMessage;
-import dev.onvoid.webrtc.examples.web.model.SessionDescriptionMessage;
-
-/**
- * This interface defines methods for processing signaling messages
- * directly related to WebRTC peer connections.
- *
- * @author Alex Andres
- */
-public interface PeerConnectionSignalingHandler {
-
- /**
- * Handles an incoming offer from a remote peer.
- *
- * @param message The session description message containing the offer.
- */
- void handleOffer(SessionDescriptionMessage message);
-
- /**
- * Handles an incoming answer from a remote peer.
- *
- * @param message The session description message containing the answer.
- */
- void handleAnswer(SessionDescriptionMessage message);
-
- /**
- * Handles an incoming ICE candidate from a remote peer.
- *
- * @param message The message containing the ICE candidate.
- */
- void handleCandidate(IceCandidateMessage message);
-
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/AudioGenerator.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/AudioGenerator.java
deleted file mode 100644
index a0ea68c..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/AudioGenerator.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.media;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import dev.onvoid.webrtc.media.audio.CustomAudioSource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A generator that produces synthetic audio samples as a continuous sine wave.
- *
- * This class creates a 440 Hz (A4 note) sine wave and delivers audio frames
- * at regular 10 ms intervals. The generated audio is stereo with 16-bit samples
- * at a 48 kHz sample rate. The audio generator runs on a dedicated scheduled
- * thread that can be started and stopped on demand.
- *
- *
- * The sine wave phase is maintained between audio frames to ensure a continuous
- * waveform without clicks or pops that would occur from phase discontinuities.
- *
- *
- * @author Alex Andres
- */
-public class AudioGenerator {
-
- private static final Logger LOG = LoggerFactory.getLogger(AudioGenerator.class);
-
- /** The custom audio source that receives generated audio frames. */
- private final CustomAudioSource customAudioSource;
-
- /** Flag indicating whether the audio generator is running. */
- private final AtomicBoolean generatorRunning = new AtomicBoolean(false);
-
- /** Executor service for scheduling audio sample generation. */
- private ScheduledExecutorService executorService;
-
- /** Future for the scheduled audio sample generation task. */
- private ScheduledFuture> generatorFuture;
-
- /** Default audio parameters */
- private static final int DEFAULT_BITS_PER_SAMPLE = 16;
- private static final int DEFAULT_SAMPLE_RATE = 48000;
- private static final int DEFAULT_CHANNELS = 2;
- private static final int DEFAULT_FRAME_COUNT = 480; // 10ms at 48kHz
-
- /**
- * Sine wave phase tracking for audio generation.
- * Maintained between frames to ensure a continuous sine wave without clicks or pops.
- */
- private double sinePhase = 0.0;
-
-
- public AudioGenerator(CustomAudioSource audioSource) {
- customAudioSource = audioSource;
- }
-
- /**
- * Starts the audio sample generator thread that pushes audio frames
- * to the custom audio source every 10 ms.
- */
- public void start() {
- if (generatorRunning.get()) {
- LOG.info("Audio generator is already running");
- return;
- }
-
- executorService = Executors.newSingleThreadScheduledExecutor();
-
- generatorRunning.set(true);
-
- generatorFuture = executorService.scheduleAtFixedRate(() -> {
- if (!generatorRunning.get()) {
- return;
- }
-
- try {
- // Create a buffer with audio data (silence in this case).
- int bytesPerSample = DEFAULT_BITS_PER_SAMPLE / 8;
- byte[] audioData = new byte[DEFAULT_FRAME_COUNT * DEFAULT_CHANNELS * bytesPerSample];
-
- // Generate a pleasant sine wave at 440 Hz (A4 note).
- double amplitude = 0.2; // 30% of the maximum to avoid being too loud
- double frequency = 440.0; // A4 note (440 Hz)
- double radiansPerSample = 2.0 * Math.PI * frequency / DEFAULT_SAMPLE_RATE;
-
- for (int i = 0; i < DEFAULT_FRAME_COUNT; i++) {
- short sample = (short) (amplitude * Short.MAX_VALUE * Math.sin(sinePhase));
- sinePhase += radiansPerSample;
-
- // Keep the phase between 0 and 2Ï€.
- if (sinePhase > 2.0 * Math.PI) {
- sinePhase -= 2.0 * Math.PI;
- }
-
- // Write the sample to both channels (stereo).
- for (int channel = 0; channel < DEFAULT_CHANNELS; channel++) {
- int index = (i * DEFAULT_CHANNELS + channel) * bytesPerSample;
- // Write as little-endian (LSB first).
- audioData[index] = (byte) (sample & 0xFF);
- audioData[index + 1] = (byte) ((sample >> 8) & 0xFF);
- }
- }
-
- // Push the audio data to the custom audio source.
- customAudioSource.pushAudio(
- audioData,
- DEFAULT_BITS_PER_SAMPLE,
- DEFAULT_SAMPLE_RATE,
- DEFAULT_CHANNELS,
- DEFAULT_FRAME_COUNT
- );
- }
- catch (Exception e) {
- LOG.error("Error in audio generator thread", e);
- }
- }, 0, 10, TimeUnit.MILLISECONDS);
-
- LOG.info("Audio generator started");
- }
-
- /**
- * Stops the audio sample generator thread.
- */
- public void stop() {
- if (!generatorRunning.get()) {
- return;
- }
-
- generatorRunning.set(false);
-
- if (generatorFuture != null) {
- generatorFuture.cancel(false);
- generatorFuture = null;
- }
-
- if (executorService != null) {
- executorService.shutdown();
- try {
- if (!executorService.awaitTermination(100, TimeUnit.MILLISECONDS)) {
- executorService.shutdownNow();
- }
- }
- catch (InterruptedException e) {
- executorService.shutdownNow();
- Thread.currentThread().interrupt();
- }
- executorService = null;
- }
-
- LOG.info("Audio generator stopped");
- }
-
-}
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/MediaManager.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/MediaManager.java
deleted file mode 100644
index ec62676..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/MediaManager.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.media;
-
-import java.util.List;
-
-import dev.onvoid.webrtc.media.audio.AudioOptions;
-import dev.onvoid.webrtc.media.audio.AudioTrack;
-import dev.onvoid.webrtc.media.audio.AudioTrackSink;
-import dev.onvoid.webrtc.media.audio.CustomAudioSource;
-import dev.onvoid.webrtc.media.video.CustomVideoSource;
-import dev.onvoid.webrtc.media.video.VideoDeviceSource;
-import dev.onvoid.webrtc.media.video.VideoTrack;
-import dev.onvoid.webrtc.media.video.VideoTrackSink;
-
-import dev.onvoid.webrtc.examples.web.connection.PeerConnectionManager;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Manages media tracks for WebRTC connections, including audio and video.
- *
- * @author Alex Andres
- */
-public class MediaManager {
-
- private static final Logger LOG = LoggerFactory.getLogger(MediaManager.class);
-
- /** The audio track managed by this class. */
- private AudioTrack audioTrack;
-
- /** The video track managed by this class. */
- private VideoTrack videoTrack;
-
- /** The custom audio source for generating audio frames. */
- private CustomAudioSource customAudioSource;
-
- /** The audio generator responsible for creating and pushing audio frames to the custom audio source. */
- private AudioGenerator audioGenerator;
-
- /** The custom video source for generating video frames. */
- private CustomVideoSource customVideoSource;
-
- /** The video generator responsible for creating and pushing video frames to the custom video source. */
- private VideoGenerator videoGenerator;
-
-
- /**
- * Creates a new MediaManager.
- */
- public MediaManager() {
- LOG.info("MediaManager created");
- }
-
- /**
- * Creates and initializes audio and video tracks.
- *
- * @param peerConnectionManager The peer connection manager to use for creating tracks.
- */
- public void createTracks(PeerConnectionManager peerConnectionManager) {
- createAudioTrack(peerConnectionManager);
- createVideoTrack(peerConnectionManager);
-
- // Add tracks to the peer connection.
- List streamIds = List.of("stream0");
-
- peerConnectionManager.addTrack(getAudioTrack(), streamIds);
- peerConnectionManager.addTrack(getVideoTrack(), streamIds);
- }
-
- /**
- * Creates and initializes tracks with a custom audio source and standard video track.
- *
- * @param peerConnectionManager The peer connection manager to use for creating tracks.
- * @param useCustomAudio Whether to use a custom audio source that can push frames.
- */
- public void createTracks(PeerConnectionManager peerConnectionManager, boolean useCustomAudio) {
- if (useCustomAudio) {
- createCustomAudioTrack(peerConnectionManager);
- }
- else {
- createAudioTrack(peerConnectionManager);
- }
-
- createVideoTrack(peerConnectionManager);
-
- // Add tracks to the peer connection.
- List streamIds = List.of("stream0");
-
- peerConnectionManager.addTrack(getAudioTrack(), streamIds);
- peerConnectionManager.addTrack(getVideoTrack(), streamIds);
- }
-
- /**
- * Creates and initializes tracks with options for both custom audio and video sources.
- *
- * @param peerConnectionManager The peer connection manager to use for creating tracks.
- * @param useCustomAudio Whether to use a custom audio source that can push frames.
- * @param useCustomVideo Whether to use a custom video source that can push frames.
- */
- public void createTracks(PeerConnectionManager peerConnectionManager, boolean useCustomAudio, boolean useCustomVideo) {
- if (useCustomAudio) {
- createCustomAudioTrack(peerConnectionManager);
- }
- else {
- createAudioTrack(peerConnectionManager);
- }
-
- if (useCustomVideo) {
- createCustomVideoTrack(peerConnectionManager);
- }
- else {
- createVideoTrack(peerConnectionManager);
- }
-
- // Add tracks to the peer connection.
- List streamIds = List.of("stream0");
-
- peerConnectionManager.addTrack(getAudioTrack(), streamIds);
- peerConnectionManager.addTrack(getVideoTrack(), streamIds);
- }
-
- /**
- * Creates an audio track with default options.
- */
- private void createAudioTrack(PeerConnectionManager peerConnectionManager) {
- AudioOptions audioOptions = new AudioOptions();
- audioOptions.echoCancellation = true;
- audioOptions.autoGainControl = true;
- audioOptions.noiseSuppression = true;
-
- audioTrack = peerConnectionManager.createAudioTrack(audioOptions, "audio0");
-
- LOG.info("Audio track created");
- }
-
- /**
- * Creates an audio track with a custom audio source that can push audio frames.
- * Also starts the audio generator thread that pushes audio frames every 10ms.
- *
- * @param peerConnectionManager The peer connection manager to use for creating the track.
- */
- public void createCustomAudioTrack(PeerConnectionManager peerConnectionManager) {
- customAudioSource = new CustomAudioSource();
-
- audioTrack = peerConnectionManager.createAudioTrack(customAudioSource, "audio0");
-
- // Start the audio generator.
- audioGenerator = new AudioGenerator(customAudioSource);
- audioGenerator.start();
-
- LOG.info("Custom audio track created with audio generator");
- }
-
- /**
- * Creates a video track using the default video device.
- */
- private void createVideoTrack(PeerConnectionManager peerConnectionManager) {
- VideoDeviceSource videoSource = new VideoDeviceSource();
- videoSource.start();
-
- videoTrack = peerConnectionManager.createVideoTrack(videoSource, "video0");
-
- LOG.info("Video track created");
- }
-
- /**
- * Creates a video track with a custom video source that can push video frames.
- * Also starts the video generator thread that pushes video frames at regular intervals.
- *
- * @param peerConnectionManager The peer connection manager to use for creating the track.
- */
- public void createCustomVideoTrack(PeerConnectionManager peerConnectionManager) {
- customVideoSource = new CustomVideoSource();
-
- videoTrack = peerConnectionManager.createVideoTrack(customVideoSource, "video0");
-
- // Start the video generator.
- videoGenerator = new VideoGenerator(customVideoSource);
- videoGenerator.start();
-
- LOG.info("Custom video track created with video generator");
- }
-
- /**
- * Gets the audio track.
- *
- * @return The audio track.
- */
- public AudioTrack getAudioTrack() {
- return audioTrack;
- }
-
- /**
- * Gets the video track.
- *
- * @return The video track.
- */
- public VideoTrack getVideoTrack() {
- return videoTrack;
- }
-
- /**
- * Adds a sink to the audio track.
- *
- * @param sink The sink to add.
- */
- public void addAudioSink(AudioTrackSink sink) {
- if (audioTrack != null) {
- audioTrack.addSink(sink);
-
- LOG.info("Added sink to audio track");
- }
- }
-
- /**
- * Adds a sink to the video track.
- *
- * @param sink The sink to add.
- */
- public void addVideoSink(VideoTrackSink sink) {
- if (videoTrack != null) {
- videoTrack.addSink(sink);
-
- LOG.info("Added sink to video track");
- }
- }
-
- /**
- * Disposes of all media resources.
- */
- public void dispose() {
- // Stop the audio generator if it's running.
- if (audioGenerator != null) {
- audioGenerator.stop();
- audioGenerator = null;
- }
-
- // Stop the video generator if it's running.
- if (videoGenerator != null) {
- videoGenerator.stop();
- videoGenerator = null;
- }
-
- if (audioTrack != null) {
- audioTrack.dispose();
- audioTrack = null;
- }
-
- if (videoTrack != null) {
- videoTrack.dispose();
- videoTrack = null;
- }
-
- customAudioSource = null;
- customVideoSource = null;
-
- LOG.info("Media resources disposed");
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/VideoGenerator.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/VideoGenerator.java
deleted file mode 100644
index 950ed5d..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/media/VideoGenerator.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.media;
-
-import java.nio.ByteBuffer;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import dev.onvoid.webrtc.media.video.CustomVideoSource;
-import dev.onvoid.webrtc.media.video.NativeI420Buffer;
-import dev.onvoid.webrtc.media.video.VideoFrame;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A generator that produces synthetic video frames.
- *
- * This class creates a color pattern that changes over time and delivers video frames
- * at regular intervals (30 fps by default). The generated video is in I420 format
- * with a default resolution of 640x480. The video generator runs on a dedicated scheduled
- * thread that can be started and stopped on demand.
- *
- *
- * @author Alex Andres
- */
-public class VideoGenerator {
-
- private static final Logger LOG = LoggerFactory.getLogger(VideoGenerator.class);
-
- /** The custom video source that receives generated video frames. */
- private final CustomVideoSource customVideoSource;
-
- /** Flag indicating whether the video generator is running. */
- private final AtomicBoolean generatorRunning = new AtomicBoolean(false);
-
- /** Counter for frame animation. */
- private final AtomicInteger frameCounter = new AtomicInteger(0);
-
- /** Executor service for scheduling video frame generation. */
- private ScheduledExecutorService executorService;
-
- /** Future for the scheduled video frame generation task. */
- private ScheduledFuture> generatorFuture;
-
- /** Default video parameters */
- private static final int DEFAULT_WIDTH = 640;
- private static final int DEFAULT_HEIGHT = 480;
- private static final int DEFAULT_FPS = 30;
- private static final int FRAME_INTERVAL_MS = 1000 / DEFAULT_FPS;
-
-
- /**
- * Creates a new VideoGenerator that will push frames to the specified video source.
- *
- * @param videoSource The custom video source to receive the generated frames.
- */
- public VideoGenerator(CustomVideoSource videoSource) {
- customVideoSource = videoSource;
- }
-
- /**
- * Starts the video frame generator thread that pushes video frames
- * to the custom video source at the specified frame rate.
- */
- public void start() {
- if (generatorRunning.get()) {
- LOG.info("Video generator is already running");
- return;
- }
-
- executorService = Executors.newSingleThreadScheduledExecutor();
- generatorRunning.set(true);
-
- generatorFuture = executorService.scheduleAtFixedRate(() -> {
- if (!generatorRunning.get()) {
- return;
- }
-
- try {
- // Create a new video frame with a color pattern.
- VideoFrame frame = generateVideoFrame();
-
- // Push the frame to the custom video source.
- customVideoSource.pushFrame(frame);
-
- // Release the frame after pushing it.
- frame.release();
-
- // Increment frame counter for animation.
- frameCounter.incrementAndGet();
- }
- catch (Exception e) {
- LOG.error("Error in video generator thread", e);
- }
- }, 0, FRAME_INTERVAL_MS, TimeUnit.MILLISECONDS);
-
- LOG.info("Video generator started at {} fps", DEFAULT_FPS);
- }
-
- /**
- * Stops the video frame generator thread.
- */
- public void stop() {
- if (!generatorRunning.get()) {
- return;
- }
-
- generatorRunning.set(false);
-
- if (generatorFuture != null) {
- generatorFuture.cancel(false);
- generatorFuture = null;
- }
-
- if (executorService != null) {
- executorService.shutdown();
- try {
- if (!executorService.awaitTermination(100, TimeUnit.MILLISECONDS)) {
- executorService.shutdownNow();
- }
- }
- catch (InterruptedException e) {
- executorService.shutdownNow();
- Thread.currentThread().interrupt();
- }
- executorService = null;
- }
-
- LOG.info("Video generator stopped");
- }
-
- /**
- * Generates a video frame with a color pattern that changes over time.
- *
- * @return A new VideoFrame with the generated pattern.
- */
- private VideoFrame generateVideoFrame() {
- // Allocate a new I420 buffer for the frame
- NativeI420Buffer buffer = NativeI420Buffer.allocate(DEFAULT_WIDTH, DEFAULT_HEIGHT);
-
- // Get the Y, U, V planes
- ByteBuffer dataY = buffer.getDataY();
- ByteBuffer dataU = buffer.getDataU();
- ByteBuffer dataV = buffer.getDataV();
-
- int strideY = buffer.getStrideY();
- int strideU = buffer.getStrideU();
- int strideV = buffer.getStrideV();
-
- // Generate a color pattern
- fillFrameWithPattern(dataY, dataU, dataV, strideY, strideU, strideV, frameCounter.get());
-
- // Create a new video frame with the buffer and current timestamp
- return new VideoFrame(buffer, System.nanoTime());
- }
-
- /**
- * Fills the frame buffers with a color pattern.
- * This creates a simple test pattern that changes over time.
- *
- * @param dataY The Y plane buffer.
- * @param dataU The U plane buffer.
- * @param dataV The V plane buffer.
- * @param strideY The Y plane stride.
- * @param strideU The U plane stride.
- * @param strideV The V plane stride.
- * @param frameCount The current frame count for animation.
- */
- private void fillFrameWithPattern(ByteBuffer dataY, ByteBuffer dataU, ByteBuffer dataV,
- int strideY, int strideU, int strideV, int frameCount) {
- // Reset buffer positions
- dataY.position(0);
- dataU.position(0);
- dataV.position(0);
-
- // Animation parameters
- int animOffset = frameCount % 255;
-
- // Fill Y plane (luma)
- for (int y = 0; y < DEFAULT_HEIGHT; y++) {
- for (int x = 0; x < DEFAULT_WIDTH; x++) {
- // Create a gradient pattern
- byte value = (byte) ((x + y + animOffset) % 255);
- dataY.put(y * strideY + x, value);
- }
- }
-
- // Fill U and V planes (chroma)
- // In I420 format, U and V planes are quarter size of Y plane
- for (int y = 0; y < DEFAULT_HEIGHT / 2; y++) {
- for (int x = 0; x < DEFAULT_WIDTH / 2; x++) {
- // Create color patterns that change over time
- byte uValue = (byte) ((x * 2 + animOffset) % 255);
- byte vValue = (byte) ((y * 2 + animOffset) % 255);
-
- dataU.put(y * strideU + x, uValue);
- dataV.put(y * strideV + x, vValue);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/IceCandidateMessage.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/IceCandidateMessage.java
deleted file mode 100644
index d53f366..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/IceCandidateMessage.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.model;
-
-/**
- * Represents an ICE candidate message used in WebRTC signaling.
- *
- * This class is used to exchange ICE candidates between peers during
- * the connection establishment process.
- *
- *
- * @author Alex Andres
- */
-public class IceCandidateMessage extends SignalingMessage {
-
- private IceCandidateData data;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public IceCandidateMessage() {
- super(MessageType.ICE_CANDIDATE.getValue());
- }
-
- /**
- * Creates a new IceCandidateMessage with the specified sender and recipient.
- *
- * @param from the sender ID.
- * @param to the recipient ID.
- */
- public IceCandidateMessage(String from, String to) {
- super(MessageType.ICE_CANDIDATE.getValue(), from, to);
-
- data = new IceCandidateData();
- }
-
- /**
- * Creates a new IceCandidateMessage with the specified sender, recipient, and candidate information.
- *
- * @param from the sender ID.
- * @param to the recipient ID.
- * @param candidate the candidate string.
- * @param sdpMid the SDP mid.
- * @param sdpMLineIndex the SDP mline index.
- */
- public IceCandidateMessage(String from, String to, String candidate, String sdpMid, int sdpMLineIndex) {
- super(MessageType.ICE_CANDIDATE.getValue(), from, to);
-
- data = new IceCandidateData(candidate, sdpMid, sdpMLineIndex);
- }
-
- /**
- * Gets the ICE candidate data.
- *
- * @return the ICE candidate data.
- */
- public IceCandidateData getData() {
- return data;
- }
-
- /**
- * Sets the ICE candidate data.
- *
- * @param data the ICE candidate data.
- */
- public void setData(IceCandidateData data) {
- this.data = data;
- }
-
-
-
- /**
- * Inner class representing the data payload of an ICE candidate message.
- */
- public static class IceCandidateData {
-
- private String candidate;
- private String sdpMid;
- private int sdpMLineIndex;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public IceCandidateData() {
- }
-
- /**
- * Creates a new IceCandidateData with the specified candidate information.
- *
- * @param candidate the candidate string.
- * @param sdpMid the SDP mid.
- * @param sdpMLineIndex the SDP mline index.
- */
- public IceCandidateData(String candidate, String sdpMid, int sdpMLineIndex) {
- this.candidate = candidate;
- this.sdpMid = sdpMid;
- this.sdpMLineIndex = sdpMLineIndex;
- }
-
- /**
- * Gets the candidate string.
- *
- * @return the candidate string.
- */
- public String getCandidate() {
- return candidate;
- }
-
- /**
- * Sets the candidate string.
- *
- * @param candidate the candidate string.
- */
- public void setCandidate(String candidate) {
- this.candidate = candidate;
- }
-
- /**
- * Gets the SDP mid.
- *
- * @return the SDP mid.
- */
- public String getSdpMid() {
- return sdpMid;
- }
-
- /**
- * Sets the SDP mid.
- *
- * @param sdpMid the SDP mid.
- */
- public void setSdpMid(String sdpMid) {
- this.sdpMid = sdpMid;
- }
-
- /**
- * Gets the SDP mline index.
- *
- * @return the SDP mline index.
- */
- public int getSdpMLineIndex() {
- return sdpMLineIndex;
- }
-
- /**
- * Sets the SDP mline index.
- *
- * @param sdpMLineIndex the SDP mline index.
- */
- public void setSdpMLineIndex(int sdpMLineIndex) {
- this.sdpMLineIndex = sdpMLineIndex;
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/JoinMessage.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/JoinMessage.java
deleted file mode 100644
index 53b2207..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/JoinMessage.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.model;
-
-/**
- * Represents a join message used in WebRTC signaling.
- * This class is used when a peer wants to join a room or session.
- *
- * @author Alex Andres
- */
-public class JoinMessage extends SignalingMessage {
-
- private JoinData data;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public JoinMessage() {
- super(MessageType.JOIN.getValue());
- }
-
- /**
- * Creates a new JoinMessage with the specified sender, room, and user information.
- *
- * @param from the sender ID.
- * @param room the room to join.
- * @param userName the user's name.
- */
- public JoinMessage(String from, String room, String userName) {
- super(MessageType.JOIN.getValue(), from, null);
-
- data = new JoinData(room, new UserInfo(userName, from));
- }
-
- /**
- * Gets the join data.
- *
- * @return the join data.
- */
- public JoinData getData() {
- return data;
- }
-
- /**
- * Sets the join data.
- *
- * @param data the join data.
- */
- public void setData(JoinData data) {
- this.data = data;
- }
-
-
-
- /**
- * Inner class representing the data payload of a join message.
- */
- public static class JoinData {
-
- private String room;
- private UserInfo userInfo;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public JoinData() {
- }
-
- /**
- * Creates a new JoinData with the specified room.
- *
- * @param room the room to join
- */
- public JoinData(String room) {
- this.room = room;
- }
-
- /**
- * Creates a new JoinData with the specified room and user information.
- *
- * @param room the room to join
- * @param userInfo the user information
- */
- public JoinData(String room, UserInfo userInfo) {
- this.room = room;
- this.userInfo = userInfo;
- }
-
- /**
- * Gets the room.
- *
- * @return the room
- */
- public String getRoom() {
- return room;
- }
-
- /**
- * Sets the room.
- *
- * @param room the room
- */
- public void setRoom(String room) {
- this.room = room;
- }
-
- /**
- * Gets the user information.
- *
- * @return the user information
- */
- public UserInfo getUserInfo() {
- return userInfo;
- }
-
- /**
- * Sets the user information.
- *
- * @param userInfo the user information
- */
- public void setUserInfo(UserInfo userInfo) {
- this.userInfo = userInfo;
- }
- }
-
-
-
- /**
- * Inner class representing user information.
- */
- public static class UserInfo {
-
- private String userId;
-
- private String name;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public UserInfo() {
- }
-
- /**
- * Creates a new UserInfo with the specified name and avatar.
- *
- * @param name the user's name.
- * @param userId the user's ID.
- */
- public UserInfo(String name, String userId) {
- this.name = name;
- this.userId = userId;
- }
-
- /**
- * Gets the user's name.
- *
- * @return the user's name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the user's name.
- *
- * @param name the user's name.
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Gets the user's ID.
- *
- * @return the user's ID.
- */
- public String getUserId() {
- return userId;
- }
-
- /**
- * Sets the user's ID.
- *
- * @param userId the user's ID.
- */
- public void setUserId(String userId) {
- this.userId = userId;
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/LeaveMessage.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/LeaveMessage.java
deleted file mode 100644
index 6b5cf1c..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/LeaveMessage.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.model;
-
-/**
- * Represents a message indicating that a user is leaving a room.
- * This class is used when a peer leaves a room or session.
- *
- * @author Alex Andres
- */
-public class LeaveMessage extends SignalingMessage {
-
- /**
- * Constructs a new leave message with default values.
- */
- public LeaveMessage() {
- super(MessageType.LEAVE.getValue());
- }
-
-}
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/MessageType.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/MessageType.java
deleted file mode 100644
index b4b8f2c..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/MessageType.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.model;
-
-/**
- * Represents the types of messages exchanged during WebRTC signaling.
- * Each message type corresponds to a specific action or state in the WebRTC connection process.
- *
- * @author Alex Andres
- */
-public enum MessageType {
-
- /** WebRTC offer message containing session description. */
- OFFER("offer"),
-
- /** WebRTC answer message containing session description. */
- ANSWER("answer"),
-
- /** ICE candidate information for establishing peer connections. */
- ICE_CANDIDATE("ice-candidate"),
-
- /** Message indicating a peer joining the signaling session. */
- JOIN("join"),
-
- /** Message indicating a peer leaving the signaling session. */
- LEAVE("leave"),
-
- /** Heartbeat message to maintain connection. */
- HEARTBEAT("heartbeat"),
-
- /** Acknowledgment response to a heartbeat message. */
- HEARTBEAT_ACK("heartbeat-ack"),
-
- /** Fallback type for unrecognized messages. */
- UNKNOWN("");
-
- /** The string representation of the message type. */
- private final String value;
-
-
- /**
- * Constructs a message type with the specified string value.
- *
- * @param value The string representation of this message type
- */
- MessageType(String value) {
- this.value = value;
- }
-
- /**
- * Returns the string representation of this message type.
- *
- * @return The string value of this message type
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Finds and returns the message type enum constant that matches the given string.
- *
- * @param text The string to convert to a message type
- * @return The matching message type, or UNKNOWN if no match is found
- */
- public static MessageType fromString(String text) {
- for (MessageType type : MessageType.values()) {
- if (type.value.equals(text)) {
- return type;
- }
- }
- return UNKNOWN;
- }
-}
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/SessionDescriptionMessage.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/SessionDescriptionMessage.java
deleted file mode 100644
index 08e529a..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/SessionDescriptionMessage.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.model;
-
-/**
- * Represents a session description message used in WebRTC signaling.
- *
- * This class is used for both offer and answer messages, which contain
- * Session Description Protocol (SDP) information.
- *
- *
- * @author Alex Andres
- */
-public class SessionDescriptionMessage extends SignalingMessage {
-
- private SessionDescriptionData data;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public SessionDescriptionMessage() {
- super();
- }
-
- /**
- * Creates a new SessionDescriptionMessage with the specified type, sender, recipient, and SDP.
- *
- * @param type the message type (either "offer" or "answer").
- * @param from the sender ID.
- * @param to the recipient ID.
- * @param sdp the SDP string.
- */
- public SessionDescriptionMessage(String type, String from, String to, String sdp) {
- super(type, from, to);
-
- data = new SessionDescriptionData(sdp);
- }
-
- /**
- * Gets the session description data.
- *
- * @return the session description data.
- */
- public SessionDescriptionData getData() {
- return data;
- }
-
- /**
- * Sets the session description data.
- *
- * @param data the session description data.
- */
- public void setData(SessionDescriptionData data) {
- this.data = data;
- }
-
- /**
- * Sets the SDP string.
- *
- * @param sdp the SDP string.
- */
- public void setSdp(String sdp) {
- if (data == null) {
- data = new SessionDescriptionData();
- }
- data.setSdp(sdp);
- }
-
- /**
- * Gets the SDP string.
- *
- * @return the SDP string.
- */
- public String getSdp() {
- return data != null ? data.getSdp() : null;
- }
-
-
-
- /**
- * Inner class representing the data payload of a session description message.
- */
- public static class SessionDescriptionData {
-
- private String sdp;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public SessionDescriptionData() {
- }
-
- /**
- * Creates a new SessionDescriptionData with the specified SDP.
- *
- * @param sdp the SDP string.
- */
- public SessionDescriptionData(String sdp) {
- this.sdp = sdp;
- }
-
- /**
- * Gets the SDP string.
- *
- * @return the SDP string.
- */
- public String getSdp() {
- return sdp;
- }
-
- /**
- * Sets the SDP string.
- *
- * @param sdp the SDP string.
- */
- public void setSdp(String sdp) {
- this.sdp = sdp;
- }
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/SignalingMessage.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/SignalingMessage.java
deleted file mode 100644
index f09d7fc..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/model/SignalingMessage.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.model;
-
-/**
- * Base class for all signaling messages.
- *
- * This class represents the common structure of all messages exchanged
- * during WebRTC signaling. Specific message types extend this class
- * and add their own data payload.
- *
- *
- * @author Alex Andres
- */
-public class SignalingMessage {
-
- private String type;
- private String from;
- private String to;
-
-
- /**
- * Default constructor required for JSON deserialization.
- */
- public SignalingMessage() {
- }
-
- /**
- * Creates a new SignalingMessage with the specified type.
- *
- * @param type the message type.
- */
- public SignalingMessage(String type) {
- this.type = type;
- }
-
- /**
- * Creates a new SignalingMessage with the specified type, sender, and recipient.
- *
- * @param type the message type.
- * @param from the sender ID.
- * @param to the recipient ID.
- */
- public SignalingMessage(String type, String from, String to) {
- this.type = type;
- this.from = from;
- this.to = to;
- }
-
- /**
- * Gets the message type.
- *
- * @return the message type.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the message type.
- *
- * @param type the message type.
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Gets the sender ID.
- *
- * @return the sender ID.
- */
- public String getFrom() {
- return from;
- }
-
- /**
- * Sets the sender ID.
- *
- * @param from the sender ID.
- */
- public void setFrom(String from) {
- this.from = from;
- }
-
- /**
- * Gets the recipient ID.
- *
- * @return the recipient ID.
- */
- public String getTo() {
- return to;
- }
-
- /**
- * Sets the recipient ID.
- *
- * @param to the recipient ID.
- */
- public void setTo(String to) {
- this.to = to;
- }
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/server/WebServer.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/server/WebServer.java
deleted file mode 100644
index 98eb42a..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/server/WebServer.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.server;
-
-import java.io.InputStream;
-import java.security.KeyStore;
-
-import dev.onvoid.webrtc.examples.web.WebClientExample;
-
-import org.eclipse.jetty.http.pathmap.PathSpec;
-import org.eclipse.jetty.server.*;
-import org.eclipse.jetty.server.handler.PathMappingsHandler;
-import org.eclipse.jetty.server.handler.ResourceHandler;
-import org.eclipse.jetty.util.resource.ResourceFactory;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.websocket.server.WebSocketUpgradeHandler;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A web server implementation using Jetty that provides both HTTPS and WebSocket functionality.
- *
- * This server:
- *
- *
Runs on port 8443 with HTTPS only (TLS 1.2/1.3)
- *
Provides WebSocket endpoints with the "ws-signaling" protocol
- *
Serves static resources from the classpath at "/resources/web/"
- *
Uses a self-signed certificate from a bundled keystore
- *
- *
- *
- * @author Alex Andres
- */
-public class WebServer {
-
- static {
- WebClientExample.setupLogging();
- }
-
- public static final Logger LOG = LoggerFactory.getLogger(WebServer.class);
-
- private static final int PORT = 8443;
-
-
- public static void main(String[] args) throws Exception {
- Server server = new Server();
-
- // Configure HTTPS only.
- HttpConfiguration httpsConfig = new HttpConfiguration();
- httpsConfig.addCustomizer(new SecureRequestCustomizer());
-
- // Create the HTTP/1.1 ConnectionFactory.
- HttpConnectionFactory http = new HttpConnectionFactory(httpsConfig);
-
- // Create the TLS ConnectionFactory, setting HTTP/1.1 as the wrapped protocol.
- SslContextFactory.Server sslContextFactory = createSslContextFactory();
- SslConnectionFactory tls = new SslConnectionFactory(sslContextFactory, http.getProtocol());
-
- ServerConnector httpsConnector = new ServerConnector(server, tls, http);
- httpsConnector.setPort(PORT);
-
- // Add only HTTPS connector.
- server.addConnector(httpsConnector);
-
- // Create WebSocket upgrade handler.
- WebSocketUpgradeHandler wsHandler = WebSocketUpgradeHandler.from(server, container -> {
- container.addMapping("/ws", (upgradeRequest, upgradeResponse, callback) -> {
- if (upgradeRequest.getSubProtocols().contains("ws-signaling")) {
- upgradeResponse.setAcceptedSubProtocol("ws-signaling");
- return new WebSocketHandler();
- }
- return null;
- });
- });
-
- // Create a static resource handler.
- ResourceHandler resourceHandler = new ResourceHandler();
- ResourceFactory resourceFactory = ResourceFactory.of(resourceHandler);
- resourceHandler.setBaseResource(resourceFactory.newClassLoaderResource("/resources/web/"));
-
- // Create a path mappings handler to combine WebSocket and static content.
- PathMappingsHandler pathHandler = new PathMappingsHandler();
- pathHandler.addMapping(PathSpec.from("/ws/*"), wsHandler);
- pathHandler.addMapping(PathSpec.from("/"), resourceHandler);
-
- server.setHandler(pathHandler);
- server.start();
-
- LOG.info("HTTPS: https://localhost:{}", PORT);
- LOG.info("WebSocket: wss://localhost:{}/ws", PORT);
- LOG.info("Note: Using self-signed certificate - browsers will show security warnings");
-
- server.join();
- }
-
- private static SslContextFactory.Server createSslContextFactory() {
- SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
-
- try (InputStream keystoreStream = WebServer.class.getResourceAsStream("/resources/keystore.p12")) {
- if (keystoreStream == null) {
- throw new IllegalArgumentException("Keystore not found in resources.");
- }
-
- KeyStore keyStore = KeyStore.getInstance("PKCS12");
- keyStore.load(keystoreStream, "l0c4lh0s7".toCharArray());
-
- sslContextFactory.setKeyStore(keyStore);
- sslContextFactory.setKeyStorePassword("l0c4lh0s7");
- }
- catch (Exception e) {
- LOG.error("Load keystore failed", e);
- }
-
- // Security settings.
- sslContextFactory.setIncludeProtocols("TLSv1.3", "TLSv1.2");
-
- return sslContextFactory;
- }
-}
diff --git a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/server/WebSocketHandler.java b/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/server/WebSocketHandler.java
deleted file mode 100644
index d4ece58..0000000
--- a/webrtc-examples/src/main/java/dev/onvoid/webrtc/examples/web/server/WebSocketHandler.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright 2025 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dev.onvoid.webrtc.examples.web.server;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import dev.onvoid.webrtc.examples.web.model.LeaveMessage;
-import dev.onvoid.webrtc.examples.web.model.MessageType;
-import dev.onvoid.webrtc.examples.web.model.SignalingMessage;
-
-import org.eclipse.jetty.websocket.api.Callback;
-import org.eclipse.jetty.websocket.api.Session;
-import org.eclipse.jetty.websocket.api.annotations.*;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Handles WebSocket connections and messages for the WebRTC signaling server.
- *
- * This class manages all active WebSocket sessions, processes incoming messages,
- * and provides methods for broadcasting messages to connected clients.
- *
- *
- * @author Alex Andres
- */
-@WebSocket
-public class WebSocketHandler {
-
- private static final Logger LOG = LoggerFactory.getLogger(WebSocketHandler.class);
-
- /** Thread-safe set to store all active sessions. */
- private static final Set sessions = new CopyOnWriteArraySet<>();
-
- /** Thread-safe map to store session to user-id mappings. */
- private static final Map sessionToUserId = new ConcurrentHashMap<>();
-
- /** JSON serializer/deserializer for processing WebSocket messages. */
- private final ObjectMapper jsonMapper = new ObjectMapper();
-
-
- @OnWebSocketOpen
- public void onOpen(Session session) {
- sessions.add(session);
-
- LOG.info("New connection: {} (Total connections: {})", session.getRemoteSocketAddress(), sessions.size());
- }
-
- @OnWebSocketMessage
- public void onMessage(Session session, String message) {
- LOG.info("Message from {}: {}", session.getRemoteSocketAddress(), message);
-
- try {
- JsonNode messageNode = jsonMapper.readTree(message);
- String type = messageNode.path("type").asText();
-
- // Check if this is a heartbeat message.
- if (MessageType.HEARTBEAT.getValue().equals(type)) {
- // Send heartbeat acknowledgment.
- SignalingMessage heartbeatAck = new SignalingMessage("heartbeat-ack");
- String heartbeatAckJson = jsonMapper.writeValueAsString(heartbeatAck);
-
- sendMessage(session, heartbeatAckJson);
- return;
- }
-
- // Check if this is a join message and extract the user-id.
- if (MessageType.JOIN.getValue().equals(type)) {
- String userId = messageNode.path("from").asText();
-
- if (userId != null && !userId.isEmpty()) {
- // Store the user-id for this session.
- sessionToUserId.put(session, userId);
-
- LOG.info("Registered user-id '{}' for session {}", userId, session.getRemoteSocketAddress());
- }
- }
- }
- catch (JsonProcessingException e) {
- LOG.error("Error parsing message type", e);
- }
-
- // Broadcast the message to all other connected peers (excluding sender).
- broadcastToOthers(session, message);
- }
-
- @OnWebSocketClose
- public void onClose(Session session, int statusCode, String reason) {
- sessions.remove(session);
-
- LOG.info("Connection closed: {} ({}) - Status: {}", session.getRemoteSocketAddress(), reason, statusCode);
- LOG.info("Remaining connections: {}", sessions.size());
-
- // Notify other clients about disconnection.
- try {
- // Get the user-id for this session or use the socket address as a fallback.
- String userId = sessionToUserId.getOrDefault(session, session.getRemoteSocketAddress().toString());
-
- // Create a leave message.
- LeaveMessage leaveMessage = new LeaveMessage();
- leaveMessage.setFrom(userId);
-
- String leaveMessageJson = jsonMapper.writeValueAsString(leaveMessage);
- broadcastToAll(leaveMessageJson);
-
- LOG.info("Sent participant left message for user-id: {}", userId);
-
- // Clean up the session-to-userId mapping.
- sessionToUserId.remove(session);
- }
- catch (JsonProcessingException e) {
- LOG.error("Error creating participant left message", e);
- }
- }
-
- @OnWebSocketError
- public void onError(Session session, Throwable error) {
- LOG.error("WebSocket error for {}", session.getRemoteSocketAddress(), error);
- }
-
- /**
- * Broadcasts a message to all connected peers except the sender.
- *
- * @param sender the session of the sender.
- * @param message the message to broadcast.
- */
- private void broadcastToOthers(Session sender, String message) {
- sessions.stream()
- .filter(Session::isOpen)
- .filter(session -> !session.equals(sender))
- .forEach(session -> sendMessage(session, message));
- }
-
- /**
- * Broadcasts a message to all connected peers.
- *
- * @param message the message to broadcast.
- */
- private void broadcastToAll(String message) {
- sessions.stream()
- .filter(Session::isOpen)
- .forEach(session -> sendMessage(session, message));
- }
-
- private void sendMessage(Session session, String message) {
- session.sendText(message, Callback.from(() -> {}, throwable -> {
- LOG.error("Error sending message to session: {}", throwable.getMessage());
- // Remove broken sessions.
- sessions.remove(session);
- }));
- }
-}
diff --git a/webrtc-examples/src/main/java/module-info.java b/webrtc-examples/src/main/java/module-info.java
deleted file mode 100644
index b330984..0000000
--- a/webrtc-examples/src/main/java/module-info.java
+++ /dev/null
@@ -1,14 +0,0 @@
-module webrtc.java.examples {
-
- requires com.fasterxml.jackson.databind;
- requires java.logging;
- requires java.net.http;
- requires org.eclipse.jetty.server;
- requires org.eclipse.jetty.websocket.server;
- requires webrtc.java;
-
- exports dev.onvoid.webrtc.examples.web.client;
- exports dev.onvoid.webrtc.examples.web.server;
- exports dev.onvoid.webrtc.examples.web.model;
-
-}
\ No newline at end of file
diff --git a/webrtc-examples/src/main/resources/keystore.p12 b/webrtc-examples/src/main/resources/keystore.p12
deleted file mode 100644
index b655bba..0000000
Binary files a/webrtc-examples/src/main/resources/keystore.p12 and /dev/null differ
diff --git a/webrtc-examples/src/main/resources/logging.properties b/webrtc-examples/src/main/resources/logging.properties
deleted file mode 100644
index 47bfe9d..0000000
--- a/webrtc-examples/src/main/resources/logging.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-.level = INFO
-
-# Configure console handler.
-handlers = java.util.logging.ConsoleHandler
-
-# Set the console handler level and formatter.
-java.util.logging.ConsoleHandler.level = ALL
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-
-# Custom format pattern.
-java.util.logging.SimpleFormatter.format = [%4$s] %5$s%n
diff --git a/webrtc-examples/src/main/resources/web/PeerConnectionManager.js b/webrtc-examples/src/main/resources/web/PeerConnectionManager.js
deleted file mode 100644
index 716013b..0000000
--- a/webrtc-examples/src/main/resources/web/PeerConnectionManager.js
+++ /dev/null
@@ -1,212 +0,0 @@
-/**
- * Manages WebRTC peer connections for real-time communication.
- *
- * This class encapsulates the WebRTC API functionality including
- * - Connection initialization
- * - Local media stream management
- * - SDP offer/answer creation and handling
- * - ICE candidate processing
- * - Connection state monitoring
- *
- * @class
- * @property {Object} configuration - The RTCPeerConnection configuration
- * @property {function} onTrackCallback - Callback for track events
- * @property {function} onIceCandidateCallback - Callback for ICE candidate events
- * @property {function} onIceConnectionStateChangeCallback - Callback for ICE connection state changes
- * @property {function} onConnectionStateChangeCallback - Callback for connection state changes
- * @property {RTCPeerConnection|null} peerConnection - The WebRTC peer connection object
- * @property {MediaStream|null} localStream - The local media stream
- */
-class PeerConnectionManager {
-
- /**
- * Creates a new PeerConnectionManager instance.
- *
- * @param {Array|Object} iceServers - ICE server configuration for the RTCPeerConnection
- * @param {function} onTrack - Callback function that handles track events
- * @param {function} onIceCandidate - Callback function for ICE candidate events
- * @param {function} onIceConnectionStateChange - Callback function for ICE connection state changes
- * @param {function} onConnectionStateChange - Callback function for connection state changes
- */
- constructor(iceServers, onTrack, onIceCandidate, onIceConnectionStateChange, onConnectionStateChange) {
- this.configuration = { iceServers };
- this.onTrackCallback = onTrack;
- this.onIceCandidateCallback = onIceCandidate;
- this.onIceConnectionStateChangeCallback = onIceConnectionStateChange;
- this.onConnectionStateChangeCallback = onConnectionStateChange;
- this.peerConnection = null;
- this.localStream = null;
- }
-
- // Helper method to get the current user ID
- getUserId() {
- // In a real application, this would be a unique identifier for the user
- return "web-client";
- }
-
- // Helper method to get the remote peer ID
- getRemotePeerId() {
- // In a real application, this would be the ID of the peer we're communicating with
- // For simplicity, we're using a fixed value here
- return "java-client";
- }
-
- initialize() {
- this.peerConnection = new RTCPeerConnection(this.configuration);
-
- this.peerConnection.ontrack = (event) => {
- if (this.onTrackCallback) {
- this.onTrackCallback(event);
- }
- };
-
- this.peerConnection.onicecandidate = (event) => {
- if (event.candidate && this.onIceCandidateCallback) {
- const candidate = {
- type: "ice-candidate",
- from: this.getUserId(),
- to: this.getRemotePeerId(),
- data: {
- candidate: event.candidate.candidate,
- sdpMid: event.candidate.sdpMid,
- sdpMLineIndex: event.candidate.sdpMLineIndex
- }
- };
- this.onIceCandidateCallback(candidate);
- }
- };
-
- this.peerConnection.oniceconnectionstatechange = () => {
- if (this.onIceConnectionStateChangeCallback) {
- this.onIceConnectionStateChangeCallback(this.peerConnection.iceConnectionState);
- }
- };
-
- this.peerConnection.onconnectionstatechange = () => {
- if (this.onConnectionStateChangeCallback) {
- this.onConnectionStateChangeCallback(this.peerConnection.connectionState);
- }
- };
- }
-
- async addLocalMedia() {
- try {
- this.localStream = await navigator.mediaDevices.getUserMedia({ audio: true, video: true });
- this.localStream.getTracks().forEach(track => {
- this.peerConnection.addTrack(track, this.localStream);
- });
- return true;
- }
- catch (error) {
- console.error("Error accessing media devices:", error);
- return false;
- }
- }
-
- async createOffer() {
- try {
- const offer = await this.peerConnection.createOffer();
- await this.peerConnection.setLocalDescription(offer);
- return {
- type: "offer",
- from: this.getUserId(),
- to: this.getRemotePeerId(),
- data: {
- sdp: this.peerConnection.localDescription.sdp
- }
- };
- }
- catch (error) {
- console.error("Error creating offer:", error);
- throw error;
- }
- }
-
- async handleOffer(message) {
- try {
- // Extract SDP from the data object in the message format
- const sdp = message.data.sdp.replace(/\\n/g, '\n');
- const sessionDescription = new RTCSessionDescription({
- type: "offer",
- sdp: sdp
- });
- await this.peerConnection.setRemoteDescription(sessionDescription);
- return true;
- }
- catch (error) {
- console.error("Error setting remote description for offer:", error);
- throw error;
- }
- }
-
- async createAnswer() {
- try {
- const answer = await this.peerConnection.createAnswer();
- await this.peerConnection.setLocalDescription(answer);
-
- console.log("Local answer:", answer);
- console.log("Local description:", this.peerConnection.localDescription);
-
- return {
- type: "answer",
- from: this.getUserId(),
- to: this.getRemotePeerId(),
- data: {
- sdp: this.peerConnection.localDescription.sdp
- }
- };
- }
- catch (error) {
- console.error("Error creating answer:", error);
- throw error;
- }
- }
-
- async handleAnswer(message) {
- try {
- // Extract SDP from the data object in the new message format
- const sdp = message.data.sdp.replace(/\\n/g, '\n');
- const sessionDescription = new RTCSessionDescription({
- type: "answer",
- sdp: sdp
- });
- await this.peerConnection.setRemoteDescription(sessionDescription);
- }
- catch (error) {
- console.error("Error setting remote description:", error);
- throw error;
- }
- }
-
- async addIceCandidate(message) {
- try {
- // Extract candidate information from the data object in the new message format
- const candidate = new RTCIceCandidate({
- sdpMid: message.data.sdpMid,
- sdpMLineIndex: message.data.sdpMLineIndex,
- candidate: message.data.candidate
- });
- await this.peerConnection.addIceCandidate(candidate);
-
- console.log('ICE candidate added successfully');
- }
- catch (error) {
- console.error('Error adding ICE candidate:', error);
- throw error;
- }
- }
-
- close() {
- if (this.localStream) {
- this.localStream.getTracks().forEach(track => track.stop());
- this.localStream = null;
- }
-
- if (this.peerConnection) {
- this.peerConnection.close();
- this.peerConnection = null;
- }
- }
-}
-
-export { PeerConnectionManager };
\ No newline at end of file
diff --git a/webrtc-examples/src/main/resources/web/SignalingChannel.js b/webrtc-examples/src/main/resources/web/SignalingChannel.js
deleted file mode 100644
index cdcb128..0000000
--- a/webrtc-examples/src/main/resources/web/SignalingChannel.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * SignalingChannel handles WebSocket communication for WebRTC signaling.
- * It includes a heartbeat mechanism to keep the connection alive and detect disconnections early.
- */
-class SignalingChannel {
-
- /**
- * Creates a new SignalingChannel instance.
- *
- * @param {string} serverUrl - The WebSocket server URL.
- * @param {function} onMessage - Callback for received messages.
- * @param {function} onOpen - Callback for connection open.
- * @param {function} onClose - Callback for connection close.
- * @param {function} onError - Callback for connection errors.
- */
- constructor(serverUrl, onOpen, onClose, onMessage, onError) {
- this.serverUrl = serverUrl;
- this.onMessageCallback = onMessage;
- this.onOpenCallback = onOpen;
- this.onCloseCallback = onClose;
- this.onErrorCallback = onError;
- this.socket = null;
- this.heartbeatInterval = 10000; // 10 seconds
- this.heartbeatTimer = null;
- }
-
- /**
- * Establishes a WebSocket connection to the signaling server.
- * Automatically starts the heartbeat mechanism when connected.
- */
- connect() {
- this.socket = new WebSocket(this.serverUrl, "ws-signaling");
-
- this.socket.onopen = () => {
- this.startHeartbeat();
-
- if (this.onOpenCallback) {
- this.onOpenCallback();
- }
- };
-
- this.socket.onmessage = (event) => {
- console.log("Received message:", event.data);
- const message = JSON.parse(event.data);
-
- // Handle heartbeat response.
- if (message.type === "heartbeat-ack") {
- // Heartbeat acknowledged.
- return;
- }
-
- if (this.onMessageCallback) {
- this.onMessageCallback(message);
- }
- };
-
- this.socket.onclose = () => {
- this.stopHeartbeat();
-
- if (this.onCloseCallback) {
- this.onCloseCallback();
- }
- };
-
- this.socket.onerror = (error) => {
- this.stopHeartbeat();
-
- if (this.onErrorCallback) {
- this.onErrorCallback(error);
- }
- };
- }
-
- /**
- * Starts the heartbeat mechanism to keep the WebSocket connection alive.
- * Sends a heartbeat message every this.heartbeatInterval millisecond.
- */
- startHeartbeat() {
- // Clear any existing timer.
- this.stopHeartbeat();
-
- this.heartbeatTimer = setInterval(() => {
- if (this.isConnected()) {
- this.send({
- type: "heartbeat",
- from: this.getUserId()
- });
- }
- else {
- this.stopHeartbeat();
- }
- }, this.heartbeatInterval);
- }
-
- // Helper method to get the current user ID
- getUserId() {
- // In a real application, this would be a unique identifier for the user
- return "web-client";
- }
-
- /**
- * Stops the heartbeat mechanism.
- * Called automatically when the connection is closed or on error.
- */
- stopHeartbeat() {
- if (this.heartbeatTimer) {
- clearInterval(this.heartbeatTimer);
- this.heartbeatTimer = null;
- }
- }
-
- send(message) {
- if (this.isConnected()) {
- this.socket.send(JSON.stringify(message));
- }
- else {
- console.error("WebSocket is not open. Cannot send message:", message);
- }
- }
-
- /**
- * Closes the WebSocket connection and stops the heartbeat mechanism.
- */
- close() {
- this.stopHeartbeat();
-
- if (this.isConnected()) {
- this.socket.close();
- }
- }
-
- /**
- * Checks if the WebSocket connection is currently open.
- *
- * @returns {boolean} True if the connection is open.
- */
- isConnected() {
- return this.socket && this.socket.readyState === WebSocket.OPEN;
- }
-}
-
-export { SignalingChannel };
\ No newline at end of file
diff --git a/webrtc-examples/src/main/resources/web/WebRTCClient.js b/webrtc-examples/src/main/resources/web/WebRTCClient.js
deleted file mode 100644
index 4bc5a68..0000000
--- a/webrtc-examples/src/main/resources/web/WebRTCClient.js
+++ /dev/null
@@ -1,332 +0,0 @@
-import { SignalingChannel } from './SignalingChannel.js';
-import { PeerConnectionManager } from './PeerConnectionManager.js';
-
-class WebRTCClient {
-
- constructor() {
- // Configuration.
- this.serverUrl = "wss://localhost:8443/ws";
- this.iceServers = [
- { urls: "stun:stun.l.google.com:19302" }
- ];
-
- // DOM elements.
- this.remoteVideo = document.getElementById("remoteVideo");
- this.videoContainer = document.getElementById("videoContainer");
- this.stopButton = document.getElementById("stopButton");
- this.statusElement = document.getElementById("status");
- this.participantsList = document.getElementById("participantsList");
-
- // Initialize components.
- this.signalingChannel = null;
- this.peerConnectionManager = null;
- this.participants = new Map();
-
- // Set up event listeners.
- this.stopButton.addEventListener("click", () => this.disconnect());
-
- // Set the initial status.
- this.setStatus("Click \"Start Connection\" to begin");
-
- this.connect();
- }
-
- setStatus(status) {
- this.statusElement.textContent = status;
-
- console.log(status);
- }
-
- connect() {
- this.setStatus("Connecting to the signaling server...");
-
- // Initialize signaling channel.
- this.signalingChannel = new SignalingChannel(
- this.serverUrl,
- () => this.handleSignalingOpen(),
- () => this.handleSignalingClose(),
- (message) => this.handleSignalingMessage(message),
- (error) => this.handleSignalingError(error)
- );
-
- // Connect to the signaling server.
- this.signalingChannel.connect();
- }
-
- disconnect() {
- this.setStatus("Closing connection");
-
- // Close peer connection
- if (this.peerConnectionManager) {
- this.peerConnectionManager.close();
- this.peerConnectionManager = null;
- }
-
- // Close signaling channel
- if (this.signalingChannel) {
- this.signalingChannel.close();
- this.signalingChannel = null;
- }
-
- // Clear remote video
- if (this.remoteVideo.srcObject) {
- this.remoteVideo.srcObject.getTracks().forEach(track => track.stop());
- this.remoteVideo.srcObject = null;
- }
-
- // Hide video container
- this.videoContainer.style.display = 'none';
-
- // Clear participants list
- this.participants.clear();
- this.updateParticipantsList();
-
- // Update UI
- this.stopButton.disabled = true;
- this.setStatus("Connection closed");
- }
-
- joinRoom(roomName) {
- // First, send a join message to the room.
- const joinMessage = {
- type: "join",
- from: this.peerConnectionManager.getUserId(),
- data: {
- room: roomName,
- userInfo: {
- name: "Web Client"
- }
- }
- };
- this.signalingChannel.send(joinMessage);
- this.setStatus('Joining room: default-room');
- }
-
- handleSignalingOpen() {
- this.setStatus("Connected to the signaling server");
-
- // Initialize peer connection manager.
- this.peerConnectionManager = new PeerConnectionManager(
- this.iceServers,
- (event) => this.handleTrack(event),
- (candidate) => this.handleLocalCandidate(candidate),
- (state) => this.handleIceConnectionStateChange(state),
- (state) => this.handleConnectionStateChange(state)
- );
-
- // Add ourselves to the participant list.
- const myUserId = this.peerConnectionManager.getUserId();
- this.participants.set(myUserId, { name: "Me (Local)" });
- this.updateParticipantsList();
-
- this.joinRoom("default-room");
-
- // Update UI.
- this.stopButton.disabled = false;
- }
-
- handleSignalingMessage(message) {
- switch(message.type) {
- case 'answer':
- this.handleAnswer(message);
- break;
- case 'ice-candidate':
- this.handleRemoteCandidate(message);
- break;
- case 'offer':
- this.handleOffer(message);
- break;
- case 'join':
- this.handleUserJoined(message);
- break;
- case 'leave':
- this.handleUserLeft(message);
- break;
- default:
- console.log('Unknown message type:', message.type);
- }
- }
-
- handleUserJoined(message) {
- const userId = message.data.userInfo.userId;
- this.setStatus('User joined: ' + userId);
-
- // Add user to participants map if not already present.
- if (!this.participants.has(userId)) {
- const userInfo = message.data.userInfo || { userId: userId };
- this.participants.set(userId, userInfo);
-
- // Update the participant list in the UI.
- this.updateParticipantsList();
- }
- }
-
- handleUserLeft(message) {
- const userId = message.from;
- this.setStatus('User left: ' + userId);
-
- // Remove user from participants map if present
- if (this.participants.has(userId)) {
- this.participants.delete(userId);
-
- // Update the participant list in the UI
- this.updateParticipantsList();
- }
- }
-
- async handleOffer(message) {
- this.setStatus('Received offer from ' + message.from);
- console.log('Received offer:', message);
-
- // Initialize WebRTC.
- this.startWebRTC();
-
- try {
- // Set the offer to the peer connection.
- await this.peerConnectionManager.handleOffer(message);
- this.setStatus('Remote offer set successfully, creating answer');
-
- // Create and send answer
- const answer = await this.peerConnectionManager.createAnswer();
- this.setStatus('Sending answer to ' + message.from);
- this.signalingChannel.send(answer);
- }
- catch (error) {
- this.setStatus('Failed to process offer: ' + error);
- console.error('Error handling offer:', error);
- }
- }
-
- updateParticipantsList() {
- // Clear the current list
- this.participantsList.innerHTML = '';
-
- // Add each participant to the list
- this.participants.forEach((userInfo, userId) => {
- const listItem = document.createElement('li');
- listItem.textContent = userInfo.name || userId;
- listItem.setAttribute('data-user-id', userId);
- this.participantsList.appendChild(listItem);
- });
- }
-
- handleSignalingClose() {
- this.setStatus('Disconnected from signaling server');
- this.disconnect();
- }
-
- handleSignalingError(error) {
- this.setStatus('Error connecting to signaling server');
- console.error('WebSocket error:', error);
- }
-
- async startWebRTC() {
- this.peerConnectionManager.initialize();
-
- // Add local media if available
- // const mediaAdded = await this.peerConnectionManager.addLocalMedia();
- // if (!mediaAdded) {
- // this.setStatus('Failed to access camera/microphone. Creating offer without local media.');
- // }
-
- // Create and send offer
- // try {
- // const offer = await this.peerConnectionManager.createOffer();
- // this.setStatus('Sending offer to Java server');
- // this.signalingChannel.send(offer);
- // }
- // catch (error) {
- // this.setStatus('Failed to create offer: ' + error);
- // }
- }
-
- handleTrack(event) {
- this.setStatus('Received remote track');
- console.log('Track event:', event);
-
- if (event.streams && event.streams[0]) {
- // If remoteVideo already has a srcObject, we need to add the new track to it
- // instead of replacing the entire stream.
- if (this.remoteVideo.srcObject) {
- // Check if this track already exists in the current stream.
- const existingTrack = this.remoteVideo.srcObject.getTracks().find(
- track => track.id === event.track.id
- );
-
- // Only add the track if it doesn't already exist.
- if (!existingTrack) {
- // Add the new track to the existing stream.
- this.remoteVideo.srcObject.addTrack(event.track);
- this.setStatus(`Added ${event.track.kind} track to existing stream`);
- }
- }
- else {
- // First track, set the stream directly.
- this.remoteVideo.srcObject = event.streams[0];
- this.setStatus(`Set initial ${event.track.kind} stream`);
- }
-
- // Show the video container when we receive a track.
- this.videoContainer.style.display = 'block';
-
- // Ensure the video plays.
- this.remoteVideo.play().catch(error => {
- console.error('Error playing video:', error);
- this.setStatus('Error playing video: ' + error.message);
- });
- }
- else {
- console.warn('Received track event without streams');
- this.setStatus('Received track without stream data');
- }
- }
-
- handleLocalCandidate(candidate) {
- this.signalingChannel.send(candidate);
- }
-
- handleIceConnectionStateChange(state) {
- this.setStatus('ICE connection state: ' + state);
-
- // Hide video if connection is disconnected, failed, or closed
- if (['disconnected', 'failed', 'closed'].includes(state)) {
- this.videoContainer.style.display = 'none';
- }
- }
-
- handleConnectionStateChange(state) {
- this.setStatus('Connection state: ' + state);
-
- // Show video only when connected
- if (state === 'connected') {
- this.videoContainer.style.display = 'block';
- } else if (['disconnected', 'failed', 'closed'].includes(state)) {
- this.videoContainer.style.display = 'none';
- }
- }
-
- async handleAnswer(message) {
- this.setStatus('Received answer from ' + message.from + ', setting remote description');
-
- try {
- await this.peerConnectionManager.handleAnswer(message);
- this.setStatus('Remote description set successfully');
- }
- catch (error) {
- this.setStatus('Failed to set remote description: ' + error);
- }
- }
-
- async handleRemoteCandidate(message) {
- try {
- this.setStatus('Received ICE candidate from ' + message.from);
-
- await this.peerConnectionManager.addIceCandidate(message);
- }
- catch (error) {
- console.error("Error handling remote candidate:", error);
- }
- }
-}
-
-export { WebRTCClient };
\ No newline at end of file
diff --git a/webrtc-examples/src/main/resources/web/index.html b/webrtc-examples/src/main/resources/web/index.html
deleted file mode 100644
index 7ba5e44..0000000
--- a/webrtc-examples/src/main/resources/web/index.html
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
-
- WebRTC Java - Browser Demo
-
-
-
-
-
-
WebRTC Java - Browser Demo
-
Not connected
-
-
-
-
-
-
-
Participants
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/webrtc-examples/src/main/resources/web/main.js b/webrtc-examples/src/main/resources/web/main.js
deleted file mode 100644
index 3a456f7..0000000
--- a/webrtc-examples/src/main/resources/web/main.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import { WebRTCClient } from './WebRTCClient.js';
-
-// Initialize the WebRTC client when the page loads
-document.addEventListener("DOMContentLoaded", () => {
- new WebRTCClient();
-});
\ No newline at end of file
diff --git a/webrtc-jni/build.gradle.kts b/webrtc-jni/build.gradle.kts
new file mode 100644
index 0000000..81f20f5
--- /dev/null
+++ b/webrtc-jni/build.gradle.kts
@@ -0,0 +1,144 @@
+import org.gradle.internal.os.OperatingSystem
+
+import java.time.ZonedDateTime
+import java.time.format.DateTimeFormatter
+
+plugins {
+ `java`
+}
+
+java {
+ toolchain {
+ languageVersion.set(JavaLanguageVersion.of(17))
+ }
+}
+
+val currentOs = OperatingSystem.current()
+
+var targetPlatform = System.getenv("WEBRTC_PLATFORM") as? String
+
+if (targetPlatform == null) {
+ val rawArch = System.getProperty("os.arch").lowercase().trim()
+
+ val osFamily = when {
+ currentOs.isLinux -> "linux"
+ currentOs.isMacOsX -> "macos"
+ currentOs.isWindows -> "windows"
+ else -> error("Unsupported OS: ${currentOs.name}")
+ }
+
+ val osArch = when {
+ rawArch == "amd64" || rawArch == "x86_64" || rawArch == "x86-64" -> "x86_64"
+ rawArch == "aarch64" || rawArch == "arm64" -> "aarch64"
+ rawArch.startsWith("arm") -> "aarch32"
+ else -> error("Unsupported Architecture: $rawArch")
+ }
+
+ targetPlatform = "$osFamily-$osArch"
+}
+
+val toolchainFile = file("src/main/cpp/toolchain").resolve("$targetPlatform.cmake")
+
+val cmakeBuildDir = layout.buildDirectory.dir("cmake/$targetPlatform")
+
+val configureNative by tasks.registering(Exec::class) {
+ logger.lifecycle("Configuring webrtc-jni for Platform: $targetPlatform")
+
+ group = "build"
+ workingDir = file("src/main/cpp")
+
+ doFirst {
+ cmakeBuildDir.get().asFile.mkdirs()
+ }
+
+ commandLine("cmake")
+ args("-S", ".", "-B", cmakeBuildDir.get().asFile.absolutePath)
+ args("-DCMAKE_BUILD_TYPE=Release")
+
+ if (targetPlatform == "windows-aarch64") {
+ args("-A", "ARM64")
+ }
+
+ if (toolchainFile.exists()) {
+ logger.lifecycle("Using Toolchain file: ${toolchainFile.absolutePath}")
+ args("-DWEBRTC_TOOLCHAIN_FILE=${toolchainFile.absolutePath}")
+ } else {
+ logger.warn("Toolchain file not found for platform $targetPlatform: ${toolchainFile.absolutePath}")
+ }
+
+ val webrtcBranch = project.property("webrtc.branch") as String? ?: "master"
+ logger.lifecycle("Using WebRTC Branch: $webrtcBranch")
+
+ args("-DWEBRTC_BRANCH=$webrtcBranch")
+ args("-DOUTPUT_NAME_SUFFIX=$targetPlatform")
+ args("-DCMAKE_INSTALL_PREFIX=${layout.buildDirectory.dir("install").get().asFile.absolutePath}")
+ args("-DCMAKE_EXPORT_COMPILE_COMMANDS=1")
+}
+
+val buildNative by tasks.registering(Exec::class) {
+ group = "build"
+ dependsOn(configureNative)
+
+ commandLine("cmake")
+ args("--build", cmakeBuildDir.get().asFile.absolutePath)
+ args("--config", "Release")
+ args("--target", "install")
+
+ if (!currentOs.isWindows) {
+ args("-j", Runtime.getRuntime().availableProcessors())
+ }
+}
+
+val copyNativeLibs by tasks.registering(Copy::class) {
+ dependsOn(buildNative)
+ includeEmptyDirs = false
+
+ from(fileTree(cmakeBuildDir).matching {
+ include("**/*.so", "**/*.dll", "**/*.dylib")
+ exclude("**/*.lib", "**/*.exp", "**/obj/**", "**/CMakeFiles/**")
+ })
+
+ into(layout.buildDirectory.dir("generated/jni"))
+
+ rename { filename ->
+ if (filename.contains("webrtc-java")) {
+ val ext = if (filename.endsWith(".dll")) "dll" else if (filename.endsWith(".dylib")) "dylib" else "so"
+ val prefix = if (ext == "dll") "" else "lib"
+ "${prefix}webrtc-java-${targetPlatform}.${ext}"
+ } else {
+ filename
+ }
+ }
+
+ eachFile { relativePath = RelativePath(true, name) }
+}
+
+tasks.named("jar") {
+ archiveBaseName.set("webrtc-java")
+ archiveClassifier.set(targetPlatform)
+
+ from(copyNativeLibs) {
+ into("/")
+ }
+
+ manifest {
+ val safePlatformName = targetPlatform?.replace("-", ".") ?: "unknown"
+
+ attributes(
+ "Manifest-Version" to "1.0",
+
+ "Implementation-Title" to "WebRTC Java Natives ($targetPlatform)",
+ "Implementation-Version" to project.version,
+ "Implementation-Vendor" to "Kas-tle",
+
+ "Automatic-Module-Name" to "dev.kastle.webrtc.natives.$safePlatformName",
+
+ "Created-By" to "Gradle ${gradle.gradleVersion}",
+ "Build-Jdk-Spec" to "17",
+ "Build-Date" to ZonedDateTime.now().format(DateTimeFormatter.ISO_INSTANT),
+ "Build-Platform" to targetPlatform!!
+ )
+ }
+}
+
+tasks.withType { enabled = false }
\ No newline at end of file
diff --git a/webrtc-jni/gradle.properties b/webrtc-jni/gradle.properties
new file mode 100644
index 0000000..3d916ba
--- /dev/null
+++ b/webrtc-jni/gradle.properties
@@ -0,0 +1 @@
+webrtc.branch=branch-heads/7339
\ No newline at end of file
diff --git a/webrtc-jni/pom.xml b/webrtc-jni/pom.xml
deleted file mode 100644
index 8d7f9af..0000000
--- a/webrtc-jni/pom.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-
-
- 4.0.0
-
-
- dev.onvoid.webrtc
- webrtc-java-parent
- 0.15.0-SNAPSHOT
-
-
- webrtc-java-jni
- pom
-
-
- branch-heads/7339
- ${user.home}/webrtc
- ${user.home}/webrtc/build
- Release
-
-
-
-
-
- webrtc-java-${project.version}
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- prepare-package
-
- jar
-
-
- ${platform.classifier}
- ${project.build.directory}/lib
-
- false
-
- ${platform.module}
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-install-plugin
-
- true
-
-
-
- install-classifier
- package
-
- install-file
-
-
- ${project.build.directory}/webrtc-java-${project.version}-${platform.classifier}.jar
- ${platform.classifier}
- ${project.groupId}
- webrtc-java
- ${project.version}
- jar
- false
-
-
-
-
-
- com.googlecode.cmake-maven-project
- cmake-maven-plugin
- 3.22.1-b1
-
-
- cmake-generate
- generate-resources
-
- generate
-
-
- false
- src/main/cpp
- ${project.build.directory}/${platform.classifier}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cmake-compile
- generate-resources
-
- compile
-
-
- false
- ${cmake.config}
- install
- ${project.build.directory}/${platform.classifier}
-
-
-
-
-
-
-
-
-
- windows-x86_64
-
-
- windows
- amd64
-
-
-
- -Ax64
- ${cmake.build.type}
-
-
-
- windows-clang
-
-
- windows
- amd64
-
-
-
- -T ClangCL
- toolchain/x86_64-windows-clang.cmake
-
-
-
- linux-x86_64
-
-
- linux
- amd64
-
-
-
- toolchain/x86_64-linux-clang.cmake
-
-
-
- linux-aarch32
-
-
- linux
- aarch32
-
-
-
- toolchain/aarch32-linux-clang.cmake
-
-
-
- linux-aarch64
-
-
- linux
- aarch64
-
-
-
- toolchain/aarch64-linux-clang.cmake
-
-
-
- macos-aarch64
-
-
- mac
- aarch64
-
-
-
- toolchain/aarch64-macos-clang.cmake
-
-
-
- macos-cross-x86_64
-
- toolchain/x86_64-macos-cross.cmake
-
-
-
-
diff --git a/webrtc-jni/src/main/cpp/CMakeLists.txt b/webrtc-jni/src/main/cpp/CMakeLists.txt
index 82f72ae..b4d0b7d 100644
--- a/webrtc-jni/src/main/cpp/CMakeLists.txt
+++ b/webrtc-jni/src/main/cpp/CMakeLists.txt
@@ -7,6 +7,23 @@ endif()
project(webrtc-java)
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND LINUX)
+ find_program(LLD_PATH ld.lld
+ HINTS /opt/clang/bin /usr/bin /usr/local/bin
+ DOC "Path to lld linker"
+ )
+ if(LLD_PATH)
+ message(STATUS "Found LLD: ${LLD_PATH}")
+ add_link_options(-fuse-ld=lld)
+ else()
+ message(WARNING "LLD not found! Linker errors may occur.")
+ endif()
+ if(TARGET_CPU STREQUAL "x64")
+ add_compile_options(-nostdinc++ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE)
+ add_link_options(-stdlib=libc++ -v -Wl,--verbose)
+ endif()
+endif()
+
if(UNIX AND NOT APPLE)
# Apply the sysroot configuration for the actual build
if(DEFERRED_SYSROOT)
@@ -50,42 +67,30 @@ add_subdirectory(dependencies/jni-voithos)
file(GLOB SOURCES_ROOT "src/*.cpp")
file(GLOB SOURCES_API "src/api/*.cpp")
-file(GLOB SOURCES_API_AUDIO "src/api/audio/*.cpp")
-file(GLOB SOURCES_MEDIA "src/media/*.cpp")
-file(GLOB SOURCES_MEDIA_AUDIO "src/media/audio/*.cpp")
-file(GLOB SOURCES_MEDIA_AUDIO_OS "src/media/audio/${SOURCE_TARGET}/*.cpp")
-file(GLOB SOURCES_MEDIA_VIDEO "src/media/video/*.cpp")
-file(GLOB SOURCES_MEDIA_VIDEO_DESKTOP "src/media/video/desktop/*.cpp")
-file(GLOB SOURCES_MEDIA_VIDEO_DESKTOP_OS "src/media/video/desktop/${SOURCE_TARGET}/*.cpp")
-file(GLOB SOURCES_MEDIA_VIDEO_OS "src/media/video/${SOURCE_TARGET}/*.cpp")
-file(GLOB SOURCES_PLATFORM "src/platform/${SOURCE_TARGET}/*.cpp")
file(GLOB SOURCES_RTC "src/rtc/*.cpp")
list(APPEND SOURCES
${SOURCES_ROOT}
${SOURCES_API}
- ${SOURCES_API_AUDIO}
- ${SOURCES_MEDIA}
- ${SOURCES_MEDIA_AUDIO}
- ${SOURCES_MEDIA_AUDIO_OS}
- ${SOURCES_MEDIA_VIDEO}
- ${SOURCES_MEDIA_VIDEO_DESKTOP}
- ${SOURCES_MEDIA_VIDEO_DESKTOP_OS}
- ${SOURCES_MEDIA_VIDEO_OS}
- ${SOURCES_PLATFORM}
${SOURCES_RTC}
)
add_library(${PROJECT_NAME} SHARED ${SOURCES})
# Introduced since WebRTC branch 7204 and Clang 20.
-target_compile_options(${PROJECT_NAME} PRIVATE -Wno-nullability-completeness)
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ if(MSVC)
+ # clang-cl on Windows requires the /clang: prefix to avoid interpreting /W... as a warning level flag
+ target_compile_options(${PROJECT_NAME} PRIVATE /clang:-Wno-nullability-completeness)
+ else()
+ target_compile_options(${PROJECT_NAME} PRIVATE -Wno-nullability-completeness)
+ endif()
+endif()
target_include_directories(${PROJECT_NAME}
PRIVATE
include
include/api
- include/media
include/rtc
)
@@ -102,7 +107,7 @@ target_link_libraries(${PROJECT_NAME} webrtc)
if(APPLE)
set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c++")
target_link_options(${PROJECT_NAME} PRIVATE "-ObjC")
- target_link_libraries(${PROJECT_NAME} "-framework Foundation" "-framework AVFoundation" "-framework CoreMedia" "-framework CoreAudio" "-framework IOKit" "-framework CoreVideo" "-framework VideoToolbox" "-framework QuartzCore")
+ target_link_libraries(${PROJECT_NAME} "-framework Foundation" "-framework AVFoundation" "-framework CoreMedia" "-framework CoreVideo")
elseif(LINUX)
if(NOT TARGET_CPU MATCHES "^arm")
set(CXX_LIBS "-static-libgcc -stdlib=libc++ -lc++ -lc++abi")
@@ -110,13 +115,37 @@ elseif(LINUX)
set(CXX_LIBS "-static-libgcc")
endif()
- target_link_libraries(${PROJECT_NAME} ${CXX_LIBS} udev)
- target_link_libraries(${PROJECT_NAME} dl)
+ target_link_libraries(${PROJECT_NAME} ${CXX_LIBS})
elseif(WIN32)
- target_link_libraries(${PROJECT_NAME} dwmapi.lib mf.lib mfreadwrite.lib mfplat.lib mfuuid.lib shcore.lib)
+ target_link_libraries(${PROJECT_NAME})
endif()
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT Runtime
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT Runtime
)
+
+if (PROJECT_IS_TOP_LEVEL)
+ get_filename_component(TARGET_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../.." ABSOLUTE)
+
+ set(COMPILE_COMMANDS_SRC "${CMAKE_BINARY_DIR}/compile_commands.json")
+ set(COMPILE_COMMANDS_DST "${TARGET_DIR}/compile_commands.json")
+
+ if (WIN32)
+ # Windows: Copy instead of symlink to avoid permission issues
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${COMPILE_COMMANDS_SRC}"
+ "${COMPILE_COMMANDS_DST}"
+ )
+ message(STATUS "Copied compile_commands.json to: ${TARGET_DIR}")
+ else()
+ # Unix: Symlink
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ "${COMPILE_COMMANDS_SRC}"
+ "${COMPILE_COMMANDS_DST}"
+ )
+ message(STATUS "Created compile_commands.json symlink in: ${TARGET_DIR}")
+ endif()
+endif()
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaArray.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaArray.h
index e24591b..307204b 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaArray.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaArray.h
@@ -9,7 +9,6 @@
#define JNI_JAVA_ARRAY_H_
#include "Exception.h"
-#include "JavaClass.h"
#include "JavaRef.h"
#include
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaBigInteger.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaBigInteger.h
index 59ee0d6..77db92f 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaBigInteger.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaBigInteger.h
@@ -13,6 +13,7 @@
#include
#include
+#include
namespace jni
{
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaClassUtils.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaClassUtils.h
index 736bf6e..eaa235c 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaClassUtils.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaClassUtils.h
@@ -9,6 +9,7 @@
#define JNI_JAVA_CLASS_UTILS_H_
#include "JavaRef.h"
+#include "JavaClass.h"
#include
#include
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaContext.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaContext.h
index 724ecae..2d09468 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaContext.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaContext.h
@@ -10,7 +10,6 @@
#include "JavaClassUtils.h"
#include "JavaRef.h"
-#include "JavaString.h"
#include
#include
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaPrimitive.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaPrimitive.h
index d7d0393..d760090 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaPrimitive.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaPrimitive.h
@@ -12,6 +12,7 @@
#include "JavaArray.h"
#include "JavaClass.h"
+#include "JavaClasses.h"
#include "JavaRef.h"
#include "JavaUtils.h"
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaString.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaString.h
index cd86700..86818bc 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaString.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaString.h
@@ -13,6 +13,7 @@
#include
#include
+#include
namespace jni
{
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaThrowable.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaThrowable.h
index e907b3e..4623d50 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaThrowable.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaThrowable.h
@@ -13,8 +13,6 @@
#include
#include
-#include
-#include
namespace jni
{
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaUtils.h b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaUtils.h
index db28797..28c1305 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaUtils.h
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/include/JavaUtils.h
@@ -8,13 +8,11 @@
#ifndef JNI_JAVA_UTILS_H_
#define JNI_JAVA_UTILS_H_
-#include "JavaNullPointerException.h"
+#include "JavaNullPointerException.h" // IWYU pragma: keep
-#include
#include
#include
#include
-#include
#define CHECK_HANDLE(handle) \
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaBigInteger.cpp b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaBigInteger.cpp
index cbcbe4e..dd17c14 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaBigInteger.cpp
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaBigInteger.cpp
@@ -8,7 +8,6 @@
#include "JavaArray.h"
#include "JavaBigInteger.h"
#include "JavaClasses.h"
-#include "JavaObject.h"
#include "JavaString.h"
#include "JavaUtils.h"
diff --git a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaUtils.cpp b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaUtils.cpp
index e3b3a94..8abeb6e 100644
--- a/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaUtils.cpp
+++ b/webrtc-jni/src/main/cpp/dependencies/jni-voithos/src/JavaUtils.cpp
@@ -5,14 +5,11 @@
* found in the LICENSE file in the root of the source tree.
*/
-#include "Exception.h"
#include "JavaUtils.h"
#include "JavaClassLoader.h"
#include "JavaContext.h"
#include "JavaError.h"
-#include "JavaIterable.h"
#include "JavaIOException.h"
-#include "JavaString.h"
#include "JavaThreadEnv.h"
#include "JavaWrappedException.h"
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt b/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
index a11a7b5..567a1c2 100644
--- a/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
+++ b/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
@@ -36,15 +36,12 @@ if(NOT DEFINED WEBRTC_BRANCH)
endif()
if(NOT DEFINED WEBRTC_SRC_DIR)
- if(DEFINED ENV{CTEST_REAL_HOME})
- set(WEBRTC_SRC_DIR "$ENV{CTEST_REAL_HOME}")
+ if (DEFINED ENV{WEBRTC_CHECKOUT_FOLDER})
+ set(WEBRTC_SRC_DIR "$ENV{WEBRTC_CHECKOUT_FOLDER}")
else()
- set(WEBRTC_SRC_DIR "$ENV{HOME}")
- endif()
-
- if(NOT WEBRTC_SRC_DIR AND WIN32)
- file(TO_CMAKE_PATH "$ENV{USERPROFILE}" WEBRTC_SRC_DIR)
+ set(WEBRTC_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/webrtc-source")
endif()
+ file(MAKE_DIRECTORY "${WEBRTC_SRC_DIR}")
endif()
if(NOT DEFINED WEBRTC_INSTALL_DIR)
@@ -154,7 +151,6 @@ target_include_directories(${PROJECT_NAME}
PUBLIC
${TARGET_INC_DIR}
${TARGET_INC_DIR}/third_party/abseil-cpp
- ${TARGET_INC_DIR}/third_party/libyuv/include
)
target_link_libraries(${PROJECT_NAME} ${TARGET_LINK_LIB})
@@ -164,19 +160,14 @@ if(APPLE)
${TARGET_INC_DIR}/sdk/objc
${TARGET_INC_DIR}/sdk/objc/base
)
- target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_MAC WEBRTC_POSIX WEBRTC_USE_H264)
- target_link_libraries(${PROJECT_NAME} "-framework Foundation" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreAudio" "-framework CoreVideo" "-framework ScreenCaptureKit" "-framework AudioToolbox" "-framework IOSurface" "-framework ApplicationServices" "-framework AppKit")
+ target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_MAC WEBRTC_POSIX)
+ target_link_libraries(${PROJECT_NAME} "-framework Foundation" "-framework AVFoundation" "-framework CoreMedia" "-framework CoreVideo")
elseif(LINUX)
- # Find DBus
- find_package(PkgConfig QUIET REQUIRED) # Include functions provided by PkgConfig module.
- pkg_check_modules(DBUS REQUIRED dbus-1)
-
- target_include_directories(${PROJECT_NAME} PUBLIC ${DBUS_INCLUDE_DIRS})
- target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_LINUX WEBRTC_POSIX WEBRTC_USE_H264)
- target_link_libraries(${PROJECT_NAME} X11 Xfixes Xrandr Xcomposite dbus-1)
+ target_include_directories(${PROJECT_NAME} PUBLIC)
+ target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_LINUX WEBRTC_POSIX)
elseif(WIN32)
- target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_WIN WEBRTC_USE_H264 NOMINMAX WIN32_LEAN_AND_MEAN NDEBUG)
- target_link_libraries(${PROJECT_NAME} D3D11 DXGI user32 gdi32 iphlpapi dmoguids msdmo secur32 strmiids winmm wmcodecdspuuid ws2_32)
+ target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_WIN NOMINMAX WIN32_LEAN_AND_MEAN NDEBUG)
+ target_link_libraries(${PROJECT_NAME} user32 iphlpapi secur32 ws2_32 winmm)
endif()
if(EXISTS "${WEBRTC_LIB_PATH}" OR EXISTS "${WEBRTC_LIB_PATH_INSTALLED}")
@@ -202,25 +193,47 @@ set(ENV{PATH} "${WEBRTC_SRC_DIR}/depot_tools${PATH_SEP}$ENV{PATH}")
file(MAKE_DIRECTORY ${WEBRTC_DIR})
-message(STATUS "WebRTC: fetch")
+message(STATUS "WebRTC: Configuring gclient for branch ${WEBRTC_BRANCH}")
+
execute_command(
- COMMAND fetch --nohooks webrtc
+ COMMAND gclient config --name src --unmanaged "https://webrtc.googlesource.com/src.git@${WEBRTC_BRANCH}"
WORKING_DIRECTORY "${WEBRTC_DIR}"
)
-message(STATUS "WebRTC: checkout \"${WEBRTC_BRANCH}\"")
-execute_command(
- COMMAND git checkout .
- WORKING_DIRECTORY "${WEBRTC_SRC}"
-)
+if(APPLE)
+ set(WEBRTC_TARGET_OS "['mac']")
+elseif(WIN32)
+ set(WEBRTC_TARGET_OS "['win']")
+else()
+ set(WEBRTC_TARGET_OS "['linux']")
+endif()
+
+file(APPEND "${WEBRTC_DIR}/.gclient" "target_os = ${WEBRTC_TARGET_OS}\n")
+
+message(STATUS "WebRTC: Syncing Sources (No Hooks, Shallow)")
execute_command(
- COMMAND git checkout ${WEBRTC_BRANCH}
- WORKING_DIRECTORY "${WEBRTC_SRC}"
+ COMMAND gclient sync -D --no-history --nohooks -j16
+ WORKING_DIRECTORY "${WEBRTC_DIR}"
)
-message(STATUS "WebRTC: sync")
+message(STATUS "WebRTC: Patching DEPS")
+set(DEPS_FILE "${WEBRTC_SRC}/DEPS")
+if(EXISTS "${DEPS_FILE}")
+ file(READ "${DEPS_FILE}" DEPS_CONTENT)
+ string(REPLACE
+ "'src/resources'],"
+ "'src/resources'], 'condition': 'False',"
+ DEPS_CONTENT
+ "${DEPS_CONTENT}"
+ )
+ file(WRITE "${DEPS_FILE}" "${DEPS_CONTENT}")
+else()
+ message(WARNING "WebRTC: DEPS file not found. Optimization skipped.")
+endif()
+
+message(STATUS "WebRTC: Final Sync (Artifacts)")
execute_command(
- COMMAND gclient sync
+ COMMAND gclient sync -D --no-history -j16
WORKING_DIRECTORY "${WEBRTC_DIR}"
)
@@ -237,7 +250,7 @@ if (PATCHES)
message(STATUS "Applying ${PATCH}")
execute_process(
- COMMAND git apply
+ COMMAND git apply --ignore-whitespace
WORKING_DIRECTORY "${WEBRTC_SRC}"
INPUT_FILE "${PATCH}"
OUTPUT_VARIABLE OUTPUT
@@ -258,16 +271,39 @@ is_clang=true \
is_debug=false \
is_component_build=false \
treat_warnings_as_errors=false \
+rtc_include_opus=false \
+rtc_opus_support_120ms_ptime=false \
+rtc_opus_variable_complexity=false \
+rtc_exclude_audio_processing_module=true \
rtc_build_tools=false \
-rtc_use_perfetto=false \
+rtc_build_examples=false \
+rtc_use_x11=false \
+rtc_use_x11_extensions=false \
rtc_use_pipewire=false \
+rtc_link_pipewire=false \
+rtc_use_h264=false \
+rtc_include_builtin_audio_codecs=false \
+rtc_enable_win_wgc=false \
+rtc_build_libvpx=false \
+rtc_build_opus=false \
+rtc_libvpx_build_vp9=false \
+rtc_include_pulse_audio=false \
+rtc_include_internal_audio_device=false \
+rtc_use_perfetto=false \
rtc_enable_protobuf=false \
-rtc_build_examples=false \
rtc_include_tests=false \
+rtc_include_dav1d_in_internal_decoder_factory=false \
+rtc_enable_google_benchmarks=false \
use_rtti=true \
-rtc_use_h264=true \
-ffmpeg_branding=\"Chrome\" \
-symbol_level=0")
+symbol_level=0 \
+use_dbus=false \
+use_udev=false \
+proprietary_codecs=false \
+enable_libaom=false \
+enable_freetype=false \
+libyuv_disable_jpeg=true \
+libyuv_disable_rvv=true \
+libyuv_include_tests=false")
if(APPLE)
set(COMPILE_ARGS "${COMPILE_ARGS} mac_deployment_target=\"${CMAKE_OSX_DEPLOYMENT_TARGET}\"")
@@ -287,7 +323,7 @@ execute_command(
message(STATUS "WebRTC: compile")
if(APPLE)
execute_command(
- COMMAND ninja -C "${WEBRTC_BUILD}" :default api/audio_codecs:builtin_audio_decoder_factory api/task_queue:default_task_queue_factory sdk:native_api sdk:default_codec_factory_objc pc:peer_connection sdk:videocapture_objc
+ COMMAND ninja -C "${WEBRTC_BUILD}" :default api/task_queue:default_task_queue_factory sdk:native_api pc:peer_connection
WORKING_DIRECTORY "${WEBRTC_SRC}"
)
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/.gitkeep b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/stack_copier_signal.patch b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/stack_copier_signal.patch
deleted file mode 100644
index 0a008cf..0000000
--- a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/linux/stack_copier_signal.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/base/profiler/stack_copier_signal.cc 2020-12-16 18:39:43.284026104 +0100
-+++ src/base/profiler/stack_copier_signal_new.cc 2020-12-16 18:39:58.256359806 +0100
-@@ -6,6 +6,7 @@
-
- #include
- #include
-+#include
- #include
- #include
-
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/.gitkeep b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/disable_desktop_capture.patch b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/disable_desktop_capture.patch
new file mode 100644
index 0000000..5c277e4
--- /dev/null
+++ b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/disable_desktop_capture.patch
@@ -0,0 +1,10 @@
+--- a/webrtc.gni
++++ b/webrtc.gni
+@@ -349,6 +349,5 @@
+
+ # Desktop capturer is supported only on Windows, OSX and Linux.
+ rtc_desktop_capture_supported =
+- (is_win && current_os != "winuwp") || is_mac ||
+- ((is_linux || is_chromeos) && (rtc_use_x11_extensions || rtc_use_pipewire))
++ false
+
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/patch_for_mac_deviceId.patch b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/patch_for_mac_deviceId.patch
deleted file mode 100644
index af35cef..0000000
--- a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/macos/patch_for_mac_deviceId.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Subject: [PATCH] patch for mac deviceId
----
-Index: modules/audio_device/mac/audio_device_mac.cc
-IDEA additional info:
-Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-<+>UTF-8
-===================================================================
-diff --git a/modules/audio_device/mac/audio_device_mac.cc b/modules/audio_device/mac/audio_device_mac.cc
---- a/modules/audio_device/mac/audio_device_mac.cc (revision e4445e46a910eb407571ec0b0b8b7043562678cf)
-+++ b/modules/audio_device/mac/audio_device_mac.cc (date 1757498230183)
-@@ -834,6 +834,10 @@
-
- if (guid != NULL) {
- memset(guid, 0, kAdmMaxGuidSize);
-+ AudioDeviceID deviceIds[MaxNumberDevices];
-+ int numberDevices = GetNumberDevices(kAudioDevicePropertyScopeOutput, deviceIds, MaxNumberDevices);
-+ std::string deviceId = std::to_string(deviceIds[index]);
-+ deviceId.copy(guid, kAdmMaxGuidSize);
- }
-
- return GetDeviceName(kAudioDevicePropertyScopeOutput, index,
-@@ -853,6 +857,10 @@
-
- if (guid != NULL) {
- memset(guid, 0, kAdmMaxGuidSize);
-+ AudioDeviceID deviceIds[MaxNumberDevices];
-+ int numberDevices = GetNumberDevices(kAudioDevicePropertyScopeInput, deviceIds, MaxNumberDevices);
-+ std::string deviceId = std::to_string(deviceIds[index]);
-+ deviceId.copy(guid, kAdmMaxGuidSize);
- }
-
- return GetDeviceName(kAudioDevicePropertyScopeInput, index,
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/windows/.gitkeep b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/windows/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/windows/disable_desktop_capture.patch b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/windows/disable_desktop_capture.patch
new file mode 100644
index 0000000..5c277e4
--- /dev/null
+++ b/webrtc-jni/src/main/cpp/dependencies/webrtc/patches/windows/disable_desktop_capture.patch
@@ -0,0 +1,10 @@
+--- a/webrtc.gni
++++ b/webrtc.gni
+@@ -349,6 +349,5 @@
+
+ # Desktop capturer is supported only on Windows, OSX and Linux.
+ rtc_desktop_capture_supported =
+- (is_win && current_os != "winuwp") || is_mac ||
+- ((is_linux || is_chromeos) && (rtc_use_x11_extensions || rtc_use_pipewire))
++ false
+
diff --git a/webrtc-jni/src/main/cpp/include/JNI_AudioConverter.h b/webrtc-jni/src/main/cpp/include/JNI_AudioConverter.h
deleted file mode 100644
index f29c41b..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_AudioConverter.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_AudioConverter */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_AudioConverter
-#define _Included_dev_onvoid_webrtc_media_audio_AudioConverter
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioConverter
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioConverter_dispose
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioConverter
- * Method: initialize
- * Signature: (IIII)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioConverter_initialize
- (JNIEnv*, jobject, jint, jint, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioConverter
- * Method: convertInternal
- * Signature: ([BI[BI)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioConverter_convertInternal
- (JNIEnv*, jobject, jbyteArray, jint, jbyteArray, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_AudioDeviceModule.h b/webrtc-jni/src/main/cpp/include/JNI_AudioDeviceModule.h
deleted file mode 100644
index 888cc99..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_AudioDeviceModule.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_AudioDeviceModule */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_AudioDeviceModule
-#define _Included_dev_onvoid_webrtc_media_audio_AudioDeviceModule
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModule
- * Method: initialize
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioLayer;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModule_initialize
- (JNIEnv *, jobject, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_AudioDeviceModuleBase.h b/webrtc-jni/src/main/cpp/include/JNI_AudioDeviceModuleBase.h
deleted file mode 100644
index b1f28de..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_AudioDeviceModuleBase.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
-#define _Included_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: initPlayout
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_initPlayout
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: stopPlayout
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_stopPlayout
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: startPlayout
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_startPlayout
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: initRecording
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_initRecording
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: stopRecording
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_stopRecording
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: startRecording
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_startRecording
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getPlayoutDevices
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getPlayoutDevices
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getRecordingDevices
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getRecordingDevices
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: setPlayoutDevice
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioDevice;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_setPlayoutDevice
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: setRecordingDevice
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioDevice;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_setRecordingDevice
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: isSpeakerMuted
- * Signature: ()Z
- */
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_isSpeakerMuted
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: isMicrophoneMuted
- * Signature: ()Z
- */
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_isMicrophoneMuted
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getSpeakerVolume
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getSpeakerVolume
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getMaxSpeakerVolume
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getMaxSpeakerVolume
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getMinSpeakerVolume
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getMinSpeakerVolume
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getMicrophoneVolume
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getMicrophoneVolume
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getMaxMicrophoneVolume
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getMaxMicrophoneVolume
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: getMinMicrophoneVolume
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_getMinMicrophoneVolume
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: setSpeakerVolume
- * Signature: (I)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_setSpeakerVolume
- (JNIEnv *, jobject, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: setSpeakerMute
- * Signature: (Z)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_setSpeakerMute
- (JNIEnv *, jobject, jboolean);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: setMicrophoneVolume
- * Signature: (I)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_setMicrophoneVolume
- (JNIEnv *, jobject, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: setMicrophoneMute
- * Signature: (Z)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_setMicrophoneMute
- (JNIEnv *, jobject, jboolean);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: addSinkInternal
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioSink;)J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_addSinkInternal
- (JNIEnv*, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: removeSinkInternal
- * Signature: (J)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_removeSinkInternal
- (JNIEnv*, jobject, jlong);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: addSourceInternal
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioSource;)J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_addSourceInternal
- (JNIEnv*, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: removeSourceInternal
- * Signature: (J)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_removeSourceInternal
- (JNIEnv*, jobject, jlong);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase
- * Method: disposeInternal
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioDeviceModuleBase_disposeInternal
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_AudioProcessing.h b/webrtc-jni/src/main/cpp/include/JNI_AudioProcessing.h
deleted file mode 100644
index 8e8644e..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_AudioProcessing.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_AudioProcessing */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_AudioProcessing
-#define _Included_dev_onvoid_webrtc_media_audio_AudioProcessing
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: applyConfig
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioProcessingConfig;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_applyConfig
- (JNIEnv*, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: setStreamDelayMs
- * Signature: (I)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_setStreamDelayMs
- (JNIEnv*, jobject, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: getStreamDelayMs
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_getStreamDelayMs
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: processStream
- * Signature: ([BLdev/onvoid/webrtc/media/audio/AudioProcessingStreamConfig;Ldev/onvoid/webrtc/media/audio/AudioProcessingStreamConfig;[B)I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_processStream
- (JNIEnv*, jobject, jbyteArray, jobject, jobject, jbyteArray);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: processReverseStream
- * Signature: ([BLdev/onvoid/webrtc/media/audio/AudioProcessingStreamConfig;Ldev/onvoid/webrtc/media/audio/AudioProcessingStreamConfig;[B)I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_processReverseStream
- (JNIEnv*, jobject, jbyteArray, jobject, jobject, jbyteArray);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_dispose
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_initialize
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioProcessing
- * Method: updateStats
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioProcessing_updateStats
- (JNIEnv*, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_AudioResampler.h b/webrtc-jni/src/main/cpp/include/JNI_AudioResampler.h
deleted file mode 100644
index d667248..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_AudioResampler.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_AudioResampler */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_AudioResampler
-#define _Included_dev_onvoid_webrtc_media_audio_AudioResampler
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioResampler
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioResampler_dispose
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioResampler
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioResampler_initialize
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioResampler
- * Method: resample
- * Signature: ([BI[BII)I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioResampler_resampleInternal
- (JNIEnv*, jobject, jbyteArray, jint, jbyteArray, jint, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_AudioTrack.h b/webrtc-jni/src/main/cpp/include/JNI_AudioTrack.h
deleted file mode 100644
index 8261a1f..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_AudioTrack.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_AudioTrack */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_AudioTrack
-#define _Included_dev_onvoid_webrtc_media_audio_AudioTrack
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioTrack
- * Method: getSignalLevel
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_media_audio_AudioTrack_getSignalLevel
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioTrack
- * Method: addSinkInternal
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioTrackSink;)J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_audio_AudioTrack_addSinkInternal
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_AudioTrack
- * Method: removeSinkInternal
- * Signature: (J)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_AudioTrack_removeSinkInternal
- (JNIEnv *, jobject, jlong);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_CustomAudioSource.h b/webrtc-jni/src/main/cpp/include/JNI_CustomAudioSource.h
deleted file mode 100644
index 2355fe2..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_CustomAudioSource.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_CustomAudioSource */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_CustomAudioSource
-#define _Included_dev_onvoid_webrtc_media_audio_CustomAudioSource
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_CustomAudioSource
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_CustomAudioSource_initialize
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_CustomAudioSource
- * Method: initializeWithClock
- * Signature: (Ldev/onvoid/webrtc/media/SyncClock;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_CustomAudioSource_initializeWithClock
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_CustomAudioSource
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_CustomAudioSource_dispose
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_CustomAudioSource
- * Method: pushAudio
- * Signature: ([BIIII)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_CustomAudioSource_pushAudio
- (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/JNI_CustomVideoSource.h b/webrtc-jni/src/main/cpp/include/JNI_CustomVideoSource.h
deleted file mode 100644
index 0b6de8a..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_CustomVideoSource.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_CustomVideoSource */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_CustomVideoSource
-#define _Included_dev_onvoid_webrtc_media_video_CustomVideoSource
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_CustomVideoSource
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_CustomVideoSource_initialize
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_CustomVideoSource
- * Method: initializeWithClock
- * Signature: (Ldev/onvoid/webrtc/media/SyncClock;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_CustomVideoSource_initializeWithClock
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_CustomVideoSource
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_CustomVideoSource_dispose
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_CustomVideoSource
- * Method: pushFrame
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoFrame;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_CustomVideoSource_pushFrame
- (JNIEnv *, jobject, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/JNI_DesktopCapturer.h b/webrtc-jni/src/main/cpp/include/JNI_DesktopCapturer.h
deleted file mode 100644
index a9e46ae..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_DesktopCapturer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_desktop_DesktopCapturer */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
-#define _Included_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_dispose
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: getDesktopSources
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_getDesktopSources
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: selectSource
- * Signature: (Ldev/onvoid/webrtc/media/video/desktop/DesktopSource;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_selectSource
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: setFocusSelectedSource
- * Signature: (Z)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_setFocusSelectedSource
- (JNIEnv*, jobject, jboolean);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: setMaxFrameRate
- * Signature: (I)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_setMaxFrameRate
- (JNIEnv*, jobject, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: start
- * Signature: (Ldev/onvoid/webrtc/media/video/desktop/DesktopCaptureCallback;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_start
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_DesktopCapturer
- * Method: captureFrame
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_captureFrame
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_HeadlessAudioDeviceModule.h b/webrtc-jni/src/main/cpp/include/JNI_HeadlessAudioDeviceModule.h
deleted file mode 100644
index 075fc21..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_HeadlessAudioDeviceModule.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_HeadlessAudioDeviceModule */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_HeadlessAudioDeviceModule
-#define _Included_dev_onvoid_webrtc_media_audio_HeadlessAudioDeviceModule
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_HeadlessAudioDeviceModule
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_HeadlessAudioDeviceModule_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_Logging.h b/webrtc-jni/src/main/cpp/include/JNI_Logging.h
index 2360e11..4f7fff4 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_Logging.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_Logging.h
@@ -1,50 +1,50 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
-/* Header for class dev_onvoid_webrtc_logging_Logging */
+/* Header for class dev_kastle_webrtc_logging_Logging */
-#ifndef _Included_dev_onvoid_webrtc_logging_Logging
-#define _Included_dev_onvoid_webrtc_logging_Logging
+#ifndef _Included_dev_kastle_webrtc_logging_Logging
+#define _Included_dev_kastle_webrtc_logging_Logging
#ifdef __cplusplus
extern "C" {
#endif
/*
- * Class: dev_onvoid_webrtc_logging_Logging
+ * Class: dev_kastle_webrtc_logging_Logging
* Method: addLogSink
- * Signature: (Ldev/onvoid/webrtc/logging/Logging/Severity;Ldev/onvoid/webrtc/logging/LogSink;)V
+ * Signature: (Ldev/kastle/webrtc/logging/Logging/Severity;Ldev/kastle/webrtc/logging/LogSink;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_addLogSink
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_logging_Logging_addLogSink
(JNIEnv *, jclass, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_logging_Logging
+ * Class: dev_kastle_webrtc_logging_Logging
* Method: log
- * Signature: (Ldev/onvoid/webrtc/logging/Logging/Severity;Ljava/lang/String;)V
+ * Signature: (Ldev/kastle/webrtc/logging/Logging/Severity;Ljava/lang/String;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_log
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_logging_Logging_log
(JNIEnv *, jclass, jobject, jstring);
/*
- * Class: dev_onvoid_webrtc_logging_Logging
+ * Class: dev_kastle_webrtc_logging_Logging
* Method: logToDebug
- * Signature: (Ldev/onvoid/webrtc/logging/Logging/Severity;)V
+ * Signature: (Ldev/kastle/webrtc/logging/Logging/Severity;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logToDebug
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_logging_Logging_logToDebug
(JNIEnv *, jclass, jobject);
/*
- * Class: dev_onvoid_webrtc_logging_Logging
+ * Class: dev_kastle_webrtc_logging_Logging
* Method: logThreads
* Signature: (Z)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logThreads
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_logging_Logging_logThreads
(JNIEnv *, jclass, jboolean);
/*
- * Class: dev_onvoid_webrtc_logging_Logging
+ * Class: dev_kastle_webrtc_logging_Logging
* Method: logTimestamps
* Signature: (Z)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logTimestamps
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_logging_Logging_logTimestamps
(JNIEnv *, jclass, jboolean);
#ifdef __cplusplus
diff --git a/webrtc-jni/src/main/cpp/include/JNI_MediaDevices.h b/webrtc-jni/src/main/cpp/include/JNI_MediaDevices.h
deleted file mode 100644
index fb7d0ed..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_MediaDevices.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_MediaDevices */
-
-#ifndef _Included_dev_onvoid_webrtc_media_MediaDevices
-#define _Included_dev_onvoid_webrtc_media_MediaDevices
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: addDeviceChangeListener
- * Signature: (Ldev/onvoid/webrtc/media/DeviceChangeListener;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_addDeviceChangeListener
- (JNIEnv*, jclass, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: removeDeviceChangeListener
- * Signature: (Ldev/onvoid/webrtc/media/DeviceChangeListener;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_removeDeviceChangeListener
- (JNIEnv*, jclass, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: getDefaultAudioRenderDevice
- * Signature: ()Ldev/onvoid/webrtc/media/audio/AudioDevice;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_getDefaultAudioRenderDevice
- (JNIEnv*, jclass);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: getDefaultAudioCaptureDevice
- * Signature: ()Ldev/onvoid/webrtc/media/audio/AudioDevice;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_getDefaultAudioCaptureDevice
- (JNIEnv*, jclass);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: getAudioRenderDevices
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_getAudioRenderDevices
- (JNIEnv*, jclass);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: getAudioCaptureDevices
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_getAudioCaptureDevices
- (JNIEnv*, jclass);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: getVideoCaptureDevices
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_getVideoCaptureDevices
- (JNIEnv*, jclass);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaDevices
- * Method: getVideoCaptureCapabilities
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoDevice;)Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaDevices_getVideoCaptureCapabilities
- (JNIEnv*, jclass, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_MediaSource.h b/webrtc-jni/src/main/cpp/include/JNI_MediaSource.h
deleted file mode 100644
index 5a015e7..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_MediaSource.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_MediaSource */
-
-#ifndef _Included_dev_onvoid_webrtc_media_MediaSource
-#define _Included_dev_onvoid_webrtc_media_MediaSource
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_MediaSource
- * Method: getState
- * Signature: ()Ldev/onvoid/webrtc/media/MediaSource/State;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaSource_getState
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_MediaStream.h b/webrtc-jni/src/main/cpp/include/JNI_MediaStream.h
deleted file mode 100644
index 8d10318..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_MediaStream.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_MediaStream */
-
-#ifndef _Included_dev_onvoid_webrtc_media_MediaStream
-#define _Included_dev_onvoid_webrtc_media_MediaStream
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_MediaStream
- * Method: id
- * Signature: ()Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_media_MediaStream_id
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStream
- * Method: getAudioTracks
- * Signature: ()[Ldev/onvoid/webrtc/media/audio/AudioTrack;
- */
- JNIEXPORT jobjectArray JNICALL Java_dev_onvoid_webrtc_media_MediaStream_getAudioTracks
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStream
- * Method: getVideoTracks
- * Signature: ()[Ldev/onvoid/webrtc/media/video/VideoTrack;
- */
- JNIEXPORT jobjectArray JNICALL Java_dev_onvoid_webrtc_media_MediaStream_getVideoTracks
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStream
- * Method: addTrack
- * Signature: (Ldev/onvoid/webrtc/media/MediaStreamTrack;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStream_addTrack
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStream
- * Method: removeTrack
- * Signature: (Ldev/onvoid/webrtc/media/MediaStreamTrack;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStream_removeTrack
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStream
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStream_dispose
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_MediaStreamTrack.h b/webrtc-jni/src/main/cpp/include/JNI_MediaStreamTrack.h
deleted file mode 100644
index 01e440f..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_MediaStreamTrack.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_MediaStreamTrack */
-
-#ifndef _Included_dev_onvoid_webrtc_media_MediaStreamTrack
-#define _Included_dev_onvoid_webrtc_media_MediaStreamTrack
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_dispose
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: getKind
- * Signature: ()Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_getKind
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: getId
- * Signature: ()Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_getId
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: isEnabled
- * Signature: ()Z
- */
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_isEnabled
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: setEnabled
- * Signature: (Z)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_setEnabled
- (JNIEnv *, jobject, jboolean);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: getState
- * Signature: ()Ldev/onvoid/webrtc/media/MediaStreamTrackState;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_getState
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: addEndedEventListener
- * Signature: (Ljava/lang/Runnable;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_addEndedEventListener
- (JNIEnv*, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: removeEndedEventListener
- * Signature: (Ljava/lang/Runnable;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_removeEndedEventListener
- (JNIEnv*, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: addMuteEventListener
- * Signature: (Ljava/util/function/Consumer;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_addMuteEventListener
- (JNIEnv*, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_MediaStreamTrack
- * Method: removeMuteEventListener
- * Signature: (Ljava/util/function/Consumer;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_MediaStreamTrack_removeMuteEventListener
- (JNIEnv*, jobject, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_NativeI420Buffer.h b/webrtc-jni/src/main/cpp/include/JNI_NativeI420Buffer.h
deleted file mode 100644
index 3998484..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_NativeI420Buffer.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_NativeI420Buffer */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_NativeI420Buffer
-#define _Included_dev_onvoid_webrtc_media_video_NativeI420Buffer
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_NativeI420Buffer
- * Method: allocate
- * Signature: (II)Ldev/onvoid/webrtc/media/video/NativeI420Buffer;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_video_NativeI420Buffer_allocate
- (JNIEnv *, jclass, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_NativeI420Buffer
- * Method: copy
- * Signature: (IILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;I)Ldev/onvoid/webrtc/media/video/NativeI420Buffer;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_video_NativeI420Buffer_copy
- (JNIEnv*, jclass, jint, jint, jobject, jint, jobject, jint, jobject, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_NativeI420Buffer
- * Method: cropAndScale
- * Signature: (Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;IIIIILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;III)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_NativeI420Buffer_cropAndScale
- (JNIEnv *, jclass, jobject, jint, jobject, jint, jobject, jint, jint, jint, jint, jint, jobject, jint, jobject, jint, jobject, jint, jint, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_PeerConnectionFactory.h b/webrtc-jni/src/main/cpp/include/JNI_PeerConnectionFactory.h
index 91d0ad6..5cf2160 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_PeerConnectionFactory.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_PeerConnectionFactory.h
@@ -1,75 +1,36 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
-/* Header for class dev_onvoid_webrtc_PeerConnectionFactory */
+/* Header for class dev_kastle_webrtc_PeerConnectionFactory */
-#ifndef _Included_dev_onvoid_webrtc_PeerConnectionFactory
-#define _Included_dev_onvoid_webrtc_PeerConnectionFactory
+#ifndef _Included_dev_kastle_webrtc_PeerConnectionFactory
+#define _Included_dev_kastle_webrtc_PeerConnectionFactory
#ifdef __cplusplus
extern "C" {
#endif
- /*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
- * Method: createAudioSource
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioOptions;)Ldev/onvoid/webrtc/media/audio/AudioTrackSource;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_createAudioSource
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
- * Method: createAudioTrack
- * Signature: (Ljava/lang/String;Ldev/onvoid/webrtc/media/audio/AudioTrackSource;)Ldev/onvoid/webrtc/media/audio/AudioTrack;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_createAudioTrack
- (JNIEnv *, jobject, jstring, jobject);
/*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
- * Method: createVideoTrack
- * Signature: (Ljava/lang/String;Ldev/onvoid/webrtc/media/video/VideoTrackSource;)Ldev/onvoid/webrtc/media/video/VideoTrack;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_createVideoTrack
- (JNIEnv *, jobject, jstring, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
+ * Class: dev_kastle_webrtc_PeerConnectionFactory
* Method: createPeerConnection
- * Signature: (Ldev/onvoid/webrtc/RTCConfiguration;Ldev/onvoid/webrtc/PeerConnectionObserver;)Ldev/onvoid/webrtc/RTCPeerConnection;
+ * Signature: (Ldev/kastle/webrtc/RTCConfiguration;Ldev/kastle/webrtc/PeerConnectionObserver;)Ldev/kastle/webrtc/RTCPeerConnection;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_createPeerConnection
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_PeerConnectionFactory_createPeerConnection
(JNIEnv *, jobject, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
- * Method: getRtpReceiverCapabilities
- * Signature: (Ldev/onvoid/webrtc/media/MediaType;)Ldev/onvoid/webrtc/RTCRtpCapabilities;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_getRtpReceiverCapabilities
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
- * Method: getRtpSenderCapabilities
- * Signature: (Ldev/onvoid/webrtc/media/MediaType;)Ldev/onvoid/webrtc/RTCRtpCapabilities;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_getRtpSenderCapabilities
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
+ * Class: dev_kastle_webrtc_PeerConnectionFactory
* Method: dispose
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_dispose
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_PeerConnectionFactory_dispose
(JNIEnv *, jobject);
- /*
- * Class: dev_onvoid_webrtc_PeerConnectionFactory
- * Method: initialize
- * Signature: (Ldev/onvoid/webrtc/media/audio/AudioDeviceModule;Ldev/onvoid/webrtc/media/audio/AudioProcessing;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_PeerConnectionFactory_initialize
- (JNIEnv *, jobject, jobject, jobject);
+ /*
+ * Class: dev_kastle_webrtc_PeerConnectionFactory
+ * Method: initialize
+ * Signature: ()V
+ */
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_PeerConnectionFactory_initialize
+ (JNIEnv *, jobject);
#ifdef __cplusplus
}
diff --git a/webrtc-jni/src/main/cpp/include/JNI_PowerManagement.h b/webrtc-jni/src/main/cpp/include/JNI_PowerManagement.h
deleted file mode 100644
index f55be85..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_PowerManagement.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_desktop_ScreenSaver */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_desktop_ScreenSaver
-#define _Included_dev_onvoid_webrtc_media_video_desktop_ScreenSaver
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_PowerManagement
- * Method: enableUserActivity
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_PowerManagement_enableUserActivity
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_PowerManagement
- * Method: disableUserActivity
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_PowerManagement_disableUserActivity
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCDataChannel.h b/webrtc-jni/src/main/cpp/include/JNI_RTCDataChannel.h
index 12305ec..065f3c3 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCDataChannel.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_RTCDataChannel.h
@@ -1,138 +1,138 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
-/* Header for class dev_onvoid_webrtc_RTCDataChannel */
+/* Header for class dev_kastle_webrtc_RTCDataChannel */
-#ifndef _Included_dev_onvoid_webrtc_RTCDataChannel
-#define _Included_dev_onvoid_webrtc_RTCDataChannel
+#ifndef _Included_dev_kastle_webrtc_RTCDataChannel
+#define _Included_dev_kastle_webrtc_RTCDataChannel
#ifdef __cplusplus
extern "C" {
#endif
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: registerObserver
- * Signature: (Ldev/onvoid/webrtc/RTCDataChannelObserver;)V
+ * Signature: (Ldev/kastle/webrtc/RTCDataChannelObserver;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_registerObserver
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDataChannel_registerObserver
(JNIEnv *, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: unregisterObserver
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_unregisterObserver
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDataChannel_unregisterObserver
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getLabel
* Signature: ()Ljava/lang/String;
*/
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getLabel
+ JNIEXPORT jstring JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getLabel
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: isReliable
* Signature: ()Z
*/
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_isReliable
+ JNIEXPORT jboolean JNICALL Java_dev_kastle_webrtc_RTCDataChannel_isReliable
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: isOrdered
* Signature: ()Z
*/
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_isOrdered
+ JNIEXPORT jboolean JNICALL Java_dev_kastle_webrtc_RTCDataChannel_isOrdered
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getMaxPacketLifeTime
* Signature: ()I
*/
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getMaxPacketLifeTime
+ JNIEXPORT jint JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getMaxPacketLifeTime
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getMaxRetransmits
* Signature: ()I
*/
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getMaxRetransmits
+ JNIEXPORT jint JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getMaxRetransmits
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getProtocol
* Signature: ()Ljava/lang/String;
*/
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getProtocol
+ JNIEXPORT jstring JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getProtocol
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: isNegotiated
* Signature: ()Z
*/
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_isNegotiated
+ JNIEXPORT jboolean JNICALL Java_dev_kastle_webrtc_RTCDataChannel_isNegotiated
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getId
* Signature: ()I
*/
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getId
+ JNIEXPORT jint JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getId
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getState
- * Signature: ()Ldev/onvoid/webrtc/RTCDataChannelState;
+ * Signature: ()Ldev/kastle/webrtc/RTCDataChannelState;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getState
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getState
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: getBufferedAmount
* Signature: ()J
*/
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_getBufferedAmount
+ JNIEXPORT jlong JNICALL Java_dev_kastle_webrtc_RTCDataChannel_getBufferedAmount
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: close
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_close
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDataChannel_close
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: dispose
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_dispose
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDataChannel_dispose
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: sendDirectBuffer
* Signature: (Ljava/nio/ByteBuffer;Z)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_sendDirectBuffer
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDataChannel_sendDirectBuffer
(JNIEnv *, jobject, jobject, jboolean);
/*
- * Class: dev_onvoid_webrtc_RTCDataChannel
+ * Class: dev_kastle_webrtc_RTCDataChannel
* Method: sendByteArrayBuffer
* Signature: ([BZ)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDataChannel_sendByteArrayBuffer
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDataChannel_sendByteArrayBuffer
(JNIEnv *, jobject, jbyteArray, jboolean);
#ifdef __cplusplus
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCDtlsTransport.h b/webrtc-jni/src/main/cpp/include/JNI_RTCDtlsTransport.h
index 86cbf7c..92a25db 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCDtlsTransport.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_RTCDtlsTransport.h
@@ -1,50 +1,50 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
-/* Header for class dev_onvoid_webrtc_RTCDtlsTransport */
+/* Header for class dev_kastle_webrtc_RTCDtlsTransport */
-#ifndef _Included_dev_onvoid_webrtc_RTCDtlsTransport
-#define _Included_dev_onvoid_webrtc_RTCDtlsTransport
+#ifndef _Included_dev_kastle_webrtc_RTCDtlsTransport
+#define _Included_dev_kastle_webrtc_RTCDtlsTransport
#ifdef __cplusplus
extern "C" {
#endif
/*
- * Class: dev_onvoid_webrtc_RTCDtlsTransport
+ * Class: dev_kastle_webrtc_RTCDtlsTransport
* Method: getIceTransport
- * Signature: ()Ldev/onvoid/webrtc/RTCIceTransport;
+ * Signature: ()Ldev/kastle/webrtc/RTCIceTransport;
*/
-JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCDtlsTransport_getIceTransport
+JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCDtlsTransport_getIceTransport
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDtlsTransport
+ * Class: dev_kastle_webrtc_RTCDtlsTransport
* Method: getState
- * Signature: ()Ldev/onvoid/webrtc/RTCDtlsTransportState;
+ * Signature: ()Ldev/kastle/webrtc/RTCDtlsTransportState;
*/
-JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCDtlsTransport_getState
+JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCDtlsTransport_getState
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDtlsTransport
+ * Class: dev_kastle_webrtc_RTCDtlsTransport
* Method: getRemoteCertificates
* Signature: ()Ljava/util/List;
*/
-JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCDtlsTransport_getRemoteCertificates
+JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCDtlsTransport_getRemoteCertificates
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDtlsTransport
+ * Class: dev_kastle_webrtc_RTCDtlsTransport
* Method: registerObserver
- * Signature: (Ldev/onvoid/webrtc/RTCDtlsTransportObserver;)V
+ * Signature: (Ldev/kastle/webrtc/RTCDtlsTransportObserver;)V
*/
-JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDtlsTransport_registerObserver
+JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDtlsTransport_registerObserver
(JNIEnv *, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCDtlsTransport
+ * Class: dev_kastle_webrtc_RTCDtlsTransport
* Method: unregisterObserver
* Signature: ()V
*/
-JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDtlsTransport_unregisterObserver
+JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCDtlsTransport_unregisterObserver
(JNIEnv *, jobject);
#ifdef __cplusplus
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCDtmfSender.h b/webrtc-jni/src/main/cpp/include/JNI_RTCDtmfSender.h
deleted file mode 100644
index 6a25bb5..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCDtmfSender.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_RTCDtmfSender */
-
-#ifndef _Included_dev_onvoid_webrtc_RTCDtmfSender
-#define _Included_dev_onvoid_webrtc_RTCDtmfSender
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: canInsertDtmf
- * Signature: ()Z
- */
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_canInsertDtmf
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: insertDtmf
- * Signature: (Ljava/lang/String;II)Z
- */
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_insertDtmf
- (JNIEnv *, jobject, jstring, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: tones
- * Signature: ()Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_tones
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: duration
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_duration
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: interToneGap
- * Signature: ()I
- */
- JNIEXPORT jint JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_interToneGap
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: registerObserver
- * Signature: (Ldev/onvoid/webrtc/RTCDtmfSenderObserver;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_registerObserver
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCDtmfSender
- * Method: unregisterObserver
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCDtmfSender_unregisterObserver
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCPeerConnection.h b/webrtc-jni/src/main/cpp/include/JNI_RTCPeerConnection.h
index 5ad409d..4c51084 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCPeerConnection.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_RTCPeerConnection.h
@@ -1,250 +1,187 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
-/* Header for class dev_onvoid_webrtc_RTCPeerConnection */
+/* Header for class dev_kastle_webrtc_RTCPeerConnection */
-#ifndef _Included_dev_onvoid_webrtc_RTCPeerConnection
-#define _Included_dev_onvoid_webrtc_RTCPeerConnection
+#ifndef _Included_dev_kastle_webrtc_RTCPeerConnection
+#define _Included_dev_kastle_webrtc_RTCPeerConnection
#ifdef __cplusplus
extern "C" {
#endif
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: getSenders
- * Signature: ()[Ldev/onvoid/webrtc/RTCRtpSender;
- */
- JNIEXPORT jobjectArray JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getSenders
- (JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: getReceivers
- * Signature: ()[Ldev/onvoid/webrtc/RTCRtpReceiver;
- */
- JNIEXPORT jobjectArray JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getReceivers
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: getTransceivers
- * Signature: ()[Ldev/onvoid/webrtc/RTCRtpTransceiver;
- */
- JNIEXPORT jobjectArray JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getTransceivers
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: addTrack
- * Signature: (Ldev/onvoid/webrtc/media/MediaStreamTrack;Ljava/util/List;)Ldev/onvoid/webrtc/RTCRtpSender;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_addTrack
- (JNIEnv *, jobject, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: removeTrack
- * Signature: (Ldev/onvoid/webrtc/RTCRtpSender;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_removeTrack
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: addTransceiver
- * Signature: (Ldev/onvoid/webrtc/media/MediaStreamTrack;Ldev/onvoid/webrtc/RTCRtpTransceiverInit;)Ldev/onvoid/webrtc/RTCRtpTransceiver;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_addTransceiver
- (JNIEnv *, jobject, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: createDataChannel
- * Signature: (Ljava/lang/String;Ldev/onvoid/webrtc/RTCDataChannelInit;)Ldev/onvoid/webrtc/RTCDataChannel;
+ * Signature: (Ljava/lang/String;Ldev/kastle/webrtc/RTCDataChannelInit;)Ldev/kastle/webrtc/RTCDataChannel;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_createDataChannel
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_createDataChannel
(JNIEnv *, jobject, jstring, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: createOffer
- * Signature: (Ldev/onvoid/webrtc/RTCOfferOptions;Ldev/onvoid/webrtc/CreateSessionDescriptionObserver;)V
+ * Signature: (Ldev/kastle/webrtc/RTCOfferOptions;Ldev/kastle/webrtc/CreateSessionDescriptionObserver;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_createOffer
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_createOffer
(JNIEnv *, jobject, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: createAnswer
- * Signature: (Ldev/onvoid/webrtc/RTCAnswerOptions;Ldev/onvoid/webrtc/CreateSessionDescriptionObserver;)V
+ * Signature: (Ldev/kastle/webrtc/RTCAnswerOptions;Ldev/kastle/webrtc/CreateSessionDescriptionObserver;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_createAnswer
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_createAnswer
(JNIEnv *, jobject, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getCurrentLocalDescription
- * Signature: ()Ldev/onvoid/webrtc/RTCSessionDescription;
+ * Signature: ()Ldev/kastle/webrtc/RTCSessionDescription;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getCurrentLocalDescription
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getCurrentLocalDescription
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getLocalDescription
- * Signature: ()Ldev/onvoid/webrtc/RTCSessionDescription;
+ * Signature: ()Ldev/kastle/webrtc/RTCSessionDescription;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getLocalDescription
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getLocalDescription
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getPendingLocalDescription
- * Signature: ()Ldev/onvoid/webrtc/RTCSessionDescription;
+ * Signature: ()Ldev/kastle/webrtc/RTCSessionDescription;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getPendingLocalDescription
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getPendingLocalDescription
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getCurrentRemoteDescription
- * Signature: ()Ldev/onvoid/webrtc/RTCSessionDescription;
+ * Signature: ()Ldev/kastle/webrtc/RTCSessionDescription;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getCurrentRemoteDescription
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getCurrentRemoteDescription
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getRemoteDescription
- * Signature: ()Ldev/onvoid/webrtc/RTCSessionDescription;
+ * Signature: ()Ldev/kastle/webrtc/RTCSessionDescription;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getRemoteDescription
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getRemoteDescription
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getPendingRemoteDescription
- * Signature: ()Ldev/onvoid/webrtc/RTCSessionDescription;
+ * Signature: ()Ldev/kastle/webrtc/RTCSessionDescription;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getPendingRemoteDescription
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getPendingRemoteDescription
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: setLocalDescription
- * Signature: (Ldev/onvoid/webrtc/RTCSessionDescription;Ldev/onvoid/webrtc/SetSessionDescriptionObserver;)V
+ * Signature: (Ldev/kastle/webrtc/RTCSessionDescription;Ldev/kastle/webrtc/SetSessionDescriptionObserver;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_setLocalDescription
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_setLocalDescription
(JNIEnv *, jobject, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: setRemoteDescription
- * Signature: (Ldev/onvoid/webrtc/RTCSessionDescription;Ldev/onvoid/webrtc/SetSessionDescriptionObserver;)V
+ * Signature: (Ldev/kastle/webrtc/RTCSessionDescription;Ldev/kastle/webrtc/SetSessionDescriptionObserver;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_setRemoteDescription
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_setRemoteDescription
(JNIEnv *, jobject, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: addIceCandidate
- * Signature: (Ldev/onvoid/webrtc/RTCIceCandidate;)V
+ * Signature: (Ldev/kastle/webrtc/RTCIceCandidate;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_addIceCandidate
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_addIceCandidate
(JNIEnv *, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: removeIceCandidates
- * Signature: ([Ldev/onvoid/webrtc/RTCIceCandidate;)V
+ * Signature: ([Ldev/kastle/webrtc/RTCIceCandidate;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_removeIceCandidates
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_removeIceCandidates
(JNIEnv *, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getSignalingState
- * Signature: ()Ldev/onvoid/webrtc/RTCSignalingState;
+ * Signature: ()Ldev/kastle/webrtc/RTCSignalingState;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getSignalingState
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getSignalingState
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getIceGatheringState
- * Signature: ()Ldev/onvoid/webrtc/RTCIceGatheringState;
+ * Signature: ()Ldev/kastle/webrtc/RTCIceGatheringState;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getIceGatheringState
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getIceGatheringState
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getIceConnectionState
- * Signature: ()Ldev/onvoid/webrtc/RTCIceConnectionState;
+ * Signature: ()Ldev/kastle/webrtc/RTCIceConnectionState;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getIceConnectionState
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getIceConnectionState
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getConnectionState
- * Signature: ()Ldev/onvoid/webrtc/RTCPeerConnectionState;
+ * Signature: ()Ldev/kastle/webrtc/RTCPeerConnectionState;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getConnectionState
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getConnectionState
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getConfiguration
- * Signature: ()Ldev/onvoid/webrtc/RTCConfiguration;
+ * Signature: ()Ldev/kastle/webrtc/RTCConfiguration;
*/
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getConfiguration
+ JNIEXPORT jobject JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getConfiguration
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: setConfiguration
- * Signature: (Ldev/onvoid/webrtc/RTCConfiguration;)V
+ * Signature: (Ldev/kastle/webrtc/RTCConfiguration;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_setConfiguration
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_setConfiguration
(JNIEnv *, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: getStats
- * Signature: (Ldev/onvoid/webrtc/RTCStatsCollectorCallback;)V
+ * Signature: (Ldev/kastle/webrtc/RTCStatsCollectorCallback;)V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getStats__Ldev_onvoid_webrtc_RTCStatsCollectorCallback_2
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_getStats__Ldev_kastle_webrtc_RTCStatsCollectorCallback_2
(JNIEnv *, jobject, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: getStats
- * Signature: (Ldev/onvoid/webrtc/RTCRtpReceiver;Ldev/onvoid/webrtc/RTCStatsCollectorCallback;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getStats__Ldev_onvoid_webrtc_RTCRtpReceiver_2Ldev_onvoid_webrtc_RTCStatsCollectorCallback_2
- (JNIEnv *, jobject, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
- * Method: getStats
- * Signature: (Ldev/onvoid/webrtc/RTCRtpSender;Ldev/onvoid/webrtc/RTCStatsCollectorCallback;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_getStats__Ldev_onvoid_webrtc_RTCRtpSender_2Ldev_onvoid_webrtc_RTCStatsCollectorCallback_2
- (JNIEnv *, jobject, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: restartIce
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_restartIce
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_restartIce
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_RTCPeerConnection
+ * Class: dev_kastle_webrtc_RTCPeerConnection
* Method: close
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCPeerConnection_close
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_RTCPeerConnection_close
(JNIEnv *, jobject);
#ifdef __cplusplus
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCRtpReceiver.h b/webrtc-jni/src/main/cpp/include/JNI_RTCRtpReceiver.h
deleted file mode 100644
index 3ff3658..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCRtpReceiver.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_RTCRtpReceiver */
-
-#ifndef _Included_dev_onvoid_webrtc_RTCRtpReceiver
-#define _Included_dev_onvoid_webrtc_RTCRtpReceiver
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_RTCRtpReceiver
- * Method: getTrack
- * Signature: ()Ldev/onvoid/webrtc/media/MediaStreamTrack;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpReceiver_getTrack
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpReceiver
- * Method: getTransport
- * Signature: ()Ldev/onvoid/webrtc/RTCDtlsTransport;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpReceiver_getTransport
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpReceiver
- * Method: getParameters
- * Signature: ()Ldev/onvoid/webrtc/RTCRtpParameters;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpReceiver_getParameters
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpReceiver
- * Method: getContributingSources
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpReceiver_getContributingSources
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpReceiver
- * Method: getSynchronizationSources
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpReceiver_getSynchronizationSources
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCRtpSender.h b/webrtc-jni/src/main/cpp/include/JNI_RTCRtpSender.h
deleted file mode 100644
index 83f23ff..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCRtpSender.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_RTCRtpSender */
-
-#ifndef _Included_dev_onvoid_webrtc_RTCRtpSender
-#define _Included_dev_onvoid_webrtc_RTCRtpSender
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: getTrack
- * Signature: ()Ldev/onvoid/webrtc/media/MediaStreamTrack;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_getTrack
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: getTransport
- * Signature: ()Ldev/onvoid/webrtc/RTCDtlsTransport;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_getTransport
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: replaceTrack
- * Signature: (Ldev/onvoid/webrtc/media/MediaStreamTrack;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_replaceTrack
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: setParameters
- * Signature: (Ldev/onvoid/webrtc/RTCRtpSendParameters;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_setParameters
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: getParameters
- * Signature: ()Ldev/onvoid/webrtc/RTCRtpSendParameters;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_getParameters
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: setStreams
- * Signature: (Ljava/util/List;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_setStreams
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpSender
- * Method: getDtmfSender
- * Signature: ()Ldev/onvoid/webrtc/RTCDtmfSender;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpSender_getDtmfSender
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RTCRtpTransceiver.h b/webrtc-jni/src/main/cpp/include/JNI_RTCRtpTransceiver.h
deleted file mode 100644
index d0b7419..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_RTCRtpTransceiver.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_RTCRtpTransceiver */
-
-#ifndef _Included_dev_onvoid_webrtc_RTCRtpTransceiver
-#define _Included_dev_onvoid_webrtc_RTCRtpTransceiver
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: getMid
- * Signature: ()Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_getMid
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: getSender
- * Signature: ()Ldev/onvoid/webrtc/RTCRtpSender;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_getSender
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: getReceiver
- * Signature: ()Ldev/onvoid/webrtc/RTCRtpReceiver;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_getReceiver
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: getDirection
- * Signature: ()Ldev/onvoid/webrtc/RTCRtpTransceiverDirection;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_getDirection
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: setDirection
- * Signature: (Ldev/onvoid/webrtc/RTCRtpTransceiverDirection;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_setDirection
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: getCurrentDirection
- * Signature: ()Ldev/onvoid/webrtc/RTCRtpTransceiverDirection;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_getCurrentDirection
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: stop
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_stop
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: stopped
- * Signature: ()Z
- */
- JNIEXPORT jboolean JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_stopped
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: getCodecPreferences
- * Signature: ()Ljava/util/List;
- */
- JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_getCodecPreferences
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_RTCRtpTransceiver
- * Method: setCodecPreferences
- * Signature: (Ljava/util/List;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_RTCRtpTransceiver_setCodecPreferences
- (JNIEnv *, jobject, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_RefCountedObject.h b/webrtc-jni/src/main/cpp/include/JNI_RefCountedObject.h
index 1c2ec1c..8577601 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_RefCountedObject.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_RefCountedObject.h
@@ -1,26 +1,26 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
-/* Header for class dev_onvoid_webrtc_internal_RefCountedObject */
+/* Header for class dev_kastle_webrtc_internal_RefCountedObject */
-#ifndef _Included_dev_onvoid_webrtc_internal_RefCountedObject
-#define _Included_dev_onvoid_webrtc_internal_RefCountedObject
+#ifndef _Included_dev_kastle_webrtc_internal_RefCountedObject
+#define _Included_dev_kastle_webrtc_internal_RefCountedObject
#ifdef __cplusplus
extern "C" {
#endif
/*
- * Class: dev_onvoid_webrtc_internal_RefCountedObject
+ * Class: dev_kastle_webrtc_internal_RefCountedObject
* Method: retain
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_internal_RefCountedObject_retain
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_internal_RefCountedObject_retain
(JNIEnv *, jobject);
/*
- * Class: dev_onvoid_webrtc_internal_RefCountedObject
+ * Class: dev_kastle_webrtc_internal_RefCountedObject
* Method: release
* Signature: ()V
*/
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_internal_RefCountedObject_release
+ JNIEXPORT void JNICALL Java_dev_kastle_webrtc_internal_RefCountedObject_release
(JNIEnv *, jobject);
#ifdef __cplusplus
diff --git a/webrtc-jni/src/main/cpp/include/JNI_ScreenCapturer.h b/webrtc-jni/src/main/cpp/include/JNI_ScreenCapturer.h
deleted file mode 100644
index ccb0af3..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_ScreenCapturer.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_desktop_ScreenCapturer */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_desktop_ScreenCapturer
-#define _Included_dev_onvoid_webrtc_media_video_desktop_ScreenCapturer
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_ScreenCapturer
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_ScreenCapturer_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_SyncClock.h b/webrtc-jni/src/main/cpp/include/JNI_SyncClock.h
deleted file mode 100644
index 04a62b4..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_SyncClock.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_SyncClock */
-
-#ifndef _Included_dev_onvoid_webrtc_media_SyncClock
-#define _Included_dev_onvoid_webrtc_media_SyncClock
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_SyncClock
- * Method: getTimestampUs
- * Signature: ()J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_SyncClock_getTimestampUs
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_SyncClock
- * Method: getTimestampMs
- * Signature: ()J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_SyncClock_getTimestampMs
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_SyncClock
- * Method: getNtpTime
- * Signature: ()J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_SyncClock_getNtpTime
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_SyncClock
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_SyncClock_dispose
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_SyncClock
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_SyncClock_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/JNI_VideoBufferConverter.h b/webrtc-jni/src/main/cpp/include/JNI_VideoBufferConverter.h
deleted file mode 100644
index 8373597..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_VideoBufferConverter.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_VideoBufferConverter */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_VideoBufferConverter
-#define _Included_dev_onvoid_webrtc_media_video_VideoBufferConverter
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoBufferConverter
- * Method: I420toByteArray
- * Signature: (Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;I[BIII)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoBufferConverter_I420toByteArray
- (JNIEnv *, jclass, jobject, jint, jobject, jint, jobject, jint, jbyteArray, jint, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoBufferConverter
- * Method: I420toDirectBuffer
- * Signature: (Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;III)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoBufferConverter_I420toDirectBuffer
- (JNIEnv *, jclass, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoBufferConverter
- * Method: byteArrayToI420
- * Signature: ([BIILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;II)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoBufferConverter_byteArrayToI420
- (JNIEnv *, jclass, jbyteArray, jint, jint, jobject, jint, jobject, jint, jobject, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoBufferConverter
- * Method: directBufferToI420
- * Signature: (Ljava/nio/ByteBuffer;IILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;ILjava/nio/ByteBuffer;II)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoBufferConverter_directBufferToI420
- (JNIEnv *, jclass, jobject, jint, jint, jobject, jint, jobject, jint, jobject, jint, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_VideoCapture.h b/webrtc-jni/src/main/cpp/include/JNI_VideoCapture.h
deleted file mode 100644
index 8371bc7..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_VideoCapture.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_VideoCapture */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_VideoCapture
-#define _Included_dev_onvoid_webrtc_media_video_VideoCapture
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: setVideoCaptureDevice
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoDevice;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_setVideoCaptureDevice
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: setVideoCaptureCapability
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoCaptureCapability;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_setVideoCaptureCapability
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: setVideoSink
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoTrackSink;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_setVideoSink
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: start
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_start
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: stop
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_stop
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_dispose
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoCapture
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoCapture_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_VideoDesktopSource.h b/webrtc-jni/src/main/cpp/include/JNI_VideoDesktopSource.h
deleted file mode 100644
index b255b3e..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_VideoDesktopSource.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_VideoDesktopSource */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_VideoDesktopSource
-#define _Included_dev_onvoid_webrtc_media_video_VideoDesktopSource
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: setSourceId
- * Signature: (JZ)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_setSourceId
- (JNIEnv*, jobject, jlong, jboolean);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: setFrameRate
- * Signature: (I)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_setFrameRate
- (JNIEnv*, jobject, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: setMaxFrameSize
- * Signature: (II)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_setMaxFrameSize
- (JNIEnv*, jobject, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: setFocusSelectedSource
- * Signature: (Z)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_setFocusSelectedSource
- (JNIEnv*, jobject, jboolean);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: start
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_start
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: stop
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_stop
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_dispose
- (JNIEnv*, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDesktopSource
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDesktopSource_initialize
- (JNIEnv*, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_VideoDeviceSource.h b/webrtc-jni/src/main/cpp/include/JNI_VideoDeviceSource.h
deleted file mode 100644
index 3c1b300..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_VideoDeviceSource.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_VideoDeviceSource */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_VideoDeviceSource
-#define _Included_dev_onvoid_webrtc_media_video_VideoDeviceSource
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDeviceSource
- * Method: setVideoCaptureDevice
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoDevice;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDeviceSource_setVideoCaptureDevice
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDeviceSource
- * Method: setVideoCaptureCapability
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoCaptureCapability;)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDeviceSource_setVideoCaptureCapability
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDeviceSource
- * Method: start
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDeviceSource_start
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDeviceSource
- * Method: stop
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDeviceSource_stop
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDeviceSource
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDeviceSource_dispose
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoDeviceSource
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoDeviceSource_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_VideoTrack.h b/webrtc-jni/src/main/cpp/include/JNI_VideoTrack.h
deleted file mode 100644
index 5333b3d..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_VideoTrack.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_VideoTrack */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_VideoTrack
-#define _Included_dev_onvoid_webrtc_media_video_VideoTrack
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoTrack
- * Method: addSinkInternal
- * Signature: (Ldev/onvoid/webrtc/media/video/VideoTrackSink;)J
- */
- JNIEXPORT jlong JNICALL Java_dev_onvoid_webrtc_media_video_VideoTrack_addSinkInternal
- (JNIEnv *, jobject, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_video_VideoTrack
- * Method: removeSinkInternal
- * Signature: (J)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_VideoTrack_removeSinkInternal
- (JNIEnv *, jobject, jlong);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/JNI_VoiceActivityDetector.h b/webrtc-jni/src/main/cpp/include/JNI_VoiceActivityDetector.h
deleted file mode 100644
index ccda4dd..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_VoiceActivityDetector.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_audio_VoiceActivityDetector */
-
-#ifndef _Included_dev_onvoid_webrtc_media_audio_VoiceActivityDetector
-#define _Included_dev_onvoid_webrtc_media_audio_VoiceActivityDetector
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_audio_VoiceActivityDetector
- * Method: process
- * Signature: ([BII)V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_VoiceActivityDetector_process
- (JNIEnv *, jobject, jbyteArray, jint, jint);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_VoiceActivityDetector
- * Method: getLastVoiceProbability
- * Signature: ()F
- */
- JNIEXPORT jfloat JNICALL Java_dev_onvoid_webrtc_media_audio_VoiceActivityDetector_getLastVoiceProbability
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_VoiceActivityDetector
- * Method: dispose
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_VoiceActivityDetector_dispose
- (JNIEnv *, jobject);
-
- /*
- * Class: dev_onvoid_webrtc_media_audio_VoiceActivityDetector
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_audio_VoiceActivityDetector_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/JNI_WebRTC.h b/webrtc-jni/src/main/cpp/include/JNI_WebRTC.h
index 0eb3888..e9c41a8 100644
--- a/webrtc-jni/src/main/cpp/include/JNI_WebRTC.h
+++ b/webrtc-jni/src/main/cpp/include/JNI_WebRTC.h
@@ -17,13 +17,9 @@
#ifndef JNI_WEBRTC_H_
#define JNI_WEBRTC_H_
-#define PKG "dev/onvoid/webrtc/"
-#define PKG_INTERNAL "dev/onvoid/webrtc/internal/"
-#define PKG_LOG "dev/onvoid/webrtc/logging/"
-#define PKG_MEDIA "dev/onvoid/webrtc/media/"
-#define PKG_AUDIO "dev/onvoid/webrtc/media/audio/"
-#define PKG_VIDEO "dev/onvoid/webrtc/media/video/"
-#define PKG_DESKTOP "dev/onvoid/webrtc/media/video/desktop/"
+#define PKG "dev/kastle/webrtc/"
+#define PKG_INTERNAL "dev/kastle/webrtc/internal/"
+#define PKG_LOG "dev/kastle/webrtc/logging/"
#define BOOLEAN_SIG "Ljava/lang/Boolean;"
#define DOUBLE_SIG "Ljava/lang/Double;"
diff --git a/webrtc-jni/src/main/cpp/include/JNI_WindowCapturer.h b/webrtc-jni/src/main/cpp/include/JNI_WindowCapturer.h
deleted file mode 100644
index ed7bdda..0000000
--- a/webrtc-jni/src/main/cpp/include/JNI_WindowCapturer.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-/* Header for class dev_onvoid_webrtc_media_video_desktop_WindowCapturer */
-
-#ifndef _Included_dev_onvoid_webrtc_media_video_desktop_WindowCapturer
-#define _Included_dev_onvoid_webrtc_media_video_desktop_WindowCapturer
-#ifdef __cplusplus
-extern "C" {
-#endif
- /*
- * Class: dev_onvoid_webrtc_media_video_desktop_WindowCapturer
- * Method: initialize
- * Signature: ()V
- */
- JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_WindowCapturer_initialize
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/webrtc-jni/src/main/cpp/include/WebRTCContext.h b/webrtc-jni/src/main/cpp/include/WebRTCContext.h
index 9b7d405..83f81da 100644
--- a/webrtc-jni/src/main/cpp/include/WebRTCContext.h
+++ b/webrtc-jni/src/main/cpp/include/WebRTCContext.h
@@ -19,45 +19,23 @@
#include "JavaContext.h"
#include "api/environment/environment.h"
-#include "media/audio/AudioDeviceManager.h"
-#include "media/video/VideoDeviceManager.h"
-#include "media/video/desktop/PowerManagement.h"
#include
-#include
-#include
namespace jni
{
- class WebRTCContext : public JavaContext
- {
- public:
- WebRTCContext(JavaVM * vm);
- ~WebRTCContext() = default;
-
- void initialize(JNIEnv * env) override;
- void initializeClassLoader(JNIEnv* env, const char * loaderName) override;
- void destroy(JNIEnv * env) override;
-
- avdev::AudioDeviceManager * getAudioDeviceManager();
- avdev::VideoDeviceManager * getVideoDeviceManager();
- avdev::PowerManagement * getPowerManagement();
-
- const webrtc::Environment webrtcEnv;
-
- private:
- void initializeAudioManager();
- void initializeVideoManager();
- void initializePowerManagement();
-
- private:
- std::mutex aMutex;
- std::mutex vMutex;
- std::unique_ptr audioDevManager;
- std::unique_ptr videoDevManager;
- std::unique_ptr powerManagement;
- };
+ class WebRTCContext : public JavaContext
+ {
+ public:
+ WebRTCContext(JavaVM * vm);
+ ~WebRTCContext() = default;
+
+ void initialize(JNIEnv * env) override;
+ void initializeClassLoader(JNIEnv* env, const char * loaderName) override;
+ void destroy(JNIEnv * env) override;
+
+ const webrtc::Environment webrtcEnv;
+ };
}
#endif
-
diff --git a/webrtc-jni/src/main/cpp/include/api/AudioOptions.h b/webrtc-jni/src/main/cpp/include/api/AudioOptions.h
deleted file mode 100644
index 1c5e645..0000000
--- a/webrtc-jni/src/main/cpp/include/api/AudioOptions.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_AUDIO_OPTIONS_H_
-#define JNI_WEBRTC_API_AUDIO_OPTIONS_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/audio_options.h"
-
-#include
-
-namespace jni
-{
- namespace AudioOptions
- {
- class JavaAudioOptionsClass : public JavaClass
- {
- public:
- explicit JavaAudioOptionsClass(JNIEnv * env);
-
- jclass cls;
- jfieldID echoCancellation;
- jfieldID autoGainControl;
- jfieldID noiseSuppression;
- jfieldID highpassFilter;
- jfieldID typingDetection;
- jfieldID residualEchoDetector;
- };
-
- webrtc::AudioOptions toNative(JNIEnv * env, const JavaRef & javaType);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/AudioTrackSink.h b/webrtc-jni/src/main/cpp/include/api/AudioTrackSink.h
deleted file mode 100644
index fc65fe9..0000000
--- a/webrtc-jni/src/main/cpp/include/api/AudioTrackSink.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_AUDIO_TRACK_SINK_H_
-#define JNI_WEBRTC_API_AUDIO_TRACK_SINK_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/media_stream_interface.h"
-
-#include
-
-namespace jni
-{
- class AudioTrackSink : public webrtc::AudioTrackSinkInterface
- {
- public:
- AudioTrackSink(JNIEnv * env, const JavaGlobalRef & sink);
- ~AudioTrackSink() = default;
-
- // AudioTrackSinkInterface implementation.
- void OnData(const void * data, int bitsPerSample, int sampleRate, size_t channels, size_t frames) override;
-
- private:
- class JavaAudioTrackSinkClass : public JavaClass
- {
- public:
- explicit JavaAudioTrackSinkClass(JNIEnv * env);
-
- jmethodID onData;
- };
-
- private:
- JavaGlobalRef sink;
-
- const std::shared_ptr javaClass;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/HeadlessAudioDeviceModule.h b/webrtc-jni/src/main/cpp/include/api/HeadlessAudioDeviceModule.h
deleted file mode 100644
index c3ae3c3..0000000
--- a/webrtc-jni/src/main/cpp/include/api/HeadlessAudioDeviceModule.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_HEADLESS_ADM_H_
-#define JNI_WEBRTC_API_HEADLESS_ADM_H_
-
-#include
-#include
-#include
-#include
-#include
-
-#include "api/environment/environment.h"
-#include "api/environment/environment_factory.h"
-#include "api/make_ref_counted.h"
-#include "modules/audio_device/audio_device_buffer.h"
-#include "modules/audio_device/include/audio_device.h"
-#include "modules/audio_device/include/audio_device_defines.h"
-#include "rtc_base/buffer.h"
-#include "rtc_base/platform_thread.h"
-#include "rtc_base/ref_counted_object.h"
-#include "rtc_base/synchronization/mutex.h"
-#include "rtc_base/thread.h"
-#include "rtc_base/time_utils.h"
-
-namespace jni
-{
- // A headless AudioDeviceModule that drives the render pipeline by pulling
- // 10 ms PCM chunks from AudioTransport and discarding them, and simulates
- // a microphone by pulling 10 ms PCM chunks from the registered AudioTransport
- // and feeding them into the WebRTC capture pipeline.
- class HeadlessAudioDeviceModule : public webrtc::AudioDeviceModule
- {
- public:
- static webrtc::scoped_refptr Create(
- const webrtc::Environment & env,
- int sample_rate_hz = 48000,
- size_t channels = 1)
- {
- return webrtc::make_ref_counted(
- env, sample_rate_hz, channels);
- }
-
- HeadlessAudioDeviceModule(const webrtc::Environment & env, int sample_rate_hz, size_t channels);
- ~HeadlessAudioDeviceModule() override;
-
- // ----- AudioDeviceModule interface -----
- int32_t ActiveAudioLayer(webrtc::AudioDeviceModule::AudioLayer * audioLayer) const override;
- int32_t RegisterAudioCallback(webrtc::AudioTransport * audioCallback) override;
- int32_t Init() override;
- int32_t Terminate() override;
- bool Initialized() const override;
-
- // --- Device enumeration (stubbed; 1 virtual output device) ---
- int16_t PlayoutDevices() override;
- int16_t RecordingDevices() override;
- int32_t PlayoutDeviceName(uint16_t index,
- char name[webrtc::kAdmMaxDeviceNameSize],
- char guid[webrtc::kAdmMaxGuidSize]) override;
- int32_t RecordingDeviceName(uint16_t index,
- char name[webrtc::kAdmMaxDeviceNameSize],
- char guid[webrtc::kAdmMaxGuidSize]) override;
-
- // --- Device selection (recording not supported) ---
- int32_t SetPlayoutDevice(uint16_t index) override;
- int32_t SetPlayoutDevice(WindowsDeviceType device) override;
- int32_t SetRecordingDevice(uint16_t index) override;
- int32_t SetRecordingDevice(WindowsDeviceType device) override;
-
- // --- Audio transport initialization ---
- int32_t PlayoutIsAvailable(bool * available) override;
- int32_t InitPlayout() override;
- bool PlayoutIsInitialized() const override;
- int32_t RecordingIsAvailable(bool * available) override;
- int32_t InitRecording() override;
- bool RecordingIsInitialized() const override;
-
- // --- Audio transport control (playout only) ---
- int32_t StartPlayout() override;
- int32_t StopPlayout() override;
- bool Playing() const override;
- int32_t StartRecording() override;
- int32_t StopRecording() override;
- bool Recording() const override;
-
- // --- Mixer init (report success; nothing to init physically) ---
- int32_t InitSpeaker() override;
- bool SpeakerIsInitialized() const override;
- int32_t InitMicrophone() override;
- bool MicrophoneIsInitialized() const override;
-
- // --- Speaker volume (not supported) ---
- int32_t SpeakerVolumeIsAvailable(bool * available) override;
- int32_t SetSpeakerVolume(uint32_t volume) override;
- int32_t SpeakerVolume(uint32_t * volume) const override;
- int32_t MaxSpeakerVolume(uint32_t * maxVolume) const override;
- int32_t MinSpeakerVolume(uint32_t * minVolume) const override;
-
- // --- Microphone volume (not supported) ---
- int32_t MicrophoneVolumeIsAvailable(bool * available) override;
- int32_t SetMicrophoneVolume(uint32_t volume) override;
- int32_t MicrophoneVolume(uint32_t * volume) const override;
- int32_t MaxMicrophoneVolume(uint32_t * maxVolume) const override;
- int32_t MinMicrophoneVolume(uint32_t * minVolume) const override;
-
- // --- Mute controls (not supported) ---
- int32_t SpeakerMuteIsAvailable(bool * available) override;
- int32_t SetSpeakerMute(bool enable) override;
- int32_t SpeakerMute(bool * enabled) const override;
- int32_t MicrophoneMuteIsAvailable(bool * available) override;
- int32_t SetMicrophoneMute(bool enable) override;
- int32_t MicrophoneMute(bool * enabled) const override;
-
- // --- Stereo support (playout only) ---
- int32_t StereoPlayoutIsAvailable(bool * available) const override;
- int32_t SetStereoPlayout(bool enable) override;
- int32_t StereoPlayout(bool * enabled) const override;
- int32_t StereoRecordingIsAvailable(bool * available) const override;
- int32_t SetStereoRecording(bool enable) override;
- int32_t StereoRecording(bool * enabled) const override;
-
- // --- Playout delay (fixed, nominal) ---
- int32_t PlayoutDelay(uint16_t * delayMS) const override;
-
- // --- Built-in effects (not supported here) ---
- bool BuiltInAECIsAvailable() const override;
- bool BuiltInAGCIsAvailable() const override;
- bool BuiltInNSIsAvailable() const override;
- int32_t EnableBuiltInAEC(bool enable) override;
- int32_t EnableBuiltInAGC(bool enable) override;
- int32_t EnableBuiltInNS(bool enable) override;
-
- // Android-only in real ADMs; just return 0 here.
- int32_t GetPlayoutUnderrunCount() const override;
-
- private:
- bool PlayThreadProcess();
- bool CaptureThreadProcess();
-
- // State
- bool initialized_ = false;
- bool playout_initialized_ = false;
- bool recording_initialized_ = false;
- bool playing_ = false;
- bool recording_ = false;
-
- // Format
- int sample_rate_hz_ = 48000;
- size_t channels_ = 1;
-
- webrtc::BufferT play_buffer_;
- webrtc::BufferT record_buffer_;
-
- size_t playoutFramesIn10MS_;
- size_t recordingFramesIn10MS_;
- int64_t lastCallPlayoutMillis_;
- int64_t lastCallRecordMillis_;
-
- mutable webrtc::Mutex mutex_;
- std::unique_ptr audio_device_buffer_ RTC_GUARDED_BY(mutex_);
- webrtc::AudioTransport * audio_callback_;
-
- webrtc::PlatformThread render_thread_;
- webrtc::PlatformThread capture_thread_;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/PeerConnectionObserver.h b/webrtc-jni/src/main/cpp/include/api/PeerConnectionObserver.h
index 55b5ef9..3f2f0d2 100644
--- a/webrtc-jni/src/main/cpp/include/api/PeerConnectionObserver.h
+++ b/webrtc-jni/src/main/cpp/include/api/PeerConnectionObserver.h
@@ -36,9 +36,6 @@ namespace jni
// PeerConnectionObserver implementation.
void OnConnectionChange(webrtc::PeerConnectionInterface::PeerConnectionState state) override;
void OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState state) override;
- void OnTrack(webrtc::scoped_refptr transceiver) override;
- void OnAddTrack(webrtc::scoped_refptr receiver, const std::vector> & streams) override;
- void OnRemoveTrack(webrtc::scoped_refptr receiver) override;
void OnDataChannel(webrtc::scoped_refptr channel) override;
void OnRenegotiationNeeded() override;
void OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState state) override;
@@ -56,9 +53,6 @@ namespace jni
jmethodID onConnectionChange;
jmethodID onSignalingChange;
- jmethodID onTrack;
- jmethodID onAddTrack;
- jmethodID onRemoveTrack;
jmethodID onDataChannel;
jmethodID onRenegotiationNeeded;
jmethodID onIceConnectionChange;
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCDtmfSender.h b/webrtc-jni/src/main/cpp/include/api/RTCDtmfSender.h
deleted file mode 100644
index 98cf6a2..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCDtmfSender.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_DTMF_SENDER_H_
-#define JNI_WEBRTC_API_RTC_DTMF_SENDER_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/dtmf_sender_interface.h"
-
-#include
-
-namespace jni
-{
- namespace RTCDtmfSender
- {
- class JavaRTCDtmfSenderClass : public JavaClass
- {
- public:
- explicit JavaRTCDtmfSenderClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- };
-
- JavaLocalRef toJava(JNIEnv * env);
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCDtmfSenderObserver.h b/webrtc-jni/src/main/cpp/include/api/RTCDtmfSenderObserver.h
deleted file mode 100644
index 994ea04..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCDtmfSenderObserver.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_DTMF_SENDER_OBSERVER_H_
-#define JNI_WEBRTC_API_RTC_DTMF_SENDER_OBSERVER_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/dtmf_sender_interface.h"
-
-#include
-#include
-
-namespace jni
-{
- class RTCDtmfSenderObserver : public webrtc::DtmfSenderObserverInterface
- {
- public:
- explicit RTCDtmfSenderObserver(JNIEnv * env, const JavaGlobalRef & observer);
- ~RTCDtmfSenderObserver() = default;
-
- // DtmfSenderObserverInterface implementation.
- void OnToneChange(const std::string & tone, const std::string & tone_buffer) override;
-
- private:
- class JavaRTCDtmfSenderObserverClass : public JavaClass
- {
- public:
- explicit JavaRTCDtmfSenderObserverClass(JNIEnv * env);
-
- jmethodID onToneChange;
- };
-
- private:
- JavaGlobalRef observer;
-
- const std::shared_ptr javaClass;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtcpParameters.h b/webrtc-jni/src/main/cpp/include/api/RTCRtcpParameters.h
deleted file mode 100644
index 598c3ec..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtcpParameters.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTCP_PARAMETERS_H_
-#define JNI_WEBRTC_API_RTC_RTCP_PARAMETERS_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtcpParameters
- {
- class JavaRTCRtcpParametersClass : public JavaClass
- {
- public:
- explicit JavaRTCRtcpParametersClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID cName;
- jfieldID reducedSize;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtcpParameters & parameters);
- webrtc::RtcpParameters toNative(JNIEnv * env, const JavaRef & parameters);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpCapabilities.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpCapabilities.h
deleted file mode 100644
index 437a15f..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpCapabilities.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_CAPABILITIES_H_
-#define JNI_WEBRTC_API_RTC_RTP_CAPABILITIES_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpCapabilities
- {
- class JavaRTCRtpCapabilitiesClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpCapabilitiesClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpCapabilities & capabilities);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpCodecCapability.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpCodecCapability.h
deleted file mode 100644
index 7a8dc62..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpCodecCapability.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_CODEC_CAPABILITY_H_
-#define JNI_WEBRTC_API_RTC_RTP_CODEC_CAPABILITY_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpCodecCapability
- {
- class JavaRTCRtpCodecCapabilityClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpCodecCapabilityClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID mediaType;
- jfieldID name;
- jfieldID clockRate;
- jfieldID channels;
- jfieldID sdpFmtp;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpCodecCapability & capability);
- webrtc::RtpCodecCapability toNative(JNIEnv * env, const JavaRef & capability);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpCodecParameters.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpCodecParameters.h
deleted file mode 100644
index 3503c61..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpCodecParameters.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_CODEC_PARAMETERS_H_
-#define JNI_WEBRTC_API_RTC_RTP_CODEC_PARAMETERS_H_
-
-#include "JavaClass.h"
-#include "JavaObject.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpCodecParameters
- {
- class JavaRTCRtpCodecParametersClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpCodecParametersClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID payloadType;
- jfieldID mediaType;
- jfieldID codecName;
- jfieldID clockRate;
- jfieldID channels;
- jfieldID parameters;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpCodecParameters & parameters);
- webrtc::RtpCodecParameters toNative(JNIEnv * env, const JavaRef & parameters);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpContributingSource.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpContributingSource.h
deleted file mode 100644
index 07cccd8..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpContributingSource.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_CONTRIBUTING_SOURCE_H_
-#define JNI_WEBRTC_API_RTC_RTP_CONTRIBUTING_SOURCE_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/transport/rtp/rtp_source.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpContributingSource
- {
- class JavaRTCRtpContributingSourceClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpContributingSourceClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID timestamp;
- jfieldID sourceId;
- jfieldID sourceType;
- jfieldID audioLevel;
- jfieldID rtpTimestamp;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpSource & source);
- webrtc::RtpSource toNative(JNIEnv * env, const JavaRef & source);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpEncodingParameters.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpEncodingParameters.h
deleted file mode 100644
index 6e2c4d4..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpEncodingParameters.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_ENCODING_PARAMETERS_H_
-#define JNI_WEBRTC_API_RTC_RTP_ENCODING_PARAMETERS_H_
-
-#include "JavaClass.h"
-#include "JavaObject.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpEncodingParameters
- {
- class JavaRTCRtpEncodingParametersClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpEncodingParametersClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID ssrc;
- jfieldID active;
- jfieldID minBitrate;
- jfieldID maxBitrate;
- jfieldID maxFramerate;
- jfieldID scaleResolution;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpEncodingParameters & parameters);
- webrtc::RtpEncodingParameters toNative(JNIEnv * env, const JavaRef & parameters);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpHeaderExtension.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpHeaderExtension.h
deleted file mode 100644
index a45d4df..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpHeaderExtension.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_HEADER_EXTENSION_H_
-#define JNI_WEBRTC_API_RTC_RTP_HEADER_EXTENSION_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpHeaderExtension
- {
- class JavaRTCRtpHeaderExtensionClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpHeaderExtensionClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID uri;
- jfieldID id;
- jfieldID encrypted;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpExtension & extension);
- webrtc::RtpExtension toNative(JNIEnv * env, const JavaRef & jExtension);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpHeaderExtensionCapability.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpHeaderExtensionCapability.h
deleted file mode 100644
index cd7c68f..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpHeaderExtensionCapability.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_HEADER_EXT_CAPABILITY_H_
-#define JNI_WEBRTC_API_RTC_RTP_HEADER_EXT_CAPABILITY_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpHeaderExtensionCapability
- {
- class JavaRTCRtpHeaderExtensionCapabilityClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpHeaderExtensionCapabilityClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpHeaderExtensionCapability & capability);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpParameters.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpParameters.h
deleted file mode 100644
index b1cb155..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpParameters.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_PARAMETERS_H_
-#define JNI_WEBRTC_API_RTC_RTP_PARAMETERS_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpParameters
- {
- class JavaRTCRtpParametersClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpParametersClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID headerExtensions;
- jfieldID rtcp;
- jfieldID codecs;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpParameters & parameters);
- webrtc::RtpParameters toNative(JNIEnv * env, const JavaRef & parameters);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpSendParameters.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpSendParameters.h
deleted file mode 100644
index 61ab494..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpSendParameters.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_SEND_PARAMETERS_H_
-#define JNI_WEBRTC_API_RTC_RTP_SEND_PARAMETERS_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_parameters.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpSendParameters
- {
- class JavaRTCRtpSendParametersClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpSendParametersClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID transactionId;
- jfieldID encodings;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpParameters & parameters);
- webrtc::RtpParameters toNative(JNIEnv * env, const JavaRef & parameters);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpSynchronizationSource.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpSynchronizationSource.h
deleted file mode 100644
index 760d4b4..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpSynchronizationSource.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_SYNCHRONIZATION_SOURCE_H_
-#define JNI_WEBRTC_API_RTC_RTP_SYNCHRONIZATION_SOURCE_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/transport/rtp/rtp_source.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpSynchronizationSource
- {
- class JavaRTCRtpSynchronizationSourceClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpSynchronizationSourceClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID voiceActivityFlag;
- };
-
- JavaLocalRef toJava(JNIEnv * env, const webrtc::RtpSource & source);
- webrtc::RtpSource toNative(JNIEnv * env, const JavaRef & source);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCRtpTransceiverInit.h b/webrtc-jni/src/main/cpp/include/api/RTCRtpTransceiverInit.h
deleted file mode 100644
index f8c0908..0000000
--- a/webrtc-jni/src/main/cpp/include/api/RTCRtpTransceiverInit.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_RTC_RTP_TRANSCEIVER_INIT_H_
-#define JNI_WEBRTC_API_RTC_RTP_TRANSCEIVER_INIT_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/rtp_transceiver_interface.h"
-
-#include
-
-namespace jni
-{
- namespace RTCRtpTransceiverInit
- {
- class JavaRTCRtpTransceiverInitClass : public JavaClass
- {
- public:
- explicit JavaRTCRtpTransceiverInitClass(JNIEnv * env);
-
- jclass cls;
- jfieldID direction;
- jfieldID streamIds;
- jfieldID sendEncodings;
- };
-
- webrtc::RtpTransceiverInit toNative(JNIEnv * env, const JavaRef & javaType);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/RTCStats.h b/webrtc-jni/src/main/cpp/include/api/RTCStats.h
index deae15b..8cb47f4 100644
--- a/webrtc-jni/src/main/cpp/include/api/RTCStats.h
+++ b/webrtc-jni/src/main/cpp/include/api/RTCStats.h
@@ -20,7 +20,7 @@
#include "JavaClass.h"
#include "JavaRef.h"
-#include "api/stats/rtc_stats_report.h"
+#include "api/stats/rtc_stats.h"
#include
diff --git a/webrtc-jni/src/main/cpp/include/api/VideoFrame.h b/webrtc-jni/src/main/cpp/include/api/VideoFrame.h
deleted file mode 100644
index 6be8e88..0000000
--- a/webrtc-jni/src/main/cpp/include/api/VideoFrame.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_VIDEO_FRAME_H_
-#define JNI_WEBRTC_API_VIDEO_FRAME_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/video/video_frame.h"
-#include "api/video/video_frame_buffer.h"
-
-#include
-
-namespace jni
-{
- namespace VideoFrame
- {
- webrtc::VideoFrame toNative(JNIEnv * env, const JavaRef & javaFrame);
- }
-
- namespace I420Buffer
- {
- JavaLocalRef toJava(JNIEnv * env, const webrtc::scoped_refptr & buffer);
- }
-
- class JavaVideoFrameClass : public JavaClass
- {
- public:
- explicit JavaVideoFrameClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID buffer;
- jfieldID rotation;
- jfieldID timestampNs;
- };
-
- class JavaNativeI420BufferClass : public JavaClass
- {
- public:
- explicit JavaNativeI420BufferClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID dataY;
- jfieldID dataU;
- jfieldID dataV;
- jfieldID strideY;
- jfieldID strideU;
- jfieldID strideV;
- jfieldID width;
- jfieldID height;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/api/VideoTrackSink.h b/webrtc-jni/src/main/cpp/include/api/VideoTrackSink.h
deleted file mode 100644
index a224d21..0000000
--- a/webrtc-jni/src/main/cpp/include/api/VideoTrackSink.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_VIDEO_TRACK_SINK_H_
-#define JNI_WEBRTC_API_VIDEO_TRACK_SINK_H_
-
-#include "api/VideoFrame.h"
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/video/video_frame.h"
-#include "api/video/video_sink_interface.h"
-
-#include
-
-namespace jni
-{
- class VideoTrackSink : public webrtc::VideoSinkInterface
- {
- public:
- VideoTrackSink(JNIEnv * env, const JavaGlobalRef & sink);
- ~VideoTrackSink() = default;
-
- // VideoSinkInterface implementation.
- void OnFrame(const webrtc::VideoFrame & frame) override;
-
- private:
- class JavaVideoTrackSinkClass : public JavaClass
- {
- public:
- JavaVideoTrackSinkClass(JNIEnv * env);
-
- jmethodID onFrame;
- };
-
- private:
- JavaGlobalRef sink;
-
- const std::shared_ptr javaClass;
- const std::shared_ptr javaFrameClass;
- const std::shared_ptr javaBufferClass;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/Device.h b/webrtc-jni/src/main/cpp/include/media/Device.h
deleted file mode 100644
index a8f5896..0000000
--- a/webrtc-jni/src/main/cpp/include/media/Device.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_DEVICE_H_
-#define JNI_WEBRTC_MEDIA_DEVICE_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include
-#include
-#include
-
-namespace jni
-{
- namespace avdev
- {
- /**
- DeviceTransport and DeviceFormFactor only for audio devices.
- */
- enum class DeviceTransport {
- trUnknown,
- trHdmi,
- trUsb,
- trWireless,
- };
-
- enum class DeviceFormFactor {
- ffUnknown,
- ffSpeaker,
- ffMicrophone,
- ffHeadset,
- ffHeadphone
- };
-
- class Device
- {
- public:
- virtual ~Device() {};
-
- virtual bool operator==(const Device & other);
- virtual bool operator!=(const Device & other);
- virtual bool operator<(const Device & other);
-
- std::string getName() const;
- std::string getDescriptor() const;
- DeviceTransport getDeviceTransport();
- DeviceFormFactor getDeviceFormFactor();
- void setDeviceTransport(DeviceTransport deviceTransport);
- void setDeviceFormFactor(DeviceFormFactor deviceFormFactor);
-
- protected:
- Device(std::string name, std::string descriptor);
-
- private:
- const std::string name;
- const std::string descriptor;
- DeviceTransport deviceTransport;
- DeviceFormFactor deviceFormFactor;
- };
-
-
- using DevicePtr = std::shared_ptr;
- }
-
- namespace Device
- {
- class JavaDeviceClass : public JavaClass
- {
- public:
- explicit JavaDeviceClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID name;
- jfieldID descriptor;
- jfieldID deviceTransport;
- jfieldID deviceFormFactor;
- };
-
- JavaLocalRef toJavaDevice(JNIEnv * env, avdev::DevicePtr device);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/DeviceChangeListener.h b/webrtc-jni/src/main/cpp/include/media/DeviceChangeListener.h
deleted file mode 100644
index 65a5a9f..0000000
--- a/webrtc-jni/src/main/cpp/include/media/DeviceChangeListener.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_DEVICE_CHANGE_LISTENER_H_
-#define JNI_WEBRTC_MEDIA_DEVICE_CHANGE_LISTENER_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "media/DeviceHotplugListener.h"
-
-#include
-#include
-
-namespace jni
-{
-
- class DeviceChangeListener : public avdev::DeviceHotplugListener
- {
- public:
- explicit DeviceChangeListener(JNIEnv * env, const JavaGlobalRef & listener);
- ~DeviceChangeListener() = default;
-
- // DeviceHotplugListener implementation.
- void deviceConnected(avdev::DevicePtr device) override;
- void deviceDisconnected(avdev::DevicePtr device) override;
-
- private:
- class JavaDeviceChangeListenerClass : public JavaClass
- {
- public:
- explicit JavaDeviceChangeListenerClass(JNIEnv * env);
-
- jmethodID deviceConnected;
- jmethodID deviceDisconnected;
- };
-
- private:
- JavaGlobalRef listener;
-
- const std::shared_ptr javaClass;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/DeviceHotplugListener.h b/webrtc-jni/src/main/cpp/include/media/DeviceHotplugListener.h
deleted file mode 100644
index cdc3071..0000000
--- a/webrtc-jni/src/main/cpp/include/media/DeviceHotplugListener.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_DEVICE_HOTPLUG_LISTENER_H_
-#define JNI_WEBRTC_MEDIA_DEVICE_HOTPLUG_LISTENER_H_
-
-#include "media/Device.h"
-
-#include
-
-namespace jni
-{
- namespace avdev
- {
- class DeviceHotplugListener
- {
- public:
- virtual ~DeviceHotplugListener() {};
-
- virtual void deviceConnected(DevicePtr device) = 0;
- virtual void deviceDisconnected(DevicePtr device) = 0;
- };
-
-
- using PDeviceHotplugListener = std::shared_ptr;
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/DeviceList.h b/webrtc-jni/src/main/cpp/include/media/DeviceList.h
deleted file mode 100644
index b6b9178..0000000
--- a/webrtc-jni/src/main/cpp/include/media/DeviceList.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_DEVICE_LIST_H_
-#define JNI_WEBRTC_MEDIA_DEVICE_LIST_H_
-
-#include
-#include
-#include
-
-namespace jni
-{
- template
- class DeviceList
- {
- public:
- DeviceList() = default;
- virtual ~DeviceList() = default;
-
- bool insertDevice(T device)
- {
- std::unique_lock mlock(mutex);
- auto result = devicesSet.insert(device);
- mlock.unlock();
-
- return result.second;
- }
-
- bool removeDevice(T device)
- {
- std::unique_lock mlock(mutex);
- size_t result = devicesSet.erase(device);
- mlock.unlock();
-
- return result;
- }
-
- T removeDevice(std::function pred)
- {
- T device = nullptr;
-
- std::unique_lock mlock(mutex);
-
- for (auto it = devicesSet.begin(), end = devicesSet.end(); it != end; ) {
- if (pred(*it)) {
- device = *it;
- devicesSet.erase(it);
- break;
- }
- else {
- ++it;
- }
- }
-
- mlock.unlock();
-
- return device;
- }
-
- template
- T findDevice(Predicate pred)
- {
- T device = nullptr;
-
- std::unique_lock mlock(mutex);
-
- typename std::set::iterator it = std::find_if(devicesSet.begin(), devicesSet.end(), pred);
- if (it != devicesSet.end()) {
- device = *it;
- }
-
- mlock.unlock();
-
- return device;
- }
-
- bool empty()
- {
- std::unique_lock mlock(mutex);
-
- return devicesSet.empty();
- }
-
- void clearDevices()
- {
- std::unique_lock mlock(mutex);
- devicesSet.clear();
- mlock.unlock();
- }
-
- std::set devices()
- {
- std::unique_lock mlock(mutex);
-
- return devicesSet;
- }
-
- private:
- std::set devicesSet;
- std::mutex mutex;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/DeviceManager.h b/webrtc-jni/src/main/cpp/include/media/DeviceManager.h
deleted file mode 100644
index a4482ff..0000000
--- a/webrtc-jni/src/main/cpp/include/media/DeviceManager.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_DEVICE_MANAGER_H_
-#define JNI_WEBRTC_MEDIA_DEVICE_MANAGER_H_
-
-#include
-#include
-
-#include "media/DeviceHotplugListener.h"
-
-namespace jni
-{
- namespace avdev
- {
- enum DeviceEvent
- {
- Connected,
- Disconnected
- };
-
- class DeviceManager
- {
- public:
- virtual ~DeviceManager() {};
-
- void attachHotplugListener(PDeviceHotplugListener listener);
- void detachHotplugListener(PDeviceHotplugListener listener);
-
- protected:
- void notifyDeviceConnected(DevicePtr device);
- void notifyDeviceDisconnected(DevicePtr device);
-
- private:
- void notifyListeners(DevicePtr device, const DeviceEvent event);
-
- std::list> hotplugListeners;
- };
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/MediaStreamTrackObserver.h b/webrtc-jni/src/main/cpp/include/media/MediaStreamTrackObserver.h
deleted file mode 100644
index 041fde2..0000000
--- a/webrtc-jni/src/main/cpp/include/media/MediaStreamTrackObserver.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2022 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_STREAM_TRACK_LISTENER_H_
-#define JNI_WEBRTC_MEDIA_STREAM_TRACK_LISTENER_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "api/media_stream_interface.h"
-
-#include
-#include
-
-namespace jni
-{
- enum class MediaStreamTrackEvent {
- ended,
- mute
- };
-
- class MediaStreamTrackObserver : public webrtc::ObserverInterface
- {
- public:
- explicit MediaStreamTrackObserver(JNIEnv * env, const JavaGlobalRef & javaTrack, const webrtc::MediaStreamTrackInterface * track, const MediaStreamTrackEvent & eventType);
- ~MediaStreamTrackObserver() = default;
-
- // ObserverInterface implementation.
- void OnChanged() override;
-
- private:
- class JavaMediaStreamTrackListenerClass : public JavaClass
- {
- public:
- explicit JavaMediaStreamTrackListenerClass(JNIEnv * env);
-
- jmethodID onTrackEnd;
- jmethodID onTrackMute;
- };
-
- JavaLocalRef createJavaTrack(JNIEnv * env);
-
- private:
- const JavaGlobalRef javaTrack;
- const webrtc::MediaStreamTrackInterface * track;
- const MediaStreamTrackEvent eventType;
- const std::shared_ptr javaClass;
- webrtc::MediaStreamTrackInterface::TrackState trackState;
- bool trackEnabled;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/SyncClock.h b/webrtc-jni/src/main/cpp/include/media/SyncClock.h
deleted file mode 100644
index 283a933..0000000
--- a/webrtc-jni/src/main/cpp/include/media/SyncClock.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_SYNC_CLOCK_H_
-#define JNI_WEBRTC_MEDIA_SYNC_CLOCK_H_
-
-#include "system_wrappers/include/clock.h"
-#include "system_wrappers/include/ntp_time.h"
-
-#include
-
-namespace jni
-{
- // Synchronized Clock for A/V timing
- class SyncClock
- {
- public:
- SyncClock();
-
- // Get current timestamp in microseconds
- int64_t GetTimestampUs() const;
-
- // Get current timestamp in milliseconds
- int64_t GetTimestampMs() const;
-
- // Get NTP timestamp for RTP synchronization
- webrtc::NtpTime GetNtpTime() const;
-
- private:
- std::chrono::steady_clock::time_point start_time_;
- };
-}
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioConverter.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioConverter.h
deleted file mode 100644
index fa496ec..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioConverter.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_CONVERTER_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_CONVERTER_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include
-
-namespace jni
-{
- class AudioConverter
- {
- public:
- AudioConverter(const AudioConverter&) = delete;
- AudioConverter& operator=(const AudioConverter&) = delete;
-
- static std::unique_ptr create(size_t srcFrames, size_t srcChannels, size_t dstFrames, size_t dstChannels);
-
- virtual ~AudioConverter() = default;
-
- virtual void convert(const int16_t * src, size_t srcSize, int16_t * dst, size_t dstSize) = 0;
-
- size_t getSrcChannels() const { return srcChannels; }
- size_t getSrcFrames() const { return srcFrames; }
- size_t getDstChannels() const { return dstChannels; }
- size_t getDstFrames() const { return dstFrames; }
-
- protected:
- AudioConverter();
- AudioConverter(size_t srcFrames, size_t srcChannels, size_t dstFrames, size_t dstChannels);
-
- void checkSizes(size_t srcSize, size_t dstCapacity) const;
-
- const size_t srcFrames;
- const size_t srcChannels;
- const size_t dstFrames;
- const size_t dstChannels;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioDevice.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioDevice.h
deleted file mode 100644
index 2edf487..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioDevice.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_DEVICE_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_DEVICE_H_
-
-#include "media/Device.h"
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include
-
-namespace jni
-{
- namespace avdev
- {
-
- enum class AudioDeviceDirectionType {
- adtUnknown,
- adtCapture,
- adtRender
- };
-
- class AudioDevice : public Device
- {
- public:
- AudioDevice(std::string name, std::string descriptor);
- virtual ~AudioDevice() {};
- AudioDeviceDirectionType directionType;
- };
- }
-
- namespace AudioDevice
- {
- class JavaAudioDeviceClass : public JavaClass
- {
- public:
- explicit JavaAudioDeviceClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID name;
- jfieldID descriptor;
- jfieldID deviceTransport;
- jfieldID deviceFormFactor;
- jfieldID directionType;
- };
-
- JavaLocalRef toJavaAudioDevice(JNIEnv * env, avdev::DevicePtr device);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioDeviceManager.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioDeviceManager.h
deleted file mode 100644
index e2b3f5a..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioDeviceManager.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_DEVICE_MANAGER_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_DEVICE_MANAGER_H_
-
-#include "media/DeviceManager.h"
-#include "media/DeviceList.h"
-#include "media/audio/AudioDevice.h"
-
-#include
-#include
-
-namespace jni
-{
- namespace avdev
- {
- using AudioDevicePtr = std::shared_ptr;
-
-
- class AudioDeviceManager : public DeviceManager
- {
- public:
- AudioDeviceManager();
- virtual ~AudioDeviceManager() {};
-
- virtual AudioDevicePtr getDefaultAudioCaptureDevice();
- virtual AudioDevicePtr getDefaultAudioPlaybackDevice();
-
- virtual std::set getAudioCaptureDevices() = 0;
- virtual std::set getAudioPlaybackDevices() = 0;
-
- protected:
- void setDefaultCaptureDevice(AudioDevicePtr device);
- AudioDevicePtr getDefaultCaptureDevice();
-
- void setDefaultPlaybackDevice(AudioDevicePtr device);
- AudioDevicePtr getDefaultPlaybackDevice();
-
- DeviceList captureDevices;
- DeviceList playbackDevices;
-
- private:
- AudioDevicePtr defaultCaptureDevice;
- AudioDevicePtr defaultPlaybackDevice;
- std::mutex mutex;
- };
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessing.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessing.h
deleted file mode 100644
index 4accfae..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessing.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "modules/audio_processing/include/audio_processing.h"
-
-#include
-
-namespace jni
-{
- namespace AudioProcessing
- {
- class JavaAudioProcessingClass : public JavaClass
- {
- public:
- explicit JavaAudioProcessingClass(JNIEnv * env);
-
- jclass cls;
- jfieldID stats;
- };
-
- void updateStats(const webrtc::AudioProcessingStats & stats, JNIEnv * env, const JavaRef & javaType);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingConfig.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingConfig.h
deleted file mode 100644
index 5fb98d1..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingConfig.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_CONFIG_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_CONFIG_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "modules/audio_processing/include/audio_processing.h"
-
-#include
-
-namespace jni
-{
- namespace AudioProcessingConfig
- {
- class JavaAudioProcessingConfigClass : public JavaClass
- {
- public:
- explicit JavaAudioProcessingConfigClass(JNIEnv * env);
-
- jclass cls;
- jfieldID pipeline;
- jfieldID echoCanceller;
- jfieldID gainController;
- jfieldID gainControllerDigital;
- jfieldID highPassFilter;
- jfieldID noiseSuppression;
- jfieldID captureLevelAdjustment;
- };
-
- webrtc::AudioProcessing::Config toNative(JNIEnv * env, const JavaRef & javaType);
- webrtc::AudioProcessing::Config::Pipeline toPipeline(JNIEnv* env, const JavaLocalRef & javaType);
- webrtc::AudioProcessing::Config::GainController1 toGainController1(JNIEnv * env, const JavaLocalRef & javaType);
- webrtc::AudioProcessing::Config::GainController2 toGainController2(JNIEnv * env, const JavaLocalRef & javaType);
-
-
- class JavaPipelineClass : public JavaClass
- {
- public:
- explicit JavaPipelineClass(JNIEnv * env);
-
- jclass cls;
- jfieldID maximumInternalProcessingRate;
- jfieldID multiChannelRender;
- jfieldID multiChannelCapture;
- jfieldID captureDownmixMethod;
- };
-
- class JavaEchoCancellerClass : public JavaClass
- {
- public:
- explicit JavaEchoCancellerClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID enforceHighPassFiltering;
- };
-
- class JavaGainControllerDigitalClass : public JavaClass
- {
- public:
- explicit JavaGainControllerDigitalClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID inputVolumeController;
- jfieldID fixedDigital;
- jfieldID adaptiveDigital;
- };
-
- class JavaInputVolumeControllerClass : public JavaClass
- {
- public:
- explicit JavaInputVolumeControllerClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- };
-
- class JavaGainControlFixedDigitalClass : public JavaClass
- {
- public:
- explicit JavaGainControlFixedDigitalClass(JNIEnv * env);
-
- jclass cls;
- jfieldID gainDb;
- };
-
- class JavaGainControlAdaptiveDigitalClass : public JavaClass
- {
- public:
- explicit JavaGainControlAdaptiveDigitalClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID headroomDb;
- jfieldID maxGainDb;
- jfieldID initialGainDb;
- jfieldID maxGainChangeDbPerSecond;
- jfieldID maxOutputNoiseLevelDbfs;
- };
-
- class JavaGainControllerClass : public JavaClass
- {
- public:
- explicit JavaGainControllerClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID targetLevelDbfs;
- jfieldID compressionGainDb;
- jfieldID enableLimiter;
- jfieldID mode;
- jfieldID analogGainController;
- };
-
- class JavaAgc1AnalogGainControllerClass : public JavaClass
- {
- public:
- explicit JavaAgc1AnalogGainControllerClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID startupMinVolume;
- jfieldID clippedLevelMin;
- jfieldID enableDigitalAdaptive;
- jfieldID clippedLevelStep;
- jfieldID clippedRatioThreshold;
- jfieldID clippedWaitFrames;
- jfieldID clippingPredictor;
- };
-
- class JavaAgc1ClippingPredictorClass : public JavaClass
- {
- public:
- explicit JavaAgc1ClippingPredictorClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID mode;
- jfieldID windowLength;
- jfieldID referenceWindowLength;
- jfieldID referenceWindowDelay;
- jfieldID clippingThreshold;
- jfieldID crestFactorMargin;
- jfieldID usePredictedStep;
- };
-
- class JavaHighPassFilterClass : public JavaClass
- {
- public:
- explicit JavaHighPassFilterClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- };
-
- class JavaNoiseSuppressionClass : public JavaClass
- {
- public:
- explicit JavaNoiseSuppressionClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID level;
- };
-
- class JavaCaptureLevelAdjustmentClass : public JavaClass
- {
- public:
- explicit JavaCaptureLevelAdjustmentClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID preGainFactor;
- jfieldID postGainFactor;
- jfieldID analogMicGainEmulation;
- };
-
- class JavaAnalogMicGainEmulationClass : public JavaClass
- {
- public:
- explicit JavaAnalogMicGainEmulationClass(JNIEnv * env);
-
- jclass cls;
- jfieldID enabled;
- jfieldID initialLevel;
- };
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingStats.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingStats.h
deleted file mode 100644
index 6b277aa..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingStats.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STATS_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STATS_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "modules/audio_processing/include/audio_processing.h"
-
-#include
-
-namespace jni
-{
- namespace AudioProcessingStats
- {
- class JavaAudioProcessingStatsClass : public JavaClass
- {
- public:
- explicit JavaAudioProcessingStatsClass(JNIEnv * env);
-
- jclass cls;
- jfieldID echoReturnLoss;
- jfieldID echoReturnLossEnhancement;
- jfieldID divergentFilterFraction;
- jfieldID delayMs;
- jfieldID delayMedianMs;
- jfieldID delayStandardDeviationMs;
- jfieldID residualEchoLikelihood;
- jfieldID residualEchoLikelihoodRecentMax;
- };
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingStreamConfig.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingStreamConfig.h
deleted file mode 100644
index 851df9d..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioProcessingStreamConfig.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STREAM_CONFIG_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_PROCESSING_STREAM_CONFIG_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "modules/audio_processing/include/audio_processing.h"
-
-#include
-
-namespace jni
-{
- namespace AudioProcessingStreamConfig
- {
- class JavaAudioProcessingStreamConfigClass : public JavaClass
- {
- public:
- explicit JavaAudioProcessingStreamConfigClass(JNIEnv * env);
-
- jclass cls;
- jmethodID ctor;
- jfieldID sampleRate;
- jfieldID channels;
- };
-
- webrtc::StreamConfig toNative(JNIEnv * env, const JavaRef & javaType);
- }
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioSink.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioSink.h
deleted file mode 100644
index 30d501c..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioSink.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_SINK_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_SINK_H_
-
-#include "modules/audio_device/include/audio_device_defines.h"
-
-namespace jni
-{
- class AudioSink : public webrtc::AudioTransport
- {
- public:
- virtual ~AudioSink() {};
-
- int32_t NeedMorePlayData(const size_t nSamples,
- const size_t nBytesPerSample,
- const size_t nChannels,
- const uint32_t samplesPerSec,
- void* audioSamples,
- size_t& nSamplesOut,
- int64_t* elapsed_time_ms,
- int64_t* ntp_time_ms)
- {
- *elapsed_time_ms = 0;
- *ntp_time_ms = 0;
-
- return 0;
- }
-
- void PullRenderData(int bits_per_sample,
- int sample_rate,
- size_t number_of_channels,
- size_t number_of_frames,
- void* audio_data,
- int64_t* elapsed_time_ms,
- int64_t* ntp_time_ms)
- {
- }
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioSource.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioSource.h
deleted file mode 100644
index b5b68f5..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioSource.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2019 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_MEDIA_AUDIO_SOURCE_H_
-#define JNI_WEBRTC_MEDIA_AUDIO_SOURCE_H_
-
-#include "modules/audio_device/include/audio_device_defines.h"
-
-namespace jni
-{
- class AudioSource : public webrtc::AudioTransport
- {
- public:
- virtual ~AudioSource() {};
-
- int32_t RecordedDataIsAvailable(const void* audioSamples,
- const size_t nSamples,
- const size_t nBytesPerSample,
- const size_t nChannels,
- const uint32_t samplesPerSec,
- const uint32_t totalDelayMS,
- const int32_t clockDrift,
- const uint32_t currentMicLevel,
- const bool keyPressed,
- uint32_t& newMicLevel)
- {
- return 0;
- }
-
- void PullRenderData(int bits_per_sample,
- int sample_rate,
- size_t number_of_channels,
- size_t number_of_frames,
- void* audio_data,
- int64_t* elapsed_time_ms,
- int64_t* ntp_time_ms)
- {
- }
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioTransportSink.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioTransportSink.h
deleted file mode 100644
index a7b76aa..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioTransportSink.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_AUDIO_TRANSPORT_SINK_H_
-#define JNI_WEBRTC_API_AUDIO_TRANSPORT_SINK_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "AudioSink.h"
-
-#include
-
-namespace jni
-{
- class AudioTransportSink : public AudioSink
- {
- public:
- AudioTransportSink(JNIEnv * env, const JavaGlobalRef & sink);
- ~AudioTransportSink() = default;
-
- // AudioTransport implementation.
- int32_t RecordedDataIsAvailable(
- const void * audioSamples,
- const size_t nSamples,
- const size_t nBytesPerSample,
- const size_t nChannels,
- const uint32_t samplesPerSec,
- const uint32_t totalDelayMS,
- const int32_t clockDrift,
- const uint32_t currentMicLevel,
- const bool keyPressed,
- uint32_t & newMicLevel) override;
-
- private:
- class JavaAudioSinkClass : public JavaClass
- {
- public:
- explicit JavaAudioSinkClass(JNIEnv * env);
-
- jmethodID onRecordedData;
- };
-
- private:
- JavaGlobalRef sink;
-
- const std::shared_ptr javaClass;
- };
-}
-
-#endif
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/include/media/audio/AudioTransportSource.h b/webrtc-jni/src/main/cpp/include/media/audio/AudioTransportSource.h
deleted file mode 100644
index 3af8fd1..0000000
--- a/webrtc-jni/src/main/cpp/include/media/audio/AudioTransportSource.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2021 Alex Andres
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JNI_WEBRTC_API_AUDIO_TRANSPORT_SOURCE_H_
-#define JNI_WEBRTC_API_AUDIO_TRANSPORT_SOURCE_H_
-
-#include "JavaClass.h"
-#include "JavaRef.h"
-
-#include "AudioSource.h"
-
-#include