Skip to content

Commit 2fe9084

Browse files
r41k0unaushir
authored andcommitted
utils: Preserve API by overloading libpisp::compute_optimal_stride
The signature for compute_optimal_stride has changed, and it is called by libcamera extrenally. While adding a default parameter makes it backwards compatible, using libcamera.so to build rpicam-apps with -Wl, --no-undefined will cause undefined symbols. This change preserves the API by overloading the function to have both the previous and new signature. This will emit both symbols in the shared object. Only compute_optimal_stride in utils.hpp needs this change as this is the only function being used in libcamera as an API from utils.
1 parent 981977f commit 2fe9084

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/libpisp/common/pisp_utils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ void compute_optimal_stride(pisp_image_format_config &config, bool preserve_subs
118118
compute_stride_align(config, PISP_BACK_END_OUTPUT_MAX_ALIGN, preserve_subsample_ratio);
119119
}
120120

121+
void compute_optimal_stride(pisp_image_format_config &config)
122+
{
123+
compute_optimal_stride(config, false);
124+
}
125+
121126
void compute_addr_offset(const pisp_image_format_config &config, int x, int y, uint32_t *addr_offset,
122127
uint32_t *addr_offset2)
123128
{

src/libpisp/common/utils.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ namespace libpisp
1414
{
1515

1616
void compute_stride(pisp_image_format_config &config, bool preserve_subsample_ratio = false);
17-
void compute_optimal_stride(pisp_image_format_config &config, bool preserve_subsample_ratio = false);
17+
void compute_optimal_stride(pisp_image_format_config &config);
18+
void compute_optimal_stride(pisp_image_format_config &config, bool preserve_subsample_ratio);
1819
void compute_stride_align(pisp_image_format_config &config, int align, bool preserve_subsample_ratio = false);
1920
void compute_addr_offset(const pisp_image_format_config &config, int x, int y, uint32_t *addr_offset,
2021
uint32_t *addr_offset2);

0 commit comments

Comments
 (0)