OpenJPEG  2.4.0
Macros | Functions
metadata_manager.c File Reference
#include "metadata_manager.h"
#include "opj_inttypes.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>

Macros

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

Functions

metadatalist_param_tgene_metadatalist (void)
 generate a metadata list More...
 
metadatalist_param_tconst_metadatalist (int fd)
 construct metadata-bin list of JP2 file More...
 
void delete_metadatalist (metadatalist_param_t **list)
 delete metadata list More...
 
metadata_param_tgene_metadata (Byte8_t idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents)
 generate a metadata bin More...
 
void delete_metadata (metadata_param_t **metadata)
 delete a metadata bin More...
 
void insert_metadata_into_list (metadata_param_t *metabin, metadatalist_param_t *metadatalist)
 insert a metadata-bin into list More...
 
void print_metadata (metadata_param_t *metadata)
 print metadata-bin parameters More...
 
void print_allmetadata (metadatalist_param_t *list)
 print all metadata parameters More...
 
boxcontents_param_tgene_boxcontents (OPJ_OFF_T offset, OPJ_SIZE_T length)
 generate box contents More...
 
metadata_param_tsearch_metadata (Byte8_t idx, metadatalist_param_t *list)
 search a metadata bin by index More...
 
Byte8_t search_metadataidx (char boxtype[4], metadatalist_param_t *list)
 search a metadata index by box-type More...
 

Macro Definition Documentation

#define FCGI_stderr   stderr

Referenced by const_metadatalist().

#define FCGI_stdout   stdout
#define logstream   stderr

Function Documentation

metadatalist_param_t* const_metadatalist ( int  fd)
void delete_metadata ( metadata_param_t **  metadata)

delete a metadata bin

Parameters
[in,out]metadataaddress of the deleting metadata bin pointer

References delete_boxlist(), and delete_placeholderlist().

Referenced by delete_metadatalist().

void delete_metadatalist ( metadatalist_param_t **  list)

delete metadata list

Parameters
[in,out]listaddress of the metadata list pointer

References delete_metadata(), and metadata_param::next.

Referenced by delete_cache(), delete_index(), destroy_jpipdecoder(), and handle_JPIPstreamMSG().

boxcontents_param_t* gene_boxcontents ( OPJ_OFF_T  offset,
OPJ_SIZE_T  length 
)

generate box contents

Returns
pointer to the box contents

References boxcontents_param::length, and boxcontents_param::offset.

Referenced by const_metadatalist(), and parse_metadata().

metadata_param_t* gene_metadata ( Byte8_t  idx,
boxlist_param_t boxlist,
placeholderlist_param_t phldlist,
boxcontents_param_t boxcontents 
)

generate a metadata bin

Parameters
[in]idxmetadata-bin index
[in]boxlistbox list pointer
[in]phldlistplaceholder list pointer
[in]boxcontentsboxcontents pointer
Returns
pointer to the generated metadata bin

References metadata_param::boxcontents, metadata_param::boxlist, metadata_param::idx, metadata_param::next, and metadata_param::placeholderlist.

Referenced by const_metadatalist(), and parse_metamsg().

metadatalist_param_t* gene_metadatalist ( void  )

generate a metadata list

Returns
pointer to the generated metadata list

References metadatalist_param::first, and metadatalist_param::last.

Referenced by const_metadatalist(), gene_cache(), handle_JPIPstreamMSG(), and init_jpipdecoder().

void insert_metadata_into_list ( metadata_param_t metabin,
metadatalist_param_t metadatalist 
)

insert a metadata-bin into list

Parameters
[in]metabinmetadata-bin pointer
[in]metadatalistmetadata list pointer

References metadatalist_param::first, metadatalist_param::last, and metadata_param::next.

Referenced by const_metadatalist(), and parse_metamsg().

void print_allmetadata ( metadatalist_param_t list)

print all metadata parameters

Parameters
[in]listmetadata list pointer

References metadatalist_param::first, logstream, metadata_param::next, and print_metadata().

Referenced by output_log(), and print_index().

void print_metadata ( metadata_param_t metadata)
metadata_param_t* search_metadata ( Byte8_t  idx,
metadatalist_param_t list 
)

search a metadata bin by index

Parameters
[in]idxindex
[in]listmetadata-bin list pointer
Returns
found metadata-bin pointer

References metadatalist_param::first, metadata_param::idx, and metadata_param::next.

Referenced by enqueue_metadata().

Byte8_t search_metadataidx ( char  boxtype[4],
metadatalist_param_t list 
)

search a metadata index by box-type

Parameters
[in]boxtypebox-type
[in]listmetadata-bin list pointer
Returns
found metadata-bin index, if not found, -1

References metadata_param::boxlist, boxlist_param::first, metadatalist_param::first, placeholderlist_param::first, metadata_param::idx, box_param::next, metadata_param::next, placeholder_param::next, placeholder_param::OrigBH, placeholder_param::OrigID, metadata_param::placeholderlist, and box_param::type.

Referenced by enqueue_metabins().