OpenJPEG  2.2.0
Macros | Functions
msgqueue_manager.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <limits.h>
#include <unistd.h>
#include "msgqueue_manager.h"
#include "metadata_manager.h"
#include "index_manager.h"
#include "opj_inttypes.h"

Macros

#define FCGI_stdout   stdout
 
#define FCGI_stderr   stderr
 
#define logstream   stderr
 

Functions

msgqueue_param_tgene_msgqueue (OPJ_BOOL stateless, cachemodel_param_t *cachemodel)
 generate message queue More...
 
void delete_msgqueue (msgqueue_param_t **msgqueue)
 delete message queue More...
 
void print_msgqueue (msgqueue_param_t *msgqueue)
 print message queue More...
 
void enqueue_message (message_param_t *msg, msgqueue_param_t *msgqueue)
 
void enqueue_mainheader (msgqueue_param_t *msgqueue)
 enqueue main header data-bin into message queue More...
 
void enqueue_tileheader (int tile_id, msgqueue_param_t *msgqueue)
 enqueue tile headers data-bin into message queue More...
 
void enqueue_tile (Byte4_t tile_id, int level, msgqueue_param_t *msgqueue)
 enqueue tile data-bin into message queue More...
 
void enqueue_precinct (int seq_id, int tile_id, int comp_id, int layers, msgqueue_param_t *msgqueue)
 enqueue precinct data-bin into message queue More...
 
Byte8_t comp_precinct_id (int t, int c, int s, int num_components, int num_tiles)
 compute precinct ID A.3.2.1 More...
 
void enqueue_box (Byte8_t meta_id, boxlist_param_t *boxlist, msgqueue_param_t *msgqueue, Byte8_t *binOffset)
 
void enqueue_phld (Byte8_t meta_id, placeholderlist_param_t *phldlist, msgqueue_param_t *msgqueue, Byte8_t *binOffset)
 
void enqueue_boxcontents (Byte8_t meta_id, boxcontents_param_t *boxcontents, msgqueue_param_t *msgqueue, Byte8_t *binOffset)
 
void enqueue_metadata (Byte8_t meta_id, msgqueue_param_t *msgqueue)
 enqueue Metadata-bin into message queue More...
 
message_param_tgene_metamsg (Byte8_t meta_id, Byte8_t binoffset, Byte8_t length, OPJ_OFF_T res_offset, placeholder_param_t *phld, Byte8_t csn)
 
void add_bin_id_vbas_stream (Byte_t bb, Byte_t c, Byte8_t in_class_id, int tmpfd)
 
void add_vbas_stream (Byte8_t code, int tmpfd)
 
void add_body_stream (message_param_t *msg, int fd, int tmpfd)
 
void add_placeholder_stream (placeholder_param_t *phld, int tmpfd)
 
void recons_stream_from_msgqueue (msgqueue_param_t *msgqueue, int tmpfd)
 reconstruct JPT/JPP-stream from message queue More...
 
void add_vbas_with_bytelen_stream (Byte8_t code, int bytelength, int tmpfd)
 
void print_binarycode (Byte8_t n, int segmentlen)
 
void add_bigendian_bytestream (Byte8_t code, int bytelength, int tmpfd)
 
Byte_tparse_bin_id_vbas (Byte_t *streamptr, Byte_t *bb, Byte_t *c, Byte8_t *in_class_id)
 
Byte_tparse_vbas (Byte_t *streamptr, Byte8_t *elem)
 
void parse_JPIPstream (Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset, msgqueue_param_t *msgqueue)
 parse JPT- JPP- stream to message queue More...
 
void parse_metadata (metadata_param_t *metadata, message_param_t *msg, Byte_t *stream)
 
void parse_metamsg (msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t streamlen, metadatalist_param_t *metadatalist)
 parse JPT- JPP- stream to message queue More...
 
placeholder_param_tparse_phld (Byte_t *datastream, Byte8_t metalength)
 
void delete_message_in_msgqueue (message_param_t **msg, msgqueue_param_t *msgqueue)
 delete a message in msgqueue More...
 

Macro Definition Documentation

#define FCGI_stderr   stderr
#define FCGI_stdout   stdout
#define logstream   stderr

Referenced by print_msgqueue().

Function Documentation

void add_bigendian_bytestream ( Byte8_t  code,
int  bytelength,
int  tmpfd 
)

References FCGI_stderr.

Referenced by add_placeholder_stream().

void add_bin_id_vbas_stream ( Byte_t  bb,
Byte_t  c,
Byte8_t  in_class_id,
int  tmpfd 
)
void add_body_stream ( message_param_t msg,
int  fd,
int  tmpfd 
)
void add_placeholder_stream ( placeholder_param_t phld,
int  tmpfd 
)
void add_vbas_stream ( Byte8_t  code,
int  tmpfd 
)
void add_vbas_with_bytelen_stream ( Byte8_t  code,
int  bytelength,
int  tmpfd 
)

References FCGI_stderr.

Referenced by add_bin_id_vbas_stream(), and add_vbas_stream().

Byte8_t comp_precinct_id ( int  t,
int  c,
int  s,
int  num_components,
int  num_tiles 
)

compute precinct ID A.3.2.1

Parameters
[in]ttile index
[in]ccomponent index
[in]ssequence number
[in]num_componentstotal number of components
[in]num_tilestotal number of tiles
Returns
precicnt id

Referenced by enqueue_precinct(), recons_packet(), and recons_precinct().

void delete_message_in_msgqueue ( message_param_t **  message,
msgqueue_param_t msgqueue 
)

delete a message in msgqueue

Parameters
[in]messageaddress of the deleting message pointer
[in]msgqueuemessage queue pointer

References msgqueue_param::first, msgqueue_param::last, message_param::next, and opj_free().

void delete_msgqueue ( msgqueue_param_t **  msgqueue)

delete message queue

Parameters
[in]msgqueueaddress of the message queue pointer

References delete_cachemodel(), message_param::next, and opj_free().

Referenced by destroy_jpipdecoder(), and terminate_dec_server().

void enqueue_box ( Byte8_t  meta_id,
boxlist_param_t boxlist,
msgqueue_param_t msgqueue,
Byte8_t binOffset 
)
void enqueue_boxcontents ( Byte8_t  meta_id,
boxcontents_param_t boxcontents,
msgqueue_param_t msgqueue,
Byte8_t binOffset 
)
void enqueue_mainheader ( msgqueue_param_t msgqueue)
void enqueue_message ( message_param_t msg,
msgqueue_param_t msgqueue 
)
void enqueue_metadata ( Byte8_t  meta_id,
msgqueue_param_t msgqueue 
)
void enqueue_phld ( Byte8_t  meta_id,
placeholderlist_param_t phldlist,
msgqueue_param_t msgqueue,
Byte8_t binOffset 
)
void enqueue_precinct ( int  seq_id,
int  tile_id,
int  comp_id,
int  layers,
msgqueue_param_t msgqueue 
)
void enqueue_tile ( Byte4_t  tile_id,
int  level,
msgqueue_param_t msgqueue 
)
void enqueue_tileheader ( int  tile_id,
msgqueue_param_t msgqueue 
)
message_param_t * gene_metamsg ( Byte8_t  meta_id,
Byte8_t  binoffset,
Byte8_t  length,
OPJ_OFF_T  res_offset,
placeholder_param_t phld,
Byte8_t  csn 
)
msgqueue_param_t* gene_msgqueue ( OPJ_BOOL  stateless,
cachemodel_param_t cachemodel 
)

generate message queue

Parameters
[in]statelessif this is a stateless message queue
[in]cachemodelcachemodel pointer
Returns
generated message queue pointer

References msgqueue_param::cachemodel, msgqueue_param::first, msgqueue_param::last, opj_malloc(), and msgqueue_param::stateless.

Referenced by gene_JPIPstream(), init_dec_server(), and init_jpipdecoder().

Byte_t * parse_bin_id_vbas ( Byte_t streamptr,
Byte_t bb,
Byte_t c,
Byte8_t in_class_id 
)

Referenced by 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

Parameters
[in]JPIPstreamJPT- JPP- stream data pointer
[in]streamlenJPIPstream length
[in]offsetoffset of the stream from the whole beginning
[in,out]msgqueueadding message queue pointer

References message_param::aux, message_param::bin_offset, message_param::class_id, message_param::csn, msgqueue_param::first, message_param::in_class_id, msgqueue_param::last, message_param::last_byte, message_param::length, message_param::next, OPJ_FALSE, opj_malloc(), OPJ_TRUE, parse_bin_id_vbas(), parse_vbas(), message_param::phld, and message_param::res_offset.

Referenced by decode_jpip(), and handle_JPIPstreamMSG().

void parse_metadata ( metadata_param_t metadata,
message_param_t msg,
Byte_t stream 
)
void parse_metamsg ( msgqueue_param_t msgqueue,
Byte_t stream,
Byte8_t  streamlen,
metadatalist_param_t metadatalist 
)

parse JPT- JPP- stream to message queue

Parameters
[in]msgqueuereference message queue pointer
[in]streamstream data pointer
[in]streamlenstream length
[in]metadatalistadding metadata list pointer

References message_param::class_id, msgqueue_param::first, gene_metadata(), message_param::in_class_id, insert_metadata_into_list(), METADATA_MSG, message_param::next, parse_metadata(), and message_param::res_offset.

Referenced by decode_jpip(), and handle_JPIPstreamMSG().

placeholder_param_t * parse_phld ( Byte_t datastream,
Byte8_t  metalength 
)
Byte_t * parse_vbas ( Byte_t streamptr,
Byte8_t elem 
)

Referenced by parse_JPIPstream().

void print_binarycode ( Byte8_t  n,
int  segmentlen 
)
void print_msgqueue ( msgqueue_param_t msgqueue)
void recons_stream_from_msgqueue ( msgqueue_param_t msgqueue,
int  tmpfd 
)