Commit 05aa24c8 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: remove unused streamType

parent 184a8446
......@@ -318,7 +318,6 @@ libadaptative_plugin_la_SOURCES = \
demux/adaptative/StreamFormat.hpp \
demux/adaptative/Streams.cpp \
demux/adaptative/Streams.hpp \
demux/adaptative/StreamsType.hpp \
demux/adaptative/Time.hpp \
demux/adaptative/tools/Debug.hpp \
demux/adaptative/tools/Helper.cpp \
......
......@@ -24,7 +24,6 @@
# include "config.h"
#endif
#include "StreamsType.hpp"
#include <vlc_common.h>
#include <list>
......
......@@ -35,7 +35,6 @@ using namespace adaptative::logic;
AbstractStream::AbstractStream(demux_t * demux_, const StreamFormat &format_)
{
p_realdemux = demux_;
type = UNKNOWN;
format = format_;
adaptationLogic = NULL;
currentChunk = NULL;
......@@ -80,21 +79,6 @@ AbstractStream::~AbstractStream()
delete fakeesout;
}
StreamType AbstractStream::mimeToType(const std::string &mime)
{
StreamType mimetype;
if (!mime.compare(0, 6, "video/"))
mimetype = VIDEO;
else if (!mime.compare(0, 6, "audio/"))
mimetype = AUDIO;
else if (!mime.compare(0, 12, "application/"))
mimetype = APPLICATION;
else if (!mime.compare(0, 5, "text/"))
mimetype = SUBTITLE;
else /* unknown of unsupported */
mimetype = UNKNOWN;
return mimetype;
}
void AbstractStream::bind(AbstractAdaptationLogic *logic, SegmentTracker *tracker,
HTTPConnectionManager *conn)
......@@ -157,11 +141,6 @@ int AbstractStream::esCount() const
return fakeesout->esCount();
}
bool AbstractStream::operator ==(const AbstractStream &stream) const
{
return stream.type == type;
}
SegmentChunk * AbstractStream::getChunk()
{
if (currentChunk == NULL && !eof)
......
......@@ -25,7 +25,6 @@
#endif
#include <vlc_common.h>
#include "StreamsType.hpp"
#include "StreamFormat.hpp"
#include "ChunksSource.hpp"
......@@ -64,8 +63,6 @@ namespace adaptative
public:
AbstractStream(demux_t *, const StreamFormat &);
virtual ~AbstractStream();
bool operator==(const AbstractStream &) const;
static StreamType mimeToType(const std::string &mime);
void bind(AbstractAdaptationLogic *, SegmentTracker *,
HTTPConnectionManager *);
......@@ -106,7 +103,6 @@ namespace adaptative
Demuxer *syncdemux;
demux_t *p_realdemux;
StreamType type;
StreamFormat format;
AbstractAdaptationLogic *adaptationLogic;
......
/*
* StreamsType.hpp
*****************************************************************************
* Copyright (C) 2014 - VideoLAN and VLC authors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef STREAMSTYPE_HPP
#define STREAMSTYPE_HPP
namespace adaptative
{
enum StreamType
{
UNKNOWN = 0,
VIDEO,
AUDIO,
SUBTITLE,
APPLICATION
};
static const int StreamTypeCount = APPLICATION + 1;
}
#endif
......@@ -61,18 +61,6 @@ const std::vector<BaseAdaptationSet*>& BasePeriod::getAdaptationSets() const
return adaptationSets;
}
const std::vector<BaseAdaptationSet*> BasePeriod::getAdaptationSets(adaptative::StreamType type) const
{
std::vector<BaseAdaptationSet*> list;
std::vector<BaseAdaptationSet*>::const_iterator it;
for(it = adaptationSets.begin(); it!= adaptationSets.end(); ++it)
{
if( AbstractStream::mimeToType((*it)->getMimeType()) == type )
list.push_back(*it);
}
return list;
}
void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet)
{
if ( adaptationSet != NULL )
......@@ -93,17 +81,6 @@ BaseAdaptationSet *BasePeriod::getAdaptationSetByID(const ID &id)
return NULL;
}
BaseAdaptationSet * BasePeriod::getAdaptationSet(adaptative::StreamType type) const
{
std::vector<BaseAdaptationSet *>::const_iterator it;
for(it = adaptationSets.begin(); it != adaptationSets.end(); ++it)
{
if ( AbstractStream::mimeToType((*it)->getMimeType()) == type )
return *it;
}
return NULL;
}
void BasePeriod::debug(vlc_object_t *obj, int indent) const
{
std::string text(indent, ' ');
......
......@@ -29,7 +29,6 @@
#include "BaseAdaptationSet.h"
#include "SegmentInformation.hpp"
#include "../tools/Properties.hpp"
#include "../StreamsType.hpp"
namespace adaptative
{
......@@ -42,9 +41,7 @@ namespace adaptative
virtual ~BasePeriod ();
const std::vector<BaseAdaptationSet *>& getAdaptationSets () const;
const std::vector<BaseAdaptationSet *> getAdaptationSets (StreamType) const;
BaseAdaptationSet * getAdaptationSetByID(const ID &);
BaseAdaptationSet * getAdaptationSet (StreamType) const;
void addAdaptationSet (BaseAdaptationSet *AdaptationSet);
void debug (vlc_object_t *,int = 0) const;
......
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