forked from livekit/react-native-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWebRTCModuleOptions.java
More file actions
55 lines (46 loc) · 1.85 KB
/
WebRTCModuleOptions.java
File metadata and controls
55 lines (46 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.oney.WebRTCModule;
import com.oney.WebRTCModule.audio.AudioProcessingFactoryProvider;
import org.webrtc.Loggable;
import org.webrtc.Logging;
import org.webrtc.VideoDecoderFactory;
import org.webrtc.VideoEncoderFactory;
import org.webrtc.audio.AudioDeviceModule;
import java.nio.ByteBuffer;
public class WebRTCModuleOptions {
private static WebRTCModuleOptions instance;
public VideoEncoderFactory videoEncoderFactory;
public VideoDecoderFactory videoDecoderFactory;
public AudioDeviceModule audioDeviceModule;
public Loggable injectableLogger;
public Logging.Severity loggingSeverity;
public String fieldTrials;
public boolean enableMediaProjectionService;
public AudioProcessingFactoryProvider audioProcessingFactoryProvider;
/**
* Provider for screen share audio bytes. When set, the AudioDeviceModule's
* AudioBufferCallback will mix screen audio into the mic buffer before
* WebRTC processing. This allows screen audio mixing to work alongside
* any audio processing factory (including noise cancellation).
*
* Set this when screen share audio capture starts, clear it when it stops.
*/
public volatile ScreenAudioBytesProvider screenAudioBytesProvider;
/**
* Functional interface for providing screen audio bytes on demand.
*/
public interface ScreenAudioBytesProvider {
/**
* Returns a ByteBuffer containing screen audio PCM data.
*
* @param bytesRequested number of bytes to read (matching mic buffer size)
* @return ByteBuffer with screen audio, or null if not available
*/
ByteBuffer getScreenAudioBytes(int bytesRequested);
}
public static WebRTCModuleOptions getInstance() {
if (instance == null) {
instance = new WebRTCModuleOptions();
}
return instance;
}
}