Style enforcement
This commit is contained in:
parent
6811b54186
commit
56c21b5ba6
4 changed files with 939 additions and 1151 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,22 @@
|
|||
#pragma once
|
||||
#include "input.h"
|
||||
#include <fstream>
|
||||
#include <mist/dtsc.h>
|
||||
#include <mist/nal.h>
|
||||
#include <mist/ts_packet.h>
|
||||
#include <mist/ts_stream.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
//#include <stdint.h>
|
||||
|
||||
#define BUFFERTIME 10
|
||||
|
||||
namespace Mist {
|
||||
namespace Mist{
|
||||
|
||||
enum PlaylistType { VOD, LIVE, EVENT };
|
||||
enum PlaylistType{VOD, LIVE, EVENT};
|
||||
|
||||
|
||||
struct playListEntries
|
||||
{
|
||||
struct playListEntries{
|
||||
std::string filename;
|
||||
uint64_t bytePos;
|
||||
float duration;
|
||||
|
@ -26,105 +24,103 @@ namespace Mist {
|
|||
unsigned int wait;
|
||||
};
|
||||
|
||||
class Playlist {
|
||||
public:
|
||||
Playlist(const std::string & uriSrc = "");
|
||||
bool atEnd() const;
|
||||
bool isUrl() const;
|
||||
bool reload();
|
||||
void addEntry(const std::string & filename, float duration, uint64_t & totalBytes);
|
||||
bool loadURL(const std::string & loadUrl);
|
||||
class Playlist{
|
||||
public:
|
||||
Playlist(const std::string &uriSrc = "");
|
||||
bool atEnd() const;
|
||||
bool isUrl() const;
|
||||
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_root;
|
||||
std::string uri;
|
||||
std::string uri_root;
|
||||
|
||||
std::string source;
|
||||
const char *packetPtr;
|
||||
std::string source;
|
||||
const char *packetPtr;
|
||||
|
||||
int id;
|
||||
bool initDone;
|
||||
bool playlistEnd;
|
||||
int noChangeCount;
|
||||
int version;
|
||||
uint64_t media_sequence;
|
||||
int lastFileIndex;
|
||||
int id;
|
||||
bool initDone;
|
||||
bool playlistEnd;
|
||||
int noChangeCount;
|
||||
int version;
|
||||
uint64_t media_sequence;
|
||||
int lastFileIndex;
|
||||
|
||||
|
||||
int waitTime;
|
||||
PlaylistType playlistType;
|
||||
std::deque<playListEntries> entries;
|
||||
int entryCount;
|
||||
unsigned int lastTimestamp;
|
||||
unsigned int startTime;
|
||||
int waitTime;
|
||||
PlaylistType playlistType;
|
||||
std::deque<playListEntries> entries;
|
||||
int entryCount;
|
||||
unsigned int lastTimestamp;
|
||||
unsigned int startTime;
|
||||
};
|
||||
|
||||
|
||||
struct entryBuffer
|
||||
{
|
||||
struct entryBuffer{
|
||||
int timestamp;
|
||||
playListEntries entry;
|
||||
int playlistIndex;
|
||||
};
|
||||
|
||||
class inputHLS : public Input {
|
||||
public:
|
||||
inputHLS(Util::Config * cfg);
|
||||
~inputHLS();
|
||||
bool needsLock();
|
||||
bool openStreamSource();
|
||||
protected:
|
||||
//Private Functions
|
||||
|
||||
unsigned int startTime;
|
||||
PlaylistType playlistType;
|
||||
int version;
|
||||
int targetDuration;
|
||||
int media_sequence;
|
||||
bool endPlaylist;
|
||||
int currentPlaylist;
|
||||
class inputHLS : public Input{
|
||||
public:
|
||||
inputHLS(Util::Config *cfg);
|
||||
~inputHLS();
|
||||
bool needsLock();
|
||||
bool openStreamSource();
|
||||
|
||||
//std::vector<playListEntries> entries;
|
||||
std::vector<Playlist> playlists;
|
||||
//std::vector<int> pidMapping;
|
||||
std::map<int,int> pidMapping;
|
||||
std::map<int,int> pidMappingR;
|
||||
protected:
|
||||
// Private Functions
|
||||
|
||||
std::vector<int> reloadNext;
|
||||
unsigned int startTime;
|
||||
PlaylistType playlistType;
|
||||
int version;
|
||||
int targetDuration;
|
||||
int media_sequence;
|
||||
bool endPlaylist;
|
||||
int currentPlaylist;
|
||||
|
||||
int currentIndex;
|
||||
std::string currentFile;
|
||||
std::ifstream in;
|
||||
// std::vector<playListEntries> entries;
|
||||
std::vector<Playlist> playlists;
|
||||
// std::vector<int> pidMapping;
|
||||
std::map<int, int> pidMapping;
|
||||
std::map<int, int> pidMappingR;
|
||||
|
||||
TS::Stream tsStream;///<Used for parsing the incoming ts stream
|
||||
std::vector<int> reloadNext;
|
||||
|
||||
Socket::Connection conn;
|
||||
TS::Packet tsBuf;
|
||||
int currentIndex;
|
||||
std::string currentFile;
|
||||
std::ifstream in;
|
||||
|
||||
int getFirstPlaylistToReload();
|
||||
TS::Stream tsStream; ///<Used for parsing the incoming ts stream
|
||||
|
||||
int firstSegment();
|
||||
void waitForNextSegment();
|
||||
void readPMT();
|
||||
bool setup();
|
||||
bool preSetup();
|
||||
bool readHeader();
|
||||
void getNext(bool smart = true);
|
||||
void seek(int seekTime);
|
||||
void trackSelect(std::string trackSpec);
|
||||
FILE * inFile;
|
||||
FILE * tsFile;
|
||||
Socket::Connection conn;
|
||||
TS::Packet tsBuf;
|
||||
|
||||
bool readIndex();
|
||||
bool initPlaylist(const std::string & uri);
|
||||
bool readPlaylist(const std::string & uri);
|
||||
bool readNextFile();
|
||||
int getFirstPlaylistToReload();
|
||||
|
||||
void parseStreamHeader();
|
||||
int firstSegment();
|
||||
void waitForNextSegment();
|
||||
void readPMT();
|
||||
bool setup();
|
||||
bool preSetup();
|
||||
bool readHeader();
|
||||
void getNext(bool smart = true);
|
||||
void seek(int seekTime);
|
||||
void trackSelect(std::string trackSpec);
|
||||
FILE *inFile;
|
||||
FILE *tsFile;
|
||||
|
||||
int getMappedTrackId(int id);
|
||||
int getMappedTrackPlaylist(int id);
|
||||
int getOriginalTrackId(int playlistId, int id);
|
||||
int getEntryId(int playlistId, uint64_t bytePos);
|
||||
bool readIndex();
|
||||
bool initPlaylist(const std::string &uri);
|
||||
bool readPlaylist(const std::string &uri);
|
||||
bool readNextFile();
|
||||
|
||||
void parseStreamHeader();
|
||||
|
||||
int getMappedTrackId(int id);
|
||||
int getMappedTrackPlaylist(int id);
|
||||
int getOriginalTrackId(int playlistId, int id);
|
||||
int getEntryId(int playlistId, uint64_t bytePos);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue