mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-04 03:41:43 +02:00
process stream
This commit is contained in:
parent
0d4cfe74e2
commit
50a4380616
6 changed files with 357 additions and 9 deletions
|
@ -19,7 +19,11 @@
|
|||
#ifndef PROCESS_STREAM_H
|
||||
#define PROCESS_STREAM_H
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "pcmStream.h"
|
||||
#include "process.hpp"
|
||||
|
||||
|
||||
/// Starts an external process and reads and PCM data from stdout
|
||||
|
@ -35,8 +39,20 @@ public:
|
|||
ProcessStream(PcmListener* pcmListener, const StreamUri& uri);
|
||||
virtual ~ProcessStream();
|
||||
|
||||
virtual void start();
|
||||
virtual void stop();
|
||||
|
||||
protected:
|
||||
void worker();
|
||||
std::string exe;
|
||||
std::string path;
|
||||
std::unique_ptr<Process> process_;
|
||||
std::thread stderrReaderThread_;
|
||||
|
||||
virtual void worker();
|
||||
void stderrReader();
|
||||
|
||||
bool fileExists(const std::string& name);
|
||||
std::string findExe(const std::string& name);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue