public class ConnectionEntry
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ConnectionEntry.Protocol |
static class |
ConnectionEntry.Source |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTRA_CONNECTION_ENTRY |
static java.lang.String |
TAG |
Constructor and Description |
---|
ConnectionEntry()
Produces a completely undefined ConnectionEntry, a minimum set of values would need to be set
before this can even be used.
|
ConnectionEntry(java.io.File f)
Construct a connection entry based on the file provided.
|
ConnectionEntry(java.lang.String alias,
java.lang.String uri)
Creates a connection entry based on a provided uri.
|
ConnectionEntry(java.lang.String alias,
java.lang.String address,
int port,
int roverPort,
java.lang.String path,
ConnectionEntry.Protocol protocol,
int networkTimeout,
int bufferTime,
int rtspReliable,
java.lang.String passphrase,
ConnectionEntry.Source source)
Construct a connection entry that describes all of the fields that could potentially be
stored to describe a video source.
|
ConnectionEntry(java.lang.String alias,
java.lang.String address,
java.lang.String macAddress,
int port,
int roverPort,
java.lang.String path,
ConnectionEntry.Protocol protocol,
int networkTimeout,
int bufferTime,
int rtspReliable,
ConnectionEntry.Source source)
Deprecated.
as of Android 11 using the machine address is strictly prohibited and unobtainable
|
ConnectionEntry(java.lang.String alias,
java.lang.String address,
java.lang.String macAddress,
int port,
int roverPort,
java.lang.String path,
ConnectionEntry.Protocol protocol,
int networkTimeout,
int bufferTime,
int rtspReliable,
java.lang.String passphrase,
ConnectionEntry.Source source)
Deprecated.
as of Android 11 using the machine address is strictly prohibited and unobtainable
|
Modifier and Type | Method and Description |
---|---|
ConnectionEntry |
copy()
Construct a copy of the Connection Entry for using by the alternative video player and also
for use by the media processor so that the connection entry - if modified does not get messed
up.
|
void |
copy(ConnectionEntry from)
Constructs an exact copy of the ConnectionEntry and even contains the same uid.
|
void |
dispose()
Called once this entry is removed from the manager and not to be used
from this point on
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAddress()
Get the address associated with the alias.
|
java.lang.String |
getAddress(boolean forDisplay)
Get the address associated with the alias.
|
java.lang.String |
getAlias()
The alias assigned to this connection entry.
|
int |
getBufferTime()
Get the time used to buffer an incoming stream.
|
java.util.List<ConnectionEntry> |
getChildren()
Get children entries (only applies to DIRECTORY entries)
|
boolean |
getIgnoreEmbeddedKLV()
If the connection entry contains embedded klv, ignore it if the flag is true.
|
java.io.File |
getLocalFile() |
java.lang.String |
getMacAddress()
Deprecated.
as of Android 11 using the machine address is strictly prohibited and unobtainable
|
int |
getNetworkTimeout()
Get the network timeout associated with the connection entry.
|
java.lang.String |
getParentUID()
Get the parent directory entry
|
java.lang.String |
getPassphrase()
Returns non-empty string if one is to be used to access the video source.
|
java.lang.String |
getPath()
The path for the video connection entry
|
int |
getPort()
The port for the video connection entry
|
java.lang.String |
getPreferredInterfaceAddress()
Gets the preferred ip address for the interface to use.
|
ConnectionEntry.Protocol |
getProtocol()
The protocol associated with the connection entry
|
int |
getRoverPort()
Get the port for any sideband metadata - this would be KLV encoded metadata not carried in
the same udp stream as the video.
|
int |
getRtspReliable()
Returns 1 if rtsp should be force negotiated as reliable (TCP).
|
ConnectionEntry.Source |
getSource()
Gets the source of the Connection Entry (Local or External) used to make sure that it is not
persisted incorrectly if it came from the removable card.
|
java.lang.String |
getUID()
Get the UID for the alias.
|
static java.lang.String |
getURL(ConnectionEntry ce)
Provide the legacy call to getURL which will show all of the sensitive bits and pieces.
|
static java.lang.String |
getURL(ConnectionEntry ce,
boolean forDisplay)
Given a connection entry, produces a well formed URL.
|
static java.lang.String[] |
getUserPassIp(java.lang.String address)
Parses out a username and password combination from the provided
address or url
|
int |
hashCode() |
boolean |
isRemote()
Convenience method for checking if a connection entry is remote based
on its protocol
|
boolean |
isTemporary()
Is the video alias considered temporary.
|
void |
setAddress(java.lang.String address)
Sets the address associated with the alias.
|
void |
setAlias(java.lang.String alias)
Sets the alias for the connection entry.
|
void |
setBufferTime(int bufferTime)
Set the time used to buffer an incoming stream
|
void |
setChildren(java.util.List<ConnectionEntry> children)
Set list of children entries (only applies to DIRECTORY entries)
|
void |
setIgnoreEmbeddedKLV(boolean state)
If the video stream contains metadata, set this flag to hint to the player to ignore any
klv processing.
|
void |
setLocalFile(java.io.File file)
Set the associated local file for this entry
|
void |
setMacAddress(java.lang.String macAddress)
Deprecated.
as of Android 11 using the machine address is strictly prohibited and unobtainable
|
void |
setNetworkTimeout(int networkTimeout)
Set the network timeout associated with the connection entry.
|
void |
setPassphrase(java.lang.String pass)
Set to non-empty string if a passphrase is used to access the video
|
void |
setPath(java.lang.String path)
Set the path for the connection entry
|
void |
setPort(int port)
The port for the video connection entry
|
void |
setPreferredInterfaceAddress(java.lang.String preferredInterfaceAddress)
Sets the preferred ip address for the interface to use.
|
void |
setProtocol(ConnectionEntry.Protocol protocol)
Sets the protocol associated with the connection entry
|
void |
setRoverPort(int port)
Set the port for any sideband metadata - this would be KLV encoded metadata not carried in
the same udp stream as the video.
|
void |
setRtspReliable(int rtspReliable)
Set 1 if rtsp should be force negotiated as reliable (TCP).
|
void |
setSource(ConnectionEntry.Source source)
Sets the source of the connection entry.
|
void |
setTemporary(boolean temp)
Set whether this video alias is temporary and should not be persisted
|
void |
setUID(java.lang.String uid)
Set the UID for the alias.
|
java.lang.String |
toString() |
public static final java.lang.String TAG
public static final java.lang.String EXTRA_CONNECTION_ENTRY
public ConnectionEntry(java.lang.String alias, java.lang.String address, int port, int roverPort, java.lang.String path, ConnectionEntry.Protocol protocol, int networkTimeout, int bufferTime, int rtspReliable, java.lang.String passphrase, ConnectionEntry.Source source)
alias
- a human readable alias for the video stream.address
- the IPv4 address for the video stream.port
- the port used for the specified video stream.roverPort
- UDP sideband metadata traffic from a L3 Com Video Downlink Receiver, provide the
additional rover port, -1 if there is no data.path
- for rtsp and http, provide the path to use when connecting to the stream.protocol
- the protocol for the video stream.networkTimeout
- as specified in milliseconds (should be 5000).bufferTime
- as specified in milliseconds (should be -1 unless required).passphrase
- passphrase to access the source (empty string if not needed)source
- the source of the saved data, either LOCAL_STORAGE or EXTERNAL (by default
should be LOCAL_STORAGE).@Deprecated public ConnectionEntry(java.lang.String alias, java.lang.String address, java.lang.String macAddress, int port, int roverPort, java.lang.String path, ConnectionEntry.Protocol protocol, int networkTimeout, int bufferTime, int rtspReliable, java.lang.String passphrase, ConnectionEntry.Source source)
alias
- a human readable alias for the video stream.address
- the IPv4 address for the video stream.macAddress
- optional MAC address in the form XX:XX:XX:XX:XX:XX identifying the specific
interface where the traffic should be from. This is only applied to MULTICAST UDP
traffic and only applied if the MAC address provided resolves to an interface that
is configured and is up. The MAC address can additionally be null, which will mean
that the system default will be used instead of a particular interface for the
multicast video.port
- the port used for the specified video stream.roverPort
- UDP sideband metadata traffic from a L3 Com Video Downlink Receiver, provide the
additional rover port, -1 if there is no data.path
- for rtsp and http, provide the path to use when connecting to the stream.protocol
- the protocol for the video stream.networkTimeout
- as specified in milliseconds (should be 5000).bufferTime
- as specified in milliseconds (should be -1 unless required).passphrase
- passphrase to access the source (empty string if not needed)source
- the source of the saved data, either LOCAL_STORAGE or EXTERNAL (by default
should be LOCAL_STORAGE).@Deprecated public ConnectionEntry(java.lang.String alias, java.lang.String address, java.lang.String macAddress, int port, int roverPort, java.lang.String path, ConnectionEntry.Protocol protocol, int networkTimeout, int bufferTime, int rtspReliable, ConnectionEntry.Source source)
alias
- a human readable alias for the video stream.address
- the IPv4 address for the video stream.macAddress
- optional MAC address in the form XX:XX:XX:XX:XX:XX identifying the specific
interface where the traffic should be from. This is only applied to MULTICAST UDP
traffic and only applied if the MAC address provided resolves to an interface that
is configured and is up. The MAC address can additionally be null, which will mean
that the system default will be used instead of a particular interface for the
multicast video.port
- the port used for the specified video stream.roverPort
- UDP sideband metadata traffic from a L3 Com Video Downlink Receiver, provide the
additional rover port, -1 if there is no data.path
- for rtsp and http, provide the path to use when connecting to the stream.protocol
- the protocol for the video stream.networkTimeout
- as specified in milliseconds (should be 5000).bufferTime
- as specified in milliseconds (should be -1 unless required).source
- the source of the saved data, either LOCAL_STORAGE or EXTERNAL (by default
should be LOCAL_STORAGE).public ConnectionEntry(java.io.File f)
f
- the filepublic ConnectionEntry(java.lang.String alias, java.lang.String uri)
alias
- the alias that is presented to the user that describes the connection entryuri
- the uri to turn into a connection entry.public ConnectionEntry()
public ConnectionEntry copy()
public void copy(ConnectionEntry from)
from
- the connection entry to copy the details from.public boolean getIgnoreEmbeddedKLV()
public void setIgnoreEmbeddedKLV(boolean state)
state
- public int getRoverPort()
public void setRoverPort(int port)
port
- the port that contains the klvpublic java.lang.String getAlias()
public void setAlias(java.lang.String alias)
alias
- the alias to set, if null is passed in a call to getAlias will return the
empty string.public java.lang.String getUID()
public void setUID(java.lang.String uid)
uid
- the unique identifierpublic java.lang.String getAddress()
public java.lang.String getAddress(boolean forDisplay)
public void setAddress(java.lang.String address)
address
- the address for the Connection Entry.@Deprecated public java.lang.String getMacAddress()
@Deprecated public void setMacAddress(java.lang.String macAddress)
macAddress
- for multicast udp video streams, an optional MAC address can be supplied to
support video streams from a specific interface. For any other input, the video
source is assumed to come from the default interface.public void setPreferredInterfaceAddress(java.lang.String preferredInterfaceAddress)
public java.lang.String getPreferredInterfaceAddress()
public int getPort()
public void setPort(int port)
port
- the port for the entrypublic java.lang.String getPath()
public void setPath(java.lang.String path)
path
- the pathpublic ConnectionEntry.Protocol getProtocol()
public void setProtocol(ConnectionEntry.Protocol protocol)
protocol
- the protocol for the connection entry.public int getNetworkTimeout()
public void setNetworkTimeout(int networkTimeout)
networkTimeout
- the network timeout in millisecondspublic int getBufferTime()
public void setBufferTime(int bufferTime)
bufferTime
- the time in milliseconds to bufferpublic int getRtspReliable()
public void setRtspReliable(int rtspReliable)
rtspReliable
- setting it to 1 will force RTSP to attempt to negotiate a TCP streampublic void setPassphrase(java.lang.String pass)
pass
- passphrase to access the video or empty string if not neededpublic java.lang.String getPassphrase()
public ConnectionEntry.Source getSource()
public void setSource(ConnectionEntry.Source source)
source
- the source.public boolean isRemote()
public void setChildren(java.util.List<ConnectionEntry> children)
children
- List of connection entriespublic java.util.List<ConnectionEntry> getChildren()
public java.lang.String getParentUID()
public void dispose()
public void setLocalFile(java.io.File file)
file
- Local filepublic java.io.File getLocalFile()
public void setTemporary(boolean temp)
temp
- Temporarypublic boolean isTemporary()
public static java.lang.String getURL(ConnectionEntry ce)
public static java.lang.String getURL(ConnectionEntry ce, boolean forDisplay)
forDisplay
- true if URL will be displayed or logged or used in some way other than
an actual connection to the media. This results in sensitive parts of the
URL being obscured.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String[] getUserPassIp(java.lang.String address)
address
- the address of url