MistServer
2.5.3-Pro-19-gf5e75b1 ( Generic_64)
|
Recording to file. More...
Data Structures | |
struct | booking |
struct | DTSCPageData |
struct | fragSet |
class | HTTPOutput |
class | InOutBase |
Class containing all basic input and output functions. More... | |
class | Input |
class | inputAV |
class | inputBuffer |
class | inputDTSC |
class | inputFLV |
class | inputFolder |
class | inputISMV |
class | inputMP3 |
class | inputMP4 |
class | inputOGG |
class | inputTS |
This class contains all functions needed to implement TS Input. More... | |
struct | keyPart |
struct | mp4PartBpos |
class | mp4PartTime |
class | mp4TrackHeader |
class | negotiationProxy |
class | OutDashMP4 |
class | OutHDS |
class | OutHLS |
class | OutHSS |
class | OutHTTP |
class | OutHTTPMinimalServer |
class | OutHTTPTS |
class | OutJSON |
class | OutProgressiveFLV |
class | OutProgressiveMP3 |
class | OutProgressiveMP4 |
class | OutProgressiveOGG |
class | OutProgressiveSRT |
class | OutPush |
class | Output |
The output class is intended to be inherited by MistOut process classes. More... | |
class | OutRaw |
class | OutRTMP |
class | OutRTSP |
class | OutTS |
class | OutTSPush |
struct | position |
struct | seekPos |
class | segment |
struct | segPart |
struct | sortedPageInfo |
This struct keeps packet information sorted in playback order, so the Mist::Output class knows when to buffer which packet. More... | |
struct | sourceCompare |
Sorts the JSON::Value objects that hold source information by preference. More... | |
class | trackmeta |
Structure used to keep track of selected tracks. More... | |
class | TSOutput |
Enumerations | |
enum | negotiationState { FILL_NEW, FILL_NEG, FILL_DEC, FILL_ACC } |
Functions | |
void | addSource (const std::string &rel, std::set< JSON::Value, sourceCompare > &sources, std::string &host, const std::string &port, JSON::Value &conncapa, unsigned int most_simul, unsigned int total_matches, const std::string &flvPlayerPrefix) |
void | addSources (std::string &streamname, const std::string &rel, std::set< JSON::Value, sourceCompare > &sources, std::string &host, const std::string &port, JSON::Value &conncapa, JSON::Value &strmMeta, const std::string httpHost) |
static void | builPipedPart (JSON::Value &p, char *argarr[], int &argnum, JSON::Value &argset) |
int | getDTSCLen (char *mapped, long long int offset) |
unsigned long long | getDTSCTime (char *mapped, long long int offset) |
bool | isMatch (const std::string &url, const std::string &m, std::string &streamname) |
bool | isPrefix (const std::string &url, const std::string &m, std::string &streamname) |
void * | memrchr (const void *s, int c, size_t n) |
void | sendTCP (void *socket, char *data, unsigned int len, unsigned int channel) |
Function used to send RTP packets over TCP. More... | |
void | sendUDP (void *socket, char *data, unsigned int len, unsigned int channel) |
Function used to send RTP packets over UDP. More... | |
Variables | |
static const int | bitRates [2][3][16] |
static const int | sampleCounts [2][3] = {{374, 1152, 1152}, {384, 1152, 576}} |
static const double | sampleRates [2][3] = {{44.1, 48.0, 32.0}, {22.05, 24.0, 16.0}} |
Recording to file.
Currently MistServer has basic support for recording for which the functionality is spread over a couple of files. The general flow in mist (this is my understanding and I'm a newb to MistServer, roxlu), is like this:
The controller creates a couple of protocol handlers, e.g. for RTMP. When a new live connection is made, an output is created through this protocol handler. In the case of a live source, all received data is passed into a inputBuffer object (see input_buffer.cpp).
So, when the inputBuffer is created, the setup()
function is called. In this function the config
object is available that holds the configuration values for the specific stream. This is also where a recording gets initialized.
An recording is initialized by starting another output with a call to startRecording()
. startRecording()
forks the current process and then calls execvp()
to take over the child process with e.g. MistOutFLV()
. When execvp()
starts the other process (that records the data), it passes the --outputFilename
command line argument.
Each output checks if it's started with the --outputFilename
flag; this is done in the constructor of Output
. In Output, it opens the given filename and uses dup2()
which makes sure that all stdout
data is written into the recording file.
Though, because some or probably most outputs also write HTTP to stdout, I created the function HTTPOutput::sendResponse()
which checks if the current output is creating a recording. When creating a recording it simply skips the HTTP output.
+-------------------------+ | inputBuffer::setup() | +-------+-----------------+ | o---- calls Util::startRecording() (stream.cpp) | v +------------------------+ | stream::startRecording | -> Kicks off output app with --outputFilename +-------+----------------+ | v +----------------+ | MistOut[XXX] | -> Checks if started with --outputFilename, +----------------+ in Output::Output() and starts recording.
The following files contain updates that were made for the recording:
void Mist::addSource | ( | const std::string & | rel, |
std::set< JSON::Value, sourceCompare > & | sources, | ||
std::string & | host, | ||
const std::string & | port, | ||
JSON::Value & | conncapa, | ||
unsigned int | most_simul, | ||
unsigned int | total_matches, | ||
const std::string & | flvPlayerPrefix | ||
) |
void Mist::addSources | ( | std::string & | streamname, |
const std::string & | rel, | ||
std::set< JSON::Value, sourceCompare > & | sources, | ||
std::string & | host, | ||
const std::string & | port, | ||
JSON::Value & | conncapa, | ||
JSON::Value & | strmMeta, | ||
const std::string | httpHost | ||
) |
|
inlinestatic |
int Mist::getDTSCLen | ( | char * | mapped, |
long long int | offset | ||
) |
unsigned long long Mist::getDTSCTime | ( | char * | mapped, |
long long int | offset | ||
) |
bool Mist::isMatch | ( | const std::string & | url, |
const std::string & | m, | ||
std::string & | streamname | ||
) |
bool Mist::isPrefix | ( | const std::string & | url, |
const std::string & | m, | ||
std::string & | streamname | ||
) |
void* Mist::memrchr | ( | const void * | s, |
int | c, | ||
size_t | n | ||
) |
void Mist::sendTCP | ( | void * | socket, |
char * | data, | ||
unsigned int | len, | ||
unsigned int | channel | ||
) |
void Mist::sendUDP | ( | void * | socket, |
char * | data, | ||
unsigned int | len, | ||
unsigned int | channel | ||
) |
|
static |
|
static |
|
static |