Add Folder check and Folder creation
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#include "FoscamRecorder.h"
|
||||
#include "Util.h"
|
||||
#include "Util/Util.h"
|
||||
#include <HttpClient.h>
|
||||
#include <JpegImageCollection.h>
|
||||
#include <Logging.h>
|
||||
#include <filesystem/path.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
|
||||
@@ -26,7 +27,31 @@ std::string FoscamRecorder::Snapshot(ctpl::thread_pool* pThreadPool, const std::
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "FoscamRecorder Snapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
//if (m_pRecorderMutex->IsRecording(m_settings.IpAddress))
|
||||
// return std::string();
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -40,7 +65,27 @@ std::string FoscamRecorder::MultiSnapshot(ctpl::thread_pool* pThreadPool, const
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "FoscamRecorder MultiSnapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -58,7 +103,28 @@ std::string FoscamRecorder::Video(ctpl::thread_pool* pThreadPool, const std::str
|
||||
std::stringstream url;
|
||||
url << "rtsp://" << m_settings.Username << ":" << m_settings.Password << "@" << m_settings.IpAddress << ":" << port << "/videoSub";
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "mp4", dateTimeString);
|
||||
|
||||
std::stringstream command;
|
||||
@@ -71,11 +137,18 @@ std::string FoscamRecorder::Video(ctpl::thread_pool* pThreadPool, const std::str
|
||||
return fileName;
|
||||
}
|
||||
|
||||
std::string FoscamRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString)
|
||||
std::string FoscamRecorder::GetFolderName(const Settings& settings)
|
||||
{
|
||||
filesystem::path fileLocation(settings.Path);
|
||||
fileLocation = fileLocation / filesystem::path(settings.IpAddress);
|
||||
|
||||
return fileLocation.str();
|
||||
}
|
||||
|
||||
std::string FoscamRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString)
|
||||
{
|
||||
filesystem::path fileLocation(GetFolderName(settings));
|
||||
|
||||
std::string fileName = std::string(dateTimeString).append(".").append(extension);
|
||||
filesystem::path fullFileName = fileLocation / filesystem::path(fileName);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
virtual std::string Video(ctpl::thread_pool* pThreadPool, const std::string& ffmpeg) override;
|
||||
|
||||
private:
|
||||
static std::string GetFolderName(const Settings& settings);
|
||||
static std::string GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString);
|
||||
static void Snapshots(Http::HttpClient* pHttpClient, const Settings& settings, std::string dateTimeString, int numberOfImages);
|
||||
static Image::JpegImage Snapshot(Http::HttpClient* pHttpClient, const Settings& settings);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "RTSPRecorder.h"
|
||||
#include "Util.h"
|
||||
#include "Util/Util.h"
|
||||
#include <HttpClient.h>
|
||||
#include <Logging.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
namespace CameraRecorder {
|
||||
@@ -21,7 +22,28 @@ std::string RTSPRecorder::Snapshot(ctpl::thread_pool* pThreadPool, const std::st
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "RTSPRecorder Snapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString, 0);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -35,7 +57,28 @@ std::string RTSPRecorder::MultiSnapshot(ctpl::thread_pool* pThreadPool, const st
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "RTSPRecorder MultiSnapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString, 0);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -52,7 +95,28 @@ std::string RTSPRecorder::Video(ctpl::thread_pool* pThreadPool, const std::strin
|
||||
std::stringstream url;
|
||||
url << "rtsp://" << m_settings.Username << ":" << m_settings.Password << "@" << m_settings.IpAddress << ":" << m_settings.Port << m_settings.URL;
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "mp4", dateTimeString, 0);
|
||||
|
||||
std::stringstream command;
|
||||
@@ -65,12 +129,19 @@ std::string RTSPRecorder::Video(ctpl::thread_pool* pThreadPool, const std::strin
|
||||
return fileName;
|
||||
}
|
||||
|
||||
std::string RTSPRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString, int imageIndex)
|
||||
std::string RTSPRecorder::GetFolderName(const Settings& settings)
|
||||
{
|
||||
filesystem::path fileLocation(settings.Path);
|
||||
fileLocation = fileLocation / filesystem::path(settings.IpAddress);
|
||||
|
||||
std::string fileName = std::string(dateTimeString).append(".").append(extension);
|
||||
return fileLocation.str();
|
||||
}
|
||||
|
||||
std::string RTSPRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString, int imageIndex)
|
||||
{
|
||||
filesystem::path fileLocation(GetFolderName(settings));
|
||||
|
||||
std::string fileName = std::string(dateTimeString).append("_").append(std::to_string(imageIndex)).append(".").append(extension);
|
||||
filesystem::path fullFileName = fileLocation / filesystem::path(fileName);
|
||||
|
||||
return fullFileName.str();
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
virtual std::string Video(ctpl::thread_pool* pThreadPool, const std::string& ffmpeg) override;
|
||||
|
||||
private:
|
||||
static std::string GetFolderName(const Settings& settings);
|
||||
static std::string GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString, int imageIndex);
|
||||
static void Snapshots(const std::string& ffmpeg, const Settings& settings, std::string dateTimeString, int numberOfImages);
|
||||
static void Snapshot(const std::string& ffmpeg, const Settings& settings, const filesystem::path& fileName);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#include "Util.h"
|
||||
#include <array>
|
||||
#include <ctime>
|
||||
|
||||
|
||||
namespace CameraRecorder {
|
||||
namespace Recorder {
|
||||
|
||||
std::string GetDateTimeString(bool omitSeparator)
|
||||
{
|
||||
std::array<char, 17> buffer;
|
||||
buffer.fill(0);
|
||||
std::time_t t = std::time(nullptr);
|
||||
std::tm* tm = std::localtime(&t);
|
||||
|
||||
if (omitSeparator)
|
||||
strftime(buffer.data(), sizeof(buffer), "%Y%m%d%H%M%S", tm);
|
||||
else
|
||||
strftime(buffer.data(), sizeof(buffer), "%Y%m%d-%H%M%S", tm);
|
||||
|
||||
return buffer.data();
|
||||
}
|
||||
|
||||
} // namespace Recorder
|
||||
} // namespace CameraRecorder
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef RECORDER_UTIL_H
|
||||
#define RECORDER_UTIL_H
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace CameraRecorder {
|
||||
namespace Recorder {
|
||||
|
||||
std::string GetDateTimeString(bool omitSeparator = false);
|
||||
|
||||
} // namespace Recorder
|
||||
} // namespace CameraRecorder
|
||||
|
||||
#endif // RECORDER_UTIL_H
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "VStarCamRecorder.h"
|
||||
#include "Util.h"
|
||||
#include "Util/Util.h"
|
||||
#include <HttpClient.h>
|
||||
#include <Logging.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -23,7 +24,28 @@ std::string VStarCamRecorder::Snapshot(ctpl::thread_pool* pThreadPool, const std
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "VStarCamRecorder Snapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString(true);
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString(true);
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString, 0);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -37,7 +59,28 @@ std::string VStarCamRecorder::MultiSnapshot(ctpl::thread_pool* pThreadPool, cons
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "VStarCamRecorder MultiSnapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString(true);
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString(true);
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString, 0);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -55,7 +98,28 @@ std::string VStarCamRecorder::Video(ctpl::thread_pool* pThreadPool, const std::s
|
||||
std::stringstream url;
|
||||
url << "rtsp://" << m_settings.Username << ":" << m_settings.Password << "@" << m_settings.IpAddress << ":" << port << "/udp/av0_0";
|
||||
|
||||
std::string dateTimeString = GetDateTimeString(true);
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString(true);
|
||||
std::string fileName = GetFileName(m_settings, "mp4", dateTimeString, 0);
|
||||
|
||||
std::stringstream command;
|
||||
@@ -68,11 +132,18 @@ std::string VStarCamRecorder::Video(ctpl::thread_pool* pThreadPool, const std::s
|
||||
return fileName;
|
||||
}
|
||||
|
||||
std::string VStarCamRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString, int imageIndex)
|
||||
std::string VStarCamRecorder::GetFolderName(const Settings& settings)
|
||||
{
|
||||
filesystem::path fileLocation(settings.Path);
|
||||
fileLocation = fileLocation / filesystem::path(settings.IpAddress);
|
||||
|
||||
return fileLocation.str();
|
||||
}
|
||||
|
||||
std::string VStarCamRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString, int imageIndex)
|
||||
{
|
||||
filesystem::path fileLocation(GetFolderName(settings));
|
||||
|
||||
std::string fileName = std::string("VSTA000000XXXXX_0_").append(dateTimeString).append("_").append(std::to_string(imageIndex)).append(".").append(extension);
|
||||
filesystem::path fullFileName = fileLocation / filesystem::path(fileName);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
virtual std::string Video(ctpl::thread_pool* pThreadPool, const std::string& ffmpeg) override;
|
||||
|
||||
private:
|
||||
static std::string GetFolderName(const Settings& settings);
|
||||
static std::string GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString, int imageIndex);
|
||||
static void Snapshots(Http::HttpClient* pHttpClient, const Settings& settings, std::string dateTimeString, int numberOfImages);
|
||||
static void Snapshot(Http::HttpClient* pHttpClient, const Settings& settings, const filesystem::path& fileName);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "WatchBotRecorder.h"
|
||||
#include "Util.h"
|
||||
#include "Util/Util.h"
|
||||
#include <HttpClient.h>
|
||||
#include <JpegImageCollection.h>
|
||||
#include <Logging.h>
|
||||
#include <filesystem/path.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
@@ -26,7 +27,28 @@ std::string WatchBotRecorder::Snapshot(ctpl::thread_pool* pThreadPool, const std
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "WatchBotRecorder Snapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -40,7 +62,28 @@ std::string WatchBotRecorder::MultiSnapshot(ctpl::thread_pool* pThreadPool, cons
|
||||
{
|
||||
Logging::Log(Logging::Severity::Debug, "WatchBotRecorder MultiSnapshot");
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "jpg", dateTimeString);
|
||||
|
||||
Http::HttpClient* pHttpClient = m_pHttpClient;
|
||||
@@ -57,7 +100,28 @@ std::string WatchBotRecorder::Video(ctpl::thread_pool* pThreadPool, const std::s
|
||||
std::stringstream url;
|
||||
url << "http://" << m_settings.IpAddress << ":" << m_settings.Port << "/videostream.asf?user=" << m_settings.Username << "&pwd=" << m_settings.Password;
|
||||
|
||||
std::string dateTimeString = GetDateTimeString();
|
||||
std::string folderName = GetFolderName(m_settings);
|
||||
if (!Util::FolderExists(folderName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Util::CreateFolder(folderName);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Exception caught" << std::endl;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Type : " << typeid(e).name() << std::endl;
|
||||
ss << "ERROR: " << e.what() << std::endl;
|
||||
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string dateTimeString = Util::GetDateTimeString();
|
||||
std::string fileName = GetFileName(m_settings, "mp4", dateTimeString);
|
||||
|
||||
std::stringstream command;
|
||||
@@ -70,11 +134,18 @@ std::string WatchBotRecorder::Video(ctpl::thread_pool* pThreadPool, const std::s
|
||||
return fileName;
|
||||
}
|
||||
|
||||
std::string WatchBotRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString)
|
||||
std::string WatchBotRecorder::GetFolderName(const Settings& settings)
|
||||
{
|
||||
filesystem::path fileLocation(settings.Path);
|
||||
fileLocation = fileLocation / filesystem::path(settings.IpAddress);
|
||||
|
||||
return fileLocation.str();
|
||||
}
|
||||
|
||||
std::string WatchBotRecorder::GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString)
|
||||
{
|
||||
filesystem::path fileLocation(GetFolderName(settings));
|
||||
|
||||
std::string fileName = std::string(dateTimeString).append(".").append(extension);
|
||||
filesystem::path fullFileName = fileLocation / filesystem::path(fileName);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
virtual std::string Video(ctpl::thread_pool* pThreadPool, const std::string& ffmpeg) override;
|
||||
|
||||
private:
|
||||
static std::string GetFolderName(const Settings& settings);
|
||||
static std::string GetFileName(const Settings& settings, const std::string& extension, const std::string& dateTimeString);
|
||||
static void Snapshots(Http::HttpClient* pHttpClient, const Settings& settings, std::string dateTimeString, int numberOfImages);
|
||||
static Image::JpegImage Snapshot(Http::HttpClient* pHttpClient, const Settings& settings);
|
||||
|
||||
Reference in New Issue
Block a user