public final class RtspRecordSession extends RecordSession implements RtspClient.IRtcpHandler
RtspRecordSession
- RTSP record session.RecordSession.CameraListener, RecordSession.IListener, RecordSession.ListenerAdapter, RecordSession.MicrophoneListener
RtspClient.IRtcpHandler.CallbackAdapter, RtspClient.IRtcpHandler.ICallback
audioTrack, camera, cameraListener, information, listener, microphone, microphoneListener, name, videoTrack
Modifier and Type | Method and Description |
---|---|
void |
announce(java.lang.String url)
Announces the presentation.
|
void |
pause()
Pauses the recording.
|
void |
record()
Starts the recording.
|
void |
sendApp(MediaTrackInfo track,
int subtype,
java.lang.String name,
ByteArray data)
Sends 'app' event.
|
void |
sendBye(MediaTrackInfo track,
java.lang.String reason)
Sends 'bye' event.
|
void |
setCallback(RtspClient.IRtcpHandler.ICallback callback)
Sets callback.
|
void |
setMulticastAddress(java.lang.String address)
Sets multicast address.
|
void |
setProfile(java.lang.String profile)
Sets profile.
|
int[] |
setup()
Setups presentation's media tracks for TCP/IP (or INTERLEAVED) mode.
|
int[] |
setup(int rtpPort)
Setups presentation's media tracks.
|
int[] |
setup(int rtpPort,
java.lang.Object... args)
Setups presentation's media tracks.
|
int[] |
setup(UnicastUdpTransport transport)
Setups presentation's media tracks for UDP/IP mode.
|
void |
teardown()
Teardowns recording.
|
attachCamera, attachCamera, attachMicrophone, attachMicrophone, bindMediaTrackDataProviderToSession, getPresentation, setInformation, setListener, setName, unbindMediaTrackDataProviders
public void setMulticastAddress(java.lang.String address)
address
- public void setProfile(java.lang.String profile)
Note:
- "RTP/AVP" - for RTP/UDP
- "MP2T/H2221/UDP" - for UDP
profile
- public void announce(java.lang.String url) throws java.lang.IllegalStateException, RtspMethodException
url
- announced stream urljava.lang.IllegalStateException
- if connection is not established or closedRtspMethodException
- if response status code is different from 2xx.public int[] setup()
public int[] setup(UnicastUdpTransport transport)
Note:
- If UnicastUdpTransport
determines that UDP is not possible to use, because of NAT configuration
then TCP/IP (or INTERLEAVED) mode is setup.
transport
- public int[] setup(int rtpPort)
Note:
- If rtpPort
is less than 255 then interleaved mode is used.
rtpPort
- first media track RTP portpublic int[] setup(int rtpPort, java.lang.Object... args)
Note:
- If rtpPort
is less than 255 then interleaved mode is used.
rtpPort
- first media track RTP portargs
- setup argumentspublic void record() throws java.lang.IllegalStateException, RtspMethodException
Note:
- Start sending the audio/video data after 'RECORD' is accepted by server.
java.lang.IllegalStateException
- if connection is not established yetRtspMethodException
- if response status code is different from 2xx.public void pause() throws java.lang.IllegalStateException, RtspMethodException
java.lang.IllegalStateException
- if connection is not established yetRtspMethodException
- if response status code is different from 2xx.public void teardown() throws java.lang.IllegalStateException, RtspMethodException
java.lang.IllegalStateException
- if connection is not established yetRtspMethodException
- if response status code is different from 2xx.public void setCallback(RtspClient.IRtcpHandler.ICallback callback)
RtspClient.IRtcpHandler
setCallback
in interface RtspClient.IRtcpHandler
public void sendApp(MediaTrackInfo track, int subtype, java.lang.String name, ByteArray data)
RtspClient.IRtcpHandler
sendApp
in interface RtspClient.IRtcpHandler
track
- media track, null
to send 'app' event to all tracksname
- 4-chars app namedata
- app datapublic void sendBye(MediaTrackInfo track, java.lang.String reason)
RtspClient.IRtcpHandler
sendBye
in interface RtspClient.IRtcpHandler
track
- media track, null
to send 'app' event to all tracksreason
- reason