aboutsummaryrefslogtreecommitdiffstats
path: root/Managers/MultimediaManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'Managers/MultimediaManager.h')
-rw-r--r--Managers/MultimediaManager.h129
1 files changed, 66 insertions, 63 deletions
diff --git a/Managers/MultimediaManager.h b/Managers/MultimediaManager.h
index b4187486..ade2b767 100644
--- a/Managers/MultimediaManager.h
+++ b/Managers/MultimediaManager.h
@@ -35,50 +35,52 @@ public:
MultimediaManager(ViperGui *viperGui, int segmentBufferSize, std::string downloadPath, bool noDecoding = false);
virtual ~MultimediaManager();
- bool init (const std::string& url);
- bool initICN (const std::string& url);
- void start (bool icnEnabled, double icnAlpha, uint32_t nextOffset);
- void stop ();
- dash::mpd::IMPD* getMPD ();
-
- bool setVideoQuality (dash::mpd::IPeriod* period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation);
- bool setAudioQuality (dash::mpd::IPeriod* period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation);
-
- bool setVideoAdaptationLogic (libdash::framework::adaptation::LogicType type, struct libdash::framework::adaptation::AdaptationParameters *params);
- bool setAudioAdaptationLogic (libdash::framework::adaptation::LogicType type, struct libdash::framework::adaptation::AdaptationParameters *params);
-
- void attachManagerObserver (IMultimediaManagerObserver *observer);
-
- void setFrameRate (double frameRate);
+ bool init (const std::string& url);
+ bool initICN (const std::string& url);
+ void start (bool icnEnabled, double icnAlpha, uint32_t nextOffset);
+ void stop ();
+ dash::mpd::IMPD* getMPD ();
+ bool setVideoQuality ();
+ bool setAudioQuality ();
+ bool setVideoAdaptationLogic (libdash::framework::adaptation::LogicType type, struct libdash::framework::adaptation::AdaptationParameters *params);
+ bool setAudioAdaptationLogic (libdash::framework::adaptation::LogicType type, struct libdash::framework::adaptation::AdaptationParameters *params);
+ void attachManagerObserver (IMultimediaManagerObserver *observer);
+ void setFrameRate (double frameRate);
+ void setSegmentDuration (float segDuration);
+ float getSegmentDuration ();
/* IStreamObserver */
- void onSegmentDownloaded ();
- void onSegmentBufferStateChanged (StreamType type, uint32_t fillstateInPercent, int maxC);
- void onVideoBufferStateChanged (uint32_t fillstateInPercent);
- void onAudioBufferStateChanged (uint32_t fillstateInPercent);
- bool isUserDependent ();
- bool isStarted ();
- bool isStopping ();
- bool isICN ();
- void setEOS (bool value);
- void shouldAbort (bool isVideo);
- void setTargetDownloadingTime (bool isVid, double time);
- bool isPlaying ();
- void onPausePressed ();
- void notifyStatistics (int segNum, uint32_t bitrate, int fps, uint32_t quality);
- void notifyQualityDownloading (uint32_t quality);
- uint32_t getUBufferLevel ();
- int getBufferLevel ();
- void setLooping (bool looping);
- void setOffset(int offset);
- void setBeta(float beta);
- void setDrop(float drop);
- bool canPush ();
- CRITICAL_SECTION monitorBufferMutex;
+ void onSegmentDownloaded ();
+ void onSegmentBufferStateChanged (StreamType type, uint32_t fillstateInPercent, int maxC);
+ void onVideoBufferStateChanged (uint32_t fillstateInPercent);
+ void onAudioBufferStateChanged (uint32_t fillstateInPercent);
+ bool isUserDependent ();
+ bool isStarted ();
+ bool isStopping ();
+ bool isICN ();
+ void setEOS (bool value);
+ void shouldAbort (bool isVideo);
+ void setTargetDownloadingTime (bool isVid, double time);
+ bool isPlaying ();
+ void onPausePressed ();
+ void notifyStatistics (int segNum, uint32_t bitrate, int fps, uint32_t quality);
+ void notifyQualityDownloading (uint32_t quality);
+ uint32_t getUBufferLevel ();
+ int getBufferLevel ();
+ void setLooping (bool looping);
+ libdash::framework::mpd::MPDWrapper* getMPDWrapper ();
+ void setMPDWrapper (libdash::framework::mpd::MPDWrapper* mpdWrapper);
+ void setOffset (int offset);
+ void setBeta (float beta);
+ void setDrop (float drop);
+ bool canPush ();
+ void fetchMPD ();
+
- int offset;
- std::chrono::time_point<std::chrono::system_clock> lastPointInTime;
- std::chrono::time_point<std::chrono::system_clock> bufferingLimit;
+ CRITICAL_SECTION monitorBufferMutex;
+ int offset;
+ std::chrono::time_point<std::chrono::system_clock> lastPointInTime;
+ std::chrono::time_point<std::chrono::system_clock> bufferingLimit;
private:
float beta;
@@ -87,14 +89,9 @@ private:
int segmentBufferSize;
ViperGui *viperGui;
dash::IDASHManager *manager;
- dash::mpd::IMPD *mpd;
- dash::mpd::IPeriod *period;
- dash::mpd::IAdaptationSet *videoAdaptationSet;
- dash::mpd::IRepresentation *videoRepresentation;
+ libdash::framework::mpd::MPDWrapper *mpdWrapper;
libdash::framework::adaptation::IAdaptationLogic *videoLogic;
MultimediaStream *videoStream;
- dash::mpd::IAdaptationSet *audioAdaptationSet;
- dash::mpd::IRepresentation *audioRepresentation;
libdash::framework::adaptation::IAdaptationLogic *audioLogic;
MultimediaStream *audioStream;
std::vector<IMultimediaManagerObserver *> managerObservers;
@@ -102,6 +99,7 @@ private:
bool stopping;
bool icn;
double icnAlpha;
+ libdash::framework::input::IICNConnection *icnConn;
uint64_t framesDisplayed;
uint64_t segmentsDownloaded;
CRITICAL_SECTION monitorMutex;
@@ -117,22 +115,27 @@ private:
mutable CRITICAL_SECTION monitor_playing_audio_mutex;
mutable CONDITION_VARIABLE playingAudioStatusChanged;
const char *logicName;
- bool noDecoding;
- void notifyBufferChange ();
- bool startVideoRenderingThread ();
- void stopVideoRenderingThread ();
- static void* pushVideo (void *data);
- static void* pushVideoNoOut (void *data);
- bool startAudioRenderingThread ();
- void stopAudioRenderingThread ();
- void initVideoRendering (uint32_t offset);
- void initAudioPlayback (uint32_t offset);
- void stopVideo ();
- void stopAudio ();
- void notifyVideoBufferObservers (uint32_t fillstateInPercent);
- void notifyVideoSegmentBufferObservers (uint32_t fillstateInPercent);
- void notifyAudioBufferObservers (uint32_t fillstateInPercent);
- void notifyAudioSegmentBufferObservers (uint32_t fillstateInPercent);
+ bool noDecoding;
+ std::string url;
+ float segmentDuration;
+
+ void notifyBufferChange ();
+ bool startVideoRenderingThread ();
+ void stopVideoRenderingThread ();
+ static void* pushVideo (void *data);
+ static void* pushVideoNoOut (void *data);
+ bool startAudioRenderingThread ();
+ void stopAudioRenderingThread ();
+ void initVideoRendering (uint32_t offset);
+ void initAudioPlayback (uint32_t offset);
+ void stopVideo ();
+ void stopAudio ();
+ void notifyVideoBufferObservers (uint32_t fillstateInPercent);
+ void notifyVideoSegmentBufferObservers (uint32_t fillstateInPercent);
+ void notifyAudioBufferObservers (uint32_t fillstateInPercent);
+ void notifyAudioSegmentBufferObservers (uint32_t fillstateInPercent);
+ void updateMPD ();
+ void updateMPDICN ();
};
}
}