| OrbbecSDK 1.5.7 OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

RecordPlayback.hpp
Go to the documentation of this file.
1
11 #pragma once
12
13 #include "Types.hpp"
14 #include <memory>
15
16 struct RecorderImpl;
17 struct PlaybackImpl;
18
19 namespace ob {
20 class Device;
21 class Frame;
22 class DeviceInfo;
23
24 using PlaybackCallback = std::function<void(std::shared_ptr<Frame> frame)>;
25 using MediaStateCallback = std::function<void(OBMediaState state)>;
26
27 class OB_EXTENSION_API Recorder {
28 private:
29 std::unique_ptr<RecorderImpl> impl_;
30
31 public:
39 Recorder();
40 Recorder(std::unique_ptr<RecorderImpl> impl);
41
51 Recorder(std::shared_ptr<Device> device);
52
53 virtual ~Recorder() noexcept;
54
68 void start(const char *filename, bool async = false);
69
77 void stop();
78
90 void write(std::shared_ptr<Frame> frame);
91 };
92
93 class OB_EXTENSION_API Playback {
94 private:
95 std::unique_ptr<PlaybackImpl> impl_;
96
97 public:
107 Playback(const char *filename);
108 Playback(std::unique_ptr<PlaybackImpl> impl);
109 virtual ~Playback() noexcept;
110
124 void start(PlaybackCallback callback, OBMediaType type = OB_MEDIA_ALL);
125
133 void stop();
134
144 void setPlaybackStateCallback(MediaStateCallback state);
145
157 std::shared_ptr<DeviceInfo> getDeviceInfo();
158
170 OBCameraParam getCameraParam();
171 };
172
173 } // namespace ob
ob::Recorder
Definition: RecordPlayback.hpp:27
ob
Definition: Context.hpp:20
OBCameraParam
Camera parameters.
Definition: ObTypes.h:434
Types.hpp
Provide SDK structure and enumeration constant definition (depending on libobsensor/h/ObTypes.h)
ob::PlaybackCallback
std::function< void(std::shared_ptr< Frame > frame)> PlaybackCallback
Definition: RecordPlayback.hpp:24
OBMediaType
OBMediaType
record playback of the type of interest
Definition: ObTypes.h:682
ob::Playback
Definition: RecordPlayback.hpp:93
ob::MediaStateCallback
std::function< void(OBMediaState state)> MediaStateCallback
Definition: RecordPlayback.hpp:25
OB_EXTENSION_API
#define OB_EXTENSION_API
Definition: ObTypes.h:25
OB_MEDIA_ALL
Definition: ObTypes.h:694