Skip to content

Commit 32c8892

Browse files
committed
backend: Use an array for the smart resize config
The smart resize config block does not need to be stored in a vector as it will remain statically sized. Signed-off-by: Naushir Patuck <[email protected]>
1 parent e7974a1 commit 32c8892

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libpisp/backend/backend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ BackEnd::BackEnd(Config const &config, PiSPVariant const &variant)
2323
if (config_.max_tile_width > max_tile_width)
2424
PISP_LOG(fatal, "Configured max tile width " << config_.max_tile_width << " exceeds " << max_tile_width);
2525

26-
smart_resize_.resize(2, { 0, 0 });
2726
smart_resize_dirty_ = 0;
2827

2928
const char *env = std::getenv("LIBPISP_BE_CONFIG_FILE");

src/libpisp/backend/backend.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
#pragma once
99

10+
#include <array>
1011
#include <cstdint>
1112
#include <string>
1213
#include <type_traits>
@@ -51,8 +52,8 @@ class BackEnd final
5152

5253
struct SmartResize
5354
{
54-
uint16_t width;
55-
uint16_t height;
55+
uint16_t width = 0;
56+
uint16_t height = 0;
5657
};
5758

5859
BackEnd(Config const &user_config, PiSPVariant const &variant);
@@ -181,7 +182,7 @@ class BackEnd final
181182
std::vector<pisp_tile> tiles_;
182183
int num_tiles_x_, num_tiles_y_;
183184
mutable ShmMutex mutex_;
184-
std::vector<SmartResize> smart_resize_;
185+
std::array<SmartResize, PISP_BACK_END_NUM_OUTPUTS> smart_resize_;
185186
uint32_t smart_resize_dirty_;
186187

187188
// Default config

0 commit comments

Comments
 (0)