Package org.webrtc
Class PeerConnectionFactory
java.lang.Object
org.webrtc.PeerConnectionFactory
Java wrapper for a C++ PeerConnectionFactoryInterface. Main entry point to
the PeerConnection API for clients.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classprivate static classHelper class holding both Java and C++ thread info. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprivate longprivate PeerConnectionFactory.ThreadInfoprivate PeerConnectionFactory.ThreadInfoprivate static PeerConnectionFactory.ThreadInfoprivate static PeerConnectionFactory.ThreadInfoprivate static PeerConnectionFactory.ThreadInfoprivate static final Stringstatic final Stringprivate static final Stringstatic final StringDeprecated.private PeerConnectionFactory.ThreadInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()private static voidprivate voidcreateAudioSource(MediaConstraints constraints) createAudioTrack(String id, AudioSource source) createLocalMediaStream(String label) createPeerConnection(List<PeerConnection.IceServer> iceServers, MediaConstraints constraints, PeerConnection.Observer observer) Deprecated.createPeerConnection(List<PeerConnection.IceServer> iceServers, PeerConnection.Observer observer) createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, PeerConnection.Observer observer) Deprecated.createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, PeerConnection.Observer observer) createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, PeerConnectionDependencies dependencies) (package private) PeerConnectioncreatePeerConnectionInternal(PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, PeerConnection.Observer observer, SSLCertificateVerifier sslCertificateVerifier) Internal helper function to pass the parameters down into the native JNI bridge.createVideoSource(boolean isScreencast) Same as above with alignTimestamps set to true.createVideoSource(boolean isScreencast, boolean alignTimestamps) Create video source with given parameters.createVideoTrack(String id, VideoSource source) voiddispose()static StringlongReturns a pointer to the native OwnedFactoryAndThreads objectlongReturns a pointer to the native webrtc::PeerConnectionFactoryInterface.static voidLoads and initializes WebRTC.static voidinitializeFieldTrials(String fieldTrialsInitString) Deprecated.private static voidprivate static longnativeCreateAudioSource(long factory, MediaConstraints constraints) private static longnativeCreateAudioTrack(long factory, String id, long nativeSource) private static longnativeCreateLocalMediaStream(long factory, String label) private static longnativeCreatePeerConnection(long factory, PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver, SSLCertificateVerifier sslCertificateVerifier) private static PeerConnectionFactorynativeCreatePeerConnectionFactory(Object context, PeerConnectionFactory.Options options, long nativeAudioDeviceModule, long audioEncoderFactory, long audioDecoderFactory, VideoEncoderFactory encoderFactory, VideoDecoderFactory decoderFactory, long nativeAudioProcessor, long nativeFecControllerFactory, long nativeNetworkControllerFactory, long nativeNetworkStatePredictorFactory, long neteqFactory) private static longnativeCreateVideoSource(long factory, boolean is_screencast, boolean alignTimestamps) private static longnativeCreateVideoTrack(long factory, String id, long nativeVideoSource) private static voidprivate static Stringprivate static voidnativeFreeFactory(long factory) private static longnativeGetNativePeerConnectionFactory(long factory) private static voidprivate static voidnativeInitializeFieldTrials(String fieldTrialsInitString) private static voidprivate static voidnativeInjectLoggable(JNILogging jniLogging, int severity) private static voidnativePrintStackTrace(int tid) private static voidprivate static booleannativeStartAecDump(long factory, int file_descriptor, int filesize_limit_bytes) private static booleannativeStartInternalTracingCapture(String tracingFilename) private static voidnativeStopAecDump(long factory) private static voidvoidprintInternalStackTraces(boolean printNativeStackTraces) Print the Java stack traces for the critical threads used by PeerConnectionFactory, namely; signaling thread, worker thread, and network thread.private static voidprintStackTrace(PeerConnectionFactory.ThreadInfo threadInfo, boolean printNativeStackTrace) static voidDeprecated.static voidbooleanstartAecDump(int file_descriptor, int filesize_limit_bytes) static booleanstartInternalTracingCapture(String tracingFilename) voidstatic void
-
Field Details
-
TRIAL_ENABLED
- See Also:
-
VIDEO_FRAME_EMIT_TRIAL
Deprecated.- See Also:
-
TAG
- See Also:
-
VIDEO_CAPTURER_THREAD_NAME
- See Also:
-
internalTracerInitialized
private static volatile boolean internalTracerInitialized -
staticNetworkThread
-
staticWorkerThread
-
staticSignalingThread
-
nativeFactory
private long nativeFactory -
networkThread
-
workerThread
-
signalingThread
-
-
Constructor Details
-
PeerConnectionFactory
PeerConnectionFactory(long nativeFactory)
-
-
Method Details
-
builder
-
initialize
Loads and initializes WebRTC. This must be called at least once before creating a PeerConnectionFactory. Replaces all the old initialization methods. Must not be called while a PeerConnectionFactory is alive. -
checkInitializeHasBeenCalled
private static void checkInitializeHasBeenCalled() -
initializeInternalTracer
private static void initializeInternalTracer() -
shutdownInternalTracer
public static void shutdownInternalTracer() -
initializeFieldTrials
Deprecated. -
fieldTrialsFindFullName
-
startInternalTracingCapture
-
stopInternalTracingCapture
public static void stopInternalTracingCapture() -
createPeerConnectionInternal
@Nullable PeerConnection createPeerConnectionInternal(PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, PeerConnection.Observer observer, SSLCertificateVerifier sslCertificateVerifier) Internal helper function to pass the parameters down into the native JNI bridge. -
createPeerConnection
@Nullable @Deprecated public PeerConnection createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, PeerConnection.Observer observer) Deprecated.Deprecated. PeerConnection constraints are deprecated. Supply values in rtcConfig struct instead and use the method without constraints in the signature. -
createPeerConnection
@Nullable @Deprecated public PeerConnection createPeerConnection(List<PeerConnection.IceServer> iceServers, MediaConstraints constraints, PeerConnection.Observer observer) Deprecated.Deprecated. PeerConnection constraints are deprecated. Supply values in rtcConfig struct instead and use the method without constraints in the signature. -
createPeerConnection
@Nullable public PeerConnection createPeerConnection(List<PeerConnection.IceServer> iceServers, PeerConnection.Observer observer) -
createPeerConnection
@Nullable public PeerConnection createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, PeerConnection.Observer observer) -
createPeerConnection
@Nullable public PeerConnection createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, PeerConnectionDependencies dependencies) -
createLocalMediaStream
-
createVideoSource
Create video source with given parameters. If alignTimestamps is false, the caller is responsible for aligning the frame timestamps to rtc::TimeNanos(). This can be used to achieve higher accuracy if there is a big delay between frame creation and frames being delivered to the returned video source. If alignTimestamps is true, timestamps will be aligned to rtc::TimeNanos() when they arrive to the returned video source. -
createVideoSource
Same as above with alignTimestamps set to true.- See Also:
-
createVideoTrack
-
createAudioSource
-
createAudioTrack
-
startAecDump
public boolean startAecDump(int file_descriptor, int filesize_limit_bytes) -
stopAecDump
public void stopAecDump() -
dispose
public void dispose() -
getNativePeerConnectionFactory
public long getNativePeerConnectionFactory()Returns a pointer to the native webrtc::PeerConnectionFactoryInterface. -
getNativeOwnedFactoryAndThreads
public long getNativeOwnedFactoryAndThreads()Returns a pointer to the native OwnedFactoryAndThreads object -
checkPeerConnectionFactoryExists
private void checkPeerConnectionFactoryExists() -
printStackTrace
private static void printStackTrace(@Nullable PeerConnectionFactory.ThreadInfo threadInfo, boolean printNativeStackTrace) -
printStackTraces
Deprecated.Deprecated, use non-static version instead. -
printInternalStackTraces
public void printInternalStackTraces(boolean printNativeStackTraces) Print the Java stack traces for the critical threads used by PeerConnectionFactory, namely; signaling thread, worker thread, and network thread. If printNativeStackTraces is true, also attempt to print the C++ stack traces for these threads. -
nativeInitializeAndroidGlobals
private static void nativeInitializeAndroidGlobals() -
nativeInitializeFieldTrials
-
nativeFindFieldTrialsFullName
-
nativeInitializeInternalTracer
private static void nativeInitializeInternalTracer() -
nativeShutdownInternalTracer
private static void nativeShutdownInternalTracer() -
nativeStartInternalTracingCapture
-
nativeStopInternalTracingCapture
private static void nativeStopInternalTracingCapture() -
nativeCreatePeerConnectionFactory
private static PeerConnectionFactory nativeCreatePeerConnectionFactory(Object context, PeerConnectionFactory.Options options, long nativeAudioDeviceModule, long audioEncoderFactory, long audioDecoderFactory, VideoEncoderFactory encoderFactory, VideoDecoderFactory decoderFactory, long nativeAudioProcessor, long nativeFecControllerFactory, long nativeNetworkControllerFactory, long nativeNetworkStatePredictorFactory, long neteqFactory) -
nativeCreatePeerConnection
private static long nativeCreatePeerConnection(long factory, PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver, SSLCertificateVerifier sslCertificateVerifier) -
nativeCreateLocalMediaStream
-
nativeCreateVideoSource
private static long nativeCreateVideoSource(long factory, boolean is_screencast, boolean alignTimestamps) -
nativeCreateVideoTrack
-
nativeCreateAudioSource
-
nativeCreateAudioTrack
-
nativeStartAecDump
private static boolean nativeStartAecDump(long factory, int file_descriptor, int filesize_limit_bytes) -
nativeStopAecDump
private static void nativeStopAecDump(long factory) -
nativeFreeFactory
private static void nativeFreeFactory(long factory) -
nativeGetNativePeerConnectionFactory
private static long nativeGetNativePeerConnectionFactory(long factory) -
nativeInjectLoggable
-
nativeDeleteLoggable
private static void nativeDeleteLoggable() -
nativePrintStackTrace
private static void nativePrintStackTrace(int tid)
-