Package com.wowza.wms.response
Class ResponseFunction
- Object
-
- com.wowza.wms.response.ResponseFunction
-
public class ResponseFunction extends Object
ResponseFunction: class for sending status messages to the client.
-
-
Field Summary
Fields Modifier and Type Field Description boolean
doBreak
-
Constructor Summary
Constructors Constructor Description ResponseFunction(IClient client)
Create an empty ResponseFunctionResponseFunction(IClient client, AMFObj amfObj)
Create an empty ResponseFunctionResponseFunction(INetConnection netConnection)
Create an empty ResponseFunctionResponseFunction(INetConnection netConnection, AMFObj amfObj)
Create an empty ResponseFunctionResponseFunction(IMediaStream stream, AMFObj amfObj)
Create an empty ResponseFunction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBody(AMFData body)
Add AMFData to the body of the message.void
addBytes(byte[] inbytes)
Add raw AMFData bytes[] to message bodyvoid
createBroadcastMessage(java.nio.ByteBuffer messageBytes)
Create broadcast message.void
createConnectMessage(String inName, double inResultNum)
Create net connection connect message.void
createDefaultMessage(String inName, double inResultNum)
Create a default message (onStatus type messages).void
createEnhancedSeekMessage(byte[] messageBuffer, int src, int tc)
void
createPlayStatusMessage(String inName)
Create onPlayStatus message.void
createSeekMessage(String inName)
Create a seek result message.void
createSOMessage(byte[] messageBuffer, int objectEncoding)
Create shared object message.long
getTimecode()
Get function timecode (milliseconds).int
getType()
Get message type.boolean
isForceAMF0()
void
setBody(int index, AMFData body)
Add AMFData to the body of the message.void
setForceAMF0(boolean forceAMF0)
void
setMessageBytes(byte[] messageBytes)
void
setRetAMFNumber(int innum)
Set the return channel idvoid
setSrc(int src)
Set the src (stream id) for the message.void
setTimecode(long timecode)
Set function timecode (milliseconds).void
setType(int type)
Set message type.int
write(java.io.OutputStream out, boolean isAbsTimecode, int chunkSize)
Write message directly to OutputStreamint
write(java.io.OutputStream out, int chunkSize)
Write message directly to OutputStream.
-
-
-
Constructor Detail
-
ResponseFunction
public ResponseFunction(IClient client)
Create an empty ResponseFunction- Parameters:
client
- client
-
ResponseFunction
public ResponseFunction(INetConnection netConnection)
Create an empty ResponseFunction- Parameters:
netConnection
- net connection
-
ResponseFunction
public ResponseFunction(INetConnection netConnection, AMFObj amfObj)
Create an empty ResponseFunction- Parameters:
netConnection
- net connectionamfObj
- amf object
-
ResponseFunction
public ResponseFunction(IClient client, AMFObj amfObj)
Create an empty ResponseFunction- Parameters:
client
- client objectamfObj
- amf object
-
ResponseFunction
public ResponseFunction(IMediaStream stream, AMFObj amfObj)
Create an empty ResponseFunction- Parameters:
stream
- media stream objectamfObj
- amf object
-
-
Method Detail
-
setSrc
public void setSrc(int src)
Set the src (stream id) for the message.- Parameters:
src
- src (stream id)
-
createDefaultMessage
public void createDefaultMessage(String inName, double inResultNum)
Create a default message (onStatus type messages).- Parameters:
inName
- handler name (example: onStatus)inResultNum
- result number of 0 if not result
-
createConnectMessage
public void createConnectMessage(String inName, double inResultNum)
Create net connection connect message.- Parameters:
inName
- handler name (example: connection)inResultNum
- result number if 0 not a result
-
createSeekMessage
public void createSeekMessage(String inName)
Create a seek result message.- Parameters:
inName
- handler name (example: onStatus)
-
createPlayStatusMessage
public void createPlayStatusMessage(String inName)
Create onPlayStatus message.- Parameters:
inName
- handler name (example: onPlayStatus)
-
setMessageBytes
public void setMessageBytes(byte[] messageBytes)
-
createBroadcastMessage
public void createBroadcastMessage(java.nio.ByteBuffer messageBytes)
Create broadcast message. Used for ByteBuffer handler calls.- Parameters:
messageBytes
- ByteBuffer with raw AMFData bytes to be sent to client
-
createSOMessage
public void createSOMessage(byte[] messageBuffer, int objectEncoding)
Create shared object message. Used for ByteBuffer handler calls.- Parameters:
messageBuffer
-
-
createEnhancedSeekMessage
public void createEnhancedSeekMessage(byte[] messageBuffer, int src, int tc)
-
addBody
public void addBody(AMFData body)
Add AMFData to the body of the message.- Parameters:
body
- AMFData message
-
setBody
public void setBody(int index, AMFData body)
Add AMFData to the body of the message.- Parameters:
index
- index in body listbody
- AMFData message
-
addBytes
public void addBytes(byte[] inbytes)
Add raw AMFData bytes[] to message body- Parameters:
inbytes
- raw AMFData bytes[]
-
setRetAMFNumber
public void setRetAMFNumber(int innum)
Set the return channel id- Parameters:
innum
- return channel id
-
getTimecode
public long getTimecode()
Get function timecode (milliseconds).- Returns:
- function timecode (milliseconds)
-
setTimecode
public void setTimecode(long timecode)
Set function timecode (milliseconds).- Parameters:
timecode
- function timecode (milliseconds)
-
setType
public void setType(int type)
Set message type. See IVHost.CONTENTTYPE_*- Parameters:
type
- message type
-
getType
public int getType()
Get message type. See IVHost.CONTENTTYPE_*- Returns:
- message type
-
write
public int write(java.io.OutputStream out, int chunkSize)
Write message directly to OutputStream.- Parameters:
out
- OutputStream- Returns:
- number of bytes written
-
isForceAMF0
public boolean isForceAMF0()
-
setForceAMF0
public void setForceAMF0(boolean forceAMF0)
-
write
public int write(java.io.OutputStream out, boolean isAbsTimecode, int chunkSize)
Write message directly to OutputStream- Parameters:
out
- OutputStreamisAbsTimecode
- is timecode absolute- Returns:
- number of bytes written
-
-