RtspMediaSource.Factory
public final class RtspMediaSource.Factory implements MediaSourceFactory
Factory for RtspMediaSource
This factory doesn't support the following methods from MediaSourceFactory:
Summary
Public constructors |
|---|
Factory() |
Public methods |
|
|---|---|
RtspMediaSource |
createMediaSource(MediaItem mediaItem)Returns a new |
int[] |
Returns the |
RtspMediaSource.Factory |
@CanIgnoreReturnValueSets whether to log RTSP messages, the default value is |
RtspMediaSource.Factory |
setDrmSessionManagerProvider(Does nothing. |
RtspMediaSource.Factory |
@CanIgnoreReturnValueSets whether to force using TCP as the default RTP transport. |
RtspMediaSource.Factory |
setLoadErrorHandlingPolicy(Does nothing. |
RtspMediaSource.Factory |
@CanIgnoreReturnValueSets a socket factory for |
RtspMediaSource.Factory |
@CanIgnoreReturnValueSets the timeout in milliseconds, the default value is |
RtspMediaSource.Factory |
@CanIgnoreReturnValueSets the user agent, the default value is |
Inherited Constants |
||
|---|---|---|
|
||
|
Inherited methods |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public methods
createMediaSource
public RtspMediaSource createMediaSource(MediaItem mediaItem)
Returns a new RtspMediaSource using the current parameters.
| Returns | |
|---|---|
RtspMediaSource |
The new |
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
getSupportedTypes
@C.ContentType
public int[] getSupportedTypes()
Returns the content types supported by media sources created by this factory.
setDebugLoggingEnabled
@CanIgnoreReturnValue
public RtspMediaSource.Factory setDebugLoggingEnabled(boolean debugLoggingEnabled)
Sets whether to log RTSP messages, the default value is false.
This option presents a privacy risk, since it may expose sensitive information such as user's credentials.
| Parameters | |
|---|---|
boolean debugLoggingEnabled |
Whether to log RTSP messages. |
| Returns | |
|---|---|
RtspMediaSource.Factory |
This Factory, for convenience. |
setDrmSessionManagerProvider
public RtspMediaSource.Factory setDrmSessionManagerProvider(
DrmSessionManagerProvider drmSessionManager
)
Does nothing. RtspMediaSource does not support DRM.
setForceUseRtpTcp
@CanIgnoreReturnValue
public RtspMediaSource.Factory setForceUseRtpTcp(boolean forceUseRtpTcp)
Sets whether to force using TCP as the default RTP transport.
The default value is false, the source will first try streaming RTSP with UDP. If no data is received on the UDP channel (for instance, when streaming behind a NAT) for a while, the source will switch to streaming using TCP. If this value is set to true, the source will always use TCP for streaming.
| Parameters | |
|---|---|
boolean forceUseRtpTcp |
Whether force to use TCP for streaming. |
| Returns | |
|---|---|
RtspMediaSource.Factory |
This Factory, for convenience. |
setLoadErrorHandlingPolicy
public RtspMediaSource.Factory setLoadErrorHandlingPolicy(
LoadErrorHandlingPolicy loadErrorHandlingPolicy
)
Does nothing. RtspMediaSource does not support error handling policies.
setSocketFactory
@CanIgnoreReturnValue
public RtspMediaSource.Factory setSocketFactory(SocketFactory socketFactory)
Sets a socket factory for RtspClient's connection, the default value is getDefault.
| Parameters | |
|---|---|
SocketFactory socketFactory |
A socket factory. |
| Returns | |
|---|---|
RtspMediaSource.Factory |
This Factory, for convenience. |
setTimeoutMs
@CanIgnoreReturnValue
public RtspMediaSource.Factory setTimeoutMs(@IntRange(from = 1) long timeoutMs)
Sets the timeout in milliseconds, the default value is DEFAULT_TIMEOUT_MS.
A positive number of milliseconds to wait before lack of received RTP packets is treated as the end of input.
| Parameters | |
|---|---|
@IntRange(from = 1) long timeoutMs |
The timeout measured in milliseconds. |
| Returns | |
|---|---|
RtspMediaSource.Factory |
This Factory, for convenience. |
setUserAgent
@CanIgnoreReturnValue
public RtspMediaSource.Factory setUserAgent(String userAgent)
Sets the user agent, the default value is VERSION_SLASHY.
| Parameters | |
|---|---|
String userAgent |
The user agent. |
| Returns | |
|---|---|
RtspMediaSource.Factory |
This Factory, for convenience. |