Commit 3258f429 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: report es selection

parent c7e83e1c
......@@ -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);
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment