Skip to content

Commit 9f08463

Browse files
naushirdavidplowman
authored andcommitted
core: Allow info-text to display on the console
This will only work if --info-text is explicitly provided in a command line argument and not defaulted, and --nopreview has been set. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
1 parent 77a03d9 commit 9f08463

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/options.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ bool Options::Parse(int argc, char *argv[])
8282
if (framerate_ != -1.0)
8383
framerate = framerate_;
8484

85+
// Check if --nopreview is set, and if no info-text string was provided
86+
// null the defaulted string so nothing gets displayed to stderr.
87+
if (nopreview && vm["info-text"].defaulted())
88+
info_text = "";
89+
8590
// lens_position is even more awkward, because we have two "default"
8691
// behaviours: Either no lens movement at all (if option is not given),
8792
// or libcamera's default control value (typically the hyperfocal).

preview/null_preview.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class NullPreview : public Preview
2525
// Return the maximum image size allowed. Zeroes mean "no limit".
2626
virtual void MaxImageSize(unsigned int &w, unsigned int &h) const override { w = h = 0; }
2727

28+
void SetInfoText(const std::string &text) override { LOG(1, text); }
29+
2830
private:
2931
};
3032

0 commit comments

Comments
 (0)