[libcamera-devel] [PATCH/RFC 01/12] libcamera: camera: Fix std::ostringstream initialisation
Niklas Söderlund
niklas.soderlund at ragnatech.se
Sat May 18 17:33:51 CEST 2019
Hi Laurent,
Thanks for your work.
On 2019-05-18 02:06:10 +0300, Laurent Pinchart wrote:
> We use the std::ostringstream class to generate log messages in the
> Camera class. The stream is initialised with initial content, but is not
> opened without seeking to the end, which results in the content being
> overwritten immediately. Fix it by opening the stream with
> std::ios_base::ate.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/libcamera/camera.cpp | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index fbc66dedba51..1a21acac9899 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -560,7 +560,7 @@ Camera::streamConfiguration(const std::vector<StreamUsage> &usages)
>
> CameraConfiguration config = pipe_->streamConfiguration(this, usages);
>
> - std::ostringstream msg("streams configuration:");
> + std::ostringstream msg("streams configuration:", std::ios_base::ate);
> unsigned int index = 0;
>
> for (Stream *stream : config) {
> @@ -614,7 +614,7 @@ int Camera::configureStreams(const CameraConfiguration &config)
> return -EINVAL;
> }
>
> - std::ostringstream msg("configuring streams:");
> + std::ostringstream msg("configuring streams:", std::ios_base::ate);
> unsigned int index = 0;
>
> for (Stream *stream : config) {
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list