Package tvi.webrtc
Class PeerConnectionFactory
- java.lang.Object
-
- tvi.webrtc.PeerConnectionFactory
-
public class PeerConnectionFactory extends java.lang.Object
Java wrapper for a C++ PeerConnectionFactoryInterface. Main entry point to the PeerConnection API for clients.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PeerConnectionFactory.Builder
static class
PeerConnectionFactory.InitializationOptions
static class
PeerConnectionFactory.Options
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TRIAL_ENABLED
static java.lang.String
VIDEO_FRAME_EMIT_TRIAL
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PeerConnectionFactory.Builder
builder()
AudioSource
createAudioSource(MediaConstraints constraints)
AudioTrack
createAudioTrack(java.lang.String id, AudioSource source)
MediaStream
createLocalMediaStream(java.lang.String label)
PeerConnection
createPeerConnection(java.util.List<PeerConnection.IceServer> iceServers, MediaConstraints constraints, PeerConnection.Observer observer)
Deprecated.PeerConnection
createPeerConnection(java.util.List<PeerConnection.IceServer> iceServers, PeerConnection.Observer observer)
PeerConnection
createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, PeerConnection.Observer observer)
Deprecated.PeerConnection
createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, PeerConnection.Observer observer)
PeerConnection
createPeerConnection(PeerConnection.RTCConfiguration rtcConfig, PeerConnectionDependencies dependencies)
VideoSource
createVideoSource(boolean isScreencast)
Same as above with alignTimestamps set to true.VideoSource
createVideoSource(boolean isScreencast, boolean alignTimestamps)
Create video source with given parameters.VideoTrack
createVideoTrack(java.lang.String id, VideoSource source)
void
dispose()
static java.lang.String
fieldTrialsFindFullName(java.lang.String name)
long
getNativeOwnedFactoryAndThreads()
Returns a pointer to the native OwnedFactoryAndThreads objectlong
getNativePeerConnectionFactory()
Returns a pointer to the native webrtc::PeerConnectionFactoryInterface.static void
initialize(PeerConnectionFactory.InitializationOptions options)
Loads and initializes WebRTC.static void
initializeFieldTrials(java.lang.String fieldTrialsInitString)
Deprecated.void
printInternalStackTraces(boolean printNativeStackTraces)
Print the Java stack traces for the critical threads used by PeerConnectionFactory, namely; signaling thread, worker thread, and network thread.static void
printStackTraces()
Deprecated.static void
shutdownInternalTracer()
boolean
startAecDump(int file_descriptor, int filesize_limit_bytes)
static boolean
startInternalTracingCapture(java.lang.String tracingFilename)
void
stopAecDump()
static void
stopInternalTracingCapture()
-
-
-
Field Detail
-
TRIAL_ENABLED
public static final java.lang.String TRIAL_ENABLED
- See Also:
- Constant Field Values
-
VIDEO_FRAME_EMIT_TRIAL
@Deprecated public static final java.lang.String VIDEO_FRAME_EMIT_TRIAL
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static PeerConnectionFactory.Builder builder()
-
initialize
public static void initialize(PeerConnectionFactory.InitializationOptions options)
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.
-
shutdownInternalTracer
public static void shutdownInternalTracer()
-
initializeFieldTrials
@Deprecated public static void initializeFieldTrials(java.lang.String fieldTrialsInitString)
Deprecated.
-
fieldTrialsFindFullName
public static java.lang.String fieldTrialsFindFullName(java.lang.String name)
-
startInternalTracingCapture
public static boolean startInternalTracingCapture(java.lang.String tracingFilename)
-
stopInternalTracingCapture
public static void stopInternalTracingCapture()
-
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(java.util.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(java.util.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
public MediaStream createLocalMediaStream(java.lang.String label)
-
createVideoSource
public VideoSource createVideoSource(boolean isScreencast, boolean alignTimestamps)
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
public VideoSource createVideoSource(boolean isScreencast)
Same as above with alignTimestamps set to true.- See Also:
createVideoSource(boolean, boolean)
-
createVideoTrack
public VideoTrack createVideoTrack(java.lang.String id, VideoSource source)
-
createAudioSource
public AudioSource createAudioSource(MediaConstraints constraints)
-
createAudioTrack
public AudioTrack createAudioTrack(java.lang.String id, AudioSource source)
-
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
-
printStackTraces
@Deprecated public static void 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 (and some other) threads.
-
-