OpenJPEG: dec_clientmsg_handler.h Source File

OpenJPEG 2.3.1

dec_clientmsg_handler.h
Go to the documentation of this file.
1 /*
2 * $Id$
3 *
4 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
5 * Copyright (c) 2002-2014, Professor Benoit Macq
6 * Copyright (c) 2010-2011, Kaori Hagihara
7 * Copyright (c) 2011, Lucian Corlaciu, GSoC
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifndef DEC_CLIENTMSG_HANDLER_H_
33 # define DEC_CLIENTMSG_HANDLER_H_
34
35 #include "imgsock_manager.h"
36 #include "cache_manager.h"
37 #include "byte_manager.h"
38 #include "msgqueue_manager.h"
39
49 void handle_JPIPstreamMSG(SOCKET connected_socket, cachelist_param_t *cachelist,
50 Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
51
60 void handle_PNMreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
61 msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
62
70 void handle_XMLreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
71 cachelist_param_t *cachelist);
72
79 void handle_TIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist);
80
87 void handle_CIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist);
88
95 void handle_dstCIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist);
96
105 void handle_SIZreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
106 msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
107
116 void handle_JP2saveMSG(SOCKET connected_socket, cachelist_param_t *cachelist,
117 msgqueue_param_t *msgqueue, Byte_t *jpipstream);
118
119
120 #endif /* !DEC_CLIENTMSG_HANDLER_H_ */
search_cache
cache_param_t * search_cache(const char targetname[], cachelist_param_t *cachelist)
search a cache by target name
Definition: cache_manager.c:113
add_cachecid
void add_cachecid(const char *cid, cache_param_t *cache)
add cid into a cache
Definition: cache_manager.c:193
imgsock_manager.h
save_codestream
void save_codestream(Byte_t *codestream, OPJ_SIZE_T streamlen, const char *fmt)
Definition: jpipstream_manager.c:58
send_PNMstream
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
Definition: imgsock_manager.c:176
Byte_t
uint8_t Byte_t
Definition: byte_manager.h:37
cache_manager.h
handle_XMLreqMSG
void handle_XMLreqMSG(SOCKET connected_socket, Byte_t *jpipstream, cachelist_param_t *cachelist)
handle XML request message
Definition: dec_clientmsg_handler.c:141
send_TIDstream
void send_TIDstream(SOCKET connected_socket, const char *tid, OPJ_SIZE_T tidlen)
send TID data stream to the client
Definition: imgsock_manager.c:157
OPJ_OFF_T
int64_t OPJ_OFF_T
Definition: openjpeg.h:130
boxcontents_param::offset
OPJ_OFF_T offset
byte position of the box contents in the file
Definition: metadata_manager.h:38
handle_dstCIDreqMSG
void handle_dstCIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist)
handle distroy ChannelID message
Definition: dec_clientmsg_handler.c:203
handle_SIZreqMSG
void handle_SIZreqMSG(SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist)
handle SIZ request message
Definition: dec_clientmsg_handler.c:214
handle_CIDreqMSG
void handle_CIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist)
handle ChannelID request message
Definition: dec_clientmsg_handler.c:183
search_cacheBycid
cache_param_t * search_cacheBycid(const char cid[], cachelist_param_t *cachelist)
search a cache by cid
Definition: cache_manager.c:151
cache_param::tid
char * tid
taregt identifier
Definition: cache_manager.h:40
cache_param::numOfcid
int numOfcid
number of cids
Definition: cache_manager.h:43
cache_param::cid
char ** cid
dynamic array of channel identifiers
Definition: cache_manager.h:42
handle_CIDreqMSG
void handle_CIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist)
handle ChannelID request message
Definition: dec_clientmsg_handler.c:183
handle_JPIPstreamMSG
void handle_JPIPstreamMSG(SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue)
handle JPT- JPP- stream message
Definition: dec_clientmsg_handler.c:42
update_JPIPstream
Byte_t * update_JPIPstream(Byte_t *newstream, OPJ_SIZE_T newstreamlen, Byte_t *cache_stream, OPJ_SIZE_T *streamlen)
Definition: jpipstream_manager.c:41
ihdrbox_param::bpc
Byte_t bpc
bits per component
Definition: ihdrbox_manager.h:43
metadatalist_param
metadata-bin list parameters
Definition: metadata_manager.h:54
cache_param
cache parameters
Definition: cache_manager.h:38
SOCKET
int SOCKET
Definition: sock_manager.h:40
OPJ_SIZE_T
size_t OPJ_SIZE_T
Definition: openjpeg.h:133
handle_TIDreqMSG
void handle_TIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist)
handle TargetID request message
Definition: dec_clientmsg_handler.c:165
handle_JPIPstreamMSG
void handle_JPIPstreamMSG(SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue)
handle JPT- JPP- stream message
Definition: dec_clientmsg_handler.c:42
remove_cachecid
void remove_cachecid(const char *cid, cachelist_param_t *cachelist)
remove cid in cache
Definition: cache_manager.c:225
receive_JPIPstream
Byte_t * receive_JPIPstream(SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen)
receive a JPT- JPP- stream from client
Definition: imgsock_manager.c:67
handle_dstCIDreqMSG
void handle_dstCIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist)
handle distroy ChannelID message
Definition: dec_clientmsg_handler.c:203
boxcontents_param
Definition: metadata_manager.h:37
msgqueue_manager.h
receive_line
OPJ_SIZE_T receive_line(SOCKET connected_socket, char *p)
receive a string line (ending with ' ') from client
Definition: sock_manager.c:142
ihdrbox_param::width
Byte4_t width
Definition: ihdrbox_manager.h:41
handle_TIDreqMSG
void handle_TIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist)
handle TargetID request message
Definition: dec_clientmsg_handler.c:165
parse_metamsg
void parse_metamsg(msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t streamlen, metadatalist_param_t *metadatalist)
parse JPT- JPP- stream to message queue
Definition: msgqueue_manager.c:687
OPJ_TRUE
#define OPJ_TRUE
Definition: openjpeg.h:111
insert_cache_into_list
void insert_cache_into_list(cache_param_t *cache, cachelist_param_t *cachelist)
insert a cache into list
Definition: cache_manager.c:103
opj_malloc
void * opj_malloc(size_t size)
Allocate an uninitialized memory block.
Definition: opj_malloc.c:191
jp2k_encoder.h
Byte4_t
uint32_t Byte4_t
Definition: byte_manager.h:39
opj_free
void opj_free(void *ptr)
Deallocates or frees a memory block.
Definition: opj_malloc.c:246
delete_metadatalist
void delete_metadatalist(metadatalist_param_t **list)
delete metadata list
Definition: metadata_manager.c:114
jpipstream_manager.h
recons_jp2
Byte_t * recons_jp2(msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *jp2len)
reconstruct jp2 file codestream from message queue
Definition: jp2k_encoder.c:98
gene_metadatalist
metadatalist_param_t * gene_metadatalist(void)
generate a metadata list
Definition: metadata_manager.c:49
ihdrbox_manager.h
send_SIZstream
void send_SIZstream(SOCKET connected_socket, unsigned int width, unsigned int height)
send SIZ data stream to the client
Definition: imgsock_manager.c:196
parse_JPIPstream
void parse_JPIPstream(Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset, msgqueue_param_t *msgqueue)
parse JPT- JPP- stream to message queue
Definition: msgqueue_manager.c:631
msgqueue_param::last
message_param_t * last
last message pointer of the list
Definition: msgqueue_manager.h:65
message_param::csn
Byte8_t csn
index of the codestream
Definition: msgqueue_manager.h:53
receive_string
char * receive_string(SOCKET connected_socket)
receive a string line (ending with ' ') from client, return malloc string
Definition: sock_manager.c:169
search_cacheBytid
cache_param_t * search_cacheBytid(const char tid[], cachelist_param_t *cachelist)
search a cache by tid
Definition: cache_manager.c:173
gene_cache
cache_param_t * gene_cache(const char *targetname, int csn, char *tid, char *cid)
generate a cache
Definition: cache_manager.c:61
handle_PNMreqMSG
void handle_PNMreqMSG(SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist)
handle PNM request message
Definition: dec_clientmsg_handler.c:102
handle_JP2saveMSG
void handle_JP2saveMSG(SOCKET connected_socket, cachelist_param_t *cachelist, msgqueue_param_t *msgqueue, Byte_t *jpipstream)
handle saving JP2 file request message
Definition: dec_clientmsg_handler.c:250
metadata_param::boxcontents
boxcontents_param_t * boxcontents
box contens in case of no boxlist and placeholderlist
Definition: metadata_manager.h:48
send_XMLstream
void send_XMLstream(SOCKET connected_socket, Byte_t *xmlstream, OPJ_SIZE_T length)
send XML data stream to the client
Definition: imgsock_manager.c:134
update_cachetid
void update_cachetid(const char *tid, cache_param_t *cache)
update tid of a cache
Definition: cache_manager.c:210
get_SIZ_from_jpipstream
ihdrbox_param_t * get_SIZ_from_jpipstream(Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn)
Definition: jpipstream_manager.c:116
byte_manager.h
handle_PNMreqMSG
void handle_PNMreqMSG(SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist)
handle PNM request message
Definition: dec_clientmsg_handler.c:102
handle_XMLreqMSG
void handle_XMLreqMSG(SOCKET connected_socket, Byte_t *jpipstream, cachelist_param_t *cachelist)
handle XML request message
Definition: dec_clientmsg_handler.c:141
metadatalist_param::last
metadata_param_t * last
last metadata-bin pointer of the list
Definition: metadata_manager.h:56
msgqueue_param
message queue parameters
Definition: msgqueue_manager.h:63
ihdrbox_param::height
Byte4_t height
Definition: ihdrbox_manager.h:40
cachelist_param
Definition: cache_manager.h:50
handle_SIZreqMSG
void handle_SIZreqMSG(SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist)
handle SIZ request message
Definition: dec_clientmsg_handler.c:214
opj_inttypes.h
boxcontents_param::length
Byte8_t length
length of the box contents
Definition: metadata_manager.h:39
cache_param::ihdrbox
ihdrbox_param_t * ihdrbox
ihdrbox
Definition: cache_manager.h:45
ihdrbox_param
I.5.3.1 Image Header box.
Definition: ihdrbox_manager.h:39
response_signal
void response_signal(SOCKET connected_socket, OPJ_BOOL succeed)
send response signal to the client
Definition: imgsock_manager.c:214
Byte8_t
uint64_t Byte8_t
Definition: byte_manager.h:40
search_cacheBycsn
cache_param_t * search_cacheBycsn(int csn, cachelist_param_t *cachelist)
search a cache by csn
Definition: cache_manager.c:135
jpipstream_to_pnm
Byte_t * jpipstream_to_pnm(Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn, int fw, int fh, ihdrbox_param_t **ihdrbox)
Definition: jpipstream_manager.c:80
send_CIDstream
void send_CIDstream(SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen)
send CID data stream to the client
Definition: imgsock_manager.c:152
dec_clientmsg_handler.h
handle_JP2saveMSG
void handle_JP2saveMSG(SOCKET connected_socket, cachelist_param_t *cachelist, msgqueue_param_t *msgqueue, Byte_t *jpipstream)
handle saving JP2 file request message
Definition: dec_clientmsg_handler.c:250
cache_param::metadatalist
metadatalist_param_t * metadatalist
metadata-bin list
Definition: cache_manager.h:44
ihdrbox_param::nc
Byte2_t nc
number of components
Definition: ihdrbox_manager.h:42
cache_param::csn
int csn
codestream number
Definition: cache_manager.h:41