[trunk]Replaced deprecated opj_stream_set_user_data function from API
authorAntonin Descampe <antonin@gmail.com>
Wed, 23 Apr 2014 07:46:11 +0000 (07:46 +0000)
committerAntonin Descampe <antonin@gmail.com>
Wed, 23 Apr 2014 07:46:11 +0000 (07:46 +0000)
with its 'v3' version, and removed all other 'v3' suffixes from API.

12 files changed:
src/bin/jp2/opj_compress.c
src/bin/jp2/opj_decompress.c
src/bin/jp2/opj_dump.c
src/lib/openjp2/cio.c
src/lib/openjp2/j2k.c
src/lib/openjp2/openjpeg.c
src/lib/openjp2/openjpeg.h
tests/j2k_random_tile_access.c
tests/test_tile_decoder.c
tests/test_tile_encoder.c
tests/unit/testempty1.c
tests/unit/testempty2.c

index 964019419575d7bc330d65af2f84caff83dd5c42..4da8eaeec68855eb88e35cb711a3f98b0796a167 100644 (file)
@@ -1747,7 +1747,7 @@ int main(int argc, char **argv) {
         }
         default:
             fprintf(stderr, "skipping file..\n");
-            opj_stream_destroy_v3(l_stream);
+            opj_stream_destroy(l_stream);
             continue;
         }
 
@@ -1766,7 +1766,7 @@ int main(int argc, char **argv) {
         opj_setup_encoder(l_codec, &parameters, image);
 
         /* open a byte stream for writing and allocate memory for all tiles */
-        l_stream = opj_stream_create_default_file_stream_v3(parameters.outfile,OPJ_FALSE);
+        l_stream = opj_stream_create_default_file_stream(parameters.outfile,OPJ_FALSE);
         if (! l_stream){
             return 1;
         }
@@ -1785,7 +1785,7 @@ int main(int argc, char **argv) {
             for (i=0;i<l_nb_tiles;++i) {
                 if (! opj_write_tile(l_codec,i,l_data,l_data_size,l_stream)) {
                     fprintf(stderr, "ERROR -> test_tile_encoder: failed to write the tile %d!\n",i);
-                    opj_stream_destroy_v3(l_stream);
+                    opj_stream_destroy(l_stream);
                     opj_destroy_codec(l_codec);
                     opj_image_destroy(image);
                     return 1;
@@ -1805,7 +1805,7 @@ int main(int argc, char **argv) {
         }
 
         if (!bSuccess)  {
-            opj_stream_destroy_v3(l_stream);
+            opj_stream_destroy(l_stream);
             opj_destroy_codec(l_codec);
             opj_image_destroy(image);
             fprintf(stderr, "failed to encode image\n");
@@ -1814,7 +1814,7 @@ int main(int argc, char **argv) {
 
         fprintf(stdout,"[INFO] Generated outfile %s\n",parameters.outfile);
         /* close and free the byte stream */
-        opj_stream_destroy_v3(l_stream);
+        opj_stream_destroy(l_stream);
 
         /* free remaining compression structures */
         opj_destroy_codec(l_codec);
index 1164f0619e2aa5f4d78e72a7f0426bb62c04bbf2..78957e852ab4e4a7bd4eb81dbe4201ace0f8c9fd 100644 (file)
@@ -762,7 +762,7 @@ int main(int argc, char **argv)
                /* read the input file and put it in memory */
                /* ---------------------------------------- */
 
-               l_stream = opj_stream_create_default_file_stream_v3(parameters.infile,1);
+               l_stream = opj_stream_create_default_file_stream(parameters.infile,1);
                if (!l_stream){
                        fprintf(stderr, "ERROR -> failed to create the stream from the file %s\n", parameters.infile);
                        return EXIT_FAILURE;
@@ -792,7 +792,7 @@ int main(int argc, char **argv)
                        }
                        default:
                                fprintf(stderr, "skipping file..\n");
-                               opj_stream_destroy_v3(l_stream);
+                               opj_stream_destroy(l_stream);
                                continue;
                }
 
@@ -804,7 +804,7 @@ int main(int argc, char **argv)
                /* Setup the decoder decoding parameters using user parameters */
                if ( !opj_setup_decoder(l_codec, &parameters) ){
                        fprintf(stderr, "ERROR -> opj_compress: failed to setup the decoder\n");
-                       opj_stream_destroy_v3(l_stream);
+                       opj_stream_destroy(l_stream);
                        opj_destroy_codec(l_codec);
                        return EXIT_FAILURE;
                }
@@ -813,7 +813,7 @@ int main(int argc, char **argv)
                /* Read the main header of the codestream and if necessary the JP2 boxes*/
                if(! opj_read_header(l_stream, l_codec, &image)){
                        fprintf(stderr, "ERROR -> opj_decompress: failed to read the header\n");
-                       opj_stream_destroy_v3(l_stream);
+                       opj_stream_destroy(l_stream);
                        opj_destroy_codec(l_codec);
                        opj_image_destroy(image);
                        return EXIT_FAILURE;
@@ -824,7 +824,7 @@ int main(int argc, char **argv)
                        if (!opj_set_decode_area(l_codec, image, (OPJ_INT32)parameters.DA_x0,
                                        (OPJ_INT32)parameters.DA_y0, (OPJ_INT32)parameters.DA_x1, (OPJ_INT32)parameters.DA_y1)){
                                fprintf(stderr, "ERROR -> opj_decompress: failed to set the decoded area\n");
-                               opj_stream_destroy_v3(l_stream);
+                               opj_stream_destroy(l_stream);
                                opj_destroy_codec(l_codec);
                                opj_image_destroy(image);
                                return EXIT_FAILURE;
@@ -834,7 +834,7 @@ int main(int argc, char **argv)
                        if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec,       l_stream))) {
                                fprintf(stderr,"ERROR -> opj_decompress: failed to decode image!\n");
                                opj_destroy_codec(l_codec);
-                               opj_stream_destroy_v3(l_stream);
+                               opj_stream_destroy(l_stream);
                                opj_image_destroy(image);
                                return EXIT_FAILURE;
                        }
@@ -845,7 +845,7 @@ int main(int argc, char **argv)
                        /*if (!opj_set_decoded_resolution_factor(l_codec, 5)) {
                                fprintf(stderr, "ERROR -> opj_decompress: failed to set the resolution factor tile!\n");
                                opj_destroy_codec(l_codec);
-                               opj_stream_destroy_v3(l_stream);
+                               opj_stream_destroy(l_stream);
                                opj_image_destroy(image);
                                return EXIT_FAILURE;
                        }*/
@@ -853,7 +853,7 @@ int main(int argc, char **argv)
                        if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) {
                                fprintf(stderr, "ERROR -> opj_decompress: failed to decode tile!\n");
                                opj_destroy_codec(l_codec);
-                               opj_stream_destroy_v3(l_stream);
+                               opj_stream_destroy(l_stream);
                                opj_image_destroy(image);
                                return EXIT_FAILURE;
                        }
@@ -861,7 +861,7 @@ int main(int argc, char **argv)
                }
 
                /* Close the byte stream */
-               opj_stream_destroy_v3(l_stream);
+               opj_stream_destroy(l_stream);
 
                if(image->color_space == OPJ_CLRSPC_SYCC){
                        color_sycc_to_rgb(image); /* FIXME */
index 3121aa4fb1ee43ab4a73da5e36b283b5a956a48e..7a841d536383b39aa88a9c01c25b0a2c331271fe 100644 (file)
@@ -498,7 +498,7 @@ int main(int argc, char *argv[])
                /* Read the input file and put it in memory */
                /* ---------------------------------------- */
 
-               l_stream = opj_stream_create_default_file_stream_v3(parameters.infile,1);
+               l_stream = opj_stream_create_default_file_stream(parameters.infile,1);
                if (!l_stream){
                        fprintf(stderr, "ERROR -> failed to create the stream from the file %s\n",parameters.infile);
                        return EXIT_FAILURE;
@@ -528,7 +528,7 @@ int main(int argc, char *argv[])
                        }
                        default:
                                fprintf(stderr, "skipping file..\n");
-                               opj_stream_destroy_v3(l_stream);
+                               opj_stream_destroy(l_stream);
                                continue;
                }
 
@@ -540,7 +540,7 @@ int main(int argc, char *argv[])
                /* Setup the decoder decoding parameters using user parameters */
                if ( !opj_setup_decoder(l_codec, &parameters) ){
                        fprintf(stderr, "ERROR -> opj_dump: failed to setup the decoder\n");
-                       opj_stream_destroy_v3(l_stream);
+                       opj_stream_destroy(l_stream);
                        opj_destroy_codec(l_codec);
                        fclose(fout);
                        return EXIT_FAILURE;
@@ -549,7 +549,7 @@ int main(int argc, char *argv[])
                /* Read the main header of the codestream and if necessary the JP2 boxes*/
                if(! opj_read_header(l_stream, l_codec, &image)){
                        fprintf(stderr, "ERROR -> opj_dump: failed to read the header\n");
-                       opj_stream_destroy_v3(l_stream);
+                       opj_stream_destroy(l_stream);
                        opj_destroy_codec(l_codec);
                        opj_image_destroy(image);
                        fclose(fout);
@@ -563,7 +563,7 @@ int main(int argc, char *argv[])
                cstr_index = opj_get_cstr_index(l_codec);
 
                /* close the byte stream */
-               opj_stream_destroy_v3(l_stream);
+               opj_stream_destroy(l_stream);
 
                /* free remaining structures */
                if (l_codec) {
index 6cba658a98a09d6cf01aabcd86960c7f6924690e..1fc2393743c36373548bb12755b839bd10988a3e 100644 (file)
@@ -204,11 +204,6 @@ void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream)
        }
 }
 
-void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream)
-{
-       opj_stream_destroy(p_stream);
-}
-
 void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function)
 {
        opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
@@ -252,15 +247,7 @@ void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_strea
        l_stream->m_skip_fn = p_function;
 }
 
-void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data)
-{
-       opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
-       if (!l_stream)
-               return;
-       l_stream->m_user_data = p_data;
-}
-
-void OPJ_CALLCONV opj_stream_set_user_data_v3(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)
+void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)
 {
        opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
        if (!l_stream)
index 1e6024eb68f3a04725adcfeb24c1df231f57d53c..677a0b6197fe1bc28fa2a64ef43b03071de91577 100644 (file)
@@ -6126,21 +6126,25 @@ void opj_j2k_setup_encoder(     opj_j2k_t *p_j2k,
 
         /* FIXME ADE: to be removed once deprecated cp_cinema and cp_rsiz have been removed */
         if (parameters->rsiz == OPJ_PROFILE_NONE) { /* consider deprecated fields only if RSIZ has not been set */
+            OPJ_BOOL deprecated_used = OPJ_FALSE;
             switch (parameters->cp_cinema){
             case OPJ_CINEMA2K_24:
                 parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
                 parameters->max_cs_size = OPJ_CINEMA_24_CS;
                 parameters->max_comp_size = OPJ_CINEMA_24_COMP;
+                deprecated_used = OPJ_TRUE;
                 break;
             case OPJ_CINEMA2K_48:
                 parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
                 parameters->max_cs_size = OPJ_CINEMA_48_CS;
                 parameters->max_comp_size = OPJ_CINEMA_48_COMP;
+                deprecated_used = OPJ_TRUE;
                 break;
             case OPJ_CINEMA4K_24:
                 parameters->rsiz = OPJ_PROFILE_CINEMA_4K;
                 parameters->max_cs_size = OPJ_CINEMA_24_CS;
                 parameters->max_comp_size = OPJ_CINEMA_24_COMP;
+                deprecated_used = OPJ_TRUE;
                 break;
             case OPJ_OFF:
             default:
@@ -6149,16 +6153,25 @@ void opj_j2k_setup_encoder(     opj_j2k_t *p_j2k,
             switch (parameters->cp_rsiz){
             case OPJ_CINEMA2K:
                 parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
+                deprecated_used = OPJ_TRUE;
                 break;
             case OPJ_CINEMA4K:
                 parameters->rsiz = OPJ_PROFILE_CINEMA_4K;
+                deprecated_used = OPJ_TRUE;
                 break;
             case OPJ_MCT:
                 parameters->rsiz = OPJ_PROFILE_PART2 | OPJ_EXTENSION_MCT;
+                deprecated_used = OPJ_TRUE;
             case OPJ_STD_RSIZ:
             default:
                 break;
             }
+            if (deprecated_used) {
+                opj_event_msg(p_manager, EVT_WARNING,
+                        "Deprecated fields cp_cinema or cp_rsiz are used\n"
+                        "Please consider using only the rsiz field\n"
+                        "See openjpeg.h documentation for more details\n");
+            }
         }
 
         /* see if max_codestream_size does limit input rate */
index c53604d3592659641992b7793a9ede54cf6b7a5a..4665d906eb01ea53dd744ed09af473c5da3b5c23 100644 (file)
@@ -921,12 +921,12 @@ void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index)
        }
 }
 
-opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream_v3 (const char *fname, OPJ_BOOL p_is_read_stream)
+opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream)
 {
-    return opj_stream_create_file_stream_v3(fname, OPJ_J2K_STREAM_CHUNK_SIZE, p_is_read_stream);
+    return opj_stream_create_file_stream(fname, OPJ_J2K_STREAM_CHUNK_SIZE, p_is_read_stream);
 }
 
-opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (
+opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (
         const char *fname, 
                OPJ_SIZE_T p_size, 
         OPJ_BOOL p_is_read_stream)
@@ -953,7 +953,7 @@ opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (
         return NULL;
     }
 
-    opj_stream_set_user_data_v3(l_stream, p_file, (opj_stream_free_user_data_fn) fclose);
+    opj_stream_set_user_data(l_stream, p_file, (opj_stream_free_user_data_fn) fclose);
     opj_stream_set_user_data_length(l_stream, opj_get_data_length_from_file(p_file));
     opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_file);
     opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from_file);
index c8d806175c28edc677e5aacc36b58529eaa0708b..988db720092c63f71de29213d5e1462708620a8f 100644 (file)
@@ -1116,14 +1116,6 @@ OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size, O
  * @param      p_stream        the stream to destroy.
  */
 OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);
-
-/**
- * Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream. 
- * If needed the user must close its own implementation of the stream.
- *
- * @param      p_stream        the stream to destroy.
- */
-OPJ_API void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream);
  
 /**
  * Sets the given function to be used as a read function.
@@ -1153,21 +1145,13 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, o
 */
 OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function);
 
-/**
- * Sets the given data to be used as a user data for the stream.
- * @param              p_stream        the stream to modify
- * @param              p_data          the data to set.
- * @warning depending on your source object p_stream this function may leak, use opj_stream_set_user_data_v3
-*/
-OPJ_DEPRECATED(OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data));
-
 /**
  * Sets the given data to be used as a user data for the stream.
  * @param              p_stream        the stream to modify
  * @param              p_data          the data to set.
  * @param              p_function      the function to free p_data when opj_stream_destroy() is called.
 */
-OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_v3 (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);
+OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);
 
 /**
  * Sets the length of the user data for the stream.
@@ -1182,14 +1166,14 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream
  * @param fname             the filename of the file to stream
  * @param p_is_read_stream  whether the stream is a read stream (true) or not (false)
 */
-OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream_v3 (const char *fname, OPJ_BOOL p_is_read_stream);
+OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream);
  
 /** Create a stream from a file identified with its filename with a specific buffer size
  * @param fname             the filename of the file to stream
  * @param p_buffer_size     size of the chunk used to stream
  * @param p_is_read_stream  whether the stream is a read stream (true) or not (false)
 */
-OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (const char *fname, 
+OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (const char *fname,
                                                                      OPJ_SIZE_T p_buffer_size,
                                                                      OPJ_BOOL p_is_read_stream);
  
index b76bf35994a184cc7572c5a09f571b6e399e91bf..b53c6005c7fd5ef1230548ad5b6972ce84d5fbb4 100644 (file)
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
        opj_set_warning_handler(l_codec, warning_callback,00);
        opj_set_error_handler(l_codec, error_callback,00);
 
-    l_stream = opj_stream_create_default_file_stream_v3(parameters.infile,1);
+    l_stream = opj_stream_create_default_file_stream(parameters.infile,1);
        if (!l_stream){
         fprintf(stderr, "ERROR -> failed to create the stream from the file %s\n", parameters.infile);
                return EXIT_FAILURE;
@@ -218,7 +218,7 @@ int main(int argc, char **argv)
        /* Setup the decoder decoding parameters using user parameters */
        if ( !opj_setup_decoder(l_codec, &parameters) ){
                fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
-               opj_stream_destroy_v3(l_stream);
+               opj_stream_destroy(l_stream);
                opj_destroy_codec(l_codec);
                return EXIT_FAILURE;
        }
@@ -226,7 +226,7 @@ int main(int argc, char **argv)
        /* Read the main header of the codestream and if necessary the JP2 boxes*/
        if(! opj_read_header(l_stream, l_codec, &image)){
                fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
-               opj_stream_destroy_v3(l_stream);
+               opj_stream_destroy(l_stream);
                opj_destroy_codec(l_codec);
                opj_image_destroy(image);
                return EXIT_FAILURE;
@@ -246,7 +246,7 @@ int main(int argc, char **argv)
        fprintf(stdout, "Decoding tile %d ...\n", tile_index); \
        if(!opj_get_decoded_tile(l_codec, l_stream, image, tile_index )){ \
                fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \
-               opj_stream_destroy_v3(l_stream); \
+               opj_stream_destroy(l_stream); \
                opj_destroy_cstr_info(&cstr_info); \
                opj_destroy_codec(l_codec); \
                opj_image_destroy(image); \
@@ -255,7 +255,7 @@ int main(int argc, char **argv)
   for(index = 0; index < image->numcomps; ++index) { \
     if( image->comps[index].data == NULL ){ \
        fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \
-               opj_stream_destroy_v3(l_stream); \
+               opj_stream_destroy(l_stream); \
                opj_destroy_cstr_info(&cstr_info); \
                opj_destroy_codec(l_codec); \
                opj_image_destroy(image); \
@@ -272,7 +272,7 @@ int main(int argc, char **argv)
        TEST_TILE(tile_lr)
 
        /* Close the byte stream */
-       opj_stream_destroy_v3(l_stream);
+       opj_stream_destroy(l_stream);
 
        /* Destroy code stream info */
        opj_destroy_cstr_info(&cstr_info);
index 96b5e8292eb1885a2f614dac09405790244a7f40..26d3a16c856f6193d98d1470bdc8b635a0eebd8d 100644 (file)
@@ -203,7 +203,7 @@ int main (int argc, char *argv[])
                 return EXIT_FAILURE;
         }
 
-        l_stream = opj_stream_create_default_file_stream_v3(input_file,OPJ_TRUE);
+        l_stream = opj_stream_create_default_file_stream(input_file,OPJ_TRUE);
         if (!l_stream){
                 free(l_data);
                 fprintf(stderr, "ERROR -> failed to create the stream from the file\n");
@@ -244,7 +244,7 @@ int main (int argc, char *argv[])
                         {    
                                 fprintf(stderr, "ERROR -> Not a valid JPEG2000 file!\n");
                                 free(l_data);
-                                opj_stream_destroy_v3(l_stream);
+                                opj_stream_destroy(l_stream);
                                 return EXIT_FAILURE;
                         }
         }
@@ -259,7 +259,7 @@ int main (int argc, char *argv[])
         {
                 fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
                 free(l_data);
-                opj_stream_destroy_v3(l_stream);
+                opj_stream_destroy(l_stream);
                 opj_destroy_codec(l_codec);
                 return EXIT_FAILURE;
         }
@@ -269,7 +269,7 @@ int main (int argc, char *argv[])
         {
                 fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
                 free(l_data);
-                opj_stream_destroy_v3(l_stream);
+                opj_stream_destroy(l_stream);
                 opj_destroy_codec(l_codec);
                 return EXIT_FAILURE;
         }
@@ -277,7 +277,7 @@ int main (int argc, char *argv[])
         if (!opj_set_decode_area(l_codec, l_image, da_x0, da_y0,da_x1, da_y1)){
                 fprintf(stderr,        "ERROR -> j2k_to_image: failed to set the decoded area\n");
                 free(l_data);
-                opj_stream_destroy_v3(l_stream);
+                opj_stream_destroy(l_stream);
                 opj_destroy_codec(l_codec);
                 opj_image_destroy(l_image);
                 return EXIT_FAILURE;
@@ -298,7 +298,7 @@ int main (int argc, char *argv[])
                                         &l_go_on))
                 {
                         free(l_data);
-                        opj_stream_destroy_v3(l_stream);
+                        opj_stream_destroy(l_stream);
                         opj_destroy_codec(l_codec);
                         opj_image_destroy(l_image);
                         return EXIT_FAILURE;
@@ -312,7 +312,7 @@ int main (int argc, char *argv[])
                                 if (! l_new_data)
                                 {
                                         free(l_new_data);
-                                        opj_stream_destroy_v3(l_stream);
+                                        opj_stream_destroy(l_stream);
                                         opj_destroy_codec(l_codec);
                                         opj_image_destroy(l_image);
                                         return EXIT_FAILURE;
@@ -324,7 +324,7 @@ int main (int argc, char *argv[])
                         if (! opj_decode_tile_data(l_codec,l_tile_index,l_data,l_data_size,l_stream))
                         {
                                 free(l_data);
-                                opj_stream_destroy_v3(l_stream);
+                                opj_stream_destroy(l_stream);
                                 opj_destroy_codec(l_codec);
                                 opj_image_destroy(l_image);
                                 return EXIT_FAILURE;
@@ -336,7 +336,7 @@ int main (int argc, char *argv[])
         if (! opj_end_decompress(l_codec,l_stream))
         {
                 free(l_data);
-                opj_stream_destroy_v3(l_stream);
+                opj_stream_destroy(l_stream);
                 opj_destroy_codec(l_codec);
                 opj_image_destroy(l_image);
                 return EXIT_FAILURE;
@@ -344,7 +344,7 @@ int main (int argc, char *argv[])
 
         /* Free memory */
         free(l_data);
-        opj_stream_destroy_v3(l_stream);
+        opj_stream_destroy(l_stream);
         opj_destroy_codec(l_codec);
         opj_image_destroy(l_image);
 
index 4330fb7d0317365219cf61a38c1cbbe70d467241..6ce628b54fe886c15454298d0d03a2ca3b146de6 100644 (file)
@@ -263,7 +263,7 @@ int main (int argc, char *argv[])
                return 1;
        }
 
-       l_stream = opj_stream_create_default_file_stream_v3(output_file, OPJ_FALSE);
+    l_stream = opj_stream_create_default_file_stream(output_file, OPJ_FALSE);
     if (! l_stream) {
                fprintf(stderr, "ERROR -> test_tile_encoder: failed to create the stream from the output file %s !\n",output_file );
                opj_destroy_codec(l_codec);
@@ -273,7 +273,7 @@ int main (int argc, char *argv[])
 
        if (! opj_start_compress(l_codec,l_image,l_stream)) {
                fprintf(stderr, "ERROR -> test_tile_encoder: failed to start compress!\n");
-               opj_stream_destroy_v3(l_stream);
+        opj_stream_destroy(l_stream);
                opj_destroy_codec(l_codec);
                opj_image_destroy(l_image);
                return 1;
@@ -282,7 +282,7 @@ int main (int argc, char *argv[])
        for (i=0;i<l_nb_tiles;++i) {
                if (! opj_write_tile(l_codec,i,l_data,l_data_size,l_stream)) {
                        fprintf(stderr, "ERROR -> test_tile_encoder: failed to write the tile %d!\n",i);
-                       opj_stream_destroy_v3(l_stream);
+            opj_stream_destroy(l_stream);
                        opj_destroy_codec(l_codec);
                        opj_image_destroy(l_image);
                        return 1;
@@ -291,13 +291,13 @@ int main (int argc, char *argv[])
 
        if (! opj_end_compress(l_codec,l_stream)) {
                fprintf(stderr, "ERROR -> test_tile_encoder: failed to end compress!\n");
-               opj_stream_destroy_v3(l_stream);
+        opj_stream_destroy(l_stream);
                opj_destroy_codec(l_codec);
                opj_image_destroy(l_image);
                return 1;
        }
 
-       opj_stream_destroy_v3(l_stream);
+    opj_stream_destroy(l_stream);
        opj_destroy_codec(l_codec);
        opj_image_destroy(l_image);
 
index a2ae2d2d2ebb5518643434fb948cec9718be3a9b..fc961c22d574ff8219ae2c9e8eb8feb52493be5e 100644 (file)
@@ -110,12 +110,12 @@ int main(int argc, char *argv[])
 
   opj_setup_encoder(l_codec, &parameters, image);
 
-  l_stream = opj_stream_create_default_file_stream_v3("testempty1.j2k",OPJ_FALSE);
+  l_stream = opj_stream_create_default_file_stream("testempty1.j2k",OPJ_FALSE);
   assert(l_stream);
   bSuccess = opj_start_compress(l_codec,image,l_stream);
   if( !bSuccess )
     {
-    opj_stream_destroy_v3(l_stream);
+    opj_stream_destroy(l_stream);
     opj_destroy_codec(l_codec);
     opj_image_destroy(image);
     return 0;
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
   bSuccess = opj_end_compress(l_codec, l_stream);
   assert( bSuccess );
 
-  opj_stream_destroy_v3(l_stream);
+  opj_stream_destroy(l_stream);
 
   opj_destroy_codec(l_codec);
   opj_image_destroy(image);
index abafa5b3571ed469d9d8f306b06c3d8e63558b37..6b395480d3c96730e94c70b8c548b2501c2d84c0 100644 (file)
@@ -115,20 +115,20 @@ int main(int argc, char *argv[])
 
   opj_setup_encoder(l_codec, &parameters, image);
 
-  l_stream = opj_stream_create_default_file_stream_v3(parameters.outfile,OPJ_FALSE);
+  l_stream = opj_stream_create_default_file_stream(parameters.outfile,OPJ_FALSE);
   if( !l_stream )
     {
     fprintf( stderr, "Something went wrong during creation of stream\n" );
     opj_destroy_codec(l_codec);
     opj_image_destroy(image);
-    opj_stream_destroy_v3(l_stream);
+    opj_stream_destroy(l_stream);
     return 1;
     }
   assert(l_stream);
   bSuccess = opj_start_compress(l_codec,image,l_stream);
   if( !bSuccess )
     {
-    opj_stream_destroy_v3(l_stream);
+    opj_stream_destroy(l_stream);
     opj_destroy_codec(l_codec);
     opj_image_destroy(image);
     return 0;
@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
   bSuccess = opj_end_compress(l_codec, l_stream);
   assert( bSuccess );
 
-  opj_stream_destroy_v3(l_stream);
+  opj_stream_destroy(l_stream);
 
   opj_destroy_codec(l_codec);
   opj_image_destroy(image);
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
   bSuccess = opj_setup_decoder(d_codec, &dparameters);
   assert( bSuccess );
 
-  l_stream = opj_stream_create_default_file_stream_v3(outputfile,1);
+  l_stream = opj_stream_create_default_file_stream(outputfile,1);
   assert( l_stream );
 
   bSuccess = opj_read_header(l_stream, d_codec, &image);
@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
   bSuccess = opj_end_decompress(l_codec, l_stream);
   assert( bSuccess );
 
-  opj_stream_destroy_v3(l_stream);
+  opj_stream_destroy(l_stream);
 
   opj_destroy_codec(d_codec);