HLS input rewrite/optimize/clarify/fun-ify
This commit is contained in:
parent
ebb9b3d8c4
commit
31403f2685
2 changed files with 411 additions and 578 deletions
File diff suppressed because it is too large
Load diff
|
@ -9,11 +9,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
//#include <stdint.h>
|
//#include <stdint.h>
|
||||||
#include <mist/http_parser.h>
|
|
||||||
#include <mist/downloader.h>
|
#include <mist/downloader.h>
|
||||||
|
#include <mist/http_parser.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define BUFFERTIME 10
|
#define BUFFERTIME 10
|
||||||
|
|
||||||
|
@ -36,32 +33,26 @@ namespace Mist{
|
||||||
bool isUrl() const;
|
bool isUrl() const;
|
||||||
bool reload();
|
bool reload();
|
||||||
void addEntry(const std::string &filename, float duration, uint64_t &totalBytes);
|
void addEntry(const std::string &filename, float duration, uint64_t &totalBytes);
|
||||||
bool loadURL(const std::string &loadUrl);
|
bool loadSegment(const HTTP::URL &uri);
|
||||||
bool isSupportedFile(const std::string filename);
|
bool isSupportedFile(const std::string filename);
|
||||||
|
|
||||||
std::string uri; // link to the current playlistfile
|
std::string uri; // link to the current playlistfile
|
||||||
std::string uri_root;
|
|
||||||
|
|
||||||
HTTP::URL root;
|
HTTP::URL root;
|
||||||
|
|
||||||
HTTP::Downloader DL;
|
HTTP::Downloader segDL;
|
||||||
|
HTTP::Downloader plsDL;
|
||||||
|
|
||||||
|
|
||||||
std::string source;
|
|
||||||
const char *packetPtr;
|
const char *packetPtr;
|
||||||
|
uint64_t reloadNext;
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
bool initDone;
|
|
||||||
bool playlistEnd;
|
bool playlistEnd;
|
||||||
int noChangeCount;
|
int noChangeCount;
|
||||||
int version;
|
uint64_t lastFileIndex;
|
||||||
uint64_t media_sequence;
|
|
||||||
int lastFileIndex;
|
|
||||||
|
|
||||||
int waitTime;
|
int waitTime;
|
||||||
PlaylistType playlistType;
|
PlaylistType playlistType;
|
||||||
std::deque<playListEntries> entries;
|
std::deque<playListEntries> entries;
|
||||||
int entryCount;
|
|
||||||
unsigned int lastTimestamp;
|
unsigned int lastTimestamp;
|
||||||
unsigned int startTime;
|
unsigned int startTime;
|
||||||
};
|
};
|
||||||
|
@ -87,7 +78,6 @@ namespace Mist{
|
||||||
PlaylistType playlistType;
|
PlaylistType playlistType;
|
||||||
int version;
|
int version;
|
||||||
int targetDuration;
|
int targetDuration;
|
||||||
int media_sequence;
|
|
||||||
bool endPlaylist;
|
bool endPlaylist;
|
||||||
int currentPlaylist;
|
int currentPlaylist;
|
||||||
|
|
||||||
|
@ -97,8 +87,6 @@ namespace Mist{
|
||||||
std::map<int, int> pidMapping;
|
std::map<int, int> pidMapping;
|
||||||
std::map<int, int> pidMappingR;
|
std::map<int, int> pidMappingR;
|
||||||
|
|
||||||
std::vector<int> reloadNext;
|
|
||||||
|
|
||||||
int currentIndex;
|
int currentIndex;
|
||||||
std::string currentFile;
|
std::string currentFile;
|
||||||
std::ifstream in;
|
std::ifstream in;
|
||||||
|
@ -125,7 +113,7 @@ namespace Mist{
|
||||||
|
|
||||||
bool readIndex();
|
bool readIndex();
|
||||||
bool initPlaylist(const std::string &uri);
|
bool initPlaylist(const std::string &uri);
|
||||||
bool readPlaylist(const std::string &uri);
|
bool readPlaylist(const HTTP::URL &uri);
|
||||||
bool readNextFile();
|
bool readNextFile();
|
||||||
|
|
||||||
void parseStreamHeader();
|
void parseStreamHeader();
|
||||||
|
@ -135,7 +123,7 @@ namespace Mist{
|
||||||
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);
|
||||||
};
|
};
|
||||||
}
|
}// namespace Mist
|
||||||
|
|
||||||
typedef Mist::inputHLS mistIn;
|
typedef Mist::inputHLS mistIn;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue