Package 

Class StreamPeerConnectionFactory

    • Constructor Detail

      • StreamPeerConnectionFactory

        StreamPeerConnectionFactory(Context context, Integer audioUsage, Function0<Integer> audioUsageProvider, ManagedAudioProcessingFactory audioProcessing, Function0<AudioBitrateProfile> audioBitrateProfileProvider, Function0<EglBase> sharedEglBaseProvider, Logging.Severity webRtcLoggingLevel)
    • Method Detail

      • getEglBase

         final EglBase getEglBase()

        Represents the EGL rendering context. Todo : Remove this with the next major release

      • setAudioSampleCallback

         final Unit setAudioSampleCallback(Function1<JavaAudioDeviceModule.AudioSamples, Unit> callback)

        Set to get callbacks when audio input from microphone is received. This can be example used to detect whether a person is speaking while muted.

      • setPreferredAudioInputDevice

         final Boolean setPreferredAudioInputDevice(AudioDeviceInfo deviceInfo)

        Sets the preferred audio input device for recording.

        This allows routing audio input to a specific device, such as a USB microphone that may not be detected by AudioSwitch (e.g., Rode Wireless Go II).

        Parameters:
        deviceInfo - The AudioDeviceInfo to use for recording, or null to restore default routing.
      • getSenderCapabilities

         final RtpCapabilities getSenderCapabilities(MediaStreamTrack.MediaType mediaType)

        Returns the capabilities of the sender based on the mediaType.

        Parameters:
        mediaType - The type of media we're sending.
      • makePeerConnection

         final StreamPeerConnection makePeerConnection(PeerConnection.RTCConfiguration configuration, StreamPeerType type, MediaConstraints mediaConstraints, Function1<MediaStream, Unit> onStreamAdded, Function2<StreamPeerConnection, StreamPeerType, Unit> onNegotiationNeeded, Function2<IceCandidate, StreamPeerType, Unit> onIceCandidateRequest, Integer maxPublishingBitrate, String debugText)

        Builds a StreamPeerConnection that wraps the WebRTC PeerConnection and exposes several helpful handlers.

        Parameters:
        configuration - The PeerConnection.RTCConfiguration used to set up the connection.
        type - The type of connection, either a subscriber of a publisher.
        mediaConstraints - Constraints used for audio and video tracks in the connection.
        onStreamAdded - Handler when a new MediaStream gets added.
        onNegotiationNeeded - Handler when there's a new negotiation.
        onIceCandidateRequest - Handler whenever we receive IceCandidates.
      • makeVideoTrack

         final VideoTrack makeVideoTrack(VideoSource source, String trackId)

        Builds a VideoTrack from the factory that can be used for regular video share (camera) or screen sharing.

        Parameters:
        source - The VideoSource used for the track.
        trackId - The unique ID for this track.
      • makeAudioSource

         final AudioSource makeAudioSource(MediaConstraints constraints)

        Builds an AudioSource from the factory that can be used for audio sharing.

        Parameters:
        constraints - The constraints used to change the way the audio behaves.
      • makeAudioTrack

         final AudioTrack makeAudioTrack(AudioSource source, String trackId)

        Builds an AudioTrack from the factory that can be used for regular video share (camera) or screen sharing.

        Parameters:
        source - The AudioSource used for the track.
        trackId - The unique ID for this track.
      • isAudioProcessingEnabled

         final Boolean isAudioProcessingEnabled()

        True if the audio processing is enabled, false otherwise.

        Returns false when the processor is not wired into the native factory — under MUSIC_HIGH_QUALITY nothing is processing this call's audio, whatever the shared module's own flag happens to say.

      • setAudioProcessingEnabled

         final Unit setAudioProcessingEnabled(Boolean enabled)

        Sets the audio processing on or off.

        No-op when the processor is not wired into the native factory: the module is shared across calls, and a call that cannot use it must not change what other calls observe.