clean up: removed useless functions 96/7296/1
authorJacques Samain <[email protected]>
Fri, 23 Jun 2017 16:47:47 +0000 (18:47 +0200)
committerJacques Samain <[email protected]>
Fri, 23 Jun 2017 16:47:47 +0000 (18:47 +0200)
Change-Id: If55237df9f9bc67b97912321b86273588f7bedd6
Signed-off-by: Jacques Samain <[email protected]>
Input/DASHManager.cpp
Input/DASHManager.h
Input/DASHReceiver.cpp
Input/DASHReceiver.h
Input/IDASHManagerObserver.h
Managers/MultimediaManager.cpp
Managers/MultimediaStream.cpp
Managers/MultimediaStream.h
UI/DASHPlayer.cpp
UI/ViperGui.cpp
UI/ViperGui.h

index 4d52a63..3377c1a 100644 (file)
@@ -161,11 +161,6 @@ void DASHManager::onBufferStateChanged(BufferType type, uint32_t fillstateInPerc
         this->receiver->OnSegmentBufferStateChanged(fillstateInPercent, maxC);
 }
 
-void DASHManager::updateMPD(IMPD* mpd)
-{
-//    this->receiver->updateMPD(mpd);
-}
-
 void DASHManager::fetchMPD()
 {
     this->multimediaStream->fetchMPD();
index 6bd54da..c2b4a88 100644 (file)
@@ -62,7 +62,6 @@ public:
     void setTargetDownloadingTime(double);
     MediaObject* getSegment();
     void onBufferStateChanged(BufferType type, uint32_t fillstateInPercent, int maxC);
-    void updateMPD(dash::mpd::IMPD* mpd);
     void fetchMPD();
 
 private:
index aaa7520..c6dafb9 100644 (file)
@@ -204,10 +204,7 @@ libdash::framework::adaptation::IAdaptationLogic* DASHReceiver::GetAdaptationLog
 {
     return this->adaptationLogic;
 }
-dash::mpd::IRepresentation* DASHReceiver::GetRepresentation         ()
-{
-     return NULL;
-}
+
 uint32_t                    DASHReceiver::CalculateSegmentOffset    ()
 {
     return this->mpdWrapper->calculateSegmentOffset(type, bufferSize);
@@ -218,14 +215,6 @@ void                        DASHReceiver::NotifySegmentDownloaded   ()
     this->observer->onSegmentDownloaded();
 }
 
-void                                           DASHReceiver::NotifyBitrateChange(dash::mpd::IRepresentation *representation)
-{
-//    if(this->representation != representation)
-//    {
-//        this->representation = representation;
-//        this->SetRepresentation(this->period,this->adaptationSet,this->representation);
-//    }
-}
 void                        DASHReceiver::DownloadInitSegmentWithoutLock    ()
 {
     int rep = std::stoi(this->mpdWrapper->getRepresentationIDWithoutLock(type).c_str());
@@ -419,30 +408,3 @@ void                                       DASHReceiver::SetDrop   (float drop)
     this->drop = drop;
 }
 
-void                                   DASHReceiver::updateMPD(IMPD* mpd)
-{
-//    EnterCriticalSection(&this->monitorMutex);
-    //First we need to find the new segmentNumber -> what is the segment time now?
-//    uint32_t time = this->representationStream->getTime(this->segmentNumber);
-//    printf("old segmentNumber!: %d\n", this->segmentNumber);
-//    printf("time: %u\n", time);
-    //Second, replace the MPD with the new one
-//    delete(this->mpd);
-//    this->mpd = mpd;
-//
-    //Third, Update all the structures associated to the mpd
-//    this->period = this->mpd->GetPeriods().at(0);
-//    this->adaptationSet = this->period->GetAdaptationSets().at(0);
-//    this->representation = this->adaptationSet->GetRepresentation().at(0);
-//    delete(this->adaptationSetStream);
-//    this->adaptationSetStream = new AdaptationSetStream(mpd, period, adaptationSet);
-//    this->representationStream = adaptationSetStream->getRepresentationStream(this->representation);
-//    this->segmentOffset = CalculateSegmentOffset();
-//    this->representationStream->setSegmentOffset(this->segmentOffset);
-//
-    //Fourth, Set the new segmentNumber by finding the index of the segment associated to 'uint32_t time' in the new mpd
-//    this->segmentNumber = this->representationStream->getSegmentNumber(time);
-//    printf("new segmentNumber!: %d\n", this->segmentNumber);
-//    LeaveCriticalSection(&this->monitorMutex);
-}
-
index cf56166..ed98b9e 100644 (file)
@@ -57,23 +57,18 @@ public:
     input::MediaObject* GetSegment(uint32_t segmentNumber);
     input::MediaObject* GetInitSegment();
     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();
     void SetAdaptationLogic(adaptation::IAdaptationLogic *_adaptationLogic);
     libdash::framework::adaptation::IAdaptationLogic* GetAdaptationLogic();
     void NotifyQualityDownloading(uint32_t quality);
     void Notifybps(uint64_t bps);
     void NotifyDLTime(double time);
-    void NotifyBitrateChange(dash::mpd::IRepresentation *representation);
     void OnSegmentBufferStateChanged(uint32_t fillstateInPercent, int maxC);
     bool IsICN();
     void ShouldAbort();
@@ -85,7 +80,6 @@ public:
     bool CanPush();
     void SetBeta(float beta);
     void SetDrop(float drop);
-    void updateMPD(dash::mpd::IMPD* mpd);
 
 private:
     float                                               beta;
index 1003d8a..57f1572 100644 (file)
@@ -26,7 +26,6 @@ class IDASHManagerObserver
 public:
     virtual ~IDASHManagerObserver() {}
 
-    virtual void addFrame(QImage *frame) = 0;
     virtual void setEOS(bool value)= 0;
 
     virtual void onSegmentBufferStateChanged(uint32_t fillstateInPercent, int maxC) = 0;
index 2311846..44473b0 100644 (file)
@@ -280,7 +280,6 @@ void MultimediaManager::stopAudio()
 
 bool MultimediaManager::setVideoQuality()
 {
-
     if (this->videoStream)
         this->videoStream->setRepresentation();
     return true;
index 4b5b66f..86cde35 100644 (file)
@@ -19,22 +19,20 @@ using namespace libdash::framework::mpd;
 using namespace dash::mpd;
 
 MultimediaStream::MultimediaStream(StreamType type, MPDWrapper *mpdWrapper, uint32_t bufferSize, bool icnEnabled, double icnAlpha, bool nodecoding, float beta, float drop) :
-    type               (type),
-    segmentBufferSize  (bufferSize),
-    dashManager                (NULL),
-    mpdWrapper         (mpdWrapper),
-    icn                        (icnEnabled),
-    icnAlpha           (icnAlpha),
-    noDecoding         (nodecoding),
-    beta               (beta),
-    drop               (drop)
-{
-//    InitializeCriticalSection (&this->monitorMutex);
+    type                (type),
+    segmentBufferSize   (bufferSize),
+    dashManager         (NULL),
+    mpdWrapper          (mpdWrapper),
+    icn                 (icnEnabled),
+    icnAlpha            (icnAlpha),
+    noDecoding          (nodecoding),
+    beta                (beta),
+    drop                (drop)
+{
     this->init();
 }
 MultimediaStream::~MultimediaStream ()
 {
-//    DestroyCriticalSection (&this->monitorMutex);
     this->stop();
     delete this->dashManager;
 }
@@ -106,15 +104,6 @@ void MultimediaStream::clear()
     this->dashManager->clear();
 }
 
-void MultimediaStream::addFrame(QImage *frame)
-{
-}
-
-QImage* MultimediaStream::getFrame()
-{
-    return NULL;
-}
-
 void MultimediaStream::attachStreamObserver(IStreamObserver *observer)
 {
     this->observers.push_back(observer);
@@ -210,12 +199,6 @@ void MultimediaStream::notifyBufferChange(uint32_t bufferfill, int maxC)
     this->dashManager->onBufferStateChanged(libdash::framework::buffer::VIDEO, bufferfill, maxC);
 }
 
-void MultimediaStream::updateMPD (IMPD* mpd)
-{
-//    this->mpd = mpd;
-//    this->dashManager->updateMPD(mpd);
-}
-
 void MultimediaStream::fetchMPD()
 {
     for(size_t i=0; i < this->observers.size(); i++)
index d9db5f6..d5661b0 100644 (file)
@@ -57,15 +57,9 @@ public:
     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 setRepresentation();
     void enqueueRepresentation(dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation);
     void setAdaptationLogic(libdash::framework::adaptation::IAdaptationLogic *logic);
@@ -82,23 +76,22 @@ public:
     bool isICN();
     void shouldAbort();
     void setTargetDownloadingTime(double);
-    void updateMPD(dash::mpd::IMPD* mpd);
     void fetchMPD();
 
 private:
-    float                                                      beta;
-    float                                                      drop;
-    std::vector<IStreamObserver *>                             observers;
-    libdash::framework::mpd::MPDWrapper                                        *mpdWrapper;
-    libdash::framework::adaptation::IAdaptationLogic           *logic;
-    libdash::framework::input::DASHManager                     *dashManager;
-    uint32_t                                                   segmentBufferSize;
-    StreamType                                                 type;
-    bool                                                       icn;
-    double                                                     icnAlpha;
-    mutable CRITICAL_SECTION                                   monitorMutex;
+    float                                               beta;
+    float                                               drop;
+    std::vector<IStreamObserver *>                      observers;
+    libdash::framework::mpd::MPDWrapper                 *mpdWrapper;
+    libdash::framework::adaptation::IAdaptationLogic    *logic;
+    libdash::framework::input::DASHManager              *dashManager;
+    uint32_t                                            segmentBufferSize;
+    StreamType                                          type;
+    bool                                                icn;
+    double                                              icnAlpha;
+    mutable CRITICAL_SECTION                            monitorMutex;
+    bool                                                noDecoding;
 
-    bool                                                       noDecoding;
     void init ();
 };
 }
index cdad7d5..d83e402 100644 (file)
@@ -159,7 +159,7 @@ bool DASHPlayer::onDownloadMPDPressed (const std::string &url)
         }
     }
     this->setSettings(-1, -1, -1, -1, -1);
-    this->gui->setGuiFields(this->mpdWrapper->getMPD());
+    this->gui->setMPDDuration(this->mpdWrapper->getMPD());
     return true;
 }
 
index 24dcfad..e23bd30 100644 (file)
@@ -54,25 +54,8 @@ ViperGui::~ViperGui()
     pthread_mutex_destroy(&(this->monitorMutex));
 }
 
-void ViperGui::setGuiFields(dash::mpd::IMPD* mpd)
-{
-//USELESS CALLS
-//    this->setPeriodComboBox(mpd);
-//    if (mpd->GetPeriods().size() > 0)
-//    {
-//        IPeriod *period = mpd->GetPeriods().at(0);
-//        this->setVideoAdaptationSetComboBox(period);
-//        if (!AdaptationSetHelper::getVideoAdaptationSets(period).empty())
-//        {
-//            IAdaptationSet *adaptationSet = AdaptationSetHelper::getVideoAdaptationSets(period).at(0);
-//            this->setRepresentationComoboBox(adaptationSet);
-//        }
-//        if (!AdaptationSetHelper::getAudioAdaptationSets(period).empty())
-//        {
-//            IAdaptationSet *adaptationSet = AdaptationSetHelper::getAudioAdaptationSets(period).at(0);
-//            this->setRepresentationComoboBox(adaptationSet);
-//        }
-//    }
+void ViperGui::setMPDDuration(dash::mpd::IMPD* mpd)
+{
     if(!strcmp(mpd->GetType().c_str(),"static"))
     {
         parse8601(mpd->GetMediaPresentationDuration());
@@ -90,49 +73,6 @@ void ViperGui::parse8601(std::string durationISO8601)
     this->durationString.assign(timeStamp);
 }
 
-void ViperGui::setRepresentationComoboBox(dash::mpd::IAdaptationSet *adaptationSet)
-{
-    std::vector<IRepresentation *> represenations = adaptationSet->GetRepresentation();
-    for(size_t i = 0; i < represenations.size(); i++)
-    {
-        IRepresentation *representation = represenations.at(i);
-    }
-}
-void ViperGui::setAdaptationSetComboBox(dash::mpd::IPeriod *period)
-{
-    std::vector<IAdaptationSet *> adaptationSets = period->GetAdaptationSets();
-    for(size_t i = 0; i < adaptationSets.size(); i++)
-    {
-        IAdaptationSet *adaptationSet = adaptationSets.at(i);
-    }
-}
-
-void ViperGui::setAudioAdaptationSetComboBox(dash::mpd::IPeriod *period)
-{
-    std::vector<IAdaptationSet *> adaptationSets = AdaptationSetHelper::getAudioAdaptationSets(period);
-    for(size_t i = 0; i < adaptationSets.size(); i++)
-    {
-        IAdaptationSet *adaptationSet = adaptationSets.at(i);
-    }
-}
-
-void ViperGui::setVideoAdaptationSetComboBox(dash::mpd::IPeriod *period)
-{
-    std::vector<IAdaptationSet *> adaptationSets = AdaptationSetHelper::getVideoAdaptationSets(period);
-    for(size_t i = 0; i < adaptationSets.size(); i++)
-    {
-        IAdaptationSet *adaptationSet = adaptationSets.at(i);
-    }
-}
-void ViperGui::setPeriodComboBox(dash::mpd::IMPD *mpd)
-{
-    std::vector<IPeriod *> periods = mpd->GetPeriods();
-    for(size_t i = 0; i < periods.size(); i++)
-    {
-        IPeriod *period = periods.at(i);
-    }
-}
-
 ViperBuffer* ViperGui::getStreamBuffer()
 {
     return this->streamBuffer;
index 1ce8e57..6431257 100644 (file)
@@ -48,7 +48,7 @@ public:
     void setListSegmentSize(int listSegmentSize);
     ViperBuffer* getStreamBuffer();
     QtAV::AVPlayer* getVideoPlayer();
-    void setGuiFields(dash::mpd::IMPD* mpd);
+    void setMPDDuration(dash::mpd::IMPD* mpd);
     void setLifeLabel(QObject *lifeLabel);
     void setNowLabel(QObject *nowLabel);
     void setPlayButton(QObject *playButton);
@@ -87,41 +87,37 @@ public:
     void resetGraphValues();
 
 private:
-    pthread_mutex_t                     monitorMutex;
-    GraphDataSource                     *graphDataSource;
-    managers::MultimediaStream          *videoStream;
-    int64_t                             offset;
-    int64_t                             durationMilliseconds;
-    qint64                              position;
-    std::string                         durationString;
-    QtAV::AVPlayer                      *videoPlayer;
-    ViperBuffer                         *streamBuffer;
-    std::map<std::string, std::string>  keyValues;
-    std::map<std::string, int>          keyIndices;
-    std::map<std::string, std::vector<std::string>>    video;
-    std::map<std::string, std::vector<std::string>>    audio;
-    QObject                             *lifeLabel;
-    QObject                             *nowLabel;
-    QObject                             *progressBar;
-    QObject                             *playButton;
-    std::vector<IDASHPlayerGuiObserver *>   observers;
-    dash::mpd::IMPD                         *mpd;
-    void setPeriodComboBox(dash::mpd::IMPD *mpd);
-    void setAdaptationSetComboBox(dash::mpd::IPeriod *period);
-    void setVideoAdaptationSetComboBox(dash::mpd::IPeriod *period);
-    void setAudioAdaptationSetComboBox(dash::mpd::IPeriod *period);
-    void setRepresentationComoboBox(dash::mpd::IAdaptationSet *adaptationSet);
+    pthread_mutex_t                                 monitorMutex;
+    GraphDataSource                                 *graphDataSource;
+    managers::MultimediaStream                      *videoStream;
+    int64_t                                         offset;
+    int64_t                                         durationMilliseconds;
+    qint64                                          position;
+    std::string                                     durationString;
+    QtAV::AVPlayer                                  *videoPlayer;
+    ViperBuffer                                     *streamBuffer;
+    std::map<std::string, std::string>              keyValues;
+    std::map<std::string, int>                      keyIndices;
+    std::map<std::string, std::vector<std::string>> video;
+    std::map<std::string, std::vector<std::string>> audio;
+    QObject                                         *lifeLabel;
+    QObject                                         *nowLabel;
+    QObject                                         *progressBar;
+    QObject                                         *playButton;
+    std::vector<IDASHPlayerGuiObserver *>           observers;
+    dash::mpd::IMPD                                 *mpd;
+    int                                             listSegmentSize;
+    int                                             segment;
+    int64_t                                         bufferDuration;
+    int64_t                                         segmentDuration;
+    int64_t                                         lastSegmentDuration;
+    bool                                            play;
+    bool                                            stop;
+    bool                                            pause;
+    bool                                            repeat;
+    QObject                                         *rootObject;
+
     void parse8601(std::string durationISO8601);
-    int                                 listSegmentSize;
-    int                                 segment;
-    int64_t                             bufferDuration;
-    int64_t                             segmentDuration;
-    int64_t                             lastSegmentDuration;
-    bool                                play;
-    bool                                stop;
-    bool                                pause;
-    bool                                repeat;
-    QObject                             *rootObject;
 
 };
 }