#include <output_dash_mp4.h>
|
void | buildFtyp (unsigned int trackid) |
|
std::string | buildManifest () |
|
void | buildMdat (unsigned int trackid, unsigned int keynum) |
|
std::string | buildMoof (unsigned int trackid, unsigned int keynum) |
|
std::string | buildMoov (unsigned int trackid) |
|
std::string | buildNalUnit (unsigned int len, const char *data) |
|
std::string | buildSidx (unsigned int trackid) |
|
std::string | buildSidx (unsigned int trackid, unsigned int keynum) |
|
void | buildStyp (unsigned int trackid) |
|
void | continueNegotiate (unsigned long tid) |
|
std::string | getConnectedBinHost () |
|
std::string | getConnectedHost () |
|
unsigned int | getKeyForTime (long unsigned int trackId, long long timeStamp) |
|
int | getKeyFromRange (unsigned int tid, long long int byteStart) |
|
std::string | h264init (const std::string &initData) |
|
std::string | h265init (const std::string &initData) |
|
bool | isTrustedProxy (const std::string &ip) |
|
std::string | makeTime (long long unsigned int time) |
|
void | parseRange (std::string header, long long &byteStart, long long &byteEnd) |
| Parses a "Range: " header, setting byteStart, byteEnd and seekPoint using data from metadata and tracks to do the calculations. More...
|
|
bool | recording () |
|
|
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...
|
|
std::map< unsigned int, std::map< unsigned int, long long unsigned int > > | fragmentSizes |
|
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...
|
|
std::map< int, std::string > | moovBoxes |
|
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...
|
|
Mist::OutDashMP4::~OutDashMP4 |
( |
| ) |
|
void Mist::InOutBase::bufferFinalize |
( |
unsigned long |
tid | ) |
|
|
inherited |
Wraps up the buffering of a shared memory data page.
Registers the data page on the track index page as well
- Parameters
-
tid | The trackid of the page to finalize |
void Mist::InOutBase::bufferLivePacket |
( |
JSON::Value & |
packet | ) |
|
|
inherited |
Buffers a live packet to a page.
Handles both buffering and creation of new pages
Initiates/continues negotiation with the buffer as well
- Parameters
-
packet | The packet to buffer |
void Mist::InOutBase::bufferLivePacket |
( |
DTSC::Packet & |
packet | ) |
|
|
inherited |
Buffers a live packet to a page.
Handles both buffering and creation of new pages
Initiates/continues negotiation with the buffer as well
- Parameters
-
packet | The packet to buffer |
Buffers the next packet on the currently opened page.
- Parameters
-
void Mist::InOutBase::bufferRemove |
( |
unsigned long |
tid, |
|
|
unsigned long |
pageNumber |
|
) |
| |
|
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.
- Parameters
-
tid | The trackid to remove the page from |
pageNumber | The number of the page to remove |
bool Mist::InOutBase::bufferStart |
( |
unsigned long |
tid, |
|
|
unsigned long |
pageNumber |
|
) |
| |
|
inherited |
void Mist::OutDashMP4::buildFtyp |
( |
unsigned int |
trackid | ) |
|
|
protected |
std::string Mist::OutDashMP4::buildManifest |
( |
| ) |
|
|
protected |
- Todo:
- Dash automatically selects the last audio and video track for manifest, maybe make this expandable/selectable?
void Mist::OutDashMP4::buildMdat |
( |
unsigned int |
trackid, |
|
|
unsigned int |
keynum |
|
) |
| |
|
protected |
std::string Mist::OutDashMP4::buildMoof |
( |
unsigned int |
trackid, |
|
|
unsigned int |
keynum |
|
) |
| |
|
protected |
- Todo:
- Determine index for live
std::string Mist::OutDashMP4::buildMoov |
( |
unsigned int |
trackid | ) |
|
|
protected |
- Todo:
- Note: this code is copied, note for muxing seperation
std::string Mist::OutDashMP4::buildNalUnit |
( |
unsigned int |
len, |
|
|
const char * |
data |
|
) |
| |
|
protected |
std::string Mist::OutDashMP4::buildSidx |
( |
unsigned int |
trackid | ) |
|
|
protected |
std::string Mist::OutDashMP4::buildSidx |
( |
unsigned int |
trackid, |
|
|
unsigned int |
keynum |
|
) |
| |
|
protected |
void Mist::OutDashMP4::buildStyp |
( |
unsigned int |
trackid | ) |
|
|
protected |
bool Mist::Output::closeOutputFileForRecording |
( |
| ) |
|
|
inherited |
void Mist::InOutBase::continueNegotiate |
( |
unsigned long |
tid | ) |
|
|
protectedinherited |
std::string Mist::HTTPOutput::getConnectedBinHost |
( |
| ) |
|
|
protectedvirtualinherited |
std::string Mist::HTTPOutput::getConnectedHost |
( |
| ) |
|
|
protectedvirtualinherited |
std::string Mist::HTTPOutput::getHandler |
( |
| ) |
|
|
inherited |
- anything else: The request should be dispatched to a connector on the named socket.
unsigned int Mist::Output::getKeyForTime |
( |
long unsigned int |
trackId, |
|
|
long long |
timeStamp |
|
) |
| |
|
protectedinherited |
int Mist::OutDashMP4::getKeyFromRange |
( |
unsigned int |
tid, |
|
|
long long int |
byteStart |
|
) |
| |
|
protected |
long unsigned int Mist::Output::getMainSelectedTrack |
( |
| ) |
|
|
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.
std::string Mist::OutDashMP4::h264init |
( |
const std::string & |
initData | ) |
|
|
protected |
std::string Mist::OutDashMP4::h265init |
( |
const std::string & |
initData | ) |
|
|
protected |
void Mist::OutDashMP4::initialize |
( |
| ) |
|
|
virtual |
- Trigger:
- The
"CONN_PLAY"
trigger is stream-specific, and is ran when an active connection first opens a stream.
Its payload is:
streamname
connected client host
output handler name
request URL (if any)
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:
streamname
connected client host
User agent
checksum (CRC32 of User-agent
string)
output handler name
request URL (if any)
Reimplemented from Mist::Output.
void Mist::InOutBase::initiateMeta |
( |
| ) |
|
|
inherited |
Opens a shared memory page for the stream metadata.
Assumes myMeta contains the metadata to write.
bool Mist::HTTPOutput::isTrustedProxy |
( |
const std::string & |
ip | ) |
|
|
protectedinherited |
static bool Mist::HTTPOutput::listenMode |
( |
| ) |
|
|
inlinestaticinherited |
std::string Mist::OutDashMP4::makeTime |
( |
long long unsigned int |
time | ) |
|
|
protected |
void Mist::HTTPOutput::onFail |
( |
| ) |
|
|
virtualinherited |
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.
virtual bool Mist::Output::onFinish |
( |
| ) |
|
|
inlinevirtualinherited |
void Mist::OutDashMP4::onHTTP |
( |
| ) |
|
|
virtual |
virtual void Mist::HTTPOutput::onRecord |
( |
| ) |
|
|
inlinevirtualinherited |
void Mist::HTTPOutput::onRequest |
( |
| ) |
|
|
virtualinherited |
bool Mist::Output::openOutputFileForRecording |
( |
| ) |
|
|
inherited |
void Mist::OutDashMP4::parseRange |
( |
std::string |
header, |
|
|
long long & |
byteStart, |
|
|
long long & |
byteEnd |
|
) |
| |
|
protected |
Parses a "Range: " header, setting byteStart, byteEnd and seekPoint using data from metadata and tracks to do the calculations.
On error, byteEnd is set to zero.
void Mist::Output::prepareNext |
( |
| ) |
|
|
virtualinherited |
void Mist::Output::reconnect |
( |
| ) |
|
|
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 | ) |
|
|
inherited |
Handles requests by starting a corresponding output process.
- Parameters
-
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
bool Mist::Output::recording |
( |
| ) |
|
|
protectedinherited |
void Mist::HTTPOutput::requestHandler |
( |
| ) |
|
|
virtualinherited |
int Mist::Output::run |
( |
| ) |
|
|
inherited |
- Trigger:
- The
"CONN_OPEN"
trigger is stream-specific, and is ran when a connection is made or passed to a new handler.
Its payload is:
streamname
connected client host
output handler name
request URL (if any)
The "CONN_CLOSE"
trigger is stream-specific, and is ran when a connection closes. Its payload is:
streamname
connected client host
output handler name
request URL (if any)
- Todo:
- generate payload
void Mist::Output::seek |
( |
unsigned long long |
pos | ) |
|
|
inherited |
Prepares all tracks from selectedTracks for seeking to the specified ms position.
bool Mist::Output::seek |
( |
unsigned int |
tid, |
|
|
unsigned long long |
pos, |
|
|
bool |
getNextKey = false |
|
) |
| |
|
inherited |
void Mist::Output::selectDefaultTracks |
( |
| ) |
|
|
inherited |
void Mist::OutDashMP4::sendHeader |
( |
| ) |
|
|
virtual |
void Mist::OutDashMP4::sendNext |
( |
| ) |
|
|
virtual |
void Mist::HTTPOutput::sendResponse |
( |
std::string |
message, |
|
|
std::string |
code = "200" |
|
) |
| |
|
inherited |
void Mist::Output::setBlocking |
( |
bool |
blocking | ) |
|
|
inherited |
void Mist::Output::stats |
( |
| ) |
|
|
inherited |
void Mist::Output::stop |
( |
| ) |
|
|
inherited |
Clears the buffer, sets parseData to false, and generally makes not very much happen at all.
void Mist::Output::updateMeta |
( |
| ) |
|
|
inherited |
bool Mist::Output::completeKeysOnly |
|
protectedinherited |
Bool if we send whole keys only, so the metadata is complete and the output knows in advance what will be sent.
unsigned int Mist::Output::crc |
|
protectedinherited |
Checksum, if any, for usage in the stats.
std::map<unsigned int, std::map<unsigned int, long long unsigned int> > Mist::OutDashMP4::fragmentSizes |
|
protected |
bool Mist::Output::isBlocking |
|
protectedinherited |
If true, indicates that myConn is blocking.
bool Mist::Output::isInitialized |
|
protectedinherited |
If false, triggers initialization if parseData is true.
unsigned int Mist::Output::maxSkipAhead |
|
protectedinherited |
Maximum ms that we will go ahead of the intended timestamps.
unsigned int Mist::Output::minSkipAhead |
|
protectedinherited |
Minimum ms that we will go ahead of the intended timestamps.
std::map<int,std::string> Mist::OutDashMP4::moovBoxes |
|
protected |
Connection to the client.
Stores either the input or output metadata.
int Mist::Output::outputFileDescriptor |
|
protectedinherited |
bool Mist::Output::parseData |
|
protectedinherited |
If true, triggers initalization if not already done, sending of header, sending of packets.
unsigned int Mist::Output::realTime |
|
protectedinherited |
Playback speed in ms of data per second. eg: 0 is infinite, 1000 real-time, 5000 is 0.2X speed, 500 = 2X speed.
std::string Mist::Output::reqUrl |
|
inherited |
std::set<unsigned long> Mist::InOutBase::selectedTracks |
|
protectedinherited |
Stores the track id's that are either selected for playback or input.
bool Mist::Output::sentHeader |
|
protectedinherited |
If false, triggers sendHeader if parseData is true.
bool Mist::InOutBase::standAlone |
|
protectedinherited |
Shared memory used for statistics reporting.
std::string Mist::InOutBase::streamName |
|
protectedinherited |
bool Mist::Output::wantRequest |
|
protectedinherited |
If true, waits for a request.
The documentation for this class was generated from the following files: