[vlc-commits] demux: adaptative: add default ID to AdaptationSet/Representation
Francois Cartegnie
git at videolan.org
Thu Aug 6 17:30:20 CEST 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 31 00:54:02 2015 +0200| [7fa3fa11d3a7cf9d4b5948d86b593688aa9c615f] | committer: Francois Cartegnie
demux: adaptative: add default ID to AdaptationSet/Representation
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7fa3fa11d3a7cf9d4b5948d86b593688aa9c615f
---
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp | 15 ++++++++++++++-
modules/demux/adaptative/playlist/BaseAdaptationSet.h | 2 ++
.../demux/adaptative/playlist/BaseRepresentation.cpp | 4 +++-
.../adaptative/playlist/CommonAttributesElements.cpp | 5 +++++
.../adaptative/playlist/CommonAttributesElements.h | 3 +++
5 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/modules/demux/adaptative/playlist/BaseAdaptationSet.cpp b/modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
index 7d189b6..50840a7 100644
--- a/modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
+++ b/modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
@@ -34,6 +34,7 @@
#include "SegmentTemplate.h"
#include "BasePeriod.h"
+#include "ID.hpp"
using namespace adaptative;
using namespace adaptative::playlist;
@@ -61,6 +62,17 @@ std::vector<BaseRepresentation*>& BaseAdaptationSet::getRepresentations()
return representations;
}
+BaseRepresentation * BaseAdaptationSet::getRepresentationByID(const ID &id)
+{
+ std::vector<BaseRepresentation *>::const_iterator it;
+ for(it = representations.begin(); it != representations.end(); ++it)
+ {
+ if((*it)->getID() == id)
+ return *it;
+ }
+ return NULL;
+}
+
void BaseAdaptationSet::addRepresentation(BaseRepresentation *rep)
{
representations.push_back(rep);
@@ -80,7 +92,8 @@ bool BaseAdaptationSet::getBitstreamSwitching () const
void BaseAdaptationSet::debug(vlc_object_t *obj, int indent) const
{
std::string text(indent, ' ');
- text.append("BaseAdaptationSet");
+ text.append("BaseAdaptationSet ");
+ text.append(id.str());
msg_Dbg(obj, "%s", text.c_str());
std::vector<BaseRepresentation *>::const_iterator k;
for(k = representations.begin(); k != representations.end(); ++k)
diff --git a/modules/demux/adaptative/playlist/BaseAdaptationSet.h b/modules/demux/adaptative/playlist/BaseAdaptationSet.h
index e2d3b4b..f261337 100644
--- a/modules/demux/adaptative/playlist/BaseAdaptationSet.h
+++ b/modules/demux/adaptative/playlist/BaseAdaptationSet.h
@@ -38,6 +38,7 @@ namespace adaptative
{
class BaseRepresentation;
class BasePeriod;
+ class ID;
class BaseAdaptationSet : public CommonAttributesElements,
public SegmentInformation
@@ -48,6 +49,7 @@ namespace adaptative
virtual StreamFormat getStreamFormat() const; /*reimpl*/
std::vector<BaseRepresentation *>& getRepresentations ();
+ BaseRepresentation * getRepresentationByID(const ID &);
void setSwitchPolicy(bool value);
bool getBitstreamSwitching() const;
void addRepresentation( BaseRepresentation *rep );
diff --git a/modules/demux/adaptative/playlist/BaseRepresentation.cpp b/modules/demux/adaptative/playlist/BaseRepresentation.cpp
index fec4154..7623987 100644
--- a/modules/demux/adaptative/playlist/BaseRepresentation.cpp
+++ b/modules/demux/adaptative/playlist/BaseRepresentation.cpp
@@ -30,6 +30,7 @@
#include "BaseRepresentation.h"
#include "BaseAdaptationSet.h"
#include "SegmentTemplate.h"
+#include "ID.hpp"
using namespace adaptative;
using namespace adaptative::playlist;
@@ -73,7 +74,8 @@ void BaseRepresentation::addCodec(const std::string &codec)
void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
{
std::string text(indent, ' ');
- text.append("Representation");
+ text.append("Representation ");
+ text.append(id.str());
msg_Dbg(obj, "%s", text.c_str());
std::vector<ISegment *> list;
getAllSegments(list);
diff --git a/modules/demux/adaptative/playlist/CommonAttributesElements.cpp b/modules/demux/adaptative/playlist/CommonAttributesElements.cpp
index 8e9de8d..6bfaa7b 100644
--- a/modules/demux/adaptative/playlist/CommonAttributesElements.cpp
+++ b/modules/demux/adaptative/playlist/CommonAttributesElements.cpp
@@ -84,3 +84,8 @@ void CommonAttributesElements::addLang( const std::string &lang )
if ( lang.empty() == false )
this->lang.push_back( lang );
}
+
+const ID & CommonAttributesElements::getID() const
+{
+ return id;
+}
diff --git a/modules/demux/adaptative/playlist/CommonAttributesElements.h b/modules/demux/adaptative/playlist/CommonAttributesElements.h
index cbac30d..79150b3 100644
--- a/modules/demux/adaptative/playlist/CommonAttributesElements.h
+++ b/modules/demux/adaptative/playlist/CommonAttributesElements.h
@@ -26,6 +26,7 @@
#include <list>
#include <string>
+#include "ID.hpp"
namespace adaptative
{
@@ -44,12 +45,14 @@ namespace adaptative
void setHeight( int height );
const std::list<std::string>& getLang() const;
void addLang( const std::string &lang );
+ const ID & getID() const;
protected:
std::string mimeType;
int width;
int height;
std::list<std::string> lang;
+ ID id;
};
}
}
More information about the vlc-commits
mailing list