From 3137acdd5a45285dab9903f9d41560c63eca8523 Mon Sep 17 00:00:00 2001 From: "Angelo Mantellini (manangel)" Date: Wed, 29 Mar 2017 18:00:06 +0200 Subject: first commit Change-Id: I8412b8e7d966c2fbc508b537fd9a9bbcfc628ca8 Signed-off-by: Angelo Mantellini (manangel) --- src/libdash/include/IDownloadableChunk.h | 93 ++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/libdash/include/IDownloadableChunk.h (limited to 'src/libdash/include/IDownloadableChunk.h') diff --git a/src/libdash/include/IDownloadableChunk.h b/src/libdash/include/IDownloadableChunk.h new file mode 100644 index 00000000..d7189cd2 --- /dev/null +++ b/src/libdash/include/IDownloadableChunk.h @@ -0,0 +1,93 @@ +/** + * @class dash::network::IDownloadableChunk + * @brief This interface is needed for starting and abortinng downloads, reading, peeking and attaching dash::network::IDownloadObservers to this Chunk + * @details Enables the download of media segments with the internal libcurl connection or with external connections that can be passed to this interface + * @see dash::network::IDownloadObserver dash::network::IConnection dash::network::IChunk + * + * @author bitmovin Softwareentwicklung OG \n + * Email: libdash-dev@vicky.bitmovin.net + * @version 2.1 + * @date 2013 + * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + */ + +#ifndef IDOWNLOADABLECHUNK_H_ +#define IDOWNLOADABLECHUNK_H_ + +#include "config.h" + +#include "IDownloadObserver.h" +#include "IConnection.h" +#include "IChunk.h" +#include "IDASHMetrics.h" + +namespace dash +{ + namespace network + { + class IDownloadableChunk : public IChunk, public dash::metrics::IDASHMetrics + { + public: + virtual ~IDownloadableChunk(){} + + /** + * Starts the download of this chunk and returns a bool value whether the starting of the download was possible or not + * @return a bool value + */ + virtual bool StartDownload () = 0; + + /** + * Starts the download of this chunk and returns a bool value whether the starting of the download was possible or not + * @param connection the dash::network::IConnection that shall be used for downloading + * @return a bool value + */ + virtual bool StartDownload (IConnection *connection) = 0; + + /** + * Aborts the download of a chunk + */ + virtual void AbortDownload () = 0; + + /** + * Reads + * @param data pointer to a block of memory + * @param len size of the memory block that can be used by the method + * @return amount of data that has been read + */ + virtual int Read (uint8_t *data, size_t len) = 0; + + /** + * Reads + * @param data pointer to a block of memory + * @param len size of the memory block that can be used by the method + * @return amount of data that has been peeked + */ + virtual int Peek (uint8_t *data, size_t len) = 0; + + /** + * Reads + * @param data pointer to a block of memory + * @param len size of the memory block that can be used by the method + * @param offset the offset to start with + * @return amount of data that has been peeked + */ + virtual int Peek (uint8_t *data, size_t len, size_t offset) = 0; + + /** + * Attaches a dash::network::IDownloadObserver to this Chunk + * @param observer a dash::network::IDownloadObserver + */ + virtual void AttachDownloadObserver (IDownloadObserver *observer) = 0; + + /** + * Detaches a dash::network::IDownloadObserver from this Chunk + * @param observer a dash::network::IDownloadObserver + */ + virtual void DetachDownloadObserver (IDownloadObserver *observer) = 0; + }; + } +} + +#endif /* IDOWNLOADABLECHUNK_H_ */ \ No newline at end of file -- cgit 1.2.3-korg