Class RTMPAdaptor

java.lang.Object
io.antmedia.webrtc.adaptor.Adaptor
io.antmedia.webrtc.adaptor.RTMPAdaptor
All Implemented Interfaces:
PeerConnection.Observer, SdpObserver

public class RTMPAdaptor extends Adaptor
  • Field Details

    • AUDIO_ECHO_CANCELLATION_CONSTRAINT

      public static final String AUDIO_ECHO_CANCELLATION_CONSTRAINT
      See Also:
    • AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT

      public static final String AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT
      See Also:
    • AUDIO_HIGH_PASS_FILTER_CONSTRAINT

      public static final String AUDIO_HIGH_PASS_FILTER_CONSTRAINT
      See Also:
    • AUDIO_NOISE_SUPPRESSION_CONSTRAINT

      public static final String AUDIO_NOISE_SUPPRESSION_CONSTRAINT
      See Also:
    • recorder

    • startTime

      private volatile long startTime
    • logger

      private static org.slf4j.Logger logger
    • videoEncoderExecutor

      private ScheduledExecutorService videoEncoderExecutor
    • audioEncoderExecutor

      private ScheduledExecutorService audioEncoderExecutor
    • isStopped

      private AtomicBoolean isStopped
    • signallingExecutor

      private ScheduledExecutorService signallingExecutor
    • enableAudio

      private boolean enableAudio
    • enableVideo

      private boolean enableVideo
    • audioFrameCount

      private volatile int audioFrameCount
    • started

      private boolean started
    • audioDataSchedulerFuture

      private ScheduledFuture<?> audioDataSchedulerFuture
    • webRtcAudioTrack

      private WebRtcAudioTrack webRtcAudioTrack
    • DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT

      public static final String DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT
      See Also:
    • stunServerUri

      private String stunServerUri
    • portRangeMin

      private int portRangeMin
    • portRangeMax

      private int portRangeMax
    • tcpCandidatesEnabled

      private boolean tcpCandidatesEnabled
    • height

      private int height
    • outputURL

      private String outputURL
    • errorLoopCount

      private int errorLoopCount
    • format

      private String format
    • videoFrameQueue

      private ConcurrentLinkedQueue<VideoFrameContext> videoFrameQueue
    • audioFrameQueue

    • lastFrameNumber

      private int lastFrameNumber
    • dropFrameCount

      private int dropFrameCount
    • videoEncoderFuture

      private ScheduledFuture<?> videoEncoderFuture
    • audioEncoderFuture

      private ScheduledFuture<?> audioEncoderFuture
    • videoFrameCount

      private int videoFrameCount
    • videoFrameLastTimestampMs

      private long videoFrameLastTimestampMs
    • turnServerUsername

      private String turnServerUsername
    • turnServerCredential

      private String turnServerCredential
  • Constructor Details

  • Method Details

    • initRecorder

      public static FFmpegFrameRecorder initRecorder(String outputURL, int width, int height, String format)
    • getNewRecorder

      public FFmpegFrameRecorder getNewRecorder(String outputURL, int width, int height, String format)
    • getVideoDecoderFactory

      public VideoDecoderFactory getVideoDecoderFactory()
    • createPeerConnectionFactory

      public PeerConnectionFactory createPeerConnectionFactory()
    • initPeerConnection

      public boolean initPeerConnection(PeerConnectionFactory pcf)
    • start

      public void start()
      Specified by:
      start in class Adaptor
    • stop

      public void stop()
      Specified by:
      stop in class Adaptor
    • getSignallingExecutor

      public ExecutorService getSignallingExecutor()
    • initAudioTrackExecutor

      public void initAudioTrackExecutor()
    • encodeAudio

      public void encodeAudio()
    • recordSamples

      public void recordSamples(RTMPAdaptor.AudioFrame audioFrameContext)
    • initializeRecorder

      public void initializeRecorder(VideoFrame frame)
    • encodeVideo

      public void encodeVideo()
    • onAddStream

      public void onAddStream(MediaStream stream)
      Description copied from interface: PeerConnection.Observer
      Triggered when media is received on a new stream from remote peer.
      Specified by:
      onAddStream in interface PeerConnection.Observer
      Overrides:
      onAddStream in class Adaptor
    • onSetSuccess

      public void onSetSuccess()
      Description copied from interface: SdpObserver
      Called on success of Set{Local,Remote}Description().
      Specified by:
      onSetSuccess in interface SdpObserver
      Overrides:
      onSetSuccess in class Adaptor
    • setRemoteDescription

      public void setRemoteDescription(SessionDescription sdp)
    • addIceCandidate

      public void addIceCandidate(IceCandidate iceCandidate)
    • isStarted

      public boolean isStarted()
    • isStopped

      public boolean isStopped()
    • getAudioDataSchedulerFuture

      public ScheduledFuture getAudioDataSchedulerFuture()
    • getStartTime

      public long getStartTime()
    • getStunServerUri

      public String getStunServerUri()
    • setStunServerUri

      public void setStunServerUri(String stunServerUri, String username, String credential)
    • setPortRange

      public void setPortRange(int webRTCPortRangeMin, int webRTCPortRangeMax)
    • setTcpCandidatesEnabled

      public void setTcpCandidatesEnabled(boolean tcpCandidatesEnabled)
    • getHeight

      public int getHeight()
    • getOutputURL

      public String getOutputURL()
    • setRecorder

      public void setRecorder(FFmpegFrameRecorder recorder)
    • setWebRtcAudioTrack

      public void setWebRtcAudioTrack(WebRtcAudioTrack webRtcAudioTrack)
    • getVideoFrameQueue

      public Queue<VideoFrameContext> getVideoFrameQueue()
    • getAudioFrameQueue

      public Queue<RTMPAdaptor.AudioFrame> getAudioFrameQueue()
    • getRecorder

      public FFmpegFrameRecorder getRecorder()
    • getVideoEncoderExecutor

      public ScheduledExecutorService getVideoEncoderExecutor()
    • getAudioEncoderExecutor

      public ScheduledExecutorService getAudioEncoderExecutor()
    • setEnableVideo

      public void setEnableVideo(boolean enableVideo)
    • isEnableVideo

      public boolean isEnableVideo()