Commit 65433f09 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: remove unused Chunk members

still carried from early impl
parent 96a08736
......@@ -35,7 +35,6 @@ using namespace adaptative::http;
Chunk::Chunk (const std::string& url) :
startByte (0),
endByte (0),
bitrate (1),
port (0),
length (0),
bytesRead (0),
......@@ -98,24 +97,12 @@ void Chunk::setStartByte (size_t startByte)
if (endByte > startByte)
bytesToRead = endByte - startByte;
}
void Chunk::addOptionalUrl (const std::string& url)
{
this->optionalUrls.push_back(url);
}
bool Chunk::usesByteRange () const
{
return (startByte != endByte);
}
void Chunk::setBitrate (uint64_t bitrate)
{
this->bitrate = bitrate;
}
int Chunk::getBitrate ()
{
return this->bitrate;
}
const std::string& Chunk::getScheme () const
{
return scheme;
......@@ -133,10 +120,7 @@ int Chunk::getPort () const
{
return this->port;
}
uint64_t Chunk::getLength () const
{
return this->length;
}
void Chunk::setLength (uint64_t length)
{
this->length = length;
......@@ -160,10 +144,6 @@ uint64_t Chunk::getBytesToRead () const
return length - bytesRead;
}
size_t Chunk::getPercentDownloaded () const
{
return (size_t)(((float)this->bytesRead / this->length) * 100);
}
HTTPConnection* Chunk::getConnection () const
{
return this->connection;
......
......@@ -50,10 +50,8 @@ namespace adaptative
const std::string& getHostname () const;
const std::string& getPath () const;
int getPort () const;
uint64_t getLength () const;
uint64_t getBytesRead () const;
uint64_t getBytesToRead () const;
size_t getPercentDownloaded () const;
HTTPConnection* getConnection () const;
void setConnection (HTTPConnection *connection);
......@@ -62,10 +60,7 @@ namespace adaptative
void setLength (uint64_t length);
void setEndByte (size_t endByte);
void setStartByte (size_t startByte);
void addOptionalUrl (const std::string& url);
bool usesByteRange () const;
void setBitrate (uint64_t bitrate);
int getBitrate ();
virtual void onDownload (block_t **) {}
......@@ -74,10 +69,8 @@ namespace adaptative
std::string scheme;
std::string path;
std::string hostname;
std::vector<std::string> optionalUrls;
size_t startByte;
size_t endByte;
int bitrate;
int port;
uint64_t length;
uint64_t bytesRead;
......
......@@ -32,8 +32,6 @@
using namespace adaptative::http;
const uint64_t HTTPConnectionManager::CHUNKDEFAULTBITRATE = 1;
HTTPConnectionManager::HTTPConnectionManager (vlc_object_t *stream) :
stream (stream)
{
......@@ -98,8 +96,5 @@ bool HTTPConnectionManager::connectChunk(Chunk *chunk)
conn->bindChunk(chunk);
if(chunk->getBitrate() <= 0)
chunk->setBitrate(HTTPConnectionManager::CHUNKDEFAULTBITRATE);
return true;
}
......@@ -54,8 +54,6 @@ namespace adaptative
std::vector<HTTPConnection *> connectionPool;
vlc_object_t *stream;
static const uint64_t CHUNKDEFAULTBITRATE;
HTTPConnection * getConnectionForHost (const std::string &hostname);
};
}
......
......@@ -225,14 +225,6 @@ Url Segment::getUrlSegment() const
}
}
SegmentChunk* Segment::toChunk(size_t index, BaseRepresentation *ctxrep)
{
SegmentChunk *chunk = ISegment::toChunk(index, ctxrep);
if (chunk && ctxrep)
chunk->setBitrate(ctxrep->getBandwidth());
return chunk;
}
std::vector<ISegment*> Segment::subSegments()
{
std::vector<ISegment*> list;
......
......@@ -94,7 +94,6 @@ namespace adaptative
~Segment();
virtual void setSourceUrl( const std::string &url );
virtual Url getUrlSegment() const; /* impl */
virtual SegmentChunk* toChunk(size_t, BaseRepresentation * = NULL);
virtual std::vector<ISegment*> subSegments();
virtual void debug(vlc_object_t *,int = 0) const;
virtual void addSubSegment(SubSegment *);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment