Class RecorderRtpImpl
- java.lang.Object
-
- org.jitsi.impl.neomedia.recording.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jitsi.service.neomedia.recording.Recorder
Recorder.Listener
-
-
Field Summary
-
Fields inherited from interface org.jitsi.service.neomedia.recording.Recorder
FORMAT, SAVED_CALLS_PATH
-
-
Constructor Summary
Constructors Constructor Description RecorderRtpImpl(RTPTranslator translator)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactiveSpeakerChanged(Long ssrc)ImplementsActiveSpeakerChangedListener.activeSpeakerChanged(Object).voidaddListener(Recorder.Listener listener)ImplementsRecorder.addListener(Recorder.Listener).voidconnect(Recorder recorder)voidcontrollerUpdate(javax.media.ControllerEvent ev)ImplementsControllerListener.controllerUpdate(ControllerEvent).StringgetFilename()ImplementsRecorder.getFilename().MediaStreamgetMediaStream()Gets the MediaStream associated with this Recorder.List<String>getSupportedFormats()ImplementsRecorder.getSupportedFormats().SynchronizerImplgetSynchronizer()Gets the Synchronizer of this Recorder.voidremoveListener(Recorder.Listener listener)ImplementsRecorder.removeListener(Recorder.Listener).voidsetEventHandler(RecorderEventHandler eventHandler)Sets the instance which should be notified when events related to recordings (such as the start or end of a recording) occur.voidsetMute(boolean mute)ImplementsRecorder.setMute(boolean).voidsetSynchronizer(Synchronizer synchronizer)Sets the Synchronizer that this instance should use.voidstart(String format, String dirname)Starts the recording of the media associated with this Recorder (e.g.voidstop()Stops the recording of the media associated with this Recorder (e.g.voidupdate(javax.media.rtp.event.ReceiveStreamEvent event)ImplementsReceiveStreamListener.update(ReceiveStreamEvent).
-
-
-
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
-
addListener
public void addListener(Recorder.Listener listener)
ImplementsRecorder.addListener(Recorder.Listener).- Specified by:
addListenerin interfaceRecorder- Parameters:
listener- the new Listener to be added to the list of listeners interested in notifications from this Recorder
-
removeListener
public void removeListener(Recorder.Listener listener)
ImplementsRecorder.removeListener(Recorder.Listener).- Specified by:
removeListenerin interfaceRecorder- Parameters:
listener- the existing Listener to be removed from the list of listeners interested in notifications from this Recorder
-
getSupportedFormats
public List<String> getSupportedFormats()
ImplementsRecorder.getSupportedFormats().- Specified by:
getSupportedFormatsin interfaceRecorder- Returns:
- a List of the formats in which this Recorder supports recording media
-
setMute
public void setMute(boolean mute)
ImplementsRecorder.setMute(boolean).
-
getFilename
public String getFilename()
ImplementsRecorder.getFilename(). Returns null, since we don't have a (single) associated filename.- Specified by:
getFilenamein interfaceRecorder- 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:
setEventHandlerin interfaceRecorder- 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:
startin interfaceRecorder- 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 RecorderMediaException- 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:
getMediaStreamin interfaceRecorder- Returns:
- the MediaStream associated with this Recorder.
-
stop
public void stop()
Description copied from interface:RecorderStops 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.
-
update
public void update(javax.media.rtp.event.ReceiveStreamEvent event)
ImplementsReceiveStreamListener.update(ReceiveStreamEvent).rtpManagerwill use this to notify us of ReceiveStreamEvents.- Specified by:
updatein interfacejavax.media.rtp.ReceiveStreamListener
-
controllerUpdate
public void controllerUpdate(javax.media.ControllerEvent ev)
ImplementsControllerListener.controllerUpdate(ControllerEvent). Handles events from the Processors that this instance uses to transcode media.- Specified by:
controllerUpdatein interfacejavax.media.ControllerListener- Parameters:
ev- the event to handle.
-
activeSpeakerChanged
public void activeSpeakerChanged(Long ssrc)
ImplementsActiveSpeakerChangedListener.activeSpeakerChanged(Object). Notifies this RecorderRtpImpl that the audio ReceiveStream considered active has changed, and that the new active stream has SSRC ssrc.- Specified by:
activeSpeakerChangedin interfaceorg.jitsi.utils.dsi.ActiveSpeakerChangedListener<Long>- Parameters:
ssrc- the SSRC of the new active stream.
-
getSynchronizer
public SynchronizerImpl getSynchronizer()
Description copied from interface:RecorderGets the Synchronizer of this Recorder.- Specified by:
getSynchronizerin interfaceRecorder- Returns:
- the Synchronizer of this Recorder.
-
setSynchronizer
public void setSynchronizer(Synchronizer synchronizer)
Description copied from interface:RecorderSets the Synchronizer that this instance should use.- Specified by:
setSynchronizerin interfaceRecorder- Parameters:
synchronizer- the Synchronizer to set.
-
connect
public void connect(Recorder recorder)
-
-