summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2014-04-23 07:46:11 +0000
committerAntonin Descampe <antonin@gmail.com>2014-04-23 07:46:11 +0000
commit7aece5e8e7d4214d140a45aca50a824ff8092924 (patch)
tree85599bd1108ecab5b12fad8dcea894f250b97145 /tests
parent8d93eae64acd18fac3c856e0a311905359233b96 (diff)
[trunk]Replaced deprecated opj_stream_set_user_data function from API
with its 'v3' version, and removed all other 'v3' suffixes from API.
Diffstat (limited to 'tests')
-rw-r--r--tests/j2k_random_tile_access.c12
-rw-r--r--tests/test_tile_decoder.c20
-rw-r--r--tests/test_tile_encoder.c10
-rw-r--r--tests/unit/testempty1.c6
-rw-r--r--tests/unit/testempty2.c12
5 files changed, 30 insertions, 30 deletions
diff --git a/tests/j2k_random_tile_access.c b/tests/j2k_random_tile_access.c
index b76bf359..b53c6005 100644
--- a/tests/j2k_random_tile_access.c
+++ b/tests/j2k_random_tile_access.c
@@ -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);
diff --git a/tests/test_tile_decoder.c b/tests/test_tile_decoder.c
index 96b5e829..26d3a16c 100644
--- a/tests/test_tile_decoder.c
+++ b/tests/test_tile_decoder.c
@@ -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);
diff --git a/tests/test_tile_encoder.c b/tests/test_tile_encoder.c
index 4330fb7d..6ce628b5 100644
--- a/tests/test_tile_encoder.c
+++ b/tests/test_tile_encoder.c
@@ -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);
diff --git a/tests/unit/testempty1.c b/tests/unit/testempty1.c
index a2ae2d2d..fc961c22 100644
--- a/tests/unit/testempty1.c
+++ b/tests/unit/testempty1.c
@@ -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);
diff --git a/tests/unit/testempty2.c b/tests/unit/testempty2.c
index abafa5b3..6b395480 100644
--- a/tests/unit/testempty2.c
+++ b/tests/unit/testempty2.c
@@ -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);