From 47a9f357fe9d6c4e6ea592f1fbc947cae3c532f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Fri, 5 Apr 2019 20:56:07 +0200 Subject: cam: Extend BufferWriter to include a stream name in file path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To be able to write multiple buffers captured in the same request (and hence having the same sequence number) the buffer writer needs to name each file uniquely. Add a stream name to the writer function which the buffer writer can add to the part of the pattern it already expands to the sequence number. As cam only supports one stream, hard code the name to stream0. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cam/main.cpp') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 41a4d9c6..3dd4b24d 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -57,7 +57,7 @@ static int parseOptions(int argc, char *argv[]) "Capture until interrupted by user", "capture"); parser.addOption(OptFile, OptionString, "Write captured frames to disk\n" - "The first '#' character in the file name is expanded to the frame sequence number.\n" + "The first '#' character in the file name is expanded to the stream name and frame sequence number.\n" "The default file name is 'frame-#.bin'.", "file", ArgumentOptional, "filename"); parser.addOption(OptStream, &streamKeyValue, @@ -121,7 +121,7 @@ static void requestComplete(Request *request, const std::map << std::endl; if (writer) - writer->write(buffer); + writer->write(buffer, "stream0"); request = camera->createRequest(); if (!request) { -- cgit v1.2.1