Reference of IVideoPlugin3

Description of IVideoPlugin3. (Server 5.1.x~ required)

IPTTPlugin4 IPublicGWPlugin IAdminWebPlugin2

ICallback3

In plug-in, 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 version3.0.x

writeLog

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

writeErrorLog

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

OnInitialized

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

IVideoPlugin3

getInterfaceVersion

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

getType

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

initialize

boolean initialize(String arg)
Returnresult of initialize
Descriptioninitialize plug-in
Common library version3.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 version3.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 version3.0.x

OnVideo

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

OnAudio

void OnAudio(int videoChannelId, byte[] frame)
videoChannelIdopened video channel id
frameaudio frame. see subframe format
Descriptionaudio packet event
Common library version3.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

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

OnUpload

void OnUpload(String userId, long transactionId, int fileChannelId, String createDate, int type, int playTime, String fileName, String jsonParams)
userIdupload user's id
transactionIdupload transactionId unique id
fileChannelIdupload file id
createDatecreated date of content
typetype of content, 10:Video, 20:Audio, 30:Picture
playTimeseconds
fileNameupload file name
jsonParamsextended parameters
DescriptionUser upload event
Common library version3.0.x

OnDownload

void OnDownload(String userId, long transactionId, int fileChannelId, String fileName, String jsonParams
userIddownload user's id
transactionIddownload transactionId unique id
fileChannelIddownload file id
fileNamedownload file name
jsonParamsextended parameters
DescriptionUser download file channel event
Not supported yet
Common library version3.0.x

OnBulk

void OnBulk(String userId, long transactionId, String createDate, byte[] bulkFrame)
userIdupload user's id
transactionIdupload transactionId unique id
createDatecreated date of content
bulkFrameraw data
Descriptionupload or download packet event
Common library version3.0.x

OnStopped

void OnStopped(String userId, long transactionId, String createDate);
userIdupload user's id
transactionIdupload transactionId unique id
createDatecreated date of content
Descriptionupload or downloa stop event
Common library version3.0.x

OnError

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

OnExtenedEvent

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