void setBitrate (uint64_t bitrate);
int getBitrate ();
- virtual void onDownload () {}
+ virtual void onDownload (void *, size_t) {}
private:
std::string url;
int bitrate;
int port;
bool isHostname;
- size_t length;
+ uint64_t length;
uint64_t bytesRead;
IHTTPConnection *connection;
};
}
-dash::http::Chunk* ISegment::toChunk() const
+dash::http::Chunk* ISegment::toChunk()
{
- Chunk *chunk = new Chunk();
+ Chunk *chunk = new SegmentChunk(this);
if (!chunk)
return NULL;
return std::string(" Segment url=").append(getUrlSegment());
}
+ISegment::SegmentChunk::SegmentChunk(ISegment *segment_) :
+ Chunk()
+{
+ segment = segment_;
+}
+
+void ISegment::SegmentChunk::onDownload(void *, size_t)
+{
+
+}
+
Segment::Segment(Representation *parent, bool isinit, bool tosplit) :
ISegment(parent),
parentRepresentation( parent ),
return ret;
}
-dash::http::Chunk* Segment::toChunk() const
+dash::http::Chunk* Segment::toChunk()
{
Chunk *chunk = ISegment::toChunk();
if (chunk)
*/
virtual bool isSingleShot () const;
virtual void done ();
- virtual dash::http::Chunk* toChunk () const;
+ virtual dash::http::Chunk* toChunk ();
virtual void setByteRange (size_t start, size_t end);
virtual std::vector<ISegment*> subSegments () = 0;
virtual std::string toString () const;
protected:
size_t startByte;
size_t endByte;
+
+ class SegmentChunk : public dash::http::Chunk
+ {
+ public:
+ SegmentChunk(ISegment *segment);
+ virtual void onDownload(void *, size_t);
+
+ private:
+ ISegment *segment;
+ };
};
class Segment : public ISegment
virtual void setSourceUrl( const std::string &url );
virtual bool needsSplit() const;
virtual std::string getUrlSegment() const; /* impl */
- virtual dash::http::Chunk* toChunk() const;
+ virtual dash::http::Chunk* toChunk();
virtual std::vector<ISegment*> subSegments();
virtual std::string toString() const;
virtual Representation* getRepresentation() const;