public final class RtspPlaySession extends PlaySession implements RtspClient.IRtcpHandler
RtspPlaySession
- RTSP play session.PlaySession.IListener, PlaySession.ListenerAdapter
RtspClient.IRtcpHandler.CallbackAdapter, RtspClient.IRtcpHandler.ICallback
listener
Modifier and Type | Method and Description |
---|---|
boolean |
isAnyMediaDataReceived()
Checks if any media data is received.
|
boolean |
isInterleavedTransport()
Checks if TCP interleaved transport is used.
|
boolean |
isPaused()
Checks if session is paused.
|
boolean |
pause()
Pauses the playback.
|
void |
play(IVideo video,
java.lang.Object... args)
Starts the playback (using "Range: npt=0.0-" header field).
|
void |
play(IVideo video,
java.lang.String range,
java.lang.Object... args)
Starts the playback.
|
void |
resume()
Resumes the playback.
|
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 |
setJitterBufferMargin(MediaTrackInfo track,
int margin)
Sets jitter buffer margin for the
track . |
void |
setMediaTimeout(MediaTrackInfo track,
int timeout)
Sets media data timeout for the
track . |
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 playback.
|
setListener
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 setJitterBufferMargin(MediaTrackInfo track, int margin)
PlaySession
track
.setJitterBufferMargin
in class PlaySession
public void setMediaTimeout(MediaTrackInfo track, int timeout)
PlaySession
track
.setMediaTimeout
in class PlaySession
timeout
- timeout (in milliseconds)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 play(IVideo video, java.lang.String range, java.lang.Object... args) throws java.lang.IllegalStateException, RtspMethodException
video
- IVideo
instance that accepts media datarange
- 'Range' header valueargs
- play argumentsjava.lang.IllegalStateException
- if connection is not established yetRtspMethodException
- if response status code is different from 2xx.public void play(IVideo video, java.lang.Object... args) throws java.lang.IllegalStateException, RtspMethodException
video
- IVideo
instance that accepts media dataargs
- play argumentsjava.lang.IllegalStateException
- if connection is not established yetRtspMethodException
- if response status code is different from 2xx.public boolean isInterleavedTransport()
true
if TCP transport is used; otherwise false
public boolean isAnyMediaDataReceived()
true
if received; otherwise false
public boolean isPaused()
true
if paused; otherwise false
public boolean pause() throws java.lang.IllegalStateException, RtspMethodException
true
if playback was paused; otherwise false
java.lang.IllegalStateException
- if connection is not established yetRtspMethodException
- if response status code is different from 2xx.public void resume() 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