
All processes:
- Added process status system and relevant API calls
- Added ability to set track masks for input/output in processes
- Added support for unmasking tracks when there is a push target, by the "unmask" parameter.
- Added track unmasking support for processes on exit/error
- Make processes start faster, if possible, in the first few seconds of a stream
- Delay stream ready state if there are processes attempting to start
Livepeer process updates:
- Added Content-Resolution header to MistProcLivepeer as per Livepeer's request
- Renamed transcode from "Mist Transcode" to source stream name
- Added ability to send audio to livepeer
- Robustified livepeer timing code, shutdown code, and improved GUI
- Prevent "audio keyframes" from starting segments in MistProcLivepeer
- Multithreaded (2 upload threads) livepeer process
- Stricter downloader/uploader timeout behaviour
- Robustness improvements
- Fix small segment size 😒
- Streamname correction
- Prevent getting stuck when transcoding multiple qualities and they are not equal length
- Corrected log message print error
- Race condition fix
- Now always waits for at least 1 video track
63 lines
1.8 KiB
C++
63 lines
1.8 KiB
C++
#include "input.h"
|
|
#include <fstream>
|
|
#include <mist/dtsc.h>
|
|
#include <mist/shared_memory.h>
|
|
|
|
namespace Mist{
|
|
class inputBuffer : public Input{
|
|
public:
|
|
inputBuffer(Util::Config *cfg);
|
|
~inputBuffer();
|
|
void onCrash();
|
|
|
|
private:
|
|
void fillBufferDetails(JSON::Value &details) const;
|
|
uint64_t bufferTime;
|
|
uint64_t cutTime;
|
|
size_t segmentSize; /*LTS*/
|
|
uint64_t lastReTime; /*LTS*/
|
|
uint64_t lastProcTime; /*LTS*/
|
|
uint64_t firstProcTime; /*LTS*/
|
|
uint64_t finalMillis;
|
|
bool hasPush;//Is a push currently being received?
|
|
bool everHadPush;//Was there ever a push received?
|
|
bool allProcsRunning;
|
|
bool resumeMode;
|
|
uint64_t maxKeepAway;
|
|
IPC::semaphore *liveMeta;
|
|
|
|
protected:
|
|
// Private Functions
|
|
bool preRun();
|
|
bool checkArguments(){return true;}
|
|
void updateMeta();
|
|
bool readHeader(){return false;}
|
|
bool needHeader(){return false;}
|
|
void getNext(size_t idx = INVALID_TRACK_ID){};
|
|
void seek(uint64_t seekTime, size_t idx = INVALID_TRACK_ID){};
|
|
|
|
void removeTrack(size_t tid);
|
|
|
|
bool removeKey(size_t tid);
|
|
void removeUnused();
|
|
void finish();
|
|
|
|
uint64_t retrieveSetting(DTSC::Scan &streamCfg, const std::string &setting, const std::string &option = "");
|
|
|
|
void userLeadIn();
|
|
void userOnActive(size_t id);
|
|
void userOnDisconnect(size_t id);
|
|
void userLeadOut();
|
|
// This is used for an ugly fix to prevent metadata from disappearing in some cases.
|
|
std::map<size_t, std::string> initData;
|
|
|
|
uint64_t findTrack(const std::string &trackVal);
|
|
void checkProcesses(const JSON::Value &procs); // LTS
|
|
std::map<std::string, pid_t> runningProcs; // LTS
|
|
|
|
std::set<size_t> generatePids;
|
|
std::map<size_t, size_t> sourcePids;
|
|
};
|
|
}// namespace Mist
|
|
|
|
typedef Mist::inputBuffer mistIn;
|