| OrbbecSDK 1.10.18 OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras

Loading...
Searching...
No Matches
RecordPlayback.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include "Types.hpp"
9#include <memory>
10
11 struct RecorderImpl;
12 struct PlaybackImpl;
13
14 namespace ob {
15
16 class Device;
17 class Frame;
18 class DeviceInfo;
19
20 using PlaybackCallback = std::function<void(std::shared_ptr<Frame> frame)>;
21 using MediaStateCallback = std::function<void(OBMediaState state)>;
22
23 class OB_EXTENSION_API Recorder {
24 private:
25 std::unique_ptr<RecorderImpl> impl_;
26
27 public:
31 Recorder();
32 Recorder(std::unique_ptr<RecorderImpl> impl);
33
38 Recorder(std::shared_ptr<Device> device);
39
40 virtual ~Recorder() noexcept;
41
48 void start(const char *filename, bool async = false);
49
53 void stop();
54
60 void write(std::shared_ptr<Frame> frame);
61};
62
63class OB_EXTENSION_API Playback {
64 private:
65 std::unique_ptr<PlaybackImpl> impl_;
66
67 public:
72 Playback(const char *filename);
73 Playback(std::unique_ptr<PlaybackImpl> impl);
74 virtual ~Playback() noexcept;
75
81 void start(PlaybackCallback callback, OBMediaType type = OB_MEDIA_ALL);
82
86 void stop();
87
92 void setPlaybackStateCallback(MediaStateCallback state);
93
99 std::shared_ptr<DeviceInfo> getDeviceInfo();
100
106 OBCameraParam getCameraParam();
107};
108
109} // namespace ob
OBMediaState
OBMediaState
Enumeration for record playback status.
Definition ObTypes.h:706
OB_EXTENSION_API
#define OB_EXTENSION_API
Definition ObTypes.h:28
OBMediaType
OBMediaType
Enumeration for types of media to record or playback.
Definition ObTypes.h:686
OB_MEDIA_ALL
@ OB_MEDIA_ALL
Definition ObTypes.h:698
Types.hpp
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
ob::DeviceInfo
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:640
ob::Frame
Definition Frame.hpp:42
ob::Playback
Definition RecordPlayback.hpp:63
ob::Playback::~Playback
virtual ~Playback() noexcept
ob::Playback::Playback
Playback(const char *filename)
Create a playback object.
ob::Playback::Playback
Playback(std::unique_ptr< PlaybackImpl > impl)
ob::Recorder
Definition RecordPlayback.hpp:23
ob::Recorder::Recorder
Recorder()
Create a recorder for data recording.
ob::Recorder::~Recorder
virtual ~Recorder() noexcept
ob::Recorder::Recorder
Recorder(std::unique_ptr< RecorderImpl > impl)
ob::Recorder::Recorder
Recorder(std::shared_ptr< Device > device)
Create a recorder for data recording.
ob
Definition Context.hpp:16
ob::PlaybackCallback
std::function< void(std::shared_ptr< Frame > frame)> PlaybackCallback
Definition RecordPlayback.hpp:20
ob::MediaStateCallback
std::function< void(OBMediaState state)> MediaStateCallback
Definition RecordPlayback.hpp:21
OBCameraParam
Structure for camera parameters.
Definition ObTypes.h:462