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() |
Return | java.sql.Connection |
Description | Get DB connection from DB connection pool in server. |
Common library version | 2.1.x |
writeLog
void writeLog(String message) |
message | log message |
Description | Write log in {ProPTT server dir}/logs/service/PTT.service.log |
Common library version | 2.1.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 | 2.1.x |
OnInitialized
void OnInitialized() |
Description | Notify initialized to PTT server. |
Common library version | 2.1.x |
IVideoPlugin2
getInterfaceVersion
int getInterfaceVersion() |
Return | most be retured INTERFACE_VERSION |
Description | Notify plug-in's INTERFACE version |
Common library version | 2.1.x |
getType
int getType() |
Return | most be retured TYPE_GENERAL_PLUGIN |
Description | Notify plug-in's type |
Common library version | 2.1.x |
initialize
boolean initialize(String arg) |
Return | result of initialize |
Description | initialize plug-in |
Common library version | 2.1.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 | 2.1.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 | 2.1.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 | 2.1.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 | 2.1.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 | 2.1.x |
OnStarted
void OnStarted(String userId, String createDate, int type, int playTime, String jsonParams) |
userId | upload user's id |
createDate | created date of content |
type | type of content, 10:Video, 20:Audio, 30:Picture |
playTime | seconds |
jsonParams | extended parameters |
Description | User connected and open a video channel event |
Common library version | 2.1.x |
OnBulk
void OnBulk(String userId, String createDate, byte[] bulkFrame) |
userId | upload user's id |
createDate | created date of content |
bulkFrame | raw data |
Description | upload packet event |
Common library version | 2.1.x |
OnStopped
void OnStopped(String userId, String createDate); |
userId | upload user's id |
createDate | created date of content |
Description | upload stop event |
Common library version | 2.1.x |
OnError
void OnError(int errCode, String jsonParams) |
errCode | error code. not defined |
jsonParams | extended parameters |
Description | fired error |
Common library version | 2.1.x |
OnExtenedEvent
void OnExtenedEvent(String cmdName, String jsonParams) |
cmdName | commend name. not defined |
jsonParams | extended parameters |
Description | Fired an extended event |
Common library version | 2.1.x |