Package com.flashphoner.fpwcsapi.webrtc
Class MediaConnection
java.lang.Object
com.flashphoner.fpwcsapi.webrtc.MediaConnection
Wrapper around WebRTC peer-connection
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorDescriptionMediaConnection
(String id, org.webrtc.VideoSink remoteVideoSink, WebRTCMediaProvider webRTCMediaProvider, LooperExecutor executor, String videoCodec, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) New MediaConnection -
Method Summary
Modifier and TypeMethodDescriptionstatic String
addH264PackectizationMode
(String sdpDescription) void
Create answer based on media optionsvoid
createOffer
(MediaConnectionOptions options) Create offer based on media optionsgetId()
org.webrtc.SessionDescription
void
getStats
(org.webrtc.RTCStatsCollectorCallback rtcStatsReport) boolean
boolean
boolean
void
Disable audio trackvoid
Disable video trackvoid
setMediaConnectionListener
(MediaConnectionListener mediaConnectionListener) Set listenervoid
setOptions
(MediaConnectionOptions options) Set media optionsvoid
setRemoteDescription
(org.webrtc.SessionDescription sdp) Set remote SDPvoid
setVideoBandwidth
(Integer minBitrate, Integer maxBitrate) Set stream bandwidthvoid
switchRenderer
(org.webrtc.VideoSink newVideoRender) Switch the stream to a new renderervoid
Enable audio trackvoid
Enable video track
-
Field Details
-
BITRATE_MULTIPLIER
public static final int BITRATE_MULTIPLIER- See Also:
-
KBPS_THRESHOLD
public static final int KBPS_THRESHOLD- See Also:
-
-
Constructor Details
-
MediaConnection
public MediaConnection(String id, org.webrtc.VideoSink remoteVideoSink, WebRTCMediaProvider webRTCMediaProvider, LooperExecutor executor, String videoCodec, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) New MediaConnection- Parameters:
id
- unique identifierremoteVideoSink
- videoSinkwebRTCMediaProvider
-WebRTCMediaProvider
executor
- thread executorvideoCodec
- preferred video codecmediaOptions
- media connection configuration
-
-
Method Details
-
getRemoteDescription
public org.webrtc.SessionDescription getRemoteDescription() -
createOffer
Create offer based on media options- Parameters:
options
-
-
createAnswer
public void createAnswer()Create answer based on media options -
setOptions
Set media options- Parameters:
options
-
-
switchRenderer
public void switchRenderer(org.webrtc.VideoSink newVideoRender) Switch the stream to a new renderer- Parameters:
newVideoRender
-
-
setRemoteDescription
public void setRemoteDescription(org.webrtc.SessionDescription sdp) Set remote SDP- Parameters:
sdp
-
-
muteAudio
public void muteAudio()Disable audio track -
unmuteAudio
public void unmuteAudio()Enable audio track -
isAudioMuted
public boolean isAudioMuted()- Returns:
- true if audio track is disabled
-
muteVideo
public void muteVideo()Disable video track -
unmuteVideo
public void unmuteVideo()Enable video track -
setVideoBandwidth
Set stream bandwidth- Parameters:
minBitrate
-maxBitrate
-
-
isKbs
-
isVideoMuted
public boolean isVideoMuted()- Returns:
- true if video track is disabled
-
getId
-
setMediaConnectionListener
Set listener- Parameters:
mediaConnectionListener
-
-
addH264PackectizationMode
-
getStats
public void getStats(org.webrtc.RTCStatsCollectorCallback rtcStatsReport)
-