Package io.antmedia.webrtc.adaptor
Class RTMPAdaptor
java.lang.Object
io.antmedia.webrtc.adaptor.Adaptor
io.antmedia.webrtc.adaptor.RTMPAdaptor
- All Implemented Interfaces:
PeerConnection.Observer
,SdpObserver
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
private ScheduledFuture<?>
private ScheduledExecutorService
private ScheduledFuture<?>
private int
private int
static final String
private boolean
private boolean
private int
private String
private int
private AtomicBoolean
private int
private static org.slf4j.Logger
private String
private int
private int
(package private) FFmpegFrameRecorder
private ScheduledExecutorService
private boolean
private long
private String
private boolean
private String
private String
private ScheduledExecutorService
private ScheduledFuture<?>
private int
private long
private ConcurrentLinkedQueue<VideoFrameContext>
private WebRtcAudioTrack
Fields inherited from class io.antmedia.webrtc.adaptor.Adaptor
log, peerConnection, peerConnectionFactory, webSocketCommunityHandler
-
Constructor Summary
ConstructorDescriptionRTMPAdaptor
(String outputURL, WebSocketCommunityHandler webSocketHandler, int height) RTMPAdaptor
(String outputURL, WebSocketCommunityHandler webSocketHandler, int height, String format) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIceCandidate
(IceCandidate iceCandidate) void
void
int
getNewRecorder
(String outputURL, int width, int height, String format) long
void
void
initializeRecorder
(VideoFrame frame) boolean
static FFmpegFrameRecorder
initRecorder
(String outputURL, int width, int height, String format) boolean
boolean
boolean
void
onAddStream
(MediaStream stream) Triggered when media is received on a new stream from remote peer.void
Called on success of Set{Local,Remote}Description().void
recordSamples
(RTMPAdaptor.AudioFrame audioFrameContext) void
setEnableVideo
(boolean enableVideo) void
setPortRange
(int webRTCPortRangeMin, int webRTCPortRangeMax) void
setRecorder
(FFmpegFrameRecorder recorder) void
void
setStunServerUri
(String stunServerUri, String username, String credential) void
setTcpCandidatesEnabled
(boolean tcpCandidatesEnabled) void
setWebRtcAudioTrack
(WebRtcAudioTrack webRtcAudioTrack) void
start()
void
stop()
Methods inherited from class io.antmedia.webrtc.adaptor.Adaptor
getPeerConnection, getSdpMediaConstraints, getSession, getStreamId, onAddTrack, onCreateFailure, onCreateSuccess, onDataChannel, onIceCandidate, onIceCandidatesRemoved, onIceConnectionChange, onIceConnectionReceivingChange, onIceGatheringChange, onRemoveStream, onRenegotiationNeeded, onSetFailure, onSignalingChange, setPeerConnection, setPeerConnectionFactory, setSdpMediaConstraints, setSession, setStreamId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.webrtc.PeerConnection.Observer
onConnectionChange, onIceCandidateError, onRemoveTrack, onSelectedCandidatePairChanged, onStandardizedIceConnectionChange, onTrack
-
Field Details
-
AUDIO_ECHO_CANCELLATION_CONSTRAINT
- See Also:
-
AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT
- See Also:
-
AUDIO_HIGH_PASS_FILTER_CONSTRAINT
- See Also:
-
AUDIO_NOISE_SUPPRESSION_CONSTRAINT
- See Also:
-
recorder
FFmpegFrameRecorder recorder -
startTime
private volatile long startTime -
logger
private static org.slf4j.Logger logger -
videoEncoderExecutor
-
audioEncoderExecutor
-
isStopped
-
signallingExecutor
-
enableAudio
private boolean enableAudio -
enableVideo
private boolean enableVideo -
audioFrameCount
private volatile int audioFrameCount -
started
private boolean started -
audioDataSchedulerFuture
-
webRtcAudioTrack
-
DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT
- See Also:
-
stunServerUri
-
portRangeMin
private int portRangeMin -
portRangeMax
private int portRangeMax -
tcpCandidatesEnabled
private boolean tcpCandidatesEnabled -
height
private int height -
outputURL
-
errorLoopCount
private int errorLoopCount -
format
-
videoFrameQueue
-
audioFrameQueue
-
lastFrameNumber
private int lastFrameNumber -
dropFrameCount
private int dropFrameCount -
videoEncoderFuture
-
audioEncoderFuture
-
videoFrameCount
private int videoFrameCount -
videoFrameLastTimestampMs
private long videoFrameLastTimestampMs -
turnServerUsername
-
turnServerCredential
-
-
Constructor Details
-
RTMPAdaptor
-
RTMPAdaptor
public RTMPAdaptor(String outputURL, WebSocketCommunityHandler webSocketHandler, int height, String format)
-
-
Method Details
-
initRecorder
public static FFmpegFrameRecorder initRecorder(String outputURL, int width, int height, String format) -
getNewRecorder
-
getVideoDecoderFactory
-
createPeerConnectionFactory
-
initPeerConnection
-
start
public void start() -
stop
public void stop() -
getSignallingExecutor
-
initAudioTrackExecutor
public void initAudioTrackExecutor() -
encodeAudio
public void encodeAudio() -
recordSamples
-
initializeRecorder
-
encodeVideo
public void encodeVideo() -
onAddStream
Description copied from interface:PeerConnection.Observer
Triggered when media is received on a new stream from remote peer.- Specified by:
onAddStream
in interfacePeerConnection.Observer
- Overrides:
onAddStream
in classAdaptor
-
onSetSuccess
public void onSetSuccess()Description copied from interface:SdpObserver
Called on success of Set{Local,Remote}Description().- Specified by:
onSetSuccess
in interfaceSdpObserver
- Overrides:
onSetSuccess
in classAdaptor
-
setRemoteDescription
-
addIceCandidate
-
isStarted
public boolean isStarted() -
isStopped
public boolean isStopped() -
getAudioDataSchedulerFuture
-
getStartTime
public long getStartTime() -
getStunServerUri
-
setStunServerUri
-
setPortRange
public void setPortRange(int webRTCPortRangeMin, int webRTCPortRangeMax) -
setTcpCandidatesEnabled
public void setTcpCandidatesEnabled(boolean tcpCandidatesEnabled) -
getHeight
public int getHeight() -
getOutputURL
-
setRecorder
-
setWebRtcAudioTrack
-
getVideoFrameQueue
-
getAudioFrameQueue
-
getRecorder
-
getVideoEncoderExecutor
-
getAudioEncoderExecutor
-
setEnableVideo
public void setEnableVideo(boolean enableVideo) -
isEnableVideo
public boolean isEnableVideo()
-