Class RecorderRtpImpl

  • All Implemented Interfaces:
    EventListener, javax.media.ControllerListener, javax.media.rtp.ReceiveStreamListener, Recorder, org.jitsi.utils.dsi.ActiveSpeakerChangedListener<Long>

    public class RecorderRtpImpl
    extends Object
    implements Recorder, javax.media.rtp.ReceiveStreamListener, org.jitsi.utils.dsi.ActiveSpeakerChangedListener<Long>, javax.media.ControllerListener
    A Recorder implementation which attaches to an RTPTranslator.
    Author:
    Vladimir Marinov, Boris Grozev
    • Constructor Detail

      • RecorderRtpImpl

        public RecorderRtpImpl​(RTPTranslator translator)
        Constructor.
        Parameters:
        translator - the RTPTranslator to which this instance will attach in order to record media.
    • Method Detail

      • getFilename

        public String getFilename()
        Implements Recorder.getFilename(). Returns null, since we don't have a (single) associated filename.
        Specified by:
        getFilename in interface Recorder
        Returns:
        the filename we are last started or stopped recording to, null if not started.
      • setEventHandler

        public void setEventHandler​(RecorderEventHandler eventHandler)
        Sets the instance which should be notified when events related to recordings (such as the start or end of a recording) occur.
        Specified by:
        setEventHandler in interface Recorder
        Parameters:
        eventHandler - the RecorderEventHandler to set.
      • start

        public void start​(String format,
                          String dirname)
                   throws IOException,
                          MediaException
        Starts the recording of the media associated with this Recorder (e.g. the media being sent and received in a Call) into a file with a specific name.
        Specified by:
        start in interface Recorder
        Parameters:
        format - unused, since this implementation records multiple streams using potentially different formats.
        dirname - the path to the directory into which this Recorder will store the recorded media files.
        Throws:
        IOException - if anything goes wrong with the input and/or output performed by this Recorder
        MediaException - if anything else goes wrong while starting the recording of media performed by this Recorder
      • getMediaStream

        public MediaStream getMediaStream()
        Gets the MediaStream associated with this Recorder.
        Specified by:
        getMediaStream in interface Recorder
        Returns:
        the MediaStream associated with this Recorder.
      • stop

        public void stop()
        Description copied from interface: Recorder
        Stops the recording of the media associated with this Recorder (e.g. the media being sent and received in a Call) if it has been started and prepares this Recorder for garbage collection.
        Specified by:
        stop in interface Recorder
      • update

        public void update​(javax.media.rtp.event.ReceiveStreamEvent event)
        Implements ReceiveStreamListener.update(ReceiveStreamEvent). rtpManager will use this to notify us of ReceiveStreamEvents.
        Specified by:
        update in interface javax.media.rtp.ReceiveStreamListener
      • controllerUpdate

        public void controllerUpdate​(javax.media.ControllerEvent ev)
        Implements ControllerListener.controllerUpdate(ControllerEvent). Handles events from the Processors that this instance uses to transcode media.
        Specified by:
        controllerUpdate in interface javax.media.ControllerListener
        Parameters:
        ev - the event to handle.
      • activeSpeakerChanged

        public void activeSpeakerChanged​(Long ssrc)
        Implements ActiveSpeakerChangedListener.activeSpeakerChanged(Object). Notifies this RecorderRtpImpl that the audio ReceiveStream considered active has changed, and that the new active stream has SSRC ssrc.
        Specified by:
        activeSpeakerChanged in interface org.jitsi.utils.dsi.ActiveSpeakerChangedListener<Long>
        Parameters:
        ssrc - the SSRC of the new active stream.
      • getSynchronizer

        public SynchronizerImpl getSynchronizer()
        Description copied from interface: Recorder
        Gets the Synchronizer of this Recorder.
        Specified by:
        getSynchronizer in interface Recorder
        Returns:
        the Synchronizer of this Recorder.
      • setSynchronizer

        public void setSynchronizer​(Synchronizer synchronizer)
        Description copied from interface: Recorder
        Sets the Synchronizer that this instance should use.
        Specified by:
        setSynchronizer in interface Recorder
        Parameters:
        synchronizer - the Synchronizer to set.
      • connect

        public void connect​(Recorder recorder)