31#include <condition_variable>
35#import "TargetConditionals.h"
54 const std::string&
resource =
"local",
55 const std::string&
sink =
"");
59 const std::string&
getName()
const {
return resource_; }
67 std::shared_future<DeviceParams>
getParams()
const {
68 return futureDecOpts_;
73 void setSink(
const std::string& sinkId);
76 std::shared_ptr<MediaDemuxer>&
demuxer,
81 void setupSink(
const int width,
const int height);
88 onSuccessfulSetup_ =
cb;
101 std::shared_future<DeviceParams> switchInput(
const std::string&
resource);
103 std::string resource_;
104 std::atomic<bool> switchPending_ = {
false};
105 std::atomic_bool isStopped_ = {
false};
107 DeviceParams decOpts_;
108 std::promise<DeviceParams> foundDecOpts_;
109 std::shared_future<DeviceParams> futureDecOpts_;
110 bool emulateRate_ =
false;
112 std::atomic_bool decOptsFound_ {
false};
113 void foundDecOpts(
const DeviceParams&
params);
118 bool initCamera(
const std::string& device);
119 bool initFile(std::string path);
126 bool initLinuxGrab(
const std::string& display);
133 bool capturing_ {
false};
134 void createDecoder();
135 void deleteDecoder();
136 std::unique_ptr<MediaDecoder> decoder_;
137 std::shared_ptr<SinkClient> sink_;
148 std::shared_ptr<AVBufferRef> displayMatrix_;
149 void setRotation(
int angle);
151 inline bool videoManagedByClient()
const
155 bool playingFile_ =
false;
156 std::atomic_bool paused_ {
true};
159 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.