Reference of IVideoPlugin

Description of IVideoPlugin

Removed at server 9.1.x

IPTTPlugin

ICallback

In plug-in, a developer can use internal API of Video server.

getDBConnection

Connection getDBConnection()
Returnjava.sql.Connection
DescriptionGet DB connection from DB connection pool in server.
Common library version1.0.x

writeLog

void writeLog(String message)
messagelog message
DescriptionWrite log in {ProPTT server dir}/logs/service/PTT.service.log
Common library version1.0.x

writeErrorLog

void writeErrorLog(String message)
messagelog message
DescriptionWrite error log in {ProPTT server dir}/logs/service/PTT.service.log
Common library version1.0.x

OnInitialized

void OnInitialized()
DescriptionNotify initialized to PTT server.
Common library version1.0.x

IVideoPlugin

getInterfaceVersion

int getInterfaceVersion()
Returnmost be retured INTERFACE_VERSION
DescriptionNotify plug-in's INTERFACE version
Common library version1.0.x

getType

int getType()
Returnmost be retured TYPE_GENERAL_PLUGIN
DescriptionNotify plug-in's type
Common library version1.0.x

initialize

boolean initialize(String arg)
Returnresult of initialize
Descriptioninitialize plug-in
Common library version1.0.x

OnCreated

void OnCreated(String userId, int videoChannelId, String jsonParams)
userIdconnected user's id
videoChannelIdcreated video channel id
jsonParamsextended parameters
DescriptionUser connected and create a video channel event
Common library version1.0.x

OnOpened

void OnOpened(String userId, int videoChannelId, String jsonParams)
userIdconnected user's id
videoChannelIdopened video channel id
jsonParamsextended parameters
DescriptionUser connected and open a video channel event
Common library version1.0.x

OnVideo

void OnVideo(int videoChannelId, byte[] subframe)
videoChannelIdopened video channel id
subframevideo frame. see subframe format
Descriptionvideo packet event
Common library version1.0.x

OnAudio

void OnAudio(int videoChannelId, byte[] subframe)
videoChannelIdopened video channel id
subframeaudio frame. see subframe format
Descriptionaudio packet event
Common library version1.0.x
< subframe format >
fieldtypebytesDescription
MediaTrackIDunsigned short2Media Track
FarmIDshort2Farm’s ID
ChannelIDint4Channel’s ID
Timestampunsigned int4Timestamp
FrameTypebyte10: Media, 1: CodecInfo
FrameInfobyte1Audio(Frame Count)
Video(0x1X:R-0, 0x2X:R-90, 0x3X: R-180, 0x4X:R-270 | 0xX0: Mid, 0xX1:End)
PadCountbyte1Padding size
Reservedbyte1Reserved
FrameDatabyte[]Frame's data

OnClosed

public void OnClosed(String userId, int videoChannelId);
userIduser's id
videoChannelIdclosed video channel id
DescriptionClose video channel event
Common library version1.0.x

OnError

void OnError(int errCode, String jsonParams)
errCodeerror code. not defined
jsonParamsextended parameters
Descriptionfired error
Common library version1.0.x

OnExtenedEvent

void OnExtenedEvent(String cmdName, String jsonParams)
cmdNamecommend name. not defined
jsonParamsextended parameters
DescriptionFired an extended event
Common library version1.0.x