MistServer
2.5.3-Pro-19-gf5e75b1 ( Generic_64)
|
#include <output_http.h>
Public Member Functions | |
HTTPOutput (Socket::Connection &conn) | |
virtual | ~HTTPOutput () |
void | bufferFinalize (unsigned long tid) |
Wraps up the buffering of a shared memory data page. More... | |
void | bufferLivePacket (JSON::Value &packet) |
Buffers a live packet to a page. More... | |
void | bufferLivePacket (DTSC::Packet &packet) |
Buffers a live packet to a page. More... | |
void | bufferNext (DTSC::Packet &pack) |
Buffers the next packet on the currently opened page. More... | |
void | bufferNext (JSON::Value &pack) |
Buffers the next packet on the currently opened page. More... | |
void | bufferRemove (unsigned long tid, unsigned long pageNumber) |
Removes a fully buffered page. More... | |
bool | bufferStart (unsigned long tid, unsigned long pageNumber) |
bool | closeOutputFileForRecording () |
std::string | getHandler () |
long unsigned int | getMainSelectedTrack () |
Returns the ID of the main selected track, or 0 if no tracks are selected. More... | |
virtual void | initialize () |
void | initiateMeta () |
Opens a shared memory page for the stream metadata. More... | |
virtual void | onFail () |
Called when stream initialization has failed. More... | |
virtual bool | onFinish () |
virtual void | onHTTP () |
virtual void | onRecord () |
void | onRequest () |
bool | openOutputFileForRecording () |
virtual void | prepareNext () |
void | reconnect () |
Connects or reconnects to the stream. More... | |
void | reConnector (std::string &connector) |
Handles requests by starting a corresponding output process. More... | |
virtual void | requestHandler () |
int | run () |
void | seek (unsigned long long pos) |
Prepares all tracks from selectedTracks for seeking to the specified ms position. More... | |
bool | seek (unsigned int tid, unsigned long long pos, bool getNextKey=false) |
void | selectDefaultTracks () |
virtual void | sendHeader () |
virtual void | sendNext () |
void | sendResponse (std::string message, std::string code="200") |
void | setBlocking (bool blocking) |
void | stats () |
void | stop () |
Clears the buffer, sets parseData to false, and generally makes not very much happen at all. More... | |
void | updateMeta () |
Static Public Member Functions | |
static void | init (Util::Config *cfg) |
static bool | listenMode () |
Data Fields | |
std::string | reqUrl |
Static Public Attributes | |
static JSON::Value | capa = JSON::Value() |
Protected Member Functions | |
void | continueNegotiate (unsigned long tid) |
std::string | getConnectedBinHost () |
std::string | getConnectedHost () |
unsigned int | getKeyForTime (long unsigned int trackId, long long timeStamp) |
bool | isTrustedProxy (const std::string &ip) |
bool | recording () |
Protected Attributes | |
std::map< int, DTSCPageData > | bookKeeping |
bool | completeKeysOnly |
Bool if we send whole keys only, so the metadata is complete and the output knows in advance what will be sent. More... | |
unsigned int | crc |
Checksum, if any, for usage in the stats. More... | |
HTTP::Parser | H |
bool | isBlocking |
If true, indicates that myConn is blocking. More... | |
bool | isInitialized |
If false, triggers initialization if parseData is true. More... | |
unsigned int | maxSkipAhead |
Maximum ms that we will go ahead of the intended timestamps. More... | |
unsigned int | minSkipAhead |
Minimum ms that we will go ahead of the intended timestamps. More... | |
Socket::Connection & | myConn |
Connection to the client. More... | |
DTSC::Meta | myMeta |
Stores either the input or output metadata. More... | |
negotiationProxy | nProxy |
int | outputFileDescriptor |
bool | parseData |
If true, triggers initalization if not already done, sending of header, sending of packets. More... | |
unsigned int | realTime |
Playback speed in ms of data per second. eg: 0 is infinite, 1000 real-time, 5000 is 0.2X speed, 500 = 2X speed. More... | |
std::set< unsigned long > | selectedTracks |
Stores the track id's that are either selected for playback or input. More... | |
bool | sentHeader |
If false, triggers sendHeader if parseData is true. More... | |
bool | standAlone |
IPC::sharedClient | statsPage |
Shared memory used for statistics reporting. More... | |
std::string | streamName |
DTSC::Packet | thisPacket |
bool | wantRequest |
If true, waits for a request. More... | |
Static Protected Attributes | |
static Util::Config * | config = NULL |
Mist::HTTPOutput::HTTPOutput | ( | Socket::Connection & | conn | ) |
|
inlinevirtual |
|
inherited |
Wraps up the buffering of a shared memory data page.
Registers the data page on the track index page as well
tid | The trackid of the page to finalize |
|
inherited |
Buffers a live packet to a page.
Handles both buffering and creation of new pages
Initiates/continues negotiation with the buffer as well
packet | The packet to buffer |
|
inherited |
Buffers a live packet to a page.
Handles both buffering and creation of new pages
Initiates/continues negotiation with the buffer as well
packet | The packet to buffer |
|
inherited |
Buffers the next packet on the currently opened page.
pack | The packet to buffer |
|
inherited |
Buffers the next packet on the currently opened page.
pack | The packet to buffer |
|
inherited |
Removes a fully buffered page.
Does not do anything if the process is not standalone, in this case the master process will have an overloaded version of this function.
tid | The trackid to remove the page from |
pageNumber | The number of the page to remove |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedvirtual |
Reimplemented from Mist::Output.
|
protectedvirtual |
Reimplemented from Mist::Output.
std::string Mist::HTTPOutput::getHandler | ( | ) |
|
protectedinherited |
|
inherited |
Returns the ID of the main selected track, or 0 if no tracks are selected.
The main track is the first video track, if any, and otherwise the first other track.
|
static |
|
virtualinherited |
"CONN_PLAY"
trigger is stream-specific, and is ran when an active connection first opens a stream.Its payload is:
The "USER_NEW"
trigger is stream-specific, and is ran when a new user first opens a stream. Segmented protcols are unduplicated over the duration of the statistics log (~10 minutes), true streaming protocols (RTMP, RTSP) are not deduplicated as no duplication ever takes place. Its payload is:
Reimplemented in Mist::OutDashMP4.
|
inherited |
Opens a shared memory page for the stream metadata.
Assumes myMeta contains the metadata to write.
|
protected |
< Open server config
|
inlinestatic |
|
virtual |
Called when stream initialization has failed.
The standard implementation will set isInitialized to false and close the client connection, thus causing the process to exit cleanly.
Reimplemented from Mist::Output.
Reimplemented in Mist::OutHTTP.
|
inlinevirtualinherited |
Reimplemented in Mist::OutProgressiveOGG, and Mist::OutJSON.
|
inlinevirtual |
|
inlinevirtual |
Reimplemented from Mist::Output.
|
virtual |
Reimplemented from Mist::Output.
Reimplemented in Mist::OutProgressiveOGG.
|
inherited |
|
virtualinherited |
|
inherited |
Connects or reconnects to the stream.
Assumes streamName class member has been set already. Will start input if not currently active, calls onFail() if this does not succeed. After assuring stream is online, clears nProxy.metaPages, then sets nProxy.metaPages[0], statsPage and nProxy.userClient to (hopefully) valid handles. Finally, calls updateMeta()
void Mist::HTTPOutput::reConnector | ( | std::string & | connector | ) |
Handles requests by starting a corresponding output process.
H | The request to be handled |
conn | The connection to the client that issued the request. |
connector | The type of connector to be invoked. |
start new/better process
|
protectedinherited |
|
virtual |
Reimplemented from Mist::Output.
|
inherited |
"CONN_OPEN"
trigger is stream-specific, and is ran when a connection is made or passed to a new handler.Its payload is:
The "CONN_CLOSE"
trigger is stream-specific, and is ran when a connection closes. Its payload is:
|
inherited |
Prepares all tracks from selectedTracks for seeking to the specified ms position.
|
inherited |
|
inherited |
|
virtualinherited |
|
inlinevirtualinherited |
void Mist::HTTPOutput::sendResponse | ( | std::string | message, |
std::string | code = "200" |
||
) |
|
inherited |
|
inherited |
|
inherited |
Clears the buffer, sets parseData to false, and generally makes not very much happen at all.
|
inherited |
|
protectedinherited |
|
staticinherited |
|
protectedinherited |
Bool if we send whole keys only, so the metadata is complete and the output knows in advance what will be sent.
|
staticprotectedinherited |
|
protectedinherited |
Checksum, if any, for usage in the stats.
|
protected |
|
protectedinherited |
If true, indicates that myConn is blocking.
|
protectedinherited |
If false, triggers initialization if parseData is true.
|
protectedinherited |
Maximum ms that we will go ahead of the intended timestamps.
|
protectedinherited |
Minimum ms that we will go ahead of the intended timestamps.
|
protectedinherited |
Connection to the client.
|
protectedinherited |
Stores either the input or output metadata.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
If true, triggers initalization if not already done, sending of header, sending of packets.
|
protectedinherited |
Playback speed in ms of data per second. eg: 0 is infinite, 1000 real-time, 5000 is 0.2X speed, 500 = 2X speed.
|
inherited |
|
protectedinherited |
Stores the track id's that are either selected for playback or input.
|
protectedinherited |
If false, triggers sendHeader if parseData is true.
|
protectedinherited |
|
protectedinherited |
Shared memory used for statistics reporting.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
If true, waits for a request.