Commit 50390eee authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: pass language to stream & es

parent ee31841e
......@@ -86,6 +86,12 @@ void Stream::updateFormat(StreamFormat &newformat)
output = streamOutputFactory->create(p_demux, format);
if(!output)
throw VLC_EGENERIC;
output->setLanguage(language);
}
void Stream::setLanguage(const std::string &lang)
{
language = lang;
}
bool Stream::isEOF() const
......@@ -318,6 +324,11 @@ AbstractStreamOutput::AbstractStreamOutput(demux_t *demux, const StreamFormat &f
format = format_;
}
void AbstractStreamOutput::setLanguage(const std::string &lang)
{
language = lang;
}
const StreamFormat & AbstractStreamOutput::getStreamFormat() const
{
return format;
......@@ -633,13 +644,21 @@ es_out_id_t * BaseStreamOutput::esOutAdd(const es_format_t *p_fmt)
if(!p_es)
{
p_es = realdemux->out->pf_add(realdemux->out, p_fmt);
es_format_t fmtcpy;
es_format_Init(&fmtcpy, p_fmt->i_cat, p_fmt->i_codec);
es_format_Copy(&fmtcpy, p_fmt);
if(!fmtcpy.psz_language && !language.empty())
fmtcpy.psz_language = strdup(language.c_str());
if(!fmtcpy.psz_description && !description.empty())
fmtcpy.psz_description = strdup(description.c_str());
p_es = realdemux->out->pf_add(realdemux->out, &fmtcpy);
if(p_es)
{
Demuxed *pair = new (std::nothrow) Demuxed(p_es, p_fmt);
Demuxed *pair = new (std::nothrow) Demuxed(p_es, &fmtcpy);
if(pair)
queues.push_back(pair);
}
es_format_Clean(&fmtcpy);
}
vlc_mutex_unlock(&lock);
......
......@@ -68,6 +68,7 @@ namespace adaptative
void create(AbstractAdaptationLogic *, SegmentTracker *,
const AbstractStreamOutputFactory *);
void updateFormat(StreamFormat &);
void setLanguage(const std::string &);
bool isEOF() const;
mtime_t getPCR() const;
mtime_t getFirstDTS() const;
......@@ -95,6 +96,7 @@ namespace adaptative
SegmentChunk *currentChunk;
bool disabled;
bool eof;
std::string language;
const AbstractStreamOutputFactory *streamOutputFactory;
};
......@@ -105,6 +107,7 @@ namespace adaptative
AbstractStreamOutput(demux_t *, const StreamFormat &);
virtual ~AbstractStreamOutput();
void setLanguage(const std::string &);
const StreamFormat & getStreamFormat() const;
virtual void pushBlock(block_t *, bool) = 0;
virtual mtime_t getPCR() const;
......@@ -123,6 +126,7 @@ namespace adaptative
demux_t *realdemux;
mtime_t pcr;
int group;
std::string language;
private:
StreamFormat format;
......
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