OpenJPEG  2.4.0
Functions
imgsock_manager.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "imgsock_manager.h"

Functions

msgtype_t identify_clientmsg (SOCKET connected_socket)
 indeitify client message type More...
 
Byte_treceive_JPIPstream (SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen)
 receive a JPT- JPP- stream from 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_IDstream (SOCKET connected_socket, const char *id, OPJ_SIZE_T idlen, const char *label)
 
void send_CIDstream (SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen)
 send CID 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_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_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...
 

Function Documentation

msgtype_t identify_clientmsg ( SOCKET  connected_socket)

indeitify client message type

Parameters
[in]connected_socketfile descriptor of the connected socket
Returns
message type

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

Parameters
[in]connected_socketfile descriptor of the connected socket
[out]targetaddress of received target file name string pointer ( malloced, if not received, NULL)
[out]tidaddress of received target identifier string pointer ( malloced, if not received, null string)
[out]cidaddress of received channel identifier string pointer ( malloced, if not received, null string)
[out]streamlenlength of the received codestream
Returns
JPT- JPP- codestream

References BUF_LEN, receive_line(), and receive_stream().

Referenced by handle_JPIPstreamMSG().

void response_signal ( SOCKET  connected_socket,
OPJ_BOOL  succeed 
)

send response signal to the client

Parameters
[in]connected_socketfile descriptor of the connected socket
[in]succeedwhether 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

Parameters
[in]connected_socketfile descriptor of the connected socket
[in]cidcid string
[in]cidlenlegnth of the cid string

References send_IDstream().

Referenced by handle_CIDreqMSG().

void send_IDstream ( SOCKET  connected_socket,
const char *  id,
OPJ_SIZE_T  idlen,
const char *  label 
)
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

Parameters
[in]connected_socketfile descriptor of the connected socket
[in]pnmstreamPGM/PPM image codestream
[in]widthwidth of the PGM/PPM image (different from the original image)
[in]heightheight of the PGM/PPM image
[in]numofcompnumber of components of the image
[in]maxvalmaximum 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

Parameters
[in]connected_socketfile descriptor of the connected socket
[in]widthoriginal width of the image
[in]heightoriginal 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

Parameters
[in]connected_socketfile descriptor of the connected socket
[in]tidtid string
[in]tidlenlegnth 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

Parameters
[in]connected_socketfile descriptor of the connected socket
[in]xmlstreamxml data stream
[in]lengthlegnth of the xml data stream

References send_IDstream(), and send_stream().

Referenced by handle_XMLreqMSG().