Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeviceDisconnectedCallback ¶
device disconnected callback, arguments will be: token deviceId and connectionType(video/ctrl)
type Receiver ¶
type Receiver interface {
/**
* start up the receiver
* CAUTION: this a blocking method
* @param listenAddr receiver's listening address
* @param networkBufferSizeKb netowrk buffer size, recommend 2048KB for lagger screens
* @param videoBufferSizeKb video deocder's buffer size
*/
Startup(listenAddr string, networkBufferSizeKb int, videoBufferSizeKb int)
/**
* shutdown the receiver
*/
Shutdown()
/**
* setup image size for a device
* @param deviceId device's id
* @param width image width
* @param height image height
*/
SetFrameImageSize(deviceId string, width int, height int)
/**
* Get frame image size configured for a device
* @param deviceId device's include
* @return the image size struct
*/
GetFrameImageSize(deviceId string) *ImageSize
/**
* Get original frame image size configured for a device
* @param deviceId device's include
* @return the image size struct
*/
GetOriginalFrameImageSize(deviceId string) *ImageSize
/**
* Add frame image callback for device
* @param deviceId device's id
* @param callbackMethod the callback method. (deviceId, png image data, png image size, screen size) in order.
*/
AddFrameImageCallback(deviceId string, callbackMethod func(string, *[]byte, *ImageSize, *ImageSize))
/**
* Remove all frame image callback methods for a device
* @param deviceId device's id
*/
RemoveAllImageCallbacks(deviceId string)
/**
* Add device info callback
* @param deviceId device's id
* @param callbackMethod the callback method. (deviceId, screen width, screen height) in order.
*/
AddDeviceInfoCallback(deviceId string, callbackMethod func(string, int, int))
/**
* Remove all device info callback methods
* @param deviceId device's id
*/
RemoveAllDeviceInfoCallbacks(deviceId string)
/**
* Get instance token name
*/
GetToken() string
/**
* Add controll event send callback
* @param deviceId the device's identifier
* @param callbackMethod callback method ref
* callbackMethod will receive deviceId, msgId, sendStatus, dataLen in order
* dataLen should equals to sendStatus if send ok
**/
AddCtrlEventSendCallback(deviceId string, callbackMethod func(string, string, int, int))
/**
* Remove all callback for controll event sending
* @param deviceId the device's id
**/
RemoveAllCtrlEventSendCallback(deviceId string)
/**
* Send controll events to device
* @param deviceId the device's identifier
* @param msgId msg identifier
* @param data event data
**/
SendCtrlEvent(deviceId string, msgId string, data *[]byte)
/**
* Add a callback for device disconnected
* @param deviceId the device's identifier
* @param callback the callback method
**/
AddDeviceDisconnectedCallback(deviceId string, callback DeviceDisconnectedCallback)
/**
* Remove all callbacks of a device's disconnected event
* @param deviceId the device's identifier
**/
RemoveAllDisconnectedCallbck(deviceId string)
}
Click to show internal directories.
Click to hide internal directories.