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() |
| Return | java.sql.Connection |
| Description | Get DB connection from DB connection pool in server. |
| Common library version | 3.0.x |
writeLog
| void writeLog(String message) |
| message | log message |
| Description | Write log in {ProPTT server dir}/logs/service/PTT.service.log |
| Common library version | 3.0.x |
writeErrorLog
| void writeErrorLog(String message) |
| message | log message |
| Description | Write error log in {ProPTT server dir}/logs/service/PTT.service.log |
| Common library version | 3.0.x |
OnInitialized
| void OnInitialized() |
| Description | Notify initialized to PTT server. |
| Common library version | 3.0.x |
IVideoPlugin3
getInterfaceVersion
| int getInterfaceVersion() |
| Return | most be retured INTERFACE_VERSION |
| Description | Notify plug-in's INTERFACE version |
| Common library version | 3.0.x |
getType
| int getType() |
| Return | most be retured TYPE_GENERAL_PLUGIN |
| Description | Notify plug-in's type |
| Common library version | 3.0.x |
initialize
| boolean initialize(String arg) |
| Return | result of initialize |
| Description | initialize plug-in |
| Common library version | 3.0.x |
OnCreated
| void OnCreated(String userId, int videoChannelId, String jsonParams) |
| userId | connected user's id |
| videoChannelId | created video channel id |
| jsonParams | extended parameters |
| Description | User connected and create a video channel event |
| Common library version | 3.0.x |
OnOpened
| void OnOpened(String userId, int videoChannelId, String jsonParams) |
| userId | connected user's id |
| videoChannelId | opened video channel id |
| jsonParams | extended parameters |
| Description | User connected and open a video channel event |
| Common library version | 3.0.x |
OnVideo
| void OnVideo(int videoChannelId, byte[] subframe) |
| videoChannelId | opened video channel id |
| subframe | video frame. see subframe format |
| Description | video packet event |
| Common library version | 3.0.x |
OnAudio
| void OnAudio(int videoChannelId, byte[] frame) |
| videoChannelId | opened video channel id |
| frame | audio frame. see subframe format |
| Description | audio packet event |
| Common library version | 3.0.x |
< subframe format >
| field | type | bytes | Description |
| MediaTrackID | unsigned short | 2 | Media Track |
| FarmID | short | 2 | Farm’s ID |
| ChannelID | int | 4 | Channel’s ID |
| Timestamp | unsigned int | 4 | Timestamp |
| FrameType | byte | 1 | 0: Media, 1: CodecInfo |
| FrameInfo | byte | 1 | Audio(Frame Count) Video(0x1X:R-0, 0x2X:R-90, 0x3X: R-180, 0x4X:R-270 | 0xX0: Mid, 0xX1:End) |
| PadCount | byte | 1 | Padding size |
| Reserved | byte | 1 | Reserved |
| FrameData | byte[] | | Frame's data |
OnClosed
| void OnClosed(String userId, int videoChannelId); |
| userId | user's id |
| videoChannelId | closed video channel id |
| Description | Close video channel event |
| Common library version | 3.0.x |
OnUpload
| void OnUpload(String userId, long transactionId, int fileChannelId, String createDate, int type, int playTime, String fileName, String jsonParams) |
| userId | upload user's id |
| transactionId | upload transactionId unique id |
| fileChannelId | upload file id |
| createDate | created date of content |
| type | type of content, 10:Video, 20:Audio, 30:Picture |
| playTime | seconds |
| fileName | upload file name |
| jsonParams | extended parameters |
| Description | User upload event |
| Common library version | 3.0.x |
OnDownload
| void OnDownload(String userId, long transactionId, int fileChannelId, String fileName, String jsonParams |
| userId | download user's id |
| transactionId | download transactionId unique id |
| fileChannelId | download file id |
| fileName | download file name |
| jsonParams | extended parameters |
| Description | User download file channel event Not supported yet |
| Common library version | 3.0.x |
OnBulk
| void OnBulk(String userId, long transactionId, String createDate, byte[] bulkFrame) |
| userId | upload user's id |
| transactionId | upload transactionId unique id |
| createDate | created date of content |
| bulkFrame | raw data |
| Description | upload or download packet event |
| Common library version | 3.0.x |
OnStopped
| void OnStopped(String userId, long transactionId, String createDate); |
| userId | upload user's id |
| transactionId | upload transactionId unique id |
| createDate | created date of content |
| Description | upload or downloa stop event |
| Common library version | 3.0.x |
OnError
| void OnError(int errCode, String jsonParams) |
| errCode | error code. not defined |
| jsonParams | extended parameters |
| Description | fired error |
| Common library version | 3.0.x |
OnExtenedEvent
| void OnExtenedEvent(String cmdName, String jsonParams) |
| cmdName | commend name. not defined |
| jsonParams | extended parameters |
| Description | Fired an extended event |
| Common library version | 3.0.x |