public final class RtspPlaySession extends java.lang.Object implements RtspClient.IRtcpHandler
RtspPlaySession - RTSP play session.| Modifier and Type | Class and Description |
|---|---|
static interface |
RtspPlaySession.IListener
IListener - listener. |
RtspClient.IRtcpHandler.ICallback| Modifier and Type | Field and Description |
|---|---|
static IReceiverSession[] |
EMPTY_SESSIONS
EMPTY_SESSIONS |
static IVideo |
EMPTY_VIDEO
EMPTY_VIDEO |
| Constructor and Description |
|---|
RtspPlaySession(RtspClient client,
RtspConnection connection,
IPresentation presentation,
RtpUdpSessionManager sessionManager,
int responseTimeout)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
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 |
setCallback(RtspClient.IRtcpHandler.ICallback callback)
Sets callback.
|
void |
setJitterBufferMargin(MediaTrackInfo track,
int margin)
Sets jitter buffer margin for the
track. |
void |
setListener(RtspPlaySession.IListener listener)
Sets the listener.
|
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.
|
public static final IReceiverSession[] EMPTY_SESSIONS
EMPTY_SESSIONSpublic static final IVideo EMPTY_VIDEO
EMPTY_VIDEOpublic RtspPlaySession(RtspClient client, RtspConnection connection, IPresentation presentation, RtpUdpSessionManager sessionManager, int responseTimeout)
client - connection - presentation - sessionManager - responseTimeout - response timeoutpublic void setListener(RtspPlaySession.IListener listener)
listener - 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)
track.track - margin - 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 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 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.IRtcpHandlersetCallback in interface RtspClient.IRtcpHandlerpublic void sendApp(MediaTrackInfo track,
int subtype,
java.lang.String name,
ByteArray data)
RtspClient.IRtcpHandlersendApp in interface RtspClient.IRtcpHandlertrack - media track, null to send 'app' event to all tracksname - 4-chars app namedata - app data