Merge branch 'development' into LTS_development

# Conflicts:
#	lib/stream.cpp
#	src/input/input.cpp
This commit is contained in:
Thulinma 2017-06-22 14:07:54 +02:00
commit 0ca63d1440
6 changed files with 27 additions and 0 deletions

View file

@ -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

View file

@ -472,3 +472,11 @@ static std::string strftime_now(const std::string& format) {
return buffer;
}
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];
}

View file

@ -13,5 +13,6 @@ namespace Util {
bool startInput(std::string streamname, std::string filename = "", bool forkFirst = true, bool isProvider = false);
int startPush(const std::string & streamname, std::string & target);
JSON::Value getStreamConfig(std::string streamname);
uint8_t getStreamStatus(std::string & streamname);
}