Added stream status shared memory page (temporary system)
This commit is contained in:
parent
76b5a91da6
commit
25699ef8b2
6 changed files with 27 additions and 0 deletions
|
@ -107,6 +107,14 @@ static inline void show_stackframe(){}
|
|||
#define FLIP_MIN_DURATION 20000
|
||||
|
||||
#define SHM_STREAM_INDEX "MstSTRM%s" //%s stream name
|
||||
#define SHM_STREAM_STATE "MstSTATE%s" //%s stream name
|
||||
#define STRMSTAT_OFF 0
|
||||
#define STRMSTAT_INIT 1
|
||||
#define STRMSTAT_BOOT 2
|
||||
#define STRMSTAT_WAIT 3
|
||||
#define STRMSTAT_READY 4
|
||||
#define STRMSTAT_SHUTDOWN 5
|
||||
#define STRMSTAT_INVALID 255
|
||||
#define SHM_TRACK_META "MstTRAK%s@%lu" //%s stream name, %lu track ID
|
||||
#define SHM_TRACK_INDEX "MstTRID%s@%lu" //%s stream name, %lu track ID
|
||||
#define SHM_TRACK_INDEX_SIZE 8192
|
||||
|
|
|
@ -299,3 +299,11 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
|
|||
return streamAlive(streamname);
|
||||
}
|
||||
|
||||
uint8_t Util::getStreamStatus(std::string & streamname){
|
||||
char pageName[NAME_BUFFER_SIZE];
|
||||
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_STATE, streamname.c_str());
|
||||
IPC::sharedPage streamStatus(pageName, 1, false, false);
|
||||
if (!streamStatus){return STRMSTAT_OFF;}
|
||||
return streamStatus.mapped[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -12,5 +12,6 @@ namespace Util {
|
|||
bool streamAlive(std::string & streamname);
|
||||
bool startInput(std::string streamname, std::string filename = "", bool forkFirst = true, bool isProvider = false);
|
||||
JSON::Value getStreamConfig(std::string streamname);
|
||||
uint8_t getStreamStatus(std::string & streamname);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue