[vlc-commits] demux: adaptative: report es selection

Francois Cartegnie git at videolan.org
Fri Jul 24 15:09:27 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 17 17:00:27 2015 +0200| [3258f4299e82dd782254e9e068c5cdde2faf7426] | committer: Francois Cartegnie

demux: adaptative: report es selection

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3258f4299e82dd782254e9e068c5cdde2faf7426
---

 modules/demux/adaptative/Streams.cpp |   20 ++++++++++++++++++++
 modules/demux/adaptative/Streams.hpp |    3 +++
 2 files changed, 23 insertions(+)

diff --git a/modules/demux/adaptative/Streams.cpp b/modules/demux/adaptative/Streams.cpp
index cf5231e..fb2521f 100644
--- a/modules/demux/adaptative/Streams.cpp
+++ b/modules/demux/adaptative/Streams.cpp
@@ -141,6 +141,11 @@ bool Stream::seekAble() const
     return (output && output->seekAble());
 }
 
+bool Stream::isSelected() const
+{
+    return output && output->isSelected();
+}
+
 Stream::status Stream::demux(HTTPConnectionManager *connManager, mtime_t nz_deadline, bool send)
 {
     if(!output)
@@ -442,6 +447,21 @@ bool BaseStreamOutput::switchAllowed() const
     return b_allowed;
 }
 
+bool BaseStreamOutput::isSelected() const
+{
+    bool b_selected = false;
+    vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
+    std::list<Demuxed *>::const_iterator it;
+    for(it=queues.begin(); it!=queues.end() && !b_selected; ++it)
+    {
+        const Demuxed *pair = *it;
+        if(pair->es_id)
+            es_out_Control(realdemux->out, ES_OUT_GET_ES_STATE, pair->es_id, &b_selected);
+    }
+    vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
+    return b_selected;
+}
+
 void BaseStreamOutput::sendToDecoder(mtime_t nzdeadline)
 {
     vlc_mutex_lock(&lock);
diff --git a/modules/demux/adaptative/Streams.hpp b/modules/demux/adaptative/Streams.hpp
index 3a16587..9960887 100644
--- a/modules/demux/adaptative/Streams.hpp
+++ b/modules/demux/adaptative/Streams.hpp
@@ -74,6 +74,7 @@ namespace adaptative
         int getGroup() const;
         int esCount() const;
         bool seekAble() const;
+        bool isSelected() const;
         typedef enum {status_eof, status_buffering, status_demuxed} status;
         status demux(HTTPConnectionManager *, mtime_t, bool);
         bool setPosition(mtime_t, bool);
@@ -112,6 +113,7 @@ namespace adaptative
         virtual void sendToDecoder(mtime_t) = 0;
         virtual bool reinitsOnSeek() const = 0;
         virtual bool switchAllowed() const = 0;
+        virtual bool isSelected() const = 0;
 
     protected:
         demux_t  *realdemux;
@@ -142,6 +144,7 @@ namespace adaptative
         virtual void sendToDecoder(mtime_t); /* reimpl */
         virtual bool reinitsOnSeek() const; /* reimpl */
         virtual bool switchAllowed() const; /* reimpl */
+        virtual bool isSelected() const; /* reimpl */
         void setTimestampOffset(mtime_t);
 
     protected:



More information about the vlc-commits mailing list