diff options
author | Luca Muscariello <lumuscar+fdio@cisco.com> | 2017-06-23 14:51:19 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2017-06-23 14:51:19 +0000 |
commit | ea99c36cadfab26fe4bf523931f87132c01a54a2 (patch) | |
tree | 13fc8ff2f6072add96f987a1a68a15c22d68d911 /Input/DASHReceiver.h | |
parent | e207b82a2b7e70e2700cf1c4237a2e819c655809 (diff) | |
parent | a644414fd2c3a3f7f41e716b6875a78981e4cfe1 (diff) |
Merge "adding mpd live handling + automatic mpd fetching" into viper/master
Diffstat (limited to 'Input/DASHReceiver.h')
-rw-r--r-- | Input/DASHReceiver.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/Input/DASHReceiver.h b/Input/DASHReceiver.h index a2893b4d..cf56166b 100644 --- a/Input/DASHReceiver.h +++ b/Input/DASHReceiver.h @@ -14,7 +14,7 @@ #include "libdash.h" #include "IMPD.h" - +#include "../MPD/MPDWrapper.h" #include "../Input/MediaObject.h" #include "IDASHReceiverObserver.h" #include "../MPD/AdaptationSetStream.h" @@ -28,6 +28,10 @@ namespace libdash { namespace framework { +namespace mpd +{ +class AdaptationSetStream; +} namespace adaptation { class IAdaptationLogic; @@ -44,7 +48,7 @@ class MediaObject; class DASHReceiver { public: - DASHReceiver(dash::mpd::IMPD *mpd, IDASHReceiverObserver *obs, buffer::Buffer<MediaObject> *buffer, uint32_t bufferSize, bool icnEnabled, double icnAlpha, float beta, float drop); + DASHReceiver(viper::managers::StreamType type, libdash::framework::mpd::MPDWrapper *mpdWrapper, IDASHReceiverObserver *obs, buffer::Buffer<MediaObject> *buffer, uint32_t bufferSize, bool icnEnabled, double icnAlpha, float beta, float drop); virtual ~DASHReceiver(); bool Start(); @@ -52,15 +56,18 @@ public: input::MediaObject* GetNextSegment(); input::MediaObject* GetSegment(uint32_t segmentNumber); input::MediaObject* GetInitSegment(); - input::MediaObject* FindInitSegment(dash::mpd::IRepresentation *representation); + input::MediaObject* GetInitSegmentWithoutLock(); +// input::MediaObject* FindInitSegment(dash::mpd::IRepresentation *representation); + input::MediaObject* FindInitSegment(int representation); uint32_t GetPosition(); void SetPosition(uint32_t segmentNumber); void SetLooping(bool isLoopinp); void SetPositionInMsecs(uint32_t milliSecs); dash::mpd::IRepresentation* GetRepresentation(); - void SetRepresentation(dash::mpd::IPeriod *period, - dash::mpd::IAdaptationSet *adaptationSet, - dash::mpd::IRepresentation *representation); +// void SetRepresentation(dash::mpd::IPeriod *period, +// dash::mpd::IAdaptationSet *adaptationSet, +// dash::mpd::IRepresentation *representation); + void SetRepresentation(); void SetAdaptationLogic(adaptation::IAdaptationLogic *_adaptationLogic); libdash::framework::adaptation::IAdaptationLogic* GetAdaptationLogic(); void NotifyQualityDownloading(uint32_t quality); @@ -78,21 +85,24 @@ public: bool CanPush(); void SetBeta(float beta); void SetDrop(float drop); + void updateMPD(dash::mpd::IMPD* mpd); private: float beta; float drop; bool withFeedBack; bool isBufferBased; - std::map<dash::mpd::IRepresentation*, MediaObject*> initSegments; +// std::map<dash::mpd::IRepresentation*, MediaObject*> initSegments; + std::map<int, MediaObject*> initSegments; libdash::framework::buffer::Buffer<MediaObject> *buffer; IDASHReceiverObserver *observer; - dash::mpd::IMPD *mpd; - dash::mpd::IPeriod *period; - dash::mpd::IAdaptationSet *adaptationSet; - dash::mpd::IRepresentation *representation; + libdash::framework::mpd::MPDWrapper *mpdWrapper; +// dash::mpd::IMPD *mpd; +// dash::mpd::IPeriod *period; +// dash::mpd::IAdaptationSet *adaptationSet; +// dash::mpd::IRepresentation *representation; mpd::AdaptationSetStream *adaptationSetStream; - mpd::IRepresentationStream *representationStream; +// mpd::IRepresentationStream *representationStream; uint32_t segmentNumber; uint32_t positionInMsecs; uint32_t segmentOffset; @@ -109,6 +119,7 @@ private: IICNConnection *conn; IICNConnection *initConn; THREAD_HANDLE bufferingThread; + THREAD_HANDLE mpdFetcherThread; bool isBuffering; bool icn; double icnAlpha; @@ -116,11 +127,16 @@ private: int bufferLevelAtUpdate; int readMax; uint8_t *readBuffer; + viper::managers::StreamType type; uint32_t CalculateSegmentOffset(); void NotifySegmentDownloaded(); - void DownloadInitSegment(dash::mpd::IRepresentation* rep); - bool InitSegmentExists(dash::mpd::IRepresentation* rep); +// void DownloadInitSegment(dash::mpd::IRepresentation* rep); + void DownloadInitSegment(); + void DownloadInitSegmentWithoutLock(); +// bool InitSegmentExists(dash::mpd::IRepresentation* rep); + bool InitSegmentExists(int rep); static void* DoBuffering(void *receiver); + static void* DoMPDFetching(void * data); }; } } |