31#import "TargetConditionals.h"
50 const std::string&
resource =
"local",
51 const std::string&
sink =
"");
55 const std::string&
getName()
const {
return resource_; }
61 std::shared_future<DeviceParams>
getParams()
const {
return futureDecOpts_; }
65 void setSink(
const std::string& sinkId);
71 void setupSink(
const int width,
const int height);
88 std::shared_future<DeviceParams> switchInput(
const std::string&
resource);
90 std::string resource_;
91 std::atomic<bool> switchPending_ = {
false};
92 std::atomic_bool isStopped_ = {
false};
94 DeviceParams decOpts_;
95 std::promise<DeviceParams> foundDecOpts_;
96 std::shared_future<DeviceParams> futureDecOpts_;
97 bool emulateRate_ =
false;
99 std::atomic_bool decOptsFound_ {
false};
100 void foundDecOpts(
const DeviceParams&
params);
105 bool initCamera(
const std::string& device);
106 bool initFile(
const std::string& path);
113 bool initLinuxGrab(
const std::string& display);
120 bool capturing_ {
false};
121 void createDecoder();
122 void deleteDecoder();
123 std::unique_ptr<MediaDecoder> decoder_;
124 std::shared_ptr<SinkClient> sink_;
135 std::shared_ptr<AVBufferRef> displayMatrix_;
136 void setRotation(
int angle);
139 bool playingFile_ =
false;
140 std::atomic_bool paused_ {
true};
143 std::function<
void(
const MediaStream& ms)> recorderCallback_;
void emitSignal(Args... args)
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)
DeviceParams Parameters used by MediaDecoder and MediaEncoder to open a LibAV device/stream.