diff options
author | Luca Muscariello <lumuscar+fdio@cisco.com> | 2017-02-25 23:42:31 +0100 |
---|---|---|
committer | Luca Muscariello <lumuscar+fdio@cisco.com> | 2017-02-25 23:42:31 +0100 |
commit | 05c1a838c881ea502888659848d8792843b28718 (patch) | |
tree | cf0b05b58bd725a1eb6c80325ba986c63dea42aa /Managers/MultimediaStream.h | |
parent | 9b30fc10fb1cbebe651e5a107e8ca5b24de54675 (diff) |
Initial commit: video player - viper
Change-Id: Id5aa33598ce34659bad4a7a9ae5006bfb84f9bd1
Signed-off-by: Luca Muscariello <lumuscar+fdio@cisco.com>
Diffstat (limited to 'Managers/MultimediaStream.h')
-rw-r--r-- | Managers/MultimediaStream.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/Managers/MultimediaStream.h b/Managers/MultimediaStream.h new file mode 100644 index 00000000..6918f639 --- /dev/null +++ b/Managers/MultimediaStream.h @@ -0,0 +1,89 @@ +/* + * MultimediaStream.h + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef VIPER_MANAGERS_MULTIMEDIASTREAM_H_ +#define VIPER_MANAGERS_MULTIMEDIASTREAM_H_ + +#include "IMPD.h" +#include "IStreamObserver.h" +#include "../Input/DASHManager.h" +#include "../Buffer/IBufferObserver.h" +#include "../Adaptation/IAdaptationLogic.h" +#include <QtMultimedia/qaudioformat.h> +#include "../Input/IDASHManagerObserver.h" +#include "../Buffer/Buffer.h" +#include <QImage> + +namespace viper +{ +namespace managers +{ +class MultimediaStream : public libdash::framework::input::IDASHManagerObserver, public libdash::framework::buffer::IBufferObserver +{ +public: + MultimediaStream(StreamType type, dash::mpd::IMPD *mpd, uint32_t segmentBufferSize, bool icnEnabled, double icnAlpha, bool nodecoding, float beta, float drop); + virtual ~MultimediaStream(); + + bool start(); + void stop(); + void stopDownload(); + bool startDownload(); + void clear(); + uint32_t getPosition(); + void setPosition(uint32_t segmentNumber); + void setLooping(bool looping); + void setPositionInMsec(uint32_t milliSecs); + + void addFrame(QImage *frame); + QImage* getFrame(); + libdash::framework::input::MediaObject* getSegment(); + + void setEOS(bool value); + + void notifyBufferChange(uint32_t bufferfill, int maxC); + + void setRepresentation(dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation); + void enqueueRepresentation(dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation); + void setAdaptationLogic(libdash::framework::adaptation::IAdaptationLogic *logic); + + void attachStreamObserver(IStreamObserver *observer); + + void onSegmentBufferStateChanged(uint32_t fillstateInPercent, int maxC); + void onBufferStateChanged(libdash::framework::buffer::BufferType type, uint32_t fillstateInPercent, int maxC); + + void notifyStatistics(int segNum, uint32_t bitrate, int fps, uint32_t quality); + void notifyQualityDownloading (uint32_t quality); + bool canPush(); + int getBufferLevel(); + bool isICN(); + void shouldAbort(); + + void setTargetDownloadingTime(double); + +private: + float beta; + float drop; + std::vector<IStreamObserver *> observers; + dash::mpd::IMPD *mpd; + libdash::framework::adaptation::IAdaptationLogic *logic; + libdash::framework::input::DASHManager *dashManager; + uint32_t segmentBufferSize; + StreamType type; + bool icn; + double icnAlpha; + + bool noDecoding; + void init (); +}; +} +} + +#endif /* VIPER_MANAGERS_MULTIMEDIASTREAM_H_ */ |