59 std::shared_ptr<MediaDemuxer>&
demuxer,
66 onSuccessfulSetup_ =
cb;
71 std::string
getId()
const {
return id_; };
74 void readFromDevice();
77 bool initDevice(
const std::string& device);
78 bool initFile(
const std::string& path);
80 void frameResized(std::shared_ptr<AudioFrame>&&
ptr);
83 std::shared_ptr<RingBuffer> ringBuf_;
84 bool muteState_ {
false};
86 mutable std::mutex fmtMutex_ {};
89 std::atomic_bool paused_ {
true};
91 std::unique_ptr<Resampler> resampler_;
92 std::unique_ptr<AudioFrameResizer> resizer_;
93 std::unique_ptr<MediaDecoder> decoder_;
95 std::string resource_;
96 std::mutex resourceMutex_ {};
97 DeviceParams devOpts_;
98 std::promise<DeviceParams> foundDevOpts_;
99 std::shared_future<DeviceParams> futureDevOpts_;
100 std::atomic_bool devOptsFound_ {
false};
101 void foundDevOpts(
const DeviceParams&
params);
103 std::atomic_bool playingDevice_ {
false};
104 std::atomic_bool decodingFile_ {
false};
105 std::atomic_bool playingFile_ {
false};
106 std::unique_ptr<AudioDeviceGuard> deviceGuard_;
111 std::chrono::time_point<std::chrono::steady_clock> wakeUp_;
114 std::function<
void(
const MediaStream& ms)> recorderCallback_;
115 std::atomic_bool settingMS_ {
true};