[vlc-commits] dash: CommonAttributesElements: When applicable, convert attributes to integers

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec  1 15:57:59 2011 +0100| [8aa98f8c743227b0d5f1fb113324a3d667734762] | 
committer: Jean-Baptiste Kempf

dash: CommonAttributesElements: When applicable, convert attributes to integers

Signed-off-by: Jean-Baptiste Kempf 
(cherry picked from commit d314c4f4cac6d055e23a387f6aa2b741aec237da)

Signed-off-by: Jean-Baptiste Kempf 

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=8aa98f8c743227b0d5f1fb113324a3d667734762
---

 .../dash/mpd/CommonAttributesElements.cpp  |   35 ++-
 .../dash/mpd/CommonAttributesElements.h|   10 +++---
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp 
b/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
index 37aa2a3..7c56376 100644
--- a/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
+++ b/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
@@ -23,6 +23,8 @@
 
 #include "CommonAttributesElements.h"
 
+#include 
+
 using namespace dash::mpd;
 using namespace dash::exception;
 
@@ -37,43 +39,43 @@ CommonAttributesElements::~CommonAttributesElements()
 delete this->contentProtection;
 }
 
-std::string CommonAttributesElements::getWidth() const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getWidth() const
 {
 std::map::const_iterator  it = 
this->attributes.find("width");
 if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getHeight   () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getHeight   () const
 {
 std::map::const_iterator  it = 
this->attributes.find("height");
 if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getParX () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getParX () const
 {
 std::map::const_iterator  it = 
this->attributes.find("parx");
-if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+if ( it == this->attributes.end() )
+return 1; //Default value is defined in standard's §5.4.3.2.2
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getParY () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getParY () const
 {
 std::map::const_iterator  it = 
this->attributes.find("pary");
 if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
+return 1; //Default value is defined in standard's §5.4.3.2.2
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
@@ -84,16 +86,15 @@ std::string CommonAttributesElements::getLang   
  () const t
 throw AttributeNotPresentException();
 
 return it->second;
-
 }
 
-std::string CommonAttributesElements::getFrameRate() const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getFrameRate() const
 {
 std::map::const_iterator  it = 
this->attributes.find("frameRate");
 if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
diff --git a/modules/stream_filter/dash/mpd/CommonAttributesElements.h 
b/modules/stream_filter/dash/mpd/CommonAttributesElements.h
index 9248e20..7f69adc 100644
--- a/modules/stream_filter/dash/mpd/CommonAttributesElements.h
+++ b/modules/stream_filter/dash/mpd/CommonAttributesElements.h
@@ -41,12 +41,12 @@ namespace dash
 public:
 CommonAttributesElements( const std::map& attributes );
 virtual ~CommonAttributesElements();
-std::string getWidth() const 
throw(dash::exception::AttributeNotPresentException);
-std::string getHeight   () const 
throw(dash::exception::AttributeNotPresentException);
-std::string getParX () const 
throw(dash::exception::AttributeNotPresentException);
-std::string getParY () const 
throw(dash::exception::AttributeNotPresentException);
+int getWidth() const;
+int getHeight   () const;
+int getParX () const;
+int   

[vlc-commits] dash: CommonAttributesElements: When applicable, convert attributes to integers

2011-12-08 Thread Hugo Beauzée-Luyssen
vlc | branch: master | Hugo Beauzée-Luyssen  | Thu Dec  1 
15:57:59 2011 +0100| [d314c4f4cac6d055e23a387f6aa2b741aec237da] | committer: 
Jean-Baptiste Kempf

dash: CommonAttributesElements: When applicable, convert attributes to integers

Signed-off-by: Jean-Baptiste Kempf 

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

 .../dash/mpd/CommonAttributesElements.cpp  |   35 ++-
 .../dash/mpd/CommonAttributesElements.h|   10 +++---
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp 
b/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
index 37aa2a3..7c56376 100644
--- a/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
+++ b/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
@@ -23,6 +23,8 @@
 
 #include "CommonAttributesElements.h"
 
+#include 
+
 using namespace dash::mpd;
 using namespace dash::exception;
 
@@ -37,43 +39,43 @@ CommonAttributesElements::~CommonAttributesElements()
 delete this->contentProtection;
 }
 
-std::string CommonAttributesElements::getWidth() const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getWidth() const
 {
 std::map::const_iterator  it = 
this->attributes.find("width");
 if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getHeight   () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getHeight   () const
 {
 std::map::const_iterator  it = 
this->attributes.find("height");
 if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getParX () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getParX () const
 {
 std::map::const_iterator  it = 
this->attributes.find("parx");
-if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+if ( it == this->attributes.end() )
+return 1; //Default value is defined in standard's §5.4.3.2.2
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getParY () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getParY () const
 {
 std::map::const_iterator  it = 
this->attributes.find("pary");
 if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
+return 1; //Default value is defined in standard's §5.4.3.2.2
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
@@ -84,16 +86,15 @@ std::string CommonAttributesElements::getLang   
  () const t
 throw AttributeNotPresentException();
 
 return it->second;
-
 }
 
-std::string CommonAttributesElements::getFrameRate() const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getFrameRate() const
 {
 std::map::const_iterator  it = 
this->attributes.find("frameRate");
 if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
diff --git a/modules/stream_filter/dash/mpd/CommonAttributesElements.h 
b/modules/stream_filter/dash/mpd/CommonAttributesElements.h
index 9248e20..7f69adc 100644
--- a/modules/stream_filter/dash/mpd/CommonAttributesElements.h
+++ b/modules/stream_filter/dash/mpd/CommonAttributesElements.h
@@ -41,12 +41,12 @@ namespace dash
 public:
 CommonAttributesElements( const std::map& attributes );
 virtual ~CommonAttributesElements();
-std::string getWidth() const 
throw(dash::exception::AttributeNotPresentException);
-std::string getHeight   () const 
throw(dash::exception::AttributeNotPresentException);
-std::string getParX () const 
throw(dash::exception::AttributeNotPresentException);
-std::string getParY () const 
throw(dash::exception::AttributeNotPresentException);
+int getWidth() const;
+int getHeight   () const;
+int getParX () const;
+int getParY () const;
 std::string getLang () const 
throw(dash:

[vlc-commits] dash: CommonAttributesElements: When applicable, convert attributes to integers

2011-12-08 Thread Hugo Beauzée-Luyssen
vlc | branch: master | Hugo Beauzée-Luyssen  | Thu Dec  1 
15:57:59 2011 +0100| [d108f87bace611b6809840f2b1f0f2d4927095da] | committer: 
Jean-Baptiste Kempf

dash: CommonAttributesElements: When applicable, convert attributes to integers

Signed-off-by: Jean-Baptiste Kempf 

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

 .../dash/mpd/CommonAttributesElements.cpp  |   35 ++-
 .../dash/mpd/CommonAttributesElements.h|   10 +++---
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp 
b/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
index 37aa2a3..7c56376 100644
--- a/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
+++ b/modules/stream_filter/dash/mpd/CommonAttributesElements.cpp
@@ -23,6 +23,8 @@
 
 #include "CommonAttributesElements.h"
 
+#include 
+
 using namespace dash::mpd;
 using namespace dash::exception;
 
@@ -37,43 +39,43 @@ CommonAttributesElements::~CommonAttributesElements()
 delete this->contentProtection;
 }
 
-std::string CommonAttributesElements::getWidth() const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getWidth() const
 {
 std::map::const_iterator  it = 
this->attributes.find("width");
 if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getHeight   () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getHeight   () const
 {
 std::map::const_iterator  it = 
this->attributes.find("height");
 if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getParX () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getParX () const
 {
 std::map::const_iterator  it = 
this->attributes.find("parx");
-if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+if ( it == this->attributes.end() )
+return 1; //Default value is defined in standard's §5.4.3.2.2
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
-std::string CommonAttributesElements::getParY () const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getParY () const
 {
 std::map::const_iterator  it = 
this->attributes.find("pary");
 if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
+return 1; //Default value is defined in standard's §5.4.3.2.2
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
@@ -84,16 +86,15 @@ std::string CommonAttributesElements::getLang   
  () const t
 throw AttributeNotPresentException();
 
 return it->second;
-
 }
 
-std::string CommonAttributesElements::getFrameRate() const 
throw(AttributeNotPresentException)
+int CommonAttributesElements::getFrameRate() const
 {
 std::map::const_iterator  it = 
this->attributes.find("frameRate");
 if ( it == this->attributes.end())
-throw AttributeNotPresentException();
+return -1;
 
-return it->second;
+return atoi( it->second.c_str() );
 
 }
 
diff --git a/modules/stream_filter/dash/mpd/CommonAttributesElements.h 
b/modules/stream_filter/dash/mpd/CommonAttributesElements.h
index 9248e20..7f69adc 100644
--- a/modules/stream_filter/dash/mpd/CommonAttributesElements.h
+++ b/modules/stream_filter/dash/mpd/CommonAttributesElements.h
@@ -41,12 +41,12 @@ namespace dash
 public:
 CommonAttributesElements( const std::map& attributes );
 virtual ~CommonAttributesElements();
-std::string getWidth() const 
throw(dash::exception::AttributeNotPresentException);
-std::string getHeight   () const 
throw(dash::exception::AttributeNotPresentException);
-std::string getParX () const 
throw(dash::exception::AttributeNotPresentException);
-std::string getParY () const 
throw(dash::exception::AttributeNotPresentException);
+int getWidth() const;
+int getHeight   () const;
+int getParX () const;
+int getParY () const;
 std::string getLang () const 
throw(dash: