libcamera: stream: Add and use toString() method to StreamConfiguration
Add a toString() method to the StreamConfiguration class, and replace all manually coded implementations through the source code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
* stream.cpp - Video stream for a Camera
|
||||
*/
|
||||
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
/**
|
||||
@@ -60,6 +63,22 @@ namespace libcamera {
|
||||
* \brief Requested number of buffers to allocate for the stream
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Assemble and return a string describing the configuration
|
||||
*
|
||||
* \return A string describing the StreamConfiguration
|
||||
*/
|
||||
std::string StreamConfiguration::toString() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
ss.fill(0);
|
||||
ss << width << "x" << height << "-0x" << std::hex
|
||||
<< std::setw(8) << pixelFormat;
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* \class StreamUsage
|
||||
* \brief Stream usage information
|
||||
|
||||
Reference in New Issue
Block a user