public abstract class NativeInterface
extends java.lang.Object
Native.| Constructor and Description |
|---|
NativeInterface() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
captureSnapshot(Capability capability,
java.lang.String downloadPath,
int heightPx,
int widthPx,
long timeout,
CapabilitySnapshot.SnapshotListener listener)
A function to capture snapshot from the resource with
CapabilitySnapshot
provided custom aspect ratio, provided timeout and save the snapshot at provided download path. |
protected abstract void |
closeTunnel(Capability tunnel,
long tunnelHandle,
long timeout)
A function to close a tunnel that was previously opened.
|
protected abstract void |
connect(Network network,
int port)
A function to connect to a
Network. |
protected abstract void |
connectWithInvite(Network network,
java.lang.String inviteUrl,
long nodeId)
A function to connect to network using invite url.
|
protected abstract void |
disconnect(Network network)
A function to disconnect from
Network. |
protected abstract void |
executeScene(Scene scene)
A function to execute
Scene. |
protected abstract void |
getAccessTokens(CocoClient.AccessTokensListener listener)
A function to get access token.
|
protected abstract void |
getAllNetworks(CocoClient.NetworkListListener listener)
A function to get all network the user currently part of.
|
protected abstract int[] |
getAvailableChannelPorts(Device device,
int portCount)
A Media streaming helper function to get free ports to talk to the device param.
|
protected abstract int[] |
getHandlingChannelPorts(long streamHandle)
A Media Streaming helper function to fetch channel ports from SDK.
|
protected abstract Resource |
getHandlingResource(long streamHandle)
A Media streaming helper function to get resource with
MediaStreamingCapability from SDK. |
protected abstract long |
getHandlingStreamId(long streamHandle)
A Media streaming helper function to get stream ID from SDK.
|
protected abstract int |
getHandlingStreamSessionId(long streamHandle)
A Media Streaming helper function to fetch stream session ID from SDK.
|
protected abstract Network[] |
getSavedNetworks()
A function to get saved networks.
|
protected abstract java.lang.String |
getVersion()
A function to get version info of Client SDK.
|
protected abstract void |
informNetworkChange()
A function to inform SDK that the networks is changed from 4G to Wi-Fi and vice versa.
|
protected abstract void |
init(java.lang.String cwdPath,
java.lang.String appAccessList,
java.lang.String clientId,
java.lang.String downloadPath,
CocoClient.ConnectivityTimers timers)
This function initializes the SDK.
|
protected abstract void |
invalidateAccessToken()
A function to invalidate the current accessToken.
|
protected abstract void |
leaveNetwork(Network network,
Network.LeaveStatusListener listener)
A function to leave
Network. |
protected abstract void |
openTunnel(Capability tunnel,
java.lang.String forwardHostName,
int forwardHostPort,
java.lang.String listeningHostName,
int listeningHostPort,
CapabilityTunnel.IpVersion ipVersion,
CapabilityTunnel.Protocol tunnelProtocol,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.TransportType transportType,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
A function to establish a tunnel connection
that facilitates exchange of packets with a resource.
|
protected abstract void |
sendContentInfo(Network network,
long contentTime,
java.lang.String data,
long[] nodeIds)
This function sends content info message to the destination nodes specified.
|
protected abstract void |
sendData(Network network,
java.lang.String data,
long[] nodeIds)
A function to send data to other nodes.
|
protected abstract void |
sendDeviceManagementCommand(Device device,
Command<Device.CommandId> command,
Device.DeviceManagementStatusListener listener)
A function to send device management commands.
|
protected abstract void |
sendInfoRequest(InfoRequest infoRequest,
Device.InfoRequestStatusListener listener)
A function to send info request.
|
protected abstract void |
sendInfoResponse(InfoResponse infoResponse,
Device.InfoResponseStatusListener listener)
A function to send info response to info request sent by
Device. |
protected abstract int |
sendMediaStreamData(long streamHandle,
int channelPort,
long frameIndex,
int frameType,
long frameDuration,
long framePts,
java.nio.ByteBuffer data)
This function sends stream data.
|
protected abstract void |
sendNetworkManagementCommand(Network network,
Command<Network.CommandId> command,
Network.NetworkManagementStatusListener listener)
A function to send network management command.Check
Network.CommandId for
network management commands. |
protected abstract void |
sendResourceCommand(Capability capability,
Command<? extends Capability.CommandId> command,
Capability.CommandStatusListener<?> listener)
A function to execute command on a resource.
|
protected abstract void |
setConnectivityMode(CocoClient.ConnectivityMode mode)
A function to set
CocoClient.ConnectivityMode. |
protected abstract void |
setTokens(java.lang.String response)
A function to set tokens which will be used during HTTP calls.
|
protected abstract void |
startMediaStream(Capability capability,
long streamId,
int streamSessionId,
java.lang.String streamDescription,
int[] channelPorts,
CapabilityMediaStreaming.TransportType[] transportTypes,
CapabilityMediaStreaming.MediaSessionType sessionType,
long timeout,
CapabilityMediaStreaming.MediaStreamListener listener)
This function starts a media stream.
|
protected abstract void |
stopMediaStream(long streamHandle)
A function to stop the stream.
|
protected abstract void init(java.lang.String cwdPath,
java.lang.String appAccessList,
java.lang.String clientId,
java.lang.String downloadPath,
CocoClient.ConnectivityTimers timers)
cwdPath - Current working directory for storing config files.appAccessList - The list of capabilities that the app will be using.clientId - The client id generated for the developer.downloadPath - Directory for temporary file storage.timers - Useful to define SDK connectivity timers.CocoClient.ConnectivityTimersprotected abstract Network[] getSavedNetworks()
protected abstract void getAllNetworks(CocoClient.NetworkListListener listener)
listener - The listener that would be triggered with result.protected abstract void connect(Network network, int port)
Network.network - Network to which user needs to connect.port - Port over which connection should happen.protected abstract void disconnect(Network network)
Network.network - network from which user needs to disconnect.protected abstract void leaveNetwork(Network network, Network.LeaveStatusListener listener)
Network.network - Network from which user want to leave.listener - Network.LeaveStatusListener which would be triggered with result.protected abstract void sendInfoResponse(InfoResponse infoResponse, Device.InfoResponseStatusListener listener)
Device.infoResponse - InfoResponselistener - Device.InfoResponseStatusListener that would be triggered with result.protected abstract void sendResourceCommand(Capability capability, Command<? extends Capability.CommandId> command, Capability.CommandStatusListener<?> listener)
capability - Capability on which command need to be executed.command - Command of the Capabilitylistener - Capability.CommandStatusListener that would be triggered with result.protected abstract void setTokens(java.lang.String response)
response - tokens. //TODO: change argument name.protected abstract void openTunnel(Capability tunnel, java.lang.String forwardHostName, int forwardHostPort, java.lang.String listeningHostName, int listeningHostPort, CapabilityTunnel.IpVersion ipVersion, CapabilityTunnel.Protocol tunnelProtocol, CapabilityTunnel.TunnelType tunnelType, CapabilityTunnel.TransportType transportType, long timeout, CapabilityTunnel.TunnelStatusListener listener)
tunnel - CapabilityTunnel instance to be opened.forwardHostName - The hostname which will receive the data.forwardHostPort - The port over which the packets will be exchanged.listeningHostName - The hostname of the transmitting device.listeningHostPort - The port over which the device will transmit data.ipVersion - The ipVersion used for identification (ipV4/ipV6).tunnelProtocol - The protocol of the data exchange in tunnel,
should be one of
CapabilityTunnel.AttributeId.SUPPORTED_PROTOCOL_ARR (RTSP).tunnelType - The type of the tunnel CapabilityTunnel.TunnelType
(LISTEN/CONNECT).transportType - The TransportType (TCP/UDP) on which the transmission
shall take place.timeout - The timeout for this command in millis.listener - The listener which will be triggered after the callback. This will be
useful in tracking in tunnelStatusCbs.protected abstract void closeTunnel(Capability tunnel, long tunnelHandle, long timeout)
tunnel - CapabilityTunnel instance to be closed.tunnelHandle - The handle responsible for tunneling.timeout - The timeout for the command.protected abstract void getAccessTokens(CocoClient.AccessTokensListener listener)
listener - CocoClient.AccessTokensListener that would be triggered with result.protected abstract void sendNetworkManagementCommand(Network network, Command<Network.CommandId> command, Network.NetworkManagementStatusListener listener)
Network.CommandId for
network management commands.network - Network on which command needs to be executed.command - commands which needs to be sent.listener - Network.NetworkManagementStatusListener that would be triggeredprotected abstract void sendDeviceManagementCommand(Device device, Command<Device.CommandId> command, Device.DeviceManagementStatusListener listener)
device - Device on which this command need to be executed.command - Device.CommandId which needs to be sent.listener - Device.DeviceManagementStatusListener trigger that
would be triggered with result.protected abstract void executeScene(Scene scene)
Scene.scene - Scene which needs to be executed.protected abstract void connectWithInvite(Network network, java.lang.String inviteUrl, long nodeId)
network - Network to which user need to connect.inviteUrl - The generated invite URL.nodeId - Node ID of user to be invited.protected abstract void sendInfoRequest(InfoRequest infoRequest, Device.InfoRequestStatusListener listener)
infoRequest - Info request that should be sent.listener - Device.InfoRequestStatusListener that would be triggered with result.protected abstract void startMediaStream(Capability capability, long streamId, int streamSessionId, java.lang.String streamDescription, int[] channelPorts, CapabilityMediaStreaming.TransportType[] transportTypes, CapabilityMediaStreaming.MediaSessionType sessionType, long timeout, CapabilityMediaStreaming.MediaStreamListener listener)
capability - CapabilityMediaStreaming.streamId - ID of the stream.streamSessionId - The interface over which the callbacks should be received.streamDescription - The description (probably in SDP or other
formats supported by the capability)channelPorts - The Ports over which this communication should take place.transportTypes - The transportTypes corresponding to the channels.sessionType - The MediaSessionType of this stream.timeout - The timeout for this command in millis.listener - The listeners over which the callbacks will be propagated.protected abstract void stopMediaStream(long streamHandle)
streamHandle - A non zero long value representing a native pointer.protected abstract void captureSnapshot(Capability capability, java.lang.String downloadPath, int heightPx, int widthPx, long timeout, CapabilitySnapshot.SnapshotListener listener)
CapabilitySnapshot
provided custom aspect ratio, provided timeout and save the snapshot at provided download path.capability - CapabilitySnapshot instance of the resource.downloadPath - The path to the file which has to be downloaded.
NOTE: This should be the absolute pathheightPx - The height of the image which has to be downloaded.widthPx - The width of the image which has to be downloaded.timeout - The timeout for this command.listener - The listener which will be triggered after the callback.protected abstract int sendMediaStreamData(long streamHandle,
int channelPort,
long frameIndex,
int frameType,
long frameDuration,
long framePts,
java.nio.ByteBuffer data)
streamHandle - A non zero long value representing a native pointer.channelPort - The port over which this communication should take place.frameIndex - Index which increments on every call.frameType - Type of frame as in CapabilityMediaStreaming.FrameTypes.frameDuration - Duration for each frame.framePts - Presentation time stamp of when this frame is displayed.data - A byte buffer comprising data.protected abstract int[] getAvailableChannelPorts(Device device, int portCount)
device - Device instance for which the request is made.portCount - Required number of ports.protected abstract Resource getHandlingResource(long streamHandle)
MediaStreamingCapability from SDK.streamHandle - A non zero long value representing a native pointer.Resource as stored by stream handle.protected abstract long getHandlingStreamId(long streamHandle)
streamHandle - A non zero long value representing a native pointer.protected abstract int getHandlingStreamSessionId(long streamHandle)
streamHandle - A non zero long value representing a native pointer.protected abstract int[] getHandlingChannelPorts(long streamHandle)
streamHandle - A non zero long value representing a native pointer.protected abstract void setConnectivityMode(CocoClient.ConnectivityMode mode)
CocoClient.ConnectivityMode.mode - CocoClient.ConnectivityMode.protected abstract void invalidateAccessToken()
protected abstract java.lang.String getVersion()
String.protected abstract void informNetworkChange()
protected abstract void sendData(Network network, java.lang.String data, long[] nodeIds)
network - Network on which data needs to be sent.data - Data that needs to be sent.nodeIds - ID of nodes to which data needs to be sent.protected abstract void sendContentInfo(Network network, long contentTime, java.lang.String data, long[] nodeIds)
network - The network in which the message has to be sent.contentTime - The base time which will be used for tx delays.data - The content of the message that has to be sent.nodeIds - The destination nodes that will receive the message.