OrbbecSDK  1.5.7
OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices
RecordPlayback.hpp
浏览该文件的文档.
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 
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 
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
Definition: Context.hpp:20
相机参数
Definition: ObTypes.h:434
提供SDK的结构体、枚举常量定义(依赖libobsensor/h/ObTypes.h)
std::function< void(std::shared_ptr< Frame > frame)> PlaybackCallback
OBMediaType
录制回放感兴趣数据类型
Definition: ObTypes.h:682
std::function< void(OBMediaState state)> MediaStateCallback
#define OB_EXTENSION_API
Definition: ObTypes.h:25