[CinCV TNG] [PATCH] Make EXR support optional

Einar Rünkaru einarrunkaru at gmail.com
Thu Jul 13 17:10:26 CEST 2017



On 07/12/2017 12:22 AM, Johannes Sixt wrote:
> Am 11.07.2017 um 19:21 schrieb Einar Rünkaru:
>> EXR support is compiled in if OpenEXR libraries are found.
>> Compilation does not fail if OpenEXR libraries are
>> not installed.
>> ---
>>   cinelerra/Makefile.am   |  6 +++++-
>>   cinelerra/asset.C       | 10 ++++++++++
>>   cinelerra/asset.h       |  4 +++-
>>   cinelerra/file.C        | 20 ++++++++++++++++----
>>   cinelerra/fileexr.h     |  4 ++++
>>   cinelerra/formatpopup.C |  3 +++
>>   configure.ac            | 11 ++++++++---
>>   7 files changed, 49 insertions(+), 9 deletions(-)
> 
>> diff --git a/cinelerra/asset.C b/cinelerra/asset.C
>> index de81a86..16cf644 100644
>> --- a/cinelerra/asset.C
>> +++ b/cinelerra/asset.C
>> @@ -168,8 +168,11 @@ int Asset::init_values()
>>       ac3_bitrate = 128;
>>       png_use_alpha = 0;
>> +
>> +#ifdef HAVE_OPENEXR
>>       exr_use_alpha = 0;
>>       exr_compression = 0;
>> +#endif
>>       tiff_cmodel = 0;
>>       tiff_compression = 0;
>> @@ -320,8 +323,11 @@ void Asset::copy_format(Asset *asset, int do_index)
>>       ac3_bitrate = asset->ac3_bitrate;
>>
>>       png_use_alpha = asset->png_use_alpha;
>> +
>> +#ifdef HAVE_OPENEXR
>>       exr_use_alpha = asset->exr_use_alpha;
>>       exr_compression = asset->exr_compression;
>> +#endif
>>       tiff_cmodel = asset->tiff_cmodel;
>>       tiff_compression = asset->tiff_compression;
>> @@ -1037,8 +1043,10 @@ void Asset::load_defaults(BC_Hash *defaults,
>>       ac3_bitrate = GET_DEFAULT("AC3_BITRATE", ac3_bitrate);
>>       png_use_alpha = GET_DEFAULT("PNG_USE_ALPHA", png_use_alpha);
>> +#ifdef HAVE_OPENEXR
>>       exr_use_alpha = GET_DEFAULT("EXR_USE_ALPHA", exr_use_alpha);
>>       exr_compression = GET_DEFAULT("EXR_COMPRESSION", exr_compression);
>> +#endif
>>       tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel);
>>       tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", 
>> tiff_compression);
>> @@ -1152,8 +1160,10 @@ void Asset::save_defaults(BC_Hash *defaults,
>>           UPDATE_DEFAULT("PNG_USE_ALPHA", png_use_alpha);
>> +#ifdef HAVE_OPENEXR
>>           UPDATE_DEFAULT("EXR_USE_ALPHA", exr_use_alpha);
>>           UPDATE_DEFAULT("EXR_COMPRESSION", exr_compression);
>> +#endif
>>           UPDATE_DEFAULT("TIFF_CMODEL", tiff_cmodel);
>>           UPDATE_DEFAULT("TIFF_COMPRESSION", tiff_compression);
> 
> These settings to do not have to be conditional. They do not depend on 
> OpenEXR. Users might switch between versions that support and do not 
> support OpenEXR, and with this change, they may lose their settings.
> 
> Otherwise, looks good.

Defaults are hold in microdatabase. They remain and keep their values if 
you do not touch them. Users do not lose their settings if they do not 
remove the file where settings are stored.

Applied, thanks.

Einar


More information about the Cinelerra mailing list