| OpenJPEG
    2.3.0
    | 
Go to the source code of this file.
| Macros | |
| #define | NUM_OF_MSGTYPES 9 | 
| Typedefs | |
| typedef enum eMSGTYPE | msgtype_t | 
| Enumerations | |
| enum | eMSGTYPE { JPIPSTREAM, PNMREQ, XMLREQ, TIDREQ, CIDREQ, CIDDST, SIZREQ, JP2SAVE, QUIT, MSGERROR } | 
| Functions | |
| msgtype_t | identify_clientmsg (SOCKET connected_socket) | 
| indeitify client message type  More... | |
| Byte_t * | receive_JPIPstream (SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen) | 
| receive a JPT- JPP- stream from client  More... | |
| void | send_PNMstream (SOCKET connected_socket, Byte_t *pnmstream, unsigned int width, unsigned int height, unsigned int numofcomp, Byte_t maxval) | 
| send PGM/PPM image stream to the client  More... | |
| void | send_XMLstream (SOCKET connected_socket, Byte_t *xmlstream, OPJ_SIZE_T length) | 
| send XML data stream to the client  More... | |
| void | send_TIDstream (SOCKET connected_socket, const char *tid, OPJ_SIZE_T tidlen) | 
| send TID data stream to the client  More... | |
| void | send_CIDstream (SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen) | 
| send CID data stream to the client  More... | |
| void | send_SIZstream (SOCKET connected_socket, unsigned int width, unsigned int height) | 
| send SIZ data stream to the client  More... | |
| void | response_signal (SOCKET connected_socket, OPJ_BOOL succeed) | 
| send response signal to the client  More... | |
PROTOCOL specification to communicate with opj_dec_server
Cache JPT- JPP- stream in server
client -> server: JPIP-stream\n version 1.1\n (optional for cid registration: targetnamestring\n tidstring\n cidstring\n) bytelengthvalue\n data 
 server -> client: 1 or 0 (of 1Byte response signal)
Get decoded PGM/PPM image
client -> server: PNM request\n [cid/tid]string\n fw\n fh\n 
 server -> client: P6 or P5 (2Byte) width (2Byte Big endian) height (2Byte Big endian) maxval (1Byte) data
Get XML data
client -> server: XML request\n 
 server -> client: XML (3Byte) length (2Byte Big endian) data
Get target ID of target image
client -> server: TID request\n targetname\n 
 server -> client: TID (3Byte) length (1Byte) tiddata
Get Channel ID of identical target image
client -> server: CID request\n targetname\n 
 server -> client: CID (3Byte) length (1Byte) ciddata
Close Channel ID
client -> server: CID destroy\n ciddata 
 server -> client: 1 or 0 (of 1Byte response signal)
Get original size of image
client -> server: SIZ request\n tidstring\n cidstring\n 
 server -> client: SIZ (3Byte) width (3Byte Big endian) height (3Byte Big endian)
Save in JP2 file format
client -> server: JP2 save\n ciddata 
 server -> client: 1 or 0 (of 1Byte response signal)
Quit the opj_dec_server program
client -> server: quit or QUIT
| #define NUM_OF_MSGTYPES 9 | 
Referenced by identify_clientmsg().
| enum eMSGTYPE | 
indeitify client message type
| [in] | connected_socket | file descriptor of the connected socket | 
References BUF_LEN, MSGERROR, NUM_OF_MSGTYPES, and receive_line().
Referenced by handle_clientreq().
| Byte_t* receive_JPIPstream | ( | SOCKET | connected_socket, | 
| char ** | target, | ||
| char ** | tid, | ||
| char ** | cid, | ||
| OPJ_SIZE_T * | streamlen | ||
| ) | 
receive a JPT- JPP- stream from client
| [in] | connected_socket | file descriptor of the connected socket | 
| [out] | target | address of received target file name string pointer ( malloced, if not received, NULL) | 
| [out] | tid | address of received target identifier string pointer ( malloced, if not received, null string) | 
| [out] | cid | address of received channel identifier string pointer ( malloced, if not received, null string) | 
| [out] | streamlen | length of the received codestream | 
References BUF_LEN, receive_line(), and receive_stream().
Referenced by handle_JPIPstreamMSG().
send response signal to the client
| [in] | connected_socket | file descriptor of the connected socket | 
| [in] | succeed | whether if the requested process succeeded | 
References send_stream().
Referenced by handle_dstCIDreqMSG(), and handle_JPIPstreamMSG().
| void send_CIDstream | ( | SOCKET | connected_socket, | 
| const char * | cid, | ||
| OPJ_SIZE_T | cidlen | ||
| ) | 
send CID data stream to the client
| [in] | connected_socket | file descriptor of the connected socket | 
| [in] | cid | cid string | 
| [in] | cidlen | legnth of the cid string | 
References send_IDstream().
Referenced by handle_CIDreqMSG().
| void send_PNMstream | ( | SOCKET | connected_socket, | 
| Byte_t * | pnmstream, | ||
| unsigned int | width, | ||
| unsigned int | height, | ||
| unsigned int | numofcomp, | ||
| Byte_t | maxval | ||
| ) | 
send PGM/PPM image stream to the client
| [in] | connected_socket | file descriptor of the connected socket | 
| [in] | pnmstream | PGM/PPM image codestream | 
| [in] | width | width of the PGM/PPM image (different from the original image) | 
| [in] | height | height of the PGM/PPM image | 
| [in] | numofcomp | number of components of the image | 
| [in] | maxval | maximum value of the image (only 255 supported) | 
References send_stream().
Referenced by handle_PNMreqMSG().
| void send_SIZstream | ( | SOCKET | connected_socket, | 
| unsigned int | width, | ||
| unsigned int | height | ||
| ) | 
send SIZ data stream to the client
| [in] | connected_socket | file descriptor of the connected socket | 
| [in] | width | original width of the image | 
| [in] | height | original height of the image | 
References send_stream().
Referenced by handle_SIZreqMSG().
| void send_TIDstream | ( | SOCKET | connected_socket, | 
| const char * | tid, | ||
| OPJ_SIZE_T | tidlen | ||
| ) | 
send TID data stream to the client
| [in] | connected_socket | file descriptor of the connected socket | 
| [in] | tid | tid string | 
| [in] | tidlen | legnth of the tid string | 
References send_IDstream().
Referenced by handle_TIDreqMSG().
| void send_XMLstream | ( | SOCKET | connected_socket, | 
| Byte_t * | xmlstream, | ||
| OPJ_SIZE_T | length | ||
| ) | 
send XML data stream to the client
| [in] | connected_socket | file descriptor of the connected socket | 
| [in] | xmlstream | xml data stream | 
| [in] | length | legnth of the xml data stream | 
References send_IDstream(), and send_stream().
Referenced by handle_XMLreqMSG().
 1.8.13
 1.8.13