Add ArRecorder logic

This commit is contained in:
2021-06-30 19:35:10 +02:00
parent b3284ae096
commit 5f85d07609
10 changed files with 263 additions and 38 deletions

View File

@@ -0,0 +1,40 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "AR/ArSession.hpp"
#include "ArPlaybackReader.hpp"
#include "Math/Timestamp.hpp"
namespace openVulkanoCpp::AR::Playback
{
class ArSessionPlayback final : public ArSession, public std::enable_shared_from_this<ArSessionPlayback>
{
public:
ArSessionPlayback(const std::string& recordingPath, bool autoAdvance);
~ArSessionPlayback() override;
void Start() override;
void Stop() override;
void Pause() override;
[[nodiscard]] std::shared_ptr<ArFrame> GetFrame() override;
[[nodiscard]] ArSessionType GetSessionType() override { return ArSessionType::PLAYBACK; }
[[nodiscard]] ArType GetArType() override;
private:
Math::Timestamp lastTimestamp;
const std::string recordingPath;
const bool autoAdvance;
ArPlaybackReader playbackReader;
};
}