public class CapabilityMediaStreaming extends Capability
Modifier and Type | Class and Description |
---|---|
static class |
CapabilityMediaStreaming.AttributeId
enum denoting various possible attributes of the
CapabilityMediaStreaming . |
static class |
CapabilityMediaStreaming.CommandId
enum denoting the possible Commands that can be sent for
CapabilityMediaStreaming . |
static class |
CapabilityMediaStreaming.ConfigRecording
This class can be sent as an argument to
Capability.sendResourceCommand(buzz.getcoco.iot.Command<T>, buzz.getcoco.iot.Capability.CommandStatusListener<T>) while sending configure recording commands. |
static class |
CapabilityMediaStreaming.DefaultMediaStreamListenerMultiplexer
This class has the ability to multiplex the calls over individual channels.
|
static class |
CapabilityMediaStreaming.FrameTypes
possible values of frame types for the media streaming capability.
|
static class |
CapabilityMediaStreaming.MediaSessionType
possible values of media session type for the media streaming capability.
|
static interface |
CapabilityMediaStreaming.MediaStreamListener
Listener that receives updates from callbacks.
|
static interface |
CapabilityMediaStreaming.MediaStreamListenerMultiplexer
This interface has the relevant signatures to multiplex the calls over individual channels.
|
static class |
CapabilityMediaStreaming.RecordMode
possible values of record mode for the media streaming capability.
|
static class |
CapabilityMediaStreaming.StartRecording
This class can be sent as an argument to
Capability.sendResourceCommand(buzz.getcoco.iot.Command<T>, buzz.getcoco.iot.Capability.CommandStatusListener<T>) while sending start recording commands. |
static class |
CapabilityMediaStreaming.Status
possible values of media stream status for the media streaming capability.
|
static class |
CapabilityMediaStreaming.StopRecording
This class can be sent as an argument to
Capability.sendResourceCommand(buzz.getcoco.iot.Command<T>, buzz.getcoco.iot.Capability.CommandStatusListener<T>) while sending stop recording commands. |
static class |
CapabilityMediaStreaming.TransportType
possible values of media transport type for the media streaming capability.
|
Capability.CapabilityId, Capability.CommandStatusListener<T extends Capability.CommandId>
Modifier and Type | Field and Description |
---|---|
static Capability.CapabilityId |
ID |
Modifier | Constructor and Description |
---|---|
protected |
CapabilityMediaStreaming(int id,
Resource parent)
Constructor of the current class.
|
Modifier and Type | Method and Description |
---|---|
protected Command<? extends Capability.CommandId> |
extendedCreateCommand(int primitiveCommandId,
com.google.gson.JsonElement commandParams)
A function to create the command from the Json params.
|
int[] |
getAvailableChannelPorts(int portCount) |
static Capability |
getHandlingCapability(long streamHandle)
This function fetches the capability that is using provided stream handle.
|
static int[] |
getHandlingChannelPorts(long streamHandle) |
static long |
getHandlingStreamId(long streamHandle) |
static int |
getHandlingStreamSessionId(long streamHandle) |
protected <T extends Capability.CommandId> |
interceptCommand(Command<T> command) |
int |
sendData(long streamHandle,
int channelPort,
long frameIndex,
int frameType,
long frameDuration,
long framePts,
byte[] data,
int offset,
int size)
This function sends data for communication.
|
int |
sendData(long streamHandle,
int channelPort,
long frameIndex,
int frameType,
long frameDuration,
long framePts,
java.nio.ByteBuffer data)
This function sends data for communication.
|
int[] |
startStream(long streamId,
int streamSessionId,
java.lang.String streamDescription,
CapabilityMediaStreaming.TransportType[] transportTypes,
CapabilityMediaStreaming.MediaSessionType sessionType,
long timeout,
CapabilityMediaStreaming.MediaStreamListener listener)
A function to start streaming using this capability.
|
void |
startStream(long streamId,
int streamSessionId,
java.lang.String streamDescription,
int[] channelPorts,
CapabilityMediaStreaming.TransportType[] transportTypes,
CapabilityMediaStreaming.MediaSessionType sessionType,
long timeout,
CapabilityMediaStreaming.MediaStreamListener listener)
A function to start streaming using this capability.
|
void |
stopStream(long streamHandle) |
boolean |
supports(Capability.CommandId commandId)
This function checks if a command is supported or not, pass
null to check if capability supports any commands at all.
|
clearAndSetStandardCommandSet, containsAttribute, containsAttribute, createCommand, createCommandResponseArgs, getAttribute, getAttribute, getAttributeMap, getCapabilityWrapper, getId, getName, getParent, getSupportedCommands, hashCode, internalAddAttribute, internalMarkAsReady, internalRemoveAttribute, internalSetName, internalSetParent, isReady, iterator, sendResourceCommand, setCapabilityWrapper, toString
public static final Capability.CapabilityId ID
protected CapabilityMediaStreaming(int id, Resource parent)
id
- The unique id Of the capabilityparent
- The parent Resource of the capability.public boolean supports(Capability.CommandId commandId)
Capability
supports
in class Capability
commandId
- The Id denoting the command to be sent.public static Capability getHandlingCapability(long streamHandle)
streamHandle
- a non zero long value representing a native pointerResource.getCapability(buzz.getcoco.iot.Capability.CapabilityId)
public static long getHandlingStreamId(long streamHandle)
public static int getHandlingStreamSessionId(long streamHandle)
public static int[] getHandlingChannelPorts(long streamHandle)
protected Command<? extends Capability.CommandId> extendedCreateCommand(int primitiveCommandId, com.google.gson.JsonElement commandParams)
Capability
extendedCreateCommand
in class Capability
primitiveCommandId
- The int form of the commandIdcommandParams
- The Json params that can form a commandpublic int[] getAvailableChannelPorts(int portCount)
public int[] startStream(long streamId, int streamSessionId, java.lang.String streamDescription, CapabilityMediaStreaming.TransportType[] transportTypes, CapabilityMediaStreaming.MediaSessionType sessionType, long timeout, CapabilityMediaStreaming.MediaStreamListener listener)
streamId
- The ID over which this communication should take placestreamSessionId
- The sessionId which you would like to providestreamDescription
- The description (probably in SDP or other
formats supported by the capability)transportTypes
- The transportTypes corresponding to the channelssessionType
- An enum denoting session is live/bufferedtimeout
- The timeout for this command in millislistener
- The interface over which the callbacks should be receivedpublic void startStream(long streamId, int streamSessionId, java.lang.String streamDescription, int[] channelPorts, CapabilityMediaStreaming.TransportType[] transportTypes, CapabilityMediaStreaming.MediaSessionType sessionType, long timeout, CapabilityMediaStreaming.MediaStreamListener listener)
streamId
- The ID over which this communication should take placestreamSessionId
- The sessionId which you would like to providestreamDescription
- The description (probably in SDP or other
formats supported by the capability)channelPorts
- The Ports over which this communication should take placetransportTypes
- The transportTypes corresponding to the channelslistener
- The interface over which the callbacks should be receivedtimeout
- The timeout for this command in millis
NOTE: For multiplexing ability over individualChannels see:
CapabilityMediaStreaming.MediaStreamListenerMultiplexer
and
CapabilityMediaStreaming.DefaultMediaStreamListenerMultiplexer
public int sendData(long streamHandle, int channelPort, long frameIndex, int frameType, long frameDuration, long framePts, byte[] data, int offset, int size)
streamHandle
- a non zero long value representing a native pointerchannelPort
- The Port over which this communication should take placeframeIndex
- index offrameType
- frame type as present in CapabilityMediaStreaming.FrameTypes
frameDuration
- duration for each frameframePts
- presentation time stamp fielddata
- byte array of data to be sentoffset
- offset to included for communication delaysize
- size of the frame datapublic int sendData(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 pointerchannelPort
- The Port over which this communication should take placeframeIndex
- index which increments on every callframeType
- frame type as present in CapabilityMediaStreaming.FrameTypes
frameDuration
- duration for each frameframePts
- presentation time stamp of when this frame is displayed.data
- byte buffer comprising data and offsetpublic void stopStream(long streamHandle)
protected <T extends Capability.CommandId> void interceptCommand(Command<T> command)
interceptCommand
in class Capability