HLS input cleanup/restructure
This commit is contained in:
parent
a9c5334833
commit
2db54b38fc
2 changed files with 625 additions and 841 deletions
File diff suppressed because it is too large
Load diff
|
@ -28,10 +28,13 @@ namespace Mist {
|
||||||
|
|
||||||
class Playlist {
|
class Playlist {
|
||||||
public:
|
public:
|
||||||
Playlist();
|
Playlist(const std::string & uriSrc = "");
|
||||||
std::string codecs;
|
bool atEnd() const;
|
||||||
std::string video;
|
bool isUrl() const;
|
||||||
std::string audio;
|
bool reload();
|
||||||
|
void addEntry(const std::string & filename, float duration, uint64_t & totalBytes);
|
||||||
|
bool loadURL(const std::string & loadUrl);
|
||||||
|
|
||||||
std::string uri;
|
std::string uri;
|
||||||
std::string uri_root;
|
std::string uri_root;
|
||||||
|
|
||||||
|
@ -39,20 +42,20 @@ namespace Mist {
|
||||||
const char *packetPtr;
|
const char *packetPtr;
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
bool initDone;
|
||||||
bool playlistEnd;
|
bool playlistEnd;
|
||||||
int noChangeCount;
|
int noChangeCount;
|
||||||
int version;
|
int version;
|
||||||
int targetDuration;
|
|
||||||
uint64_t media_sequence;
|
uint64_t media_sequence;
|
||||||
int lastFileIndex;
|
int lastFileIndex;
|
||||||
|
|
||||||
|
|
||||||
int waitTime;
|
int waitTime;
|
||||||
bool vodLive;
|
|
||||||
PlaylistType playlistType;
|
PlaylistType playlistType;
|
||||||
std::deque<playListEntries> entries;
|
std::deque<playListEntries> entries;
|
||||||
int entryCount;
|
int entryCount;
|
||||||
int programId;
|
|
||||||
int bandwidth;
|
|
||||||
unsigned int lastTimestamp;
|
unsigned int lastTimestamp;
|
||||||
|
unsigned int startTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,37 +83,27 @@ namespace Mist {
|
||||||
bool endPlaylist;
|
bool endPlaylist;
|
||||||
int currentPlaylist;
|
int currentPlaylist;
|
||||||
|
|
||||||
bool initDone;
|
|
||||||
std::string init_source;
|
|
||||||
|
|
||||||
//std::vector<playListEntries> entries;
|
//std::vector<playListEntries> entries;
|
||||||
std::vector<Playlist> playlists;
|
std::vector<Playlist> playlists;
|
||||||
//std::vector<int> pidMapping;
|
//std::vector<int> pidMapping;
|
||||||
std::map<int,int> pidMapping;
|
std::map<int,int> pidMapping;
|
||||||
std::map<int,int> pidMappingR;
|
std::map<int,int> pidMappingR;
|
||||||
|
|
||||||
std::string playlistFile;
|
|
||||||
std::string playlistRootPath;
|
|
||||||
std::vector<int> reloadNext;
|
std::vector<int> reloadNext;
|
||||||
|
|
||||||
|
|
||||||
bool liveStream;
|
|
||||||
int currentIndex;
|
int currentIndex;
|
||||||
std::string currentFile;
|
std::string currentFile;
|
||||||
std::ifstream in;
|
std::ifstream in;
|
||||||
bool isUrl;
|
|
||||||
|
|
||||||
TS::Stream tsStream;///<Used for parsing the incoming ts stream
|
TS::Stream tsStream;///<Used for parsing the incoming ts stream
|
||||||
bool pushing;
|
|
||||||
Socket::UDPConnection udpCon;
|
|
||||||
std::string udpDataBuffer;
|
|
||||||
Socket::Connection conn;
|
Socket::Connection conn;
|
||||||
TS::Packet tsBuf;
|
TS::Packet tsBuf;
|
||||||
|
|
||||||
int getFirstPlaylistToReload();
|
int getFirstPlaylistToReload();
|
||||||
|
|
||||||
int firstSegment();
|
int firstSegment();
|
||||||
bool getNextSegment();
|
void waitForNextSegment();
|
||||||
void readPMT();
|
void readPMT();
|
||||||
bool setup();
|
bool setup();
|
||||||
bool preSetup();
|
bool preSetup();
|
||||||
|
@ -120,27 +113,18 @@ namespace Mist {
|
||||||
void trackSelect(std::string trackSpec);
|
void trackSelect(std::string trackSpec);
|
||||||
FILE * inFile;
|
FILE * inFile;
|
||||||
FILE * tsFile;
|
FILE * tsFile;
|
||||||
bool openURL(std::string urlString, Playlist &p);
|
|
||||||
|
|
||||||
|
|
||||||
void printContent();
|
|
||||||
void printBuffer();
|
|
||||||
bool readIndex();
|
bool readIndex();
|
||||||
bool initPlaylist(std::string uri);
|
bool initPlaylist(const std::string & uri);
|
||||||
bool readPlaylist(std::string uri);
|
bool readPlaylist(const std::string & uri);
|
||||||
bool reloadPlaylist(Playlist &p);
|
|
||||||
bool readNextFile();
|
bool readNextFile();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void parseStreamHeader();
|
void parseStreamHeader();
|
||||||
void addEntryToPlaylist(Playlist &p, std::string filename, float duration, uint64_t &totalBytes);
|
|
||||||
|
|
||||||
int getMappedTrackId(int id);
|
int getMappedTrackId(int id);
|
||||||
int getMappedTrackPlaylist(int id);
|
int getMappedTrackPlaylist(int id);
|
||||||
int getOriginalTrackId(int playlistId, int id);
|
int getOriginalTrackId(int playlistId, int id);
|
||||||
int getEntryId(int playlistId, uint64_t bytePos);
|
int getEntryId(int playlistId, uint64_t bytePos);
|
||||||
int cleanLine(std::string &s);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue