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
11struct RecorderImpl;
12struct PlaybackImpl;
13
14namespace ob {
15
16class Device;
17class Frame;
18class DeviceInfo;
19
20using PlaybackCallback = std::function<void(std::shared_ptr<Frame> frame)>;
21using MediaStateCallback = std::function<void(OBMediaState state)>;
22
24private:
25 std::unique_ptr<RecorderImpl> impl_;
26
27public:
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
64private:
65 std::unique_ptr<PlaybackImpl> impl_;
66
67public:
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
Enumeration for record playback status.
Definition ObTypes.h:706
#define OB_EXTENSION_API
Definition ObTypes.h:28
OBMediaType
Enumeration for types of media to record or playback.
Definition ObTypes.h:686
@ OB_MEDIA_ALL
Definition ObTypes.h:698
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:640
virtual ~Playback() noexcept
Playback(const char *filename)
Create a playback object.
Playback(std::unique_ptr< PlaybackImpl > impl)
Recorder()
Create a recorder for data recording.
virtual ~Recorder() noexcept
Recorder(std::unique_ptr< RecorderImpl > impl)
Recorder(std::shared_ptr< Device > device)
Create a recorder for data recording.
Definition Context.hpp:16
std::function< void(std::shared_ptr< Frame > frame)> PlaybackCallback
std::function< void(OBMediaState state)> MediaStateCallback
Structure for camera parameters.
Definition ObTypes.h:462