Commit 96789285 authored by Christopher Mueller's avatar Christopher Mueller Committed by Hugo Beauzée-Luyssen

dash: added connection to chunk

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent eb5ab7ff
...@@ -36,7 +36,8 @@ Chunk::Chunk () : ...@@ -36,7 +36,8 @@ Chunk::Chunk () :
port (0), port (0),
isHostname (false), isHostname (false),
length (0), length (0),
bytesRead (0) bytesRead (0),
connection (NULL)
{ {
} }
...@@ -140,3 +141,11 @@ size_t Chunk::getPercentDownloaded () const ...@@ -140,3 +141,11 @@ size_t Chunk::getPercentDownloaded () const
{ {
return (size_t)(((float)this->bytesRead / this->length) * 100); return (size_t)(((float)this->bytesRead / this->length) * 100);
} }
IHTTPConnection* Chunk::getConnection () const
{
return this->connection;
}
void Chunk::setConnection (IHTTPConnection *connection)
{
this->connection = connection;
}
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_url.h> #include <vlc_url.h>
#include "IHTTPConnection.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
...@@ -52,7 +54,9 @@ namespace dash ...@@ -52,7 +54,9 @@ namespace dash
uint64_t getBytesRead () const; uint64_t getBytesRead () const;
uint64_t getBytesToRead () const; uint64_t getBytesToRead () const;
size_t getPercentDownloaded () const; size_t getPercentDownloaded () const;
IHTTPConnection* getConnection () const;
void setConnection (IHTTPConnection *connection);
void setBytesRead (uint64_t bytes); void setBytesRead (uint64_t bytes);
void setLength (uint64_t length); void setLength (uint64_t length);
void setEndByte (int endByte); void setEndByte (int endByte);
...@@ -77,6 +81,7 @@ namespace dash ...@@ -77,6 +81,7 @@ namespace dash
bool isHostname; bool isHostname;
size_t length; size_t length;
uint64_t bytesRead; uint64_t bytesRead;
IHTTPConnection *connection;
}; };
} }
} }
......
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