Reference of IVideoPlugin2

Description of IVideoPlugin2. (Server 5.0.x~ required)

Depreciated

IPTTPlugin2

ICallback2

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 version2.1.x

writeLog

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

writeErrorLog

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

OnInitialized

void OnInitialized()
DescriptionNotify initialized to PTT server.
Common library version2.1.x

IVideoPlugin2

getInterfaceVersion

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

getType

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

initialize

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

OnVideo

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

OnAudio

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

OnStarted

void OnStarted(String userId, String createDate, int type, int playTime, String jsonParams)
userIdupload user's id
createDatecreated date of content
typetype of content, 10:Video, 20:Audio, 30:Picture
playTimeseconds
jsonParamsextended parameters
DescriptionUser connected and open a video channel event
Common library version2.1.x

OnBulk

void OnBulk(String userId, String createDate, byte[] bulkFrame)
userIdupload user's id
createDatecreated date of content
bulkFrameraw data
Descriptionupload packet event
Common library version2.1.x

OnStopped

void OnStopped(String userId, String createDate);
userIdupload user's id
createDatecreated date of content
Descriptionupload stop event
Common library version2.1.x

OnError

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

OnExtenedEvent

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