[vlc-commits] logger: store in the context which logging mode is being used

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Wed Jan 25 
01:43:15 2012 -0500| [d417550f2c2c8b25f4b33ffade524d9334419111] | committer: 
Rafaël Carré

logger: store in the context which logging mode is being used

Don't close a NULL FILE* on android
(cherry picked from commit e50cfac2d3cbc00abd7d332eb47abb584ef5eac4)

Signed-off-by: Rafaël Carré 

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

 modules/misc/logger.c |   27 ---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 481d262..2669319 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -69,6 +69,17 @@
 #include 
 #endif
 
+enum logmode {
+LOGGER_TEXT,
+LOGGER_HTML,
+#ifdef HAVE_SYSLOG_H
+LOGGER_SYSLOG,
+#endif
+#ifdef __ANDROID__
+LOGGER_ANDROID,
+#endif
+};
+
 /*
  * intf_sys_t: description and status of log interface
  */
@@ -77,6 +88,7 @@ struct intf_sys_t
 msg_subscription_t *p_sub;
 FILE *p_file;
 const char *footer;
+enum logmode logmode;
 };
 
 /*
@@ -204,6 +216,7 @@ static int Open( vlc_object_t *p_this )
 msg_callback_t cb = TextPrint;
 const char *filename = LOG_FILE_TEXT, *header = TEXT_HEADER;
 p_sys->footer = TEXT_FOOTER;
+p_sys->logmode = LOGGER_TEXT;
 
 char *mode = var_InheritString( p_intf, "logmode" );
 if( mode != NULL )
@@ -213,14 +226,21 @@ static int Open( vlc_object_t *p_this )
 p_sys->footer = HTML_FOOTER;
 header = HTML_HEADER;
 cb = HtmlPrint;
+p_sys->logmode = LOGGER_HTML;
 }
 #ifdef HAVE_SYSLOG_H
 else if( !strcmp( mode, "syslog" ) )
+{
 cb = SyslogPrint;
+p_sys->logmode = LOGGER_SYSLOG;
+}
 #endif
 #ifdef __ANDROID__
 else if( !strcmp( mode, "android" ) )
+{
 cb = AndroidPrint;
+p_sys->logmode = LOGGER_ANDROID;
+}
 #endif
 else if( strcmp( mode, "text" ) )
 msg_Warn( p_intf, "invalid log mode `%s', using `text'", mode );
@@ -228,7 +248,7 @@ static int Open( vlc_object_t *p_this )
 }
 
 #ifdef HAVE_SYSLOG_H
-if( cb == SyslogPrint )
+if( p_sys->logmode == LOGGER_SYSLOG )
 {
 int i_facility;
 char *psz_facility = var_InheritString( p_intf, "syslog-facility" );
@@ -265,7 +285,7 @@ static int Open( vlc_object_t *p_this )
 else
 #endif
 #ifdef __ANDROID__
-if( cb == AndroidPrint )
+if( p_sys->logmode == LOGGER_ANDROID )
 {
 /* nothing to do */
 }
@@ -322,10 +342,11 @@ static void Close( vlc_object_t *p_this )
 
 /* Close the log file */
 #ifdef HAVE_SYSLOG_H
-if( p_sys->p_file == NULL )
+if( p_sys->logmode == LOGGER_SYSLOG )
 closelog();
 else
 #endif
+if( p_sys->logmode == LOGGER_TEXT || p_sys->logmode == LOGGER_HTML )
 {
 fputs( p_sys->footer, p_sys->p_file );
 fclose( p_sys->p_file );

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: cascade if/else for different modes

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Wed Jan 25 
01:38:32 2012 -0500| [954295dcce2e4f82f5ac5ca3aacf68b9f71f7d50] | committer: 
Rafaël Carré

logger: cascade if/else for different modes
(cherry picked from commit 2e86bc8f278a18d7be6d0d2d8a00505ed24efba1)

Signed-off-by: Rafaël Carré 

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

 modules/misc/logger.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index dbd8483..481d262 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -265,7 +265,11 @@ static int Open( vlc_object_t *p_this )
 else
 #endif
 #ifdef __ANDROID__
-if( cb != AndroidPrint )
+if( cb == AndroidPrint )
+{
+/* nothing to do */
+}
+else
 #endif
 {
 char *psz_file = var_InheritString( p_intf, "logfile" );

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: remove unused defines

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Wed Jan 25 
01:36:17 2012 -0500| [32b662e4662fe5e132ab6e0aee7da9220110082e] | committer: 
Rafaël Carré

logger: remove unused defines
(cherry picked from commit 9acc769230e1fab55bc9d22e8accce6c9f66b0ae)

Signed-off-by: Rafaël Carré 

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

 modules/misc/logger.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 9927357..6ef0792 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -42,10 +42,6 @@
 # include 
 #endif
 
-#define MODE_TEXT 0
-#define MODE_HTML 1
-#define MODE_SYSLOG 2
-
 #ifdef __APPLE__
 #define LOG_DIR "Library/Logs/"
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: move Apple related define where it is used

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Wed Jan 25 
01:36:40 2012 -0500| [7b002b05639de4adbe58bf8365eec104242cd213] | committer: 
Rafaël Carré

logger: move Apple related define where it is used
(cherry picked from commit 7c6abb20451f26a175eebc426960f30afa440c72)

Signed-off-by: Rafaël Carré 

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

 modules/misc/logger.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 6ef0792..dbd8483 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -42,10 +42,6 @@
 # include 
 #endif
 
-#ifdef __APPLE__
-#define LOG_DIR "Library/Logs/"
-#endif
-
 #define LOG_FILE_TEXT "vlc-log.txt"
 #define LOG_FILE_HTML "vlc-log.html"
 
@@ -276,6 +272,7 @@ static int Open( vlc_object_t *p_this )
 if( !psz_file )
 {
 #ifdef __APPLE__
+# define LOG_DIR "Library/Logs/"
 char *home = config_GetUserDir(VLC_DOCUMENTS_DIR);
 if( home == NULL
  || asprintf( &psz_file, "%s/"LOG_DIR"/%s", home,

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: cascade if/else for different modes

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Wed Jan 25 01:38:32 
2012 -0500| [2e86bc8f278a18d7be6d0d2d8a00505ed24efba1] | committer: Rafaël Carré

logger: cascade if/else for different modes

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

 modules/misc/logger.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index ebcfe26..ad0fcc5 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -257,7 +257,11 @@ static int Open( vlc_object_t *p_this )
 else
 #endif
 #ifdef __ANDROID__
-if( cb != AndroidPrint )
+if( cb == AndroidPrint )
+{
+/* nothing to do */
+}
+else
 #endif
 {
 char *psz_file = var_InheritString( p_intf, "logfile" );

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: move Apple related define where it is used

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Wed Jan 25 01:36:40 
2012 -0500| [7c6abb20451f26a175eebc426960f30afa440c72] | committer: Rafaël Carré

logger: move Apple related define where it is used

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

 modules/misc/logger.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 9e68c3d..ebcfe26 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -42,10 +42,6 @@
 # include 
 #endif
 
-#ifdef __APPLE__
-#define LOG_DIR "Library/Logs/"
-#endif
-
 #define LOG_FILE_TEXT "vlc-log.txt"
 #define LOG_FILE_HTML "vlc-log.html"
 
@@ -268,6 +264,7 @@ static int Open( vlc_object_t *p_this )
 if( !psz_file )
 {
 #ifdef __APPLE__
+# define LOG_DIR "Library/Logs/"
 char *home = config_GetUserDir(VLC_DOCUMENTS_DIR);
 if( home == NULL
  || asprintf( &psz_file, "%s/"LOG_DIR"/%s", home,

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: store in the context which logging mode is being used

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Wed Jan 25 01:43:15 
2012 -0500| [e50cfac2d3cbc00abd7d332eb47abb584ef5eac4] | committer: Rafaël Carré

logger: store in the context which logging mode is being used

Don't close a NULL FILE* on android

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

 modules/misc/logger.c |   27 ---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index ad0fcc5..1d3c819 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -69,6 +69,17 @@
 #include 
 #endif
 
+enum logmode {
+LOGGER_TEXT,
+LOGGER_HTML,
+#ifdef HAVE_SYSLOG_H
+LOGGER_SYSLOG,
+#endif
+#ifdef __ANDROID__
+LOGGER_ANDROID,
+#endif
+};
+
 /*
  * intf_sys_t: description and status of log interface
  */
@@ -77,6 +88,7 @@ struct intf_sys_t
 msg_subscription_t *p_sub;
 FILE *p_file;
 const char *footer;
+enum logmode logmode;
 };
 
 /*
@@ -196,6 +208,7 @@ static int Open( vlc_object_t *p_this )
 msg_callback_t cb = TextPrint;
 const char *filename = LOG_FILE_TEXT, *header = TEXT_HEADER;
 p_sys->footer = TEXT_FOOTER;
+p_sys->logmode = LOGGER_TEXT;
 
 char *mode = var_InheritString( p_intf, "logmode" );
 if( mode != NULL )
@@ -205,14 +218,21 @@ static int Open( vlc_object_t *p_this )
 p_sys->footer = HTML_FOOTER;
 header = HTML_HEADER;
 cb = HtmlPrint;
+p_sys->logmode = LOGGER_HTML;
 }
 #ifdef HAVE_SYSLOG_H
 else if( !strcmp( mode, "syslog" ) )
+{
 cb = SyslogPrint;
+p_sys->logmode = LOGGER_SYSLOG;
+}
 #endif
 #ifdef __ANDROID__
 else if( !strcmp( mode, "android" ) )
+{
 cb = AndroidPrint;
+p_sys->logmode = LOGGER_ANDROID;
+}
 #endif
 else if( strcmp( mode, "text" ) )
 msg_Warn( p_intf, "invalid log mode `%s', using `text'", mode );
@@ -220,7 +240,7 @@ static int Open( vlc_object_t *p_this )
 }
 
 #ifdef HAVE_SYSLOG_H
-if( cb == SyslogPrint )
+if( p_sys->logmode == LOGGER_SYSLOG )
 {
 int i_facility;
 char *psz_facility = var_InheritString( p_intf, "syslog-facility" );
@@ -257,7 +277,7 @@ static int Open( vlc_object_t *p_this )
 else
 #endif
 #ifdef __ANDROID__
-if( cb == AndroidPrint )
+if( p_sys->logmode == LOGGER_ANDROID )
 {
 /* nothing to do */
 }
@@ -314,10 +334,11 @@ static void Close( vlc_object_t *p_this )
 
 /* Close the log file */
 #ifdef HAVE_SYSLOG_H
-if( p_sys->p_file == NULL )
+if( p_sys->logmode == LOGGER_SYSLOG )
 closelog();
 else
 #endif
+if( p_sys->logmode == LOGGER_TEXT || p_sys->logmode == LOGGER_HTML )
 {
 fputs( p_sys->footer, p_sys->p_file );
 fclose( p_sys->p_file );

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] logger: remove unused defines

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Wed Jan 25 01:36:17 
2012 -0500| [9acc769230e1fab55bc9d22e8accce6c9f66b0ae] | committer: Rafaël Carré

logger: remove unused defines

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

 modules/misc/logger.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 7e065ff..9e68c3d 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -42,10 +42,6 @@
 # include 
 #endif
 
-#define MODE_TEXT 0
-#define MODE_HTML 1
-#define MODE_SYSLOG 2
-
 #ifdef __APPLE__
 #define LOG_DIR "Library/Logs/"
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] android: configure will fill PKG_CONFIG_LIBDIR itself

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Tue Jan 24 
23:45:09 2012 -0500| [73967c45b7b5d297c66da033e6ea3ba0061378ac] | committer: 
Rafaël Carré

android: configure will fill PKG_CONFIG_LIBDIR itself

don't make it point to a wrong location
(cherry picked from commit 56018495fb0f8d6258fc99da599f2d2aee0e1011)

Signed-off-by: Rafaël Carré 

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

 extras/package/android/configure.sh |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index 8421ca9..cc95e9d 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -40,7 +40,6 @@ NM="${CROSS_COMPILE}nm" \
 STRIP="${CROSS_COMPILE}strip" \
 RANLIB="${CROSS_COMPILE}ranlib" \
 AR="${CROSS_COMPILE}ar" \
-PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" 
\
 sh $VLC_SOURCEDIR/configure --host=arm-linux-androideabi 
--build=x86_64-unknown-linux $EXTRA_PARAMS \
 --enable-live555 --enable-realrtsp \
 --enable-avformat \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] android: remove workaround for old ndk

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Tue Jan 24 
23:43:08 2012 -0500| [9c8a32f4de9c4dc0231741c5dc95de9c3531ff2e] | committer: 
Rafaël Carré

android: remove workaround for old ndk

Give the real host to configure
(cherry picked from commit a2fe52949ec26f1e35f9a83f26e9ae01d7a2efab)

Signed-off-by: Rafaël Carré 

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

 extras/package/android/configure.sh |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index 2ec42f9..8421ca9 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -9,9 +9,6 @@ ANDROID_API=android-9
 
 VLC_SOURCEDIR="`dirname $0`/../../.."
 
-# needed for old ndk: change all the arm-linux-androideabi to arm-eabi
-# the --host is kept on purpose because otherwise libtool complains..
-
 CFLAGS="-g -O2 -mlong-calls -fstrict-aliasing -fprefetch-loop-arrays 
-ffast-math"
 LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"
 
@@ -44,7 +41,7 @@ STRIP="${CROSS_COMPILE}strip" \
 RANLIB="${CROSS_COMPILE}ranlib" \
 AR="${CROSS_COMPILE}ar" \
 PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" 
\
-sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux 
$EXTRA_PARAMS \
+sh $VLC_SOURCEDIR/configure --host=arm-linux-androideabi 
--build=x86_64-unknown-linux $EXTRA_PARAMS \
 --enable-live555 --enable-realrtsp \
 --enable-avformat \
 --enable-swscale \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: ffmpeg was removed from libav

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Tue Jan 24 
19:09:27 2012 -0500| [ef43d6b2386484d3eb61fb99d1a5cf6145c0e40b] | committer: 
Rafaël Carré

contrib: ffmpeg was removed from libav
(cherry picked from commit c48f8460bb5911e8436825adbaf707a3b33c3558)

Signed-off-by: Rafaël Carré 

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

 contrib/src/ffmpeg/rules.mak |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index b9519cf..500b0f7 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -12,7 +12,6 @@ FFMPEGCONF = \
--disable-debug \
--enable-gpl \
--enable-postproc \
-   --disable-ffmpeg \
--disable-avconv \
--disable-devices \
--disable-protocols \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] android: build live555 plugin

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Thu Jan 19 
17:05:06 2012 -0500| [2a4208b5cd7579fe8b412f8ca215a646811ae35a] | committer: 
Rafaël Carré

android: build live555 plugin
(cherry picked from commit 7edf187cc653555ecdd0186fabca30e1e9bc9575)

Signed-off-by: Rafaël Carré 

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

 extras/package/android/configure.sh |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index c7812cb..0132b7b 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -45,7 +45,7 @@ RANLIB="${CROSS_COMPILE}ranlib" \
 AR="${CROSS_COMPILE}ar" \
 PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" 
\
 sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux 
$EXTRA_PARAMS \
---disable-live555 --enable-realrtsp \
+--enable-live555 --enable-realrtsp \
 --enable-avformat \
 --enable-swscale \
 --enable-avcodec \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] android: build with -g

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Sat Jan 21 
07:08:10 2012 -0500| [bfd1e2bf3a0ccd740a6a4cc98005a64ef07512d8] | committer: 
Rafaël Carré

android: build with -g
(cherry picked from commit c16d79969fec549f45f4b063aebf8710f2db1cfb)

Signed-off-by: Rafaël Carré 

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

 extras/package/android/configure.sh |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index 0132b7b..2ec42f9 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -12,7 +12,7 @@ VLC_SOURCEDIR="`dirname $0`/../../.."
 # needed for old ndk: change all the arm-linux-androideabi to arm-eabi
 # the --host is kept on purpose because otherwise libtool complains..
 
-CFLAGS="-O2 -mlong-calls -fstrict-aliasing -fprefetch-loop-arrays -ffast-math"
+CFLAGS="-g -O2 -mlong-calls -fstrict-aliasing -fprefetch-loop-arrays 
-ffast-math"
 LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"
 
 if [ -z "$NO_NEON" ]; then

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Revert "Android: hack to fix warnings in pthread.h when compiling in C++"

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Wed Jan 25 
00:14:26 2012 -0500| [abd3163a1f299dd881eb64aae486f0f7f185433d] | committer: 
Rafaël Carré

Revert "Android: hack to fix warnings in pthread.h when compiling in C++"

This reverts commit 1a1bba5a3da60b1433509f54375f0c12db22b3c1.

Conflicts:

include/vlc_fixups.h
(cherry picked from commit 3437e616aea5bad334b1a304d2af0c239415f922)

Signed-off-by: Rafaël Carré 

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

 include/vlc_fixups.h |   12 
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index e0152fc..15ebb4c 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -329,18 +329,6 @@ long jrand48 (unsigned short subi[3]);
 long nrand48 (unsigned short subi[3]);
 #endif
 
-#ifdef __ANDROID__
-# undef __linux__
-# ifndef __cplusplus
-#  define __cplusplus 0
-# endif
-# include 
-# if __cplusplus == 0
-#  undef __cplusplus
-# endif
-char *tempnam(const char *, const char *);
-#endif // ANDROID
-
 #ifdef __OS2__
 # undef HAVE_FORK   /* Implementation of fork() is imperfect on OS/2 */
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: don't match just 'ar'

2012-01-24 Thread Rafaël Carré
vlc/vlc-2.0 | branch: master | Rafaël Carré  | Tue Jan 24 
22:43:07 2012 -0500| [d7da94f8e42fe96e7dedb7062af82e5efe2d514c] | committer: 
Rafaël Carré

contrib: live555: don't match just 'ar'

It would replace the 'ar' of 'arm-'
Instead use "LIBRARY_LINK =.*ar" to be sure we replace the correct tool
(cherry picked from commit 2a8e01dda3d9bcf9328623bdb2194f2d4c2d9c17)

Signed-off-by: Rafaël Carré 

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

 contrib/src/live555/rules.mak |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index bc23cf1..ebc1b22 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -32,7 +32,7 @@ live555: $(LIVE555_FILE) .sum-live555
 ifdef HAVE_WINCE
cd live && sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw
 endif
-   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%ar%$(AR)%' 
-i.orig config.$(LIVE_TARGET)
+   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%LIBRARY_LINK 
=.*ar%LIBRARY_LINK = $(AR)%' -i.orig config.$(LIVE_TARGET)
cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
cd live && sed \
-e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Revert "Android: hack to fix warnings in pthread.h when compiling in C++"

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Wed Jan 25 00:14:26 
2012 -0500| [3437e616aea5bad334b1a304d2af0c239415f922] | committer: Rafaël Carré

Revert "Android: hack to fix warnings in pthread.h when compiling in C++"

This reverts commit 1a1bba5a3da60b1433509f54375f0c12db22b3c1.

Conflicts:

include/vlc_fixups.h

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

 include/vlc_fixups.h |   12 
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 74650ae..6b0b7be 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -329,18 +329,6 @@ long jrand48 (unsigned short subi[3]);
 long nrand48 (unsigned short subi[3]);
 #endif
 
-#ifdef __ANDROID__
-# undef __linux__
-# ifndef __cplusplus
-#  define __cplusplus 0
-# endif
-# include 
-# if __cplusplus == 0
-#  undef __cplusplus
-# endif
-char *tempnam(const char *, const char *);
-#endif // ANDROID
-
 #ifdef __OS2__
 # undef HAVE_FORK   /* Implementation of fork() is imperfect on OS/2 */
 #endif

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] android: configure will fill PKG_CONFIG_LIBDIR itself

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Tue Jan 24 23:45:09 
2012 -0500| [56018495fb0f8d6258fc99da599f2d2aee0e1011] | committer: Rafaël Carré

android: configure will fill PKG_CONFIG_LIBDIR itself

don't make it point to a wrong location

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

 extras/package/android/configure.sh |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index 8421ca9..cc95e9d 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -40,7 +40,6 @@ NM="${CROSS_COMPILE}nm" \
 STRIP="${CROSS_COMPILE}strip" \
 RANLIB="${CROSS_COMPILE}ranlib" \
 AR="${CROSS_COMPILE}ar" \
-PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" 
\
 sh $VLC_SOURCEDIR/configure --host=arm-linux-androideabi 
--build=x86_64-unknown-linux $EXTRA_PARAMS \
 --enable-live555 --enable-realrtsp \
 --enable-avformat \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] android: remove workaround for old ndk

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Tue Jan 24 23:43:08 
2012 -0500| [a2fe52949ec26f1e35f9a83f26e9ae01d7a2efab] | committer: Rafaël Carré

android: remove workaround for old ndk

Give the real host to configure

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

 extras/package/android/configure.sh |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index 2ec42f9..8421ca9 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -9,9 +9,6 @@ ANDROID_API=android-9
 
 VLC_SOURCEDIR="`dirname $0`/../../.."
 
-# needed for old ndk: change all the arm-linux-androideabi to arm-eabi
-# the --host is kept on purpose because otherwise libtool complains..
-
 CFLAGS="-g -O2 -mlong-calls -fstrict-aliasing -fprefetch-loop-arrays 
-ffast-math"
 LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"
 
@@ -44,7 +41,7 @@ STRIP="${CROSS_COMPILE}strip" \
 RANLIB="${CROSS_COMPILE}ranlib" \
 AR="${CROSS_COMPILE}ar" \
 PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" 
\
-sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux 
$EXTRA_PARAMS \
+sh $VLC_SOURCEDIR/configure --host=arm-linux-androideabi 
--build=x86_64-unknown-linux $EXTRA_PARAMS \
 --enable-live555 --enable-realrtsp \
 --enable-avformat \
 --enable-swscale \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: don't match just 'ar'

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Tue Jan 24 22:43:07 
2012 -0500| [2a8e01dda3d9bcf9328623bdb2194f2d4c2d9c17] | committer: Rafaël Carré

contrib: live555: don't match just 'ar'

It would replace the 'ar' of 'arm-'
Instead use "LIBRARY_LINK =.*ar" to be sure we replace the correct tool

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

 contrib/src/live555/rules.mak |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index bc23cf1..ebc1b22 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -32,7 +32,7 @@ live555: $(LIVE555_FILE) .sum-live555
 ifdef HAVE_WINCE
cd live && sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw
 endif
-   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%ar%$(AR)%' 
-i.orig config.$(LIVE_TARGET)
+   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%LIBRARY_LINK 
=.*ar%LIBRARY_LINK = $(AR)%' -i.orig config.$(LIVE_TARGET)
cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
cd live && sed \
-e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Tag 2.0.0-rc1 : VLC media player 'Twoflower' 2.0.0-rc1

2012-01-24 Thread git
[vlc/vlc-2.0] [branch: refs/tags/2.0.0-rc1]
Tag:4b76993a5744acdcff2f11b73f00a365dde3d734
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git?a=tag;h=4b76993a5744acdcff2f11b73f00a365dde3d734

Tagger: Jean-Baptiste Kempf 
Date:   Wed Jan 25 01:18:42 2012 +0100

VLC media player 'Twoflower' 2.0.0-rc1
This is the first release candidate of VLC 2.0.0.
Twoflower is a major upgrade from VLC 1.1.x releases from the 1.1 branch.

It adds many new features, while reworking the video and audio internals of VLC,
adding support for new OSes, cleaning a lot the source code and relicensing
the core libraries to LGPLv2.1+
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: ffmpeg was removed from libav

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Tue Jan 24 19:09:27 
2012 -0500| [c48f8460bb5911e8436825adbaf707a3b33c3558] | committer: Rafaël Carré

contrib: ffmpeg was removed from libav

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

 contrib/src/ffmpeg/rules.mak |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index b13bcae..cd369dc 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -12,7 +12,6 @@ FFMPEGCONF = \
--disable-debug \
--enable-gpl \
--enable-postproc \
-   --disable-ffmpeg \
--disable-avconv \
--disable-devices \
--disable-avfilter

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Update PO

2012-01-24 Thread Jean-Baptiste Kempf
vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf  | Wed 
Jan 25 00:34:47 2012 +0100| [9cc771b106c542f98535f41d7b70460c0465afd0] | 
committer: Jean-Baptiste Kempf

Update PO

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

 po/ach.po   |  503 
 po/af.po|  503 
 po/am.po|  503 
 po/ar.po|  504 
 po/ast.po   |  503 
 po/be.po|  503 
 po/bg.po|  507 
 po/bn.po|  507 
 po/br.po|  503 
 po/ca.po|  503 
 po/cgg.po   |  503 
 po/ckb.po   |  503 
 po/co.po|  503 
 po/cs.po|  504 
 po/da.po|  503 
 po/de.po|  507 
 po/el.po|  503 
 po/en_GB.po |  503 
 po/es.po|  507 
 po/et.po|  508 
 po/eu.po|  508 
 po/fa.po|  503 
 po/ff.po|  503 
 po/fi.po|  511 
 po/fr.po|  507 
 po/fur.po   |  503 
 po/ga.po|  506 
 po/gl.po|  507 
 po/he.po| 1779 ++--
 po/hi.po|  503 
 po/hr.po|  504 
 po/hu.po|  507 
 po/hy.po|  508 
 po/id.po|  504 
 po/is.po|  503 
 po/it.po|  503 
 po/ja.po|  507 
 po/ka.po|  503 
 po/kk.po|  503 
 po/km.po|  504 
 po/ko.po|  504 
 po/lg.po|  503 
 po/lt.po|  504 
 po/lv.po|  503 
 po/mk.po|  503 
 po/ml.po|  503 
 po/mn.po|  503 
 po/ms.po|  504 
 po/my.po|  503 
 po/nb.po|  503 
 po/ne.po|  504 
 po/nl.po|  509 
 po/nn.po|  503 
 po/oc.po|  503 
 po/pa.po|  503 
 po/pl.po|  507 
 po/ps.po|  503 
 po/pt_BR.po |  507 
 po/pt_PT.po |  503 
 po/ro.po|  504 
 po/ru.po|  507 
 po/si.po|  503 
 po/sk.po| 2015 ++-
 po/sl.po|  504 
 po/sq.po|  503 
 po/sr.po|  504 
 po/sv.po|  504 
 po/ta.po|  503 
 po/tet.po   |  503 
 po/th.po|  503 
 po/tl.po|  503 
 po/tr.po|  507 
 po/uk.po|  568 +-
 po/vi.po|  503 
 po/vlc.pot  |  503 
 po/wa.po|  504 
 po/zh_CN.po |  507 
 po/zh_TW.po |  503 
 po/zu.po|  503 
 79 files changed, 21286 insertions(+), 21402 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commitdiff;h=9cc771b106c542f98535f41d7b70460c0465afd0
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] omxil: Add a prefix to the iomx function symbols

2012-01-24 Thread Martin Storsjö
vlc/vlc-1.2 | branch: master | Martin Storsjö  | Tue Jan 24 
09:27:36 2012 +0200| [e4eb05a73013bfa2b65429ec8c3bb6eb270e44b5] | committer: 
Jean-Baptiste Kempf

omxil: Add a prefix to the iomx function symbols

On some devices (apparently froyo and earlier), some OMX core
(with sw-only codecs) already is loaded into the process, and
dlsym(RTLD_DEFAULT) can just as well return functions from that
one instead of the ones from the iomx wrapper that we've loaded.

This makes sure we really get the functions we want.

Signed-off-by: Rafaël Carré 
(cherry picked from commit 3c34f80809b89ebb581a76763b8c9e7f58568942)

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/codec/omxil/iomx.cpp |   16 ++--
 modules/codec/omxil/omxil.c  |2 +-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/codec/omxil/iomx.cpp b/modules/codec/omxil/iomx.cpp
index ccc4abb..1316c0b 100644
--- a/modules/codec/omxil/iomx.cpp
+++ b/modules/codec/omxil/iomx.cpp
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#define PREFIX(x) I ## x
+
 using namespace android;
 
 class IOMXContext {
@@ -270,7 +272,8 @@ static OMX_ERRORTYPE iomx_set_config(OMX_HANDLETYPE 
component, OMX_INDEXTYPE ind
 return get_error(ctx->iomx->setConfig(node->node, index, param, 
sizeof(OMX_BOOL)));
 }
 
-OMX_ERRORTYPE OMX_GetHandle(OMX_HANDLETYPE *handle_ptr, OMX_STRING 
component_name, OMX_PTR app_data, OMX_CALLBACKTYPE *callbacks)
+extern "C" {
+OMX_ERRORTYPE PREFIX(OMX_GetHandle)(OMX_HANDLETYPE *handle_ptr, OMX_STRING 
component_name, OMX_PTR app_data, OMX_CALLBACKTYPE *callbacks)
 {
 OMXNode* node = new OMXNode();
 node->app_data = app_data;
@@ -308,7 +311,7 @@ OMX_ERRORTYPE OMX_GetHandle(OMX_HANDLETYPE *handle_ptr, 
OMX_STRING component_nam
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE handle)
+OMX_ERRORTYPE PREFIX(OMX_FreeHandle)(OMX_HANDLETYPE handle)
 {
 OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)handle)->pComponentPrivate;
 ctx->iomx->freeNode( node->node );
@@ -318,7 +321,7 @@ OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE handle)
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_Init(void)
+OMX_ERRORTYPE PREFIX(OMX_Init)(void)
 {
 OMXClient client;
 if (client.connect() != OK)
@@ -331,7 +334,7 @@ OMX_ERRORTYPE OMX_Init(void)
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_Deinit(void)
+OMX_ERRORTYPE PREFIX(OMX_Deinit)(void)
 {
 ctx->iomx = NULL;
 delete ctx;
@@ -339,7 +342,7 @@ OMX_ERRORTYPE OMX_Deinit(void)
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_ComponentNameEnum(OMX_STRING component_name, OMX_U32 
name_length, OMX_U32 index)
+OMX_ERRORTYPE PREFIX(OMX_ComponentNameEnum)(OMX_STRING component_name, OMX_U32 
name_length, OMX_U32 index)
 {
 if (index >= ctx->components.size())
 return OMX_ErrorNoMore;
@@ -351,7 +354,7 @@ OMX_ERRORTYPE OMX_ComponentNameEnum(OMX_STRING 
component_name, OMX_U32 name_leng
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_GetRolesOfComponent(OMX_STRING component_name, OMX_U32 
*num_roles, OMX_U8 **roles)
+OMX_ERRORTYPE PREFIX(OMX_GetRolesOfComponent)(OMX_STRING component_name, 
OMX_U32 *num_roles, OMX_U8 **roles)
 {
 for( List::iterator it = ctx->components.begin(); it 
!= ctx->components.end(); it++ ) {
 if (!strcmp(component_name, it->mName.string())) {
@@ -372,4 +375,5 @@ OMX_ERRORTYPE OMX_GetRolesOfComponent(OMX_STRING 
component_name, OMX_U32 *num_ro
 }
 return OMX_ErrorInvalidComponentName;
 }
+}
 
diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index ef8982b..3c13a73 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -33,7 +33,7 @@
 /* On dll_open, just check that the OMX_Init symbol already is loaded */
 # define dll_open(name) dlsym(RTLD_DEFAULT, "OMX_Init")
 # define dll_close(handle) do { } while (0)
-# define dlsym(handle, name) dlsym(RTLD_DEFAULT, name)
+# define dlsym(handle, name) dlsym(RTLD_DEFAULT, "I" name)
 #else
 # define dll_open(name) dlopen( name, RTLD_NOW )
 # define dll_close(handle) dlclose(handle)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] omxil: Add a prefix to the iomx function symbols

2012-01-24 Thread Martin Storsjö
vlc | branch: master | Martin Storsjö  | Tue Jan 24 09:27:36 
2012 +0200| [3c34f80809b89ebb581a76763b8c9e7f58568942] | committer: Rafaël Carré

omxil: Add a prefix to the iomx function symbols

On some devices (apparently froyo and earlier), some OMX core
(with sw-only codecs) already is loaded into the process, and
dlsym(RTLD_DEFAULT) can just as well return functions from that
one instead of the ones from the iomx wrapper that we've loaded.

This makes sure we really get the functions we want.

Signed-off-by: Rafaël Carré 

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

 modules/codec/omxil/iomx.cpp |   16 ++--
 modules/codec/omxil/omxil.c  |2 +-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/codec/omxil/iomx.cpp b/modules/codec/omxil/iomx.cpp
index ccc4abb..1316c0b 100644
--- a/modules/codec/omxil/iomx.cpp
+++ b/modules/codec/omxil/iomx.cpp
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#define PREFIX(x) I ## x
+
 using namespace android;
 
 class IOMXContext {
@@ -270,7 +272,8 @@ static OMX_ERRORTYPE iomx_set_config(OMX_HANDLETYPE 
component, OMX_INDEXTYPE ind
 return get_error(ctx->iomx->setConfig(node->node, index, param, 
sizeof(OMX_BOOL)));
 }
 
-OMX_ERRORTYPE OMX_GetHandle(OMX_HANDLETYPE *handle_ptr, OMX_STRING 
component_name, OMX_PTR app_data, OMX_CALLBACKTYPE *callbacks)
+extern "C" {
+OMX_ERRORTYPE PREFIX(OMX_GetHandle)(OMX_HANDLETYPE *handle_ptr, OMX_STRING 
component_name, OMX_PTR app_data, OMX_CALLBACKTYPE *callbacks)
 {
 OMXNode* node = new OMXNode();
 node->app_data = app_data;
@@ -308,7 +311,7 @@ OMX_ERRORTYPE OMX_GetHandle(OMX_HANDLETYPE *handle_ptr, 
OMX_STRING component_nam
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE handle)
+OMX_ERRORTYPE PREFIX(OMX_FreeHandle)(OMX_HANDLETYPE handle)
 {
 OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)handle)->pComponentPrivate;
 ctx->iomx->freeNode( node->node );
@@ -318,7 +321,7 @@ OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE handle)
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_Init(void)
+OMX_ERRORTYPE PREFIX(OMX_Init)(void)
 {
 OMXClient client;
 if (client.connect() != OK)
@@ -331,7 +334,7 @@ OMX_ERRORTYPE OMX_Init(void)
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_Deinit(void)
+OMX_ERRORTYPE PREFIX(OMX_Deinit)(void)
 {
 ctx->iomx = NULL;
 delete ctx;
@@ -339,7 +342,7 @@ OMX_ERRORTYPE OMX_Deinit(void)
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_ComponentNameEnum(OMX_STRING component_name, OMX_U32 
name_length, OMX_U32 index)
+OMX_ERRORTYPE PREFIX(OMX_ComponentNameEnum)(OMX_STRING component_name, OMX_U32 
name_length, OMX_U32 index)
 {
 if (index >= ctx->components.size())
 return OMX_ErrorNoMore;
@@ -351,7 +354,7 @@ OMX_ERRORTYPE OMX_ComponentNameEnum(OMX_STRING 
component_name, OMX_U32 name_leng
 return OMX_ErrorNone;
 }
 
-OMX_ERRORTYPE OMX_GetRolesOfComponent(OMX_STRING component_name, OMX_U32 
*num_roles, OMX_U8 **roles)
+OMX_ERRORTYPE PREFIX(OMX_GetRolesOfComponent)(OMX_STRING component_name, 
OMX_U32 *num_roles, OMX_U8 **roles)
 {
 for( List::iterator it = ctx->components.begin(); it 
!= ctx->components.end(); it++ ) {
 if (!strcmp(component_name, it->mName.string())) {
@@ -372,4 +375,5 @@ OMX_ERRORTYPE OMX_GetRolesOfComponent(OMX_STRING 
component_name, OMX_U32 *num_ro
 }
 return OMX_ErrorInvalidComponentName;
 }
+}
 
diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index ef8982b..3c13a73 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -33,7 +33,7 @@
 /* On dll_open, just check that the OMX_Init symbol already is loaded */
 # define dll_open(name) dlsym(RTLD_DEFAULT, "OMX_Init")
 # define dll_close(handle) do { } while (0)
-# define dlsym(handle, name) dlsym(RTLD_DEFAULT, name)
+# define dlsym(handle, name) dlsym(RTLD_DEFAULT, "I" name)
 #else
 # define dll_open(name) dlopen( name, RTLD_NOW )
 # define dll_close(handle) dlclose(handle)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: replace ar by our $(AR)

2012-01-24 Thread Olivier Gambier
vlc/vlc-1.2 | branch: master | Olivier Gambier  | Tue Jan 
24 18:15:33 2012 +0100| [76bda07d81b3f43ae30738d0dc3ae19bf6eb999a] | committer: 
Jean-Baptiste Kempf

contrib: live555: replace ar by our $(AR)

Signed-off-by: Rafaël Carré 
(cherry picked from commit 2171af178491f01eeca2f7e5329d4e6cd3f78909)

Signed-off-by: Jean-Baptiste Kempf 

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

 contrib/src/live555/rules.mak |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index 80bb137..bc23cf1 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -32,7 +32,7 @@ live555: $(LIVE555_FILE) .sum-live555
 ifdef HAVE_WINCE
cd live && sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw
 endif
-   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -i.orig 
config.$(LIVE_TARGET)
+   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%ar%$(AR)%' 
-i.orig config.$(LIVE_TARGET)
cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
cd live && sed \
-e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: make sure the main window's position is correctly restored ( fixes #5856)

2012-01-24 Thread Felix Paul Kühne
vlc/vlc-1.2 | branch: master | Felix Paul Kühne  | Tue 
Jan 24 20:03:32 2012 +0100| [3948a4b69a695b3c8fa913314de19706c676042e] | 
committer: Jean-Baptiste Kempf

macosx: make sure the main window's position is correctly restored (fixes #5856)
(cherry picked from commit d832507736d33cb435ba1830e9bdbace89a68c2e)

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/gui/macosx/MainWindow.m |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 80cc50b..6875bd9 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -411,16 +411,15 @@ static VLCMainWindow *_o_sharedInstance = nil;
 [self setOpaque: NO];
 [self setHasShadow:YES];
 
-NSRect winrect;
+NSRect winrect = [self frame];
 CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
-winrect = [self frame];
 
 [o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - 
f_titleBarHeight,
   winrect.size.width, 
f_titleBarHeight )];
 [[self contentView] addSubview: o_titlebar_view];
 
-winrect.size.height = winrect.size.height + f_titleBarHeight;
-[self setFrame: winrect display:NO animate:NO];
+[self setFrame: winrect display:YES animate:YES];
+previousSavedFrame = winrect;
 winrect = [o_split_view frame];
 winrect.size.height = winrect.size.height - f_titleBarHeight;
 [o_split_view setFrame: winrect];
@@ -429,10 +428,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
 o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view 
frame]];
 [[self contentView] addSubview: o_color_backdrop positioned: 
NSWindowBelow relativeTo: o_split_view];
 [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | 
NSViewWidthSizable];
-
-previousSavedFrame = winrect;
-
-[self display];
 }
 else
 {
@@ -891,6 +886,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)windowResizedOrMoved:(NSNotification *)notification
 {
+previousSavedFrame = [self frame];
 [self saveFrameUsingName: [self frameAutosaveName]];
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Handle UrlTemplate in parser.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 17:11:01 2012 +0100| [504bed780c6f46c936f539dfb69d6947b0e061f7] | 
committer: Jean-Baptiste Kempf

dash: Handle UrlTemplate in parser.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |  106 --
 modules/stream_filter/dash/mpd/BasicCMParser.h   |6 +-
 2 files changed, 100 insertions(+), 12 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 7590f1d..ccfead6 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -28,10 +28,12 @@
 #include "BasicCMParser.h"
 #include "mpd/ContentDescription.h"
 #include "mpd/SegmentInfoDefault.h"
+#include "mpd/SegmentTemplate.h"
 #include "mpd/SegmentTimeline.h"
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -43,7 +45,8 @@ using namespace dash::xml;
 BasicCMParser::BasicCMParser( Node *root, stream_t *p_stream ) :
 root( root ),
 mpd( NULL ),
-p_stream( p_stream )
+p_stream( p_stream ),
+currentRepresentation( NULL )
 {
 this->url = p_stream->psz_access;
 this->url += "://";
@@ -297,6 +300,7 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 
 Representation *rep = new Representation;
 rep->setParentGroup( group );
+this->currentRepresentation = rep;
 if ( this->parseCommonAttributesElements( representations.at( i ), 
rep, group ) == false )
 {
 delete rep;
@@ -374,21 +378,39 @@ boolBasicCMParser::setSegmentInfo   (Node *root, 
Representation *rep)
 return false;
 }
 
-bool BasicCMParser::parseSegment(Segment *seg, const std::map& attr )
+Segment*BasicCMParser::parseSegment( Node* node )
 {
+const std::mapattr = node->getAttributes();
 std::map::const_iterator  it;
 
+boolisTemplate = false;
+Segment*seg = NULL;
+
+if ( node->getName() == "UrlTemplate" )
+isTemplate = true;
 it = attr.find( "sourceURL" );
 //FIXME: When not present, the sourceUrl attribute should be computed
 //using BaseURL and the range attribute.
 if ( it != attr.end() )
 {
 std::string url = it->second;
+boolruntimeToken = false;
+if ( isTemplate == true )
+{
+if ( this->resolveUrlTemplates( url, runtimeToken ) == false )
+{
+std::cerr << "Failed to substitute URLTemplate identifier." << 
std::endl;
+return NULL;
+}
+seg = new SegmentTemplate( runtimeToken, 
this->currentRepresentation );
+}
+else
+seg = new Segment;
 if ( url.find( this->p_stream->psz_access ) != 0 ) //Relative url
 url = this->url + url;
 seg->setSourceUrl( url );
 }
-return true;
+return seg;
 }
 
 ProgramInformation* BasicCMParser::parseProgramInformation()
@@ -423,28 +445,92 @@ voidBasicCMParser::setInitSegment   (Node *root, 
SegmentInfoCommon *info
  " other InitialisationSegmentURL will be dropped." << 
std::endl;
 if ( initSeg.size() == 1 )
 {
-Segment *seg = new Segment();
-parseSegment( seg, initSeg.at(0)->getAttributes() );
-info->setInitialisationSegment( seg );
+Segment *seg = parseSegment( initSeg.at(0) );
+if ( seg != NULL )
+info->setInitialisationSegment( seg );
 }
 }
 
 boolBasicCMParser::setSegments  (Node *root, SegmentInfo *info)
 {
-std::vector segments = DOMHelper::getElementByTagName(root, "Url", 
false);
+std::vector segments = DOMHelper::getElementByTagName( root, 
"Url", false );
+std::vector segmentsTemplates = DOMHelper::getElementByTagName( 
root, "UrlTemplate", false );
 
-if ( segments.size() == 0 )
+if ( segments.size() == 0 && segmentsTemplates.size() == 0 )
 return false;
+segments.insert( segments.end(), segmentsTemplates.begin(), 
segmentsTemplates.end() );
 for(size_t i = 0; i < segments.size(); i++)
 {
-Segment *seg = new Segment();
-parseSegment( seg, segments.at(i)->getAttributes() );
+Segment*seg = parseSegment( segments.at( i ) );
+if ( seg == NULL )
+continue ;
 if ( seg->getSourceUrl().empty() == false )
 info->addSegment(seg);
 }
 return true;
 }
 
+boolBasicCMParser::resolveUrlTemplates( std::string &url, bool 
&containRuntimeToken )
+{
+size_t  it = url.find( '$' );
+containRuntimeToken = false;
+
+while ( it != std::string::npos )
+{
+size_t  closing = url.find

[vlc-commits] dash: HTTPConnectionManager: Removing useless method.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 16:03:27 2012 +0100| [13e968b41baab555d0afad81e6986603fc28377b] | 
committer: Jean-Baptiste Kempf

dash: HTTPConnectionManager: Removing useless method.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 .../dash/http/HTTPConnectionManager.cpp|7 ---
 .../dash/http/HTTPConnectionManager.h  |1 -
 2 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp 
b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
index 8dce57b..0084f7d 100644
--- a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
@@ -46,13 +46,6 @@ HTTPConnectionManager::~HTTPConnectionManager   ()
 this->closeAllConnections();
 }
 
-IHTTPConnection*HTTPConnectionManager::getConnection
(std::string url)
-{
-HTTPConnection *con = new HTTPConnection(url, this->stream);
-con->init();
-this->connections.push_back(con);
-return con;
-}
 boolHTTPConnectionManager::closeConnection  
(IHTTPConnection *con)
 {
 for(std::vector::iterator it = 
this->connections.begin(); it != this->connections.end(); ++it)
diff --git a/modules/stream_filter/dash/http/HTTPConnectionManager.h 
b/modules/stream_filter/dash/http/HTTPConnectionManager.h
index 11487ed..56ba8f6 100644
--- a/modules/stream_filter/dash/http/HTTPConnectionManager.h
+++ b/modules/stream_filter/dash/http/HTTPConnectionManager.h
@@ -50,7 +50,6 @@ namespace dash
 
 voidcloseAllConnections ();
 boolcloseConnection (IHTTPConnection *con);
-IHTTPConnection*getConnection   (std::string url);
 int read(Chunk *chunk, void 
*p_buffer, size_t len);
 int peek(Chunk *chunk, const 
uint8_t **pp_peek, size_t i_peek);
 voidattach  
(dash::logic::IDownloadRateObserver *observer);

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: CommonAttributesElements: Reworking getters/setters.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Mon 
Dec 19 23:56:13 2011 +0100| [1ea33a1fdc6472597478226d3ec34bfdbe7edf8b] | 
committer: Jean-Baptiste Kempf

dash: CommonAttributesElements: Reworking getters/setters.

This will allow the parser to interact with all elements sharing these
attibutes/subelements.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 .../dash/mpd/CommonAttributesElements.cpp  |  113 
 .../dash/mpd/CommonAttributesElements.h|   46 ++---
 modules/stream_filter/dash/mpd/Representation.cpp  |2 +-
 modules/stream_filter/dash/mpd/Representation.h|1 +
 4 files changed, 100 insertions(+), 62 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=1ea33a1fdc6472597478226d3ec34bfdbe7edf8b
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: For first segments, don't choose the lowest bitrate.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 15:50:38 2012 +0100| [8bc4eab8a9d21eb89c5abcdd93eea181f2df9165] | 
committer: Jean-Baptiste Kempf

dash: For first segments, don't choose the lowest bitrate.

For some streams, the lowest bitrate is an audio stream only. We will
fall back to a more appropriate stream after a few chunks.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 .../adaptationlogic/AbstractAdaptationLogic.cpp|2 +-
 .../dash/adaptationlogic/AbstractAdaptationLogic.h |2 +-
 .../dash/http/HTTPConnectionManager.cpp|2 +
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |   28 +++
 modules/stream_filter/dash/mpd/BasicCMManager.h|2 +-
 modules/stream_filter/dash/mpd/IMPDManager.h   |2 +-
 6 files changed, 16 insertions(+), 22 deletions(-)

diff --git 
a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp 
b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
index 5a5c1bc..dab9019 100644
--- a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
@@ -34,7 +34,7 @@ using namespace dash::exception;
 
 AbstractAdaptationLogic::AbstractAdaptationLogic(IMPDManager *mpdManager)
 {
-this->bpsAvg= 0;
+this->bpsAvg= -1;
 this->bpsLastChunk  = 0;
 this->mpdManager= mpdManager;
 }
diff --git 
a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h 
b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
index e2fe566..88bf906 100644
--- a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
@@ -52,7 +52,7 @@ namespace dash
 longgetBpsLastChunk ();
 
 private:
-longbpsAvg;
+int bpsAvg;
 longbpsLastChunk;
 dash::mpd::IMPDManager  *mpdManager;
 };
diff --git a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp 
b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
index 93c97e4..8dce57b 100644
--- a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
@@ -161,6 +161,8 @@ voidHTTPConnectionManager::attach   
(IDownloadRa
 }
 voidHTTPConnectionManager::notify   ()
 {
+if ( this->bpsAvg <= 0 )
+return ;
 for(size_t i = 0; i < this->rateObservers.size(); i++)
 this->rateObservers.at(i)->downloadRateChanged(this->bpsAvg, 
this->bpsLastChunk);
 }
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp 
b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
index e8b3167..21c86f5 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
@@ -91,38 +91,30 @@ Period* BasicCMManager::getFirstPeriod  
()
 return periods.at(0);
 }
 
-Representation* BasicCMManager::getRepresentation   (Period 
*period, long bitrate)
+Representation* BasicCMManager::getRepresentation(Period *period, int 
bitrate )
 {
-std::vector groups = period->getGroups();
+std::vectorgroups = period->getGroups();
 
-Representation  *best   = NULL;
-int bestDif  = -1;
+Representation  *best = NULL;
+std::cout << "Sarching for best representation with bitrate: " << bitrate 
<< std::endl;
 
 for(size_t i = 0; i < groups.size(); i++)
 {
 std::vector reps = 
groups.at(i)->getRepresentations();
-for(size_t j = 0; j < reps.size(); j++)
+for( size_t j = 0; j < reps.size(); j++ )
 {
 int currentBitrate = reps.at(j)->getBandwidth();
 assert( currentBitrate != -1 );
-int dif = bitrate - currentBitrate;
 
-if( bestDif == -1 )
+if ( best == NULL || bitrate == -1 ||
+ ( currentBitrate > best->getBandwidth() &&
+   currentBitrate < bitrate ) )
 {
-bestDif = dif;
-best = reps.at(j);
-}
-else
-{
-if ( dif >= 0 && dif < bestDif )
-{
-bestDif = dif;
-best = reps.at(j);
-}
+std::cout << "Found a better Representation (#" << j << ") in 
group #" << i << std::endl;
+best = reps.at( j );
 }
 }
 }
-
 return best;
 }
 Period*  

[vlc-commits] dash: Allow SegmentTimeline to be queried for a "S" element.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 14:53:49 2012 +0100| [de45860f99ff6e58f60642b61bf6b486635ce701] | 
committer: Jean-Baptiste Kempf

dash: Allow SegmentTimeline to be queried for a "S" element.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/SegmentTimeline.cpp |   24 
 modules/stream_filter/dash/mpd/SegmentTimeline.h   |2 +
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.cpp 
b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
index c18e537..f97aeae 100644
--- a/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
@@ -26,6 +26,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace dash::mpd;
 
 SegmentTimeline::SegmentTimeline() :
@@ -53,6 +55,28 @@ void 
dash::mpd::SegmentTimeline::addElement(dash::mpd::SegmentTimeline::Element
 this->elements.push_back( e );
 }
 
+const SegmentTimeline::Element*SegmentTimeline::getElement( mtime_t dts ) 
const
+{
+if ( this->elements.size() == 0 )
+return NULL;
+int64_t targetT = dts * this->timescale / 100;
+targetT -= this->elements.front()->t;
+
+std::list::const_iterator it = this->elements.begin();
+std::list::const_iterator end = this->elements.end();
+const Element*  res = NULL;
+
+while ( it != end )
+{
+if ( (*it)->t > targetT )
+return res;
+res = *it;
+++it;
+}
+std::cerr << "No more element to be used." << std::endl;
+return NULL;
+}
+
 dash::mpd::SegmentTimeline::Element::Element() :
 r( 0 )
 {
diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.h 
b/modules/stream_filter/dash/mpd/SegmentTimeline.h
index efc5db7..c7d5cde 100644
--- a/modules/stream_filter/dash/mpd/SegmentTimeline.h
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.h
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace dash
 {
@@ -47,6 +48,7 @@ namespace dash
 int getTimescale() const;
 voidsetTimescale( int timescale );
 voidaddElement( Element* e );
+const Element*  getElement( mtime_t dts ) const;
 
 private:
 int timescale;

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Cleaning Period class.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 14:53:09 2012 +0100| [694ae8e72ddd67953b49423e171bb838a3f5d1ab] | 
committer: Jean-Baptiste Kempf

dash: Cleaning Period class.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |2 +-
 modules/stream_filter/dash/mpd/Period.cpp|   19 ---
 modules/stream_filter/dash/mpd/Period.h  |   11 +++
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 708b577..7590f1d 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -157,7 +157,7 @@ voidBasicCMParser::setPeriods   (Node *root)
 
 for(size_t i = 0; i < periods.size(); i++)
 {
-Period *period = new Period(periods.at(i)->getAttributes());
+Period *period = new Period();
 this->setGroups(periods.at(i), period);
 this->mpd->addPeriod(period);
 }
diff --git a/modules/stream_filter/dash/mpd/Period.cpp 
b/modules/stream_filter/dash/mpd/Period.cpp
index 98b2c74..6d94474 100644
--- a/modules/stream_filter/dash/mpd/Period.cpp
+++ b/modules/stream_filter/dash/mpd/Period.cpp
@@ -21,29 +21,34 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 
USA.
  */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
 #include "Period.h"
 
+#include 
+#include 
+
 using namespace dash::mpd;
 
-Period::Period  (std::map attributes)
+Period::Period()
 {
-this->attributes = attributes;
 }
+
 Period::~Period ()
 {
-for(size_t i = 0; i < this->groups.size(); i++)
-delete(this->groups.at(i));
+vlc_delete_all( this->groups );
 }
 
-std::vector Period::getGroups   ()
+const std::vector&  Period::getGroups() const
 {
 return this->groups;
 }
-voidPeriod::addGroup(Group *group)
+
+voidPeriod::addGroup(Group *group)
 {
-this->groups.push_back(group);
+if ( group != NULL )
+this->groups.push_back(group);
 }
diff --git a/modules/stream_filter/dash/mpd/Period.h 
b/modules/stream_filter/dash/mpd/Period.h
index d019bc4..469f1f1 100644
--- a/modules/stream_filter/dash/mpd/Period.h
+++ b/modules/stream_filter/dash/mpd/Period.h
@@ -26,10 +26,8 @@
 
 #include 
 #include 
-#include 
 
 #include "mpd/Group.h"
-#include "mpd/Representation.h"
 
 namespace dash
 {
@@ -38,17 +36,14 @@ namespace dash
 class Period
 {
 public:
-Period  (std::map 
attributes);
+Period();
 virtual ~Period ();
 
-std::vectorgetGroups   ();
-voidaddGroup(Group *group);
+const std::vector& getGroups() const;
+voidaddGroup( Group *group );
 
 private:
-std::map  attributes;
 std::vectorgroups;
-
-
 };
 }
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Removing empty IAdaptionLogic implementation.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Jan  6 11:25:47 2012 +0100| [767ff82b747593068388b61384fc45a146fe372a] | 
committer: Jean-Baptiste Kempf

dash: Removing empty IAdaptionLogic implementation.

This is crash prone, and makes us maintain another implementation if we
ever edit the interface.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/DASHManager.cpp |9 +++-
 modules/stream_filter/dash/DASHManager.h   |3 +-
 modules/stream_filter/dash/Modules.am  |1 -
 .../adaptationlogic/AdaptationLogicFactory.cpp |8 ++--
 .../dash/adaptationlogic/AdaptationLogicFactory.h  |1 -
 .../dash/adaptationlogic/NullAdaptationLogic.h |   49 
 modules/stream_filter/dash/dash.cpp|3 +-
 7 files changed, 16 insertions(+), 58 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp 
b/modules/stream_filter/dash/DASHManager.cpp
index 849aec4..f14e1f7 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -47,6 +47,8 @@ DASHManager::DASHManager( HTTPConnectionManager 
*conManager, MPD *mpd,
 if ( this->mpdManager == NULL )
 return ;
 this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, 
this->mpdManager );
+if ( this->adaptationLogic == NULL )
+return ;
 this->conManager->attach(this->adaptationLogic);
 }
 DASHManager::~DASHManager   ()
@@ -98,7 +100,12 @@ int DASHManager::peek( const uint8_t **pp_peek, size_t 
i_peek )
 return ret;
 }
 
-const mpd::IMPDManager* DASHManager::getMpdManager() const
+const mpd::IMPDManager* DASHManager::getMpdManager() const
 {
 return this->mpdManager;
 }
+
+const logic::IAdaptationLogic*  DASHManager::getAdaptionLogic() const
+{
+return this->adaptationLogic;
+}
diff --git a/modules/stream_filter/dash/DASHManager.h 
b/modules/stream_filter/dash/DASHManager.h
index d824808..860eee2 100644
--- a/modules/stream_filter/dash/DASHManager.h
+++ b/modules/stream_filter/dash/DASHManager.h
@@ -45,7 +45,8 @@ namespace dash
 
 int read( void *p_buffer, size_t len );
 int peek( const uint8_t **pp_peek, size_t i_peek );
-const mpd::IMPDManager* getMpdManager() const;
+const mpd::IMPDManager* getMpdManager() const;
+const logic::IAdaptationLogic*  getAdaptionLogic() const;
 
 private:
 http::HTTPConnectionManager *conManager;
diff --git a/modules/stream_filter/dash/Modules.am 
b/modules/stream_filter/dash/Modules.am
index b38bb18..f6c11f2 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -7,7 +7,6 @@ SOURCES_stream_filter_dash = \
 adaptationlogic/AlwaysBestAdaptationLogic.h \
 adaptationlogic/IAdaptationLogic.h \
 adaptationlogic/IDownloadRateObserver.h \
-adaptationlogic/NullAdaptationLogic.h \
 adaptationlogic/RateBasedAdaptationLogic.h \
 adaptationlogic/RateBasedAdaptationLogic.cpp \
 exceptions/EOFException.h \
diff --git 
a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp 
b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
index 80469c0..341c739 100644
--- a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
@@ -36,11 +36,11 @@ IAdaptationLogic* AdaptationLogicFactory::create ( 
IAdaptationLogic::LogicType l
 {
 switch(logic)
 {
-case IAdaptationLogic::Default: return new NullAdaptationLogic 
 (mpdManager);
 case IAdaptationLogic::AlwaysBest:  return new 
AlwaysBestAdaptationLogic(mpdManager);
-case IAdaptationLogic::AlwaysLowest:return new NullAdaptationLogic 
 (mpdManager);
 case IAdaptationLogic::RateBased:   return new 
RateBasedAdaptationLogic (mpdManager);
-
-default:return new NullAdaptationLogic 
 (mpdManager);
+case IAdaptationLogic::Default:
+case IAdaptationLogic::AlwaysLowest:
+default:
+return NULL;
 }
 }
diff --git 
a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h 
b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
index 79ff47b..f27cf25 100644
--- a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
+++ b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
@@ -29,7 +29,6 @@
 #include "xml/Node.h"
 #include "mpd/IMPDManager.h"
 #include "adaptationlogic/AlwaysBestAdaptationLogic.h"
-#include "adaptationlogic/NullAdaptationLogic.h"
 #include "adaptationlogic/Ra

[vlc-commits] dash: Fixing SegmentInfoDefault parsing.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 18:23:52 2012 +0100| [3fff15a4c54028a9713281f2d99e6142baf4ef68] | 
committer: Jean-Baptiste Kempf

dash: Fixing SegmentInfoDefault parsing.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index ccfead6..ee0bd38 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -266,6 +266,7 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 std::map::const_iterator  it = attr.find( 
"subsegmentAlignmentFlag" );
 if ( it != attr.end() && it->second == "true" )
 group->setSubsegmentAlignmentFlag( true ); //Otherwise it is false 
by default.
+this->parseSegmentInfoDefault( groups.at( i ), group );
 this->setRepresentations(groups.at(i), group);
 period->addGroup(group);
 }
@@ -361,9 +362,7 @@ boolBasicCMParser::setSegmentInfo   (Node *root, 
Representation *rep)
 
 if ( segmentInfo )
 {
-const std::map attr = 
segmentInfo->getAttributes();
-
-SegmentInfo *info = new SegmentInfo();
+SegmentInfo *info = new SegmentInfo;
 this->parseSegmentInfoCommon( segmentInfo, info );
 //If we don't have any segment, there's no point keeping this 
SegmentInfo.
 if ( this->setSegments( segmentInfo, info ) == false )

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Adding an implementation for UrlTemplate

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 14:35:10 2012 +0100| [9ca785b7b03713d722a73e8d69dd767dc47b9d47] | 
committer: Jean-Baptiste Kempf

dash: Adding an implementation for UrlTemplate

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/DASHManager.cpp |   18 ++--
 modules/stream_filter/dash/DASHManager.h   |4 +-
 modules/stream_filter/dash/Modules.am  |2 +
 .../dash/adaptationlogic/AbstractAdaptationLogic.h |1 -
 .../adaptationlogic/AdaptationLogicFactory.cpp |3 +-
 .../adaptationlogic/AlwaysBestAdaptationLogic.cpp  |4 +-
 .../adaptationlogic/AlwaysBestAdaptationLogic.h|4 +-
 .../dash/adaptationlogic/IAdaptationLogic.h|4 +-
 .../dash/adaptationlogic/NullAdaptationLogic.h |2 +-
 .../adaptationlogic/RateBasedAdaptationLogic.cpp   |   16 ++--
 .../adaptationlogic/RateBasedAdaptationLogic.h |2 +-
 modules/stream_filter/dash/dash.cpp|6 +-
 modules/stream_filter/dash/http/HTTPConnection.cpp |2 +
 .../dash/http/HTTPConnectionManager.cpp|   10 ++-
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |6 +-
 modules/stream_filter/dash/mpd/BasicCMManager.h|2 +-
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |2 +-
 modules/stream_filter/dash/mpd/IMPDManager.h   |2 +-
 modules/stream_filter/dash/mpd/Segment.cpp |   12 +++-
 modules/stream_filter/dash/mpd/Segment.h   |   13 ++-
 .../stream_filter/dash/mpd/SegmentInfoCommon.cpp   |4 +-
 modules/stream_filter/dash/mpd/SegmentInfoCommon.h |6 +-
 modules/stream_filter/dash/mpd/SegmentTemplate.cpp |   95 
 modules/stream_filter/dash/mpd/SegmentTemplate.h   |   52 +++
 modules/stream_filter/dash/mpd/SegmentTimeline.cpp |   36 +---
 modules/stream_filter/dash/mpd/SegmentTimeline.h   |4 +-
 26 files changed, 250 insertions(+), 62 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=9ca785b7b03713d722a73e8d69dd767dc47b9d47
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Removing useless and potentially harmful recursion.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 16:40:23 2012 +0100| [f6e9ca145e6323da90d8f8664cba55b5f2b6847c] | 
committer: Jean-Baptiste Kempf

dash: Removing useless and potentially harmful recursion.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 .../dash/http/HTTPConnectionManager.cpp|   49 ++--
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp 
b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
index d1cf529..ee377bd 100644
--- a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
@@ -87,14 +87,27 @@ void
HTTPConnectionManager::closeAllConnections  ()
 
 this->chunkMap.clear();
 }
-int HTTPConnectionManager::read (Chunk 
*chunk, void *p_buffer, size_t len)
+
+int HTTPConnectionManager::read( Chunk *chunk, void *p_buffer, 
size_t len )
 {
-if(this->chunkMap.find(chunk) != this->chunkMap.end())
+if(this->chunkMap.find(chunk) == this->chunkMap.end())
 {
-mtime_t start = mdate();
-int ret = this->chunkMap[chunk]->read(p_buffer, len);
-mtime_t end = mdate();
+this->bytesReadChunk= 0;
+this->timeSecChunk  = 0;
+
+if ( this->initConnection( chunk ) == NULL )
+return -1;
+}
 
+mtime_t start = mdate();
+int ret = this->chunkMap[chunk]->read(p_buffer, len);
+mtime_t end = mdate();
+
+std::cout << "ret: " << ret << std::endl;
+if( ret <= 0 )
+this->closeConnection( chunk );
+else
+{
 double time = ((double)(end - start)) / 100;
 
 this->bytesReadSession += ret;
@@ -116,30 +129,18 @@ int HTTPConnectionManager::read   
  (Chunk *chun
 this->bpsLastChunk = 0;
 
 this->notify();
-
-if(ret <= 0)
-this->closeConnection(chunk);
-
-return ret;
 }
-else
-{
-this->bytesReadChunk= 0;
-this->timeSecChunk  = 0;
+return ret;
+}
 
+int HTTPConnectionManager::peek (Chunk 
*chunk, const uint8_t **pp_peek, size_t i_peek)
+{
+if(this->chunkMap.find(chunk) == this->chunkMap.end())
+{
 if ( this->initConnection(chunk) == NULL )
 return -1;
-return this->read(chunk, p_buffer, len);
 }
-}
-int HTTPConnectionManager::peek (Chunk 
*chunk, const uint8_t **pp_peek, size_t i_peek)
-{
-if(this->chunkMap.find(chunk) != this->chunkMap.end())
-return this->chunkMap[chunk]->peek(pp_peek, i_peek);
-
-if ( this->initConnection(chunk) == NULL )
-return -1;
-return this->peek(chunk, pp_peek, i_peek);
+return this->chunkMap[chunk]->peek(pp_peek, i_peek);
 }
 
 IHTTPConnection* HTTPConnectionManager::initConnection(Chunk *chunk)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Group: Fixing SegmentInfoDefault initialization/deletion

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 18:20:36 2012 +0100| [26a54da31260618661c5818fef261de0ad9e6865] | 
committer: Jean-Baptiste Kempf

dash: Group: Fixing SegmentInfoDefault initialization/deletion

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/Group.cpp |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/Group.cpp 
b/modules/stream_filter/dash/mpd/Group.cpp
index 0723396..b2073bd 100644
--- a/modules/stream_filter/dash/mpd/Group.cpp
+++ b/modules/stream_filter/dash/mpd/Group.cpp
@@ -27,15 +27,19 @@
 #include 
 #include 
 
+#include "SegmentInfoDefault.h"
+
 using namespace dash::mpd;
 
 Group::Group() :
-subsegmentAlignmentFlag( false )
+subsegmentAlignmentFlag( false ),
+segmentInfoDefault( NULL )
 {
 }
 
 Group::~Group   ()
 {
+delete this->segmentInfoDefault;
 vlc_delete_all( this->representations );
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Fixing SegmentInfoCommon initialization/deletion.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 18:21:37 2012 +0100| [8b5f1ac1cccdc61528a98b6bdbedcafd5984212c] | 
committer: Jean-Baptiste Kempf

dash: Fixing SegmentInfoCommon initialization/deletion.

This prevents a potential crash, and solves a memory leak.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 .../stream_filter/dash/mpd/SegmentInfoCommon.cpp   |   13 -
 modules/stream_filter/dash/mpd/SegmentInfoCommon.h |1 +
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp 
b/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
index 0d7c26b..51f3519 100644
--- a/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
+++ b/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
@@ -24,11 +24,22 @@
 
 #include "SegmentInfoCommon.h"
 
+#include "Segment.h"
+#include "SegmentTimeline.h"
+
 using namespace dash::mpd;
 
 SegmentInfoCommon::SegmentInfoCommon() :
-duration( -1 )
+duration( -1 ),
+initialisationSegment( NULL ),
+segmentTimeline( NULL )
+{
+}
+
+SegmentInfoCommon::~SegmentInfoCommon()
 {
+delete this->segmentTimeline;
+delete this->initialisationSegment;
 }
 
 time_t  SegmentInfoCommon::getDuration() const
diff --git a/modules/stream_filter/dash/mpd/SegmentInfoCommon.h 
b/modules/stream_filter/dash/mpd/SegmentInfoCommon.h
index 654ebfc..d637c4e 100644
--- a/modules/stream_filter/dash/mpd/SegmentInfoCommon.h
+++ b/modules/stream_filter/dash/mpd/SegmentInfoCommon.h
@@ -39,6 +39,7 @@ namespace dash
 {
 public:
 SegmentInfoCommon();
+virtual ~SegmentInfoCommon();
 time_t  getDuration() const;
 voidsetDuration( time_t duration );
 int getStartIndex() const;

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Don't crash when a segment can't be accessed.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 16:06:54 2012 +0100| [8d6ddd7000a8df9c32bd99c4ef1d4193e55229bf] | 
committer: Jean-Baptiste Kempf

dash: Don't crash when a segment can't be accessed.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/http/HTTPConnection.cpp |6 +++---
 .../dash/http/HTTPConnectionManager.cpp|   12 
 .../dash/http/HTTPConnectionManager.h  |4 ++--
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/modules/stream_filter/dash/http/HTTPConnection.cpp 
b/modules/stream_filter/dash/http/HTTPConnection.cpp
index d42aa43..493c105 100644
--- a/modules/stream_filter/dash/http/HTTPConnection.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnection.cpp
@@ -66,11 +66,11 @@ voidHTTPConnection::parseURL()
 this->request = "GET " + this->path + " HTTP/1.1\r\n" +
 "Host: " + this->hostname + "\r\nConnection: 
close\r\n\r\n";
 }
-boolHTTPConnection::init()
+boolHTTPConnection::init()
 {
-this->urlStream = stream_UrlNew(this->stream, this->url.c_str());
+this->urlStream = stream_UrlNew( this->stream, this->url.c_str() );
 
-if(!this->urlStream)
+if( this->urlStream == NULL )
 return false;
 
 return true;
diff --git a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp 
b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
index 0084f7d..d1cf529 100644
--- a/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnectionManager.cpp
@@ -127,7 +127,8 @@ int HTTPConnectionManager::read 
(Chunk *chun
 this->bytesReadChunk= 0;
 this->timeSecChunk  = 0;
 
-this->initConnection(chunk);
+if ( this->initConnection(chunk) == NULL )
+return -1;
 return this->read(chunk, p_buffer, len);
 }
 }
@@ -136,13 +137,16 @@ int HTTPConnectionManager::peek   
  (Chunk *chun
 if(this->chunkMap.find(chunk) != this->chunkMap.end())
 return this->chunkMap[chunk]->peek(pp_peek, i_peek);
 
-this->initConnection(chunk);
+if ( this->initConnection(chunk) == NULL )
+return -1;
 return this->peek(chunk, pp_peek, i_peek);
 }
-HTTPConnection* HTTPConnectionManager::initConnection   (Chunk 
*chunk)
+
+IHTTPConnection* HTTPConnectionManager::initConnection(Chunk *chunk)
 {
 HTTPConnection *con = new HTTPConnection(chunk->getUrl(), this->stream);
-con->init();
+if ( con->init() == false )
+return NULL;
 this->connections.push_back(con);
 this->chunkMap[chunk] = con;
 this->chunkCount++;
diff --git a/modules/stream_filter/dash/http/HTTPConnectionManager.h 
b/modules/stream_filter/dash/http/HTTPConnectionManager.h
index 56ba8f6..c82c937 100644
--- a/modules/stream_filter/dash/http/HTTPConnectionManager.h
+++ b/modules/stream_filter/dash/http/HTTPConnectionManager.h
@@ -69,8 +69,8 @@ namespace dash
 stream_t*stream;
 int chunkCount;
 
-boolcloseConnection (Chunk *chunk);
-HTTPConnection* initConnection  (Chunk *chunk);
+boolcloseConnection( Chunk *chunk );
+IHTTPConnection*initConnection( Chunk *chunk );
 
 };
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Reworking SemgentInfo parsing

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sat 
Dec 24 14:31:04 2011 +0100| [09ffaf1884fcff969ef8442db5ea5bbeddec3245] | 
committer: Jean-Baptiste Kempf

dash: Reworking SemgentInfo parsing

Elements/attributes are now parsed once, and not everytime a getter is
called.
Also, mandatory elements are now checked, also at parsing time.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   51 -
 modules/stream_filter/dash/mpd/BasicCMParser.h   |4 +-
 modules/stream_filter/dash/mpd/SegmentInfo.cpp   |   26 +++
 modules/stream_filter/dash/mpd/SegmentInfo.h |   10 +++--
 4 files changed, 64 insertions(+), 27 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 6c37dc8..339406a 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -30,6 +30,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 using namespace dash::mpd;
 using namespace dash::xml;
 
@@ -133,9 +136,12 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 if ( it != attributes.end() )
 this->handleDependencyId( rep, group, it->second );
 
-this->setSegmentInfo(representations.at(i), rep);
-if ( rep->getSegmentInfo() && 
rep->getSegmentInfo()->getSegments().size() > 0 )
-group->addRepresentation(rep);
+if ( this->setSegmentInfo(representations.at(i), rep) == false )
+{
+delete rep;
+continue ;
+}
+group->addRepresentation(rep);
 }
 }
 
@@ -154,39 +160,60 @@ voidBasicCMParser::handleDependencyId( Representation 
*rep, const Group *gro
 }
 }
 
-voidBasicCMParser::setSegmentInfo   (Node *root, Representation *rep)
+boolBasicCMParser::setSegmentInfo   (Node *root, Representation *rep)
 {
 Node*segmentInfo = DOMHelper::getFirstChildElementByName( root, 
"SegmentInfo");
 
 if ( segmentInfo )
 {
-SegmentInfo *info = new SegmentInfo( segmentInfo->getAttributes() );
+const std::map attr = 
segmentInfo->getAttributes();
+
+SegmentInfo *info = new SegmentInfo();
+//Init segment is not mandatory.
 this->setInitSegment( segmentInfo, info );
-this->setSegments(segmentInfo, info );
+//If we don't have any segment, there's no point keeping this 
SegmentInfo.
+if ( this->setSegments(segmentInfo, info ) == false )
+{
+delete info;
+return false;
+}
+std::map::const_iterator  it;
+it = attr.find( "duration" );
+if ( it != attr.end() )
+info->setDuration( str_duration( it->second.c_str() ) );
+
 rep->setSegmentInfo(info);
+return true;
 }
+return false;
 }
 
 voidBasicCMParser::setInitSegment   (Node *root, SegmentInfo *info)
 {
-std::vector initSeg = DOMHelper::getChildElementByTagName(root, 
"InitialisationSegmentURL");
+const std::vector initSeg = 
DOMHelper::getChildElementByTagName(root, "InitialisationSegmentURL");
 
-for(size_t i = 0; i < initSeg.size(); i++)
+if (  initSeg.size() > 1 )
+std::cerr << "There could be at most one InitialisationSegmentURL per 
SegmentInfo"
+ " other InitialisationSegmentURL will be dropped." << 
std::endl;
+if ( initSeg.size() == 1 )
 {
-InitSegment *seg = new InitSegment(initSeg.at(i)->getAttributes());
-info->setInitSegment(seg);
-return;
+InitSegment *seg = new InitSegment( initSeg.at(0)->getAttributes() );
+info->setInitSegment( seg );
 }
 }
-voidBasicCMParser::setSegments  (Node *root, SegmentInfo *info)
+
+boolBasicCMParser::setSegments  (Node *root, SegmentInfo *info)
 {
 std::vector segments = DOMHelper::getElementByTagName(root, "Url", 
false);
 
+if ( segments.size() == 0 )
+return false;
 for(size_t i = 0; i < segments.size(); i++)
 {
 Segment *seg = new Segment(segments.at(i)->getAttributes());
 info->addSegment(seg);
 }
+return true;
 }
 MPD*BasicCMParser::getMPD   ()
 {
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index 2c867dc..dbc80eb 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -61,9 +61,9 @@ namespace dash
 voidsetPeriods  (dash::xml::Node *root);
 voidsetGroups   (dash::xml::Node *root, Period 
*period);
 voidsetRepresentations  (dash::xml::N

[vlc-commits] dash: Handle relative URL

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Jan  5 12:20:47 2012 +0100| [eaf97ac67a41dff33a611941d565e0f1189c7743] | 
committer: Jean-Baptiste Kempf

dash: Handle relative URL

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   19 ---
 modules/stream_filter/dash/mpd/BasicCMParser.h   |1 +
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 9b5f0f2..708b577 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -42,11 +42,19 @@ using namespace dash::xml;
 
 BasicCMParser::BasicCMParser( Node *root, stream_t *p_stream ) :
 root( root ),
-mpd( NULL )
+mpd( NULL ),
+p_stream( p_stream )
 {
 this->url = p_stream->psz_access;
 this->url += "://";
-this->url += p_stream->psz_path;
+//Only append without the mpd file.
+std::string path = p_stream->psz_path;
+size_t  it = path.find_last_of( '/', path.length() - 1 );
+if ( it != std::string::npos )
+this->url.append( path, 0, it );
+else
+this->url += p_stream->psz_path;
+this->url += '/';
 }
 
 BasicCMParser::~BasicCMParser   ()
@@ -374,7 +382,12 @@ bool BasicCMParser::parseSegment(Segment *seg, const 
std::mapsetSourceUrl( it->second );
+{
+std::string url = it->second;
+if ( url.find( this->p_stream->psz_access ) != 0 ) //Relative url
+url = this->url + url;
+seg->setSourceUrl( url );
+}
 return true;
 }
 
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index e76f577..07de212 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -80,6 +80,7 @@ namespace dash
 dash::xml::Node *root;
 MPD *mpd;
 std::string url;
+stream_t*p_stream;
 };
 }
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Store the parent Group in every representations.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan  3 16:05:09 2012 +0100| [3e6823521f37f2582d38583064211569538f10d6] | 
committer: Jean-Baptiste Kempf

dash: Store the parent Group in every representations.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp  |3 ++-
 modules/stream_filter/dash/mpd/Representation.cpp |   17 ++---
 modules/stream_filter/dash/mpd/Representation.h   |   11 ---
 3 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 25d3f6d..9b5f0f2 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -287,7 +287,8 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 {
 const std::mapattributes = 
representations.at(i)->getAttributes();
 
-Representation *rep = new Representation( attributes );
+Representation *rep = new Representation;
+rep->setParentGroup( group );
 if ( this->parseCommonAttributesElements( representations.at( i ), 
rep, group ) == false )
 {
 delete rep;
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp 
b/modules/stream_filter/dash/mpd/Representation.cpp
index 079323b..f7be5bf 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -31,11 +31,11 @@
 
 using namespace dash::mpd;
 
-Representation::Representation  (const std::map&  
attributes) :
+Representation::Representation() :
 qualityRanking( -1 ),
-attributes( attributes ),
 segmentInfo( NULL ),
-trickModeType( NULL )
+trickModeType( NULL ),
+parentGroup( NULL )
 {
 }
 
@@ -82,6 +82,17 @@ voidRepresentation::setTrickMode
(TrickModeType *trickMod
 this->trickModeType = trickModeType;
 }
 
+const Group *Representation::getParentGroup() const
+{
+return this->parentGroup;
+}
+
+void Representation::setParentGroup(const Group *group)
+{
+if ( group != NULL )
+this->parentGroup = group;
+}
+
 voidRepresentation::setSegmentInfo  (SegmentInfo *info)
 {
 this->segmentInfo = info;
diff --git a/modules/stream_filter/dash/mpd/Representation.h 
b/modules/stream_filter/dash/mpd/Representation.h
index 04c25b7..0d01c47 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -35,10 +35,12 @@ namespace dash
 {
 namespace mpd
 {
+class Group;
+
 class Representation : public CommonAttributesElements
 {
 public:
-Representation  ( const std::map&  attributes);
+Representation();
 virtual ~Representation ();
 
 const std::string&  getId   () const;
@@ -65,14 +67,17 @@ namespace dash
 
 voidsetSegmentInfo( SegmentInfo *info );
 voidsetTrickMode( TrickModeType *trickModeType 
);
+const Group*getParentGroup() const;
+voidsetParentGroup( const Group *group );
 
 private:
 int bandwidth;
-std::string id; int
 qualityRanking;
+std::string id;
+int qualityRanking;
 std::listdependencies;
-std::map  attributes;
 SegmentInfo *segmentInfo;
 TrickModeType   *trickModeType;
+const Group *parentGroup;
 };
 }
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Working arround specifications ambiguity.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 19:07:29 2011 +0100| [50f97b3ec466ada916c8ce5693533809241d0787] | 
committer: Jean-Baptiste Kempf

dash: Working arround specifications ambiguity.

profile is spelled once as "profile", and "profiles" a few line after,
so we now handle both.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 8ded464..25d3f6d 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -65,6 +65,8 @@ boolBasicCMParser::setMPD()
 
 std::map::const_iterator  it;
 it = attr.find( "profile" );
+if ( it == attr.end() )
+it = attr.find( "profiles" ); //The standard spells it the two ways...
 if ( it != attr.end() )
 this->mpd->setProfile( it->second );
 

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Dash: fix win32 compilation

2012-01-24 Thread Jean-Baptiste Kempf
vlc/vlc-1.2 | branch: master | Jean-Baptiste Kempf  | Fri 
Dec 30 18:54:41 2011 +0100| [ae05b43e59c2a9195e0521236b772e2c164867de] | 
committer: Jean-Baptiste Kempf

Dash: fix win32 compilation

(cherry picked from commit 2d31fd776f7717da77193d6a893b0d93c68f689b)

Signed-off-by: Jean-Baptiste Kempf 

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

 configure.ac |2 +-
 modules/stream_filter/dash/mpd/BasicCMParser.cpp |2 ++
 modules/stream_filter/dash/mpd/SegmentTimeline.h |1 +
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0b1599e..391af84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -501,7 +501,7 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include ])
-AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex 
if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise 
posix_madvise setlocale stricmp strnicmp uselocale])
+AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex 
if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise 
posix_madvise setlocale stricmp strnicmp strptime uselocale])
 AC_REPLACE_FUNCS([asprintf atof atoll dirfd fdopendir flockfile fsync getdelim 
getpid gmtime_r inet_pton lldiv localtime_r nrand48 rewind setenv strcasecmp 
strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r 
strtoll swab tdestroy vasprintf])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index d72334b..8ded464 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -81,6 +81,7 @@ boolBasicCMParser::setMPD()
  " the stream @type is Live" << std::endl;
 return false;
 }
+#ifdef HAVE_STRPTIME
 if ( it != attr.end() )
 {
 struct tm   t;
@@ -105,6 +106,7 @@ boolBasicCMParser::setMPD()
 if ( res != NULL )
 this->mpd->setAvailabilityEndTime( mktime( &t ) );
 }
+#endif
 it = attr.find( "mediaPresentationDuration" );
 if ( it != attr.end() )
 this->mpd->setDuration( str_duration( it->second.c_str() ) );
diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.h 
b/modules/stream_filter/dash/mpd/SegmentTimeline.h
index f4df859..efc5db7 100644
--- a/modules/stream_filter/dash/mpd/SegmentTimeline.h
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.h
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 
 namespace dash
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Don't crash if we don't have a valid mpdManager.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 19:02:32 2011 +0100| [0a99eaa93e251f79cbfc7bfa6fa676dec4588aae] | 
committer: Jean-Baptiste Kempf

dash: Don't crash if we don't have a valid mpdManager.

This will happen when the profil is invalid.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/DASHManager.cpp |2 ++
 modules/stream_filter/dash/dash.cpp|3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp 
b/modules/stream_filter/dash/DASHManager.cpp
index 08205cb..caab9cd 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -44,6 +44,8 @@ DASHManager::DASHManager( HTTPConnectionManager 
*conManager, MPD *mpd,
 mpd( mpd )
 {
 this->mpdManager= mpd::MPDManagerFactory::create( mpd );
+if ( this->mpdManager == NULL )
+return ;
 this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, 
this->mpdManager );
 this->conManager->attach(this->adaptationLogic);
 }
diff --git a/modules/stream_filter/dash/dash.cpp 
b/modules/stream_filter/dash/dash.cpp
index d99fc4f..4f00dfb 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -109,7 +109,8 @@ static int Open(vlc_object_t *p_obj)
 new dash::DASHManager( p_conManager, p_sys->p_mpd,
dash::logic::IAdaptationLogic::RateBased );
 
-if ( p_dashManager->getMpdManager()->getMPD() == NULL )
+if ( p_dashManager->getMpdManager() == NULL ||
+ p_dashManager->getMpdManager()->getMPD() == NULL )
 {
 delete p_conManager;
 delete p_dashManager;

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Only use const Segments.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 15:06:43 2011 +0100| [4468816d11570e7a5b8e01afb128d1e7b15381df] | 
committer: Jean-Baptiste Kempf

dash: Only use const Segments.

Everything after the parsing step should be used as a const instance, as
the MPD tree is read only.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 .../adaptationlogic/AlwaysBestAdaptationLogic.cpp  |2 +-
 .../adaptationlogic/AlwaysBestAdaptationLogic.h|2 +-
 .../adaptationlogic/RateBasedAdaptationLogic.cpp   |2 +-
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |8 
 modules/stream_filter/dash/mpd/BasicCMManager.h|2 +-
 modules/stream_filter/dash/mpd/IMPDManager.h   |2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp 
b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
index 8265538..9996489 100644
--- a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
@@ -75,7 +75,7 @@ voidAlwaysBestAdaptationLogic::initSchedule ()
 
 if(best != NULL)
 {
-std::vector segments = 
this->mpdManager->getSegments(best);
+std::vector segments = 
this->mpdManager->getSegments(best);
 for(size_t j = 0; j < segments.size(); j++)
 {
 this->schedule.push_back(segments.at(j));
diff --git 
a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h 
b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
index a0ba0e2..49f7a98 100644
--- a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
@@ -48,7 +48,7 @@ namespace dash
 dash::http::Chunk* getNextChunk () 
throw(dash::exception::EOFException);
 
 private:
-std::vector  schedule;
+std::vector   schedule;
 dash::mpd::IMPDManager  *mpdManager;
 size_t  count;
 
diff --git 
a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp 
b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
index 78a9bdf..dbf4cba 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
@@ -56,7 +56,7 @@ Chunk*  RateBasedAdaptationLogic::getNextChunk () 
throw(EOFException)
 if(rep == NULL)
 throw EOFException();
 
-std::vector segments = this->mpdManager->getSegments(rep);
+std::vector segments = this->mpdManager->getSegments(rep);
 
 if(this->count == segments.size())
 {
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp 
b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
index 830c49a..e8b3167 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
@@ -40,11 +40,11 @@ BasicCMManager::~BasicCMManager ()
 delete this->mpd;
 }
 
-std::vector  BasicCMManager::getSegments (Representation 
*rep)
+std::vector  BasicCMManager::getSegments( Representation *rep )
 {
-std::vector  retSegments;
-SegmentInfo*info = rep->getSegmentInfo();
-Segment*initSegment = info->getInitSegment();
+std::vectorretSegments;
+SegmentInfo*info = rep->getSegmentInfo();
+const Segment*  initSegment = 
info->getInitialisationSegment();
 
 if ( initSegment )
 retSegments.push_back( initSegment );
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.h 
b/modules/stream_filter/dash/mpd/BasicCMManager.h
index c13e51e..f38da3c 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.h
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.h
@@ -51,7 +51,7 @@ namespace dash
 Period* getFirstPeriod();
 Period* getNextPeriod( Period *period 
);
 Representation* getBestRepresentation( Period 
*period );
-std::vector  getSegments( Representation 
*rep );
+std::vectorgetSegments( Representation 
*rep );
 Representation* getRepresentation( Period 
*period, long bitrate );
 const MPD*  getMPD() const;
 
diff --git a/modules/stream_filter/dash/mpd/IMPDManager.h 
b/modules/stream_filter/dash/mpd/IMPDManager.h
index 6bf16a7..16494d7 100644
--- a/modu

[vlc-commits] dash: Parsing SegmentInfoDefault & SegmentTimeline elements.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 15:09:32 2011 +0100| [92c43bb6f045a701714aedd06ebc06f828b60dac] | 
committer: Jean-Baptiste Kempf

dash: Parsing SegmentInfoDefault & SegmentTimeline elements.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   98 --
 modules/stream_filter/dash/mpd/BasicCMParser.h   |5 +-
 modules/stream_filter/dash/mpd/Group.cpp |   11 +++
 modules/stream_filter/dash/mpd/Group.h   |5 +
 4 files changed, 109 insertions(+), 10 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index ae7d4dc..d72334b 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -27,6 +27,8 @@
 
 #include "BasicCMParser.h"
 #include "mpd/ContentDescription.h"
+#include "mpd/SegmentInfoDefault.h"
+#include "mpd/SegmentTimeline.h"
 
 #include 
 #include 
@@ -149,6 +151,90 @@ voidBasicCMParser::setPeriods   (Node *root)
 }
 }
 
+void BasicCMParser::parseSegmentTimeline(Node *node, SegmentInfoCommon 
*segmentInfo)
+{
+Node*   segmentTimelineNode = DOMHelper::getFirstChildElementByName( node, 
"SegmentTimeline" );
+if ( segmentTimelineNode )
+{
+SegmentTimeline *segmentTimeline = new SegmentTimeline;
+std::vector  sNodes = DOMHelper::getChildElementByTagName( 
segmentTimelineNode, "S" );
+std::vector::const_iterator  it = sNodes.begin();
+std::vector::const_iterator  end = sNodes.end();
+
+while ( it != end )
+{
+SegmentTimeline::Element*s = new SegmentTimeline::Element;
+const std::mapsAttr = 
(*it)->getAttributes();
+std::map::const_iterator  sIt;
+
+sIt = sAttr.find( "t" );
+if ( sIt == sAttr.end() )
+{
+std::cerr << "'t' attribute is mandatory for every 
SegmentTimeline/S element" << std::endl;
+delete s;
+++it;
+continue ;
+}
+s->t = atoll( sIt->second.c_str() );
+sIt = sAttr.find( "d" );
+if ( sIt == sAttr.end() )
+{
+std::cerr << "'d' attribute is mandatory for every 
SegmentTimeline/S element" << std::endl;
+delete s;
+++it;
+continue ;
+}
+s->d = atoll( sIt->second.c_str() );
+sIt = sAttr.find( "r" );
+if ( sIt != sAttr.end() )
+s->r = atoi( sIt->second.c_str() );
+segmentTimeline->addElement( s );
+++it;
+}
+segmentInfo->setSegmentTimeline( segmentTimeline );
+}
+}
+
+void BasicCMParser::parseSegmentInfoCommon(Node *node, SegmentInfoCommon 
*segmentInfo)
+{
+const std::mapattr = 
node->getAttributes();
+
+const std::vectorbaseUrls = 
DOMHelper::getChildElementByTagName( node, "BaseURL" );
+if ( baseUrls.size() > 0 )
+{
+std::vector::const_iterator  it = baseUrls.begin();
+std::vector::const_iterator  end = baseUrls.end();
+while ( it != end )
+{
+segmentInfo->appendBaseURL( (*it)->getText() );
+++it;
+}
+}
+std::map::const_iterator  it = attr.begin();
+
+this->setInitSegment( node, segmentInfo );
+it = attr.find( "duration" );
+if ( it != attr.end() )
+segmentInfo->setDuration( str_duration( it->second.c_str() ) );
+it = attr.find( "startIndex" );
+if ( it != attr.end() )
+segmentInfo->setStartIndex( atoi( it->second.c_str() ) );
+this->parseSegmentTimeline( node, segmentInfo );
+}
+
+void BasicCMParser::parseSegmentInfoDefault(Node *node, Group *group)
+{
+Node*   segmentInfoDefaultNode = DOMHelper::getFirstChildElementByName( 
node, "SegmentInfoDefault" );
+
+if ( segmentInfoDefaultNode != NULL )
+{
+SegmentInfoDefault* segInfoDef = new SegmentInfoDefault;
+this->parseSegmentInfoCommon( segmentInfoDefaultNode, segInfoDef );
+
+group->setSegmentInfoDefault( segInfoDef );
+}
+}
+
 voidBasicCMParser::setGroups(Node *root, Period *period)
 {
 std::vector groups = DOMHelper::getElementByTagName(root, "Group", 
false);
@@ -261,19 +347,13 @@ boolBasicCMParser::setSegmentInfo   (Node *root, 
Representation *rep)
 const std::map attr = 
segmentInfo->getAttributes();
 
 SegmentInfo *info = new SegmentInfo();
-//Init segment is not mandatory.
-this->setInitSegment( segmentInfo, info );
+this->parseSegmentInfoCommon( segmentInfo, info );
 //If

[vlc-commits] dash: Adding a SegmentInfoCommon class.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 13:08:33 2011 +0100| [bc62979e9c7148cb4391ff0c2c406103662c18a4] | 
committer: Jean-Baptiste Kempf

dash: Adding a SegmentInfoCommon class.

This holds common property for both SegmentInfo and SegmentInfoDefault.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |2 +
 modules/stream_filter/dash/mpd/SegmentInfo.cpp |   23 +-
 modules/stream_filter/dash/mpd/SegmentInfo.h   |8 +--
 .../stream_filter/dash/mpd/SegmentInfoCommon.cpp   |   86 
 modules/stream_filter/dash/mpd/SegmentInfoCommon.h |   63 ++
 5 files changed, 154 insertions(+), 28 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am 
b/modules/stream_filter/dash/Modules.am
index cdf7feb..eea53ed 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -45,6 +45,8 @@ SOURCES_stream_filter_dash = \
 mpd/Segment.h \
 mpd/SegmentInfo.cpp \
 mpd/SegmentInfo.h \
+mpd/SegmentInfoCommon.cpp \
+mpd/SegmentInfoCommon.h \
 mpd/SegmentTimeline.cpp \
 mpd/SegmentTimeline.h \
 mpd/TrickModeType.cpp \
diff --git a/modules/stream_filter/dash/mpd/SegmentInfo.cpp 
b/modules/stream_filter/dash/mpd/SegmentInfo.cpp
index 1b6ec9c..1bfec26 100644
--- a/modules/stream_filter/dash/mpd/SegmentInfo.cpp
+++ b/modules/stream_filter/dash/mpd/SegmentInfo.cpp
@@ -30,8 +30,7 @@
 using namespace dash::mpd;
 
 SegmentInfo::SegmentInfo() :
-initSeg( NULL ),
-duration( -1 )
+initSeg( NULL )
 {
 }
 
@@ -43,16 +42,6 @@ SegmentInfo::~SegmentInfo   ()
 delete(this->initSeg);
 }
 
-Segment*SegmentInfo::getInitSegment() const
-{
-return this->initSeg;
-}
-
-voidSegmentInfo::setInitSegment( Segment *initSeg )
-{
-this->initSeg = initSeg;
-}
-
 const std::vector&   SegmentInfo::getSegments() const
 {
 return this->segments;
@@ -63,13 +52,3 @@ voidSegmentInfo::addSegment 
(Segment *seg)
 this->segments.push_back(seg);
 }
 
-time_t  SegmentInfo::getDuration() const
-{
-return this->duration;
-}
-
-voidSegmentInfo::setDuration( time_t duration )
-{
-if ( duration >= 0 )
-this->duration = duration;
-}
diff --git a/modules/stream_filter/dash/mpd/SegmentInfo.h 
b/modules/stream_filter/dash/mpd/SegmentInfo.h
index fd778b7..c208add 100644
--- a/modules/stream_filter/dash/mpd/SegmentInfo.h
+++ b/modules/stream_filter/dash/mpd/SegmentInfo.h
@@ -30,27 +30,23 @@
 #include 
 
 #include "mpd/Segment.h"
+#include "mpd/SegmentInfoCommon.h"
 
 namespace dash
 {
 namespace mpd
 {
-class SegmentInfo
+class SegmentInfo : public SegmentInfoCommon
 {
 public:
 SegmentInfo ();
 virtual ~SegmentInfo();
 
-Segment*getInitSegment() const;
-voidsetInitSegment( Segment *seg );
-time_t  getDuration() const;
-voidsetDuration( time_t duration );
 const std::vector&   getSegments() const;
 voidaddSegment(Segment *seg);
 
 private:
 Segment *initSeg;
-time_t  duration;
 std::vector  segments;
 };
 }
diff --git a/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp 
b/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
new file mode 100644
index 000..0d7c26b
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
@@ -0,0 +1,86 @@
+/*
+ * SegmentInfoCommon.cpp: Implement the common part for both SegmentInfoDefault
+ *and SegmentInfo
+ *
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen 
+ *
+ * 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 wi

[vlc-commits] dash: Adding an implementation for SegmentInfoDefault element.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 13:50:27 2011 +0100| [39e8e11b9f7eeed6e38874d7349b96b69f55d0d0] | 
committer: Jean-Baptiste Kempf

dash: Adding an implementation for SegmentInfoDefault element.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |2 +
 .../stream_filter/dash/mpd/SegmentInfoDefault.cpp  |   52 
 .../stream_filter/dash/mpd/SegmentInfoDefault.h|   52 
 3 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am 
b/modules/stream_filter/dash/Modules.am
index eea53ed..da8973a 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -47,6 +47,8 @@ SOURCES_stream_filter_dash = \
 mpd/SegmentInfo.h \
 mpd/SegmentInfoCommon.cpp \
 mpd/SegmentInfoCommon.h \
+mpd/SegmentInfoDefault.cpp \
+mpd/SegmentInfoDefault.h \
 mpd/SegmentTimeline.cpp \
 mpd/SegmentTimeline.h \
 mpd/TrickModeType.cpp \
diff --git a/modules/stream_filter/dash/mpd/SegmentInfoDefault.cpp 
b/modules/stream_filter/dash/mpd/SegmentInfoDefault.cpp
new file mode 100644
index 000..5158059
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentInfoDefault.cpp
@@ -0,0 +1,52 @@
+/*
+ * SegmentInfoDefault.cpp: Implement the SegmentInfoDefault element.
+ *
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen 
+ *
+ * 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.
+ */
+
+#include "SegmentInfoDefault.h"
+
+using namespace dash::mpd;
+
+SegmentInfoDefault::SegmentInfoDefault()
+{
+}
+
+const std::string&  SegmentInfoDefault::getSourceURLTemplatePeriod() const
+{
+return this->sourceURLTemplatePeriod;
+}
+
+voidSegmentInfoDefault::setSourceURLTemplatePediod( const std::string &url 
)
+{
+if ( url.empty() == false )
+this->sourceURLTemplatePeriod = url;
+}
+
+int SegmentInfoDefault::getIndexTemplate() const
+{
+return this->indexTemplate;
+}
+
+voidSegmentInfoDefault::setIndexTemplate( int indexTpl )
+{
+if ( indexTpl >= 0 )
+this->indexTemplate = indexTpl;
+}
diff --git a/modules/stream_filter/dash/mpd/SegmentInfoDefault.h 
b/modules/stream_filter/dash/mpd/SegmentInfoDefault.h
new file mode 100644
index 000..a15ab77
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentInfoDefault.h
@@ -0,0 +1,52 @@
+/*
+ * SegmentInfoDefault.cpp: Implement the SegmentInfoDefault element.
+ *
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen 
+ *
+ * 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 SEGMENTINFODEFAULT_H
+#define SEGMENTINFODEFAULT_H
+
+#include "mpd/SegmentInfoCommon.h"
+
+#include 
+
+namespace dash
+{
+namespace mpd
+{
+class SegmentInfoDefault : public SegmentInfoCommon
+{
+ 

[vlc-commits] dash: Reworking MPD tree building.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 17:46:22 2011 +0100| [5f68d95bdd2a404c86831aa27b7be9aa1655f68c] | 
committer: Jean-Baptiste Kempf

dash: Reworking MPD tree building.

First build a DOM tree, then compute the MPD tree.
This should ease the pain later when implementing UrlTemplate elements.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/DASHManager.cpp |   16 ++
 modules/stream_filter/dash/DASHManager.h   |6 ++-
 modules/stream_filter/dash/dash.cpp|   30 
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |8 -
 modules/stream_filter/dash/mpd/BasicCMParser.h |   14 ++---
 .../stream_filter/dash/mpd/MPDManagerFactory.cpp   |   13 ++--
 modules/stream_filter/dash/mpd/MPDManagerFactory.h |4 +--
 7 files changed, 51 insertions(+), 40 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp 
b/modules/stream_filter/dash/DASHManager.cpp
index cf4d133..08205cb 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -34,15 +34,17 @@ using namespace dash::logic;
 using namespace dash::mpd;
 using namespace dash::exception;
 
-DASHManager::DASHManager( HTTPConnectionManager *conManager, Node *node, 
IAdaptationLogic::LogicType type )
+DASHManager::DASHManager( HTTPConnectionManager *conManager, MPD *mpd,
+  IAdaptationLogic::LogicType type ) :
+conManager( conManager ),
+currentChunk( NULL ),
+adaptationLogic( NULL ),
+logicType( type ),
+mpdManager( NULL ),
+mpd( mpd )
 {
-this->conManager= conManager;
-this->node  = node;
-this->logicType = type;
-this->mpdManager= mpd::MPDManagerFactory::create(this->node);
+this->mpdManager= mpd::MPDManagerFactory::create( mpd );
 this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, 
this->mpdManager );
-this->currentChunk  = NULL;
-
 this->conManager->attach(this->adaptationLogic);
 }
 DASHManager::~DASHManager   ()
diff --git a/modules/stream_filter/dash/DASHManager.h 
b/modules/stream_filter/dash/DASHManager.h
index 13a3346..a1370f9 100644
--- a/modules/stream_filter/dash/DASHManager.h
+++ b/modules/stream_filter/dash/DASHManager.h
@@ -32,13 +32,15 @@
 #include "mpd/IMPDManager.h"
 #include "mpd/MPDManagerFactory.h"
 #include "exceptions/EOFException.h"
+#include "mpd/MPD.h"
 
 namespace dash
 {
 class DASHManager
 {
 public:
-DASHManager (http::HTTPConnectionManager *conManager, 
xml::Node *node, logic::IAdaptationLogic::LogicType type);
+DASHManager( http::HTTPConnectionManager *conManager, mpd::MPD 
*mpd,
+ logic::IAdaptationLogic::LogicType type );
 virtual ~DASHManager();
 
 int read(void *p_buffer, size_t len);
@@ -50,8 +52,8 @@ namespace dash
 http::Chunk *currentChunk;
 logic::IAdaptationLogic *adaptationLogic;
 logic::IAdaptationLogic::LogicType  logicType;
-xml::Node   *node;
 mpd::IMPDManager*mpdManager;
+mpd::MPD*mpd;
 };
 }
 
diff --git a/modules/stream_filter/dash/dash.cpp 
b/modules/stream_filter/dash/dash.cpp
index 45c1905..d99fc4f 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -38,6 +38,7 @@
 #include "xml/DOMParser.h"
 #include "http/HTTPConnectionManager.h"
 #include "adaptationlogic/IAdaptationLogic.h"
+#include "mpd/BasicCMParser.h"
 
 #define SEEK 0
 
@@ -63,7 +64,7 @@ struct stream_sys_t
 {
 dash::DASHManager   *p_dashManager;
 dash::http::HTTPConnectionManager   *p_conManager;
-dash::xml::Node *p_node;
+dash::mpd::MPD  *p_mpd;
 int position;
 boolisLive;
 };
@@ -82,35 +83,40 @@ static int Open(vlc_object_t *p_obj)
 if(!dash::xml::DOMParser::isDash(p_stream->p_source))
 return VLC_EGENERIC;
 
-dash::xml::DOMParser parser(p_stream->p_source);
-if(!parser.parse())
+//Build a XML tree
+dash::xml::DOMParserparser(p_stream->p_source);
+if( !parser.parse() )
 {
-msg_Dbg(p_stream, "could not parse mpd file");
+msg_Dbg( p_stream, "Could not parse mpd file." );
+return VLC_EGENERIC;
+}
+//Begin the actual MPD parsing:
+dash::mpd::BasicCMParsermpdParser( parser.getRootNode(), 
p_stream->p_source );
+if 

[vlc-commits] dash: Implementing the basics for SegmentTimeline.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 11:58:46 2011 +0100| [032156ee22f3a9c370075cc637705bc3bda983ce] | 
committer: Jean-Baptiste Kempf

dash: Implementing the basics for SegmentTimeline.

This will be usefull when implementing UrlTemplate.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |2 +
 modules/stream_filter/dash/mpd/SegmentTimeline.cpp |   59 
 modules/stream_filter/dash/mpd/SegmentTimeline.h   |   57 +++
 3 files changed, 118 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am 
b/modules/stream_filter/dash/Modules.am
index 5b03b9d..cdf7feb 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -45,6 +45,8 @@ SOURCES_stream_filter_dash = \
 mpd/Segment.h \
 mpd/SegmentInfo.cpp \
 mpd/SegmentInfo.h \
+mpd/SegmentTimeline.cpp \
+mpd/SegmentTimeline.h \
 mpd/TrickModeType.cpp \
 mpd/TrickModeType.h \
 xml/DOMHelper.cpp \
diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.cpp 
b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
new file mode 100644
index 000..c18e537
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
@@ -0,0 +1,59 @@
+/*
+ * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
+ *
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen 
+ *
+ * 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.
+ */
+
+#include "SegmentTimeline.h"
+
+#include 
+#include 
+
+using namespace dash::mpd;
+
+SegmentTimeline::SegmentTimeline() :
+timescale( -1 )
+{
+}
+
+SegmentTimeline::~SegmentTimeline()
+{
+vlc_delete_all( this->elements );
+}
+
+int dash::mpd::SegmentTimeline::getTimescale() const
+{
+return this->timescale;
+}
+
+void dash::mpd::SegmentTimeline::setTimescale(int timescale)
+{
+this->timescale = timescale;
+}
+
+void 
dash::mpd::SegmentTimeline::addElement(dash::mpd::SegmentTimeline::Element *e)
+{
+this->elements.push_back( e );
+}
+
+dash::mpd::SegmentTimeline::Element::Element() :
+r( 0 )
+{
+}
diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.h 
b/modules/stream_filter/dash/mpd/SegmentTimeline.h
new file mode 100644
index 000..f4df859
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.h
@@ -0,0 +1,57 @@
+/*
+ * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
+ *
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen 
+ *
+ * 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 SEGMENTTIMELINE_H
+#define SEGMENTTIMELINE_H
+
+#include 
+#include 
+
+namespace dash
+{
+namespace mpd
+{
+class SegmentTimeline
+{
+public:
+struct  Element
+{
+Element();
+   

[vlc-commits] dash: Parser: Ignore segments without sourceURL

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec 29 13:19:53 2011 +0100| [356cf412945f63a94568b5194425939d03d33dbc] | 
committer: Jean-Baptiste Kempf

dash: Parser: Ignore segments without sourceURL

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 6c40828..7ca943a 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -335,7 +335,8 @@ boolBasicCMParser::setSegments  (Node *root, 
SegmentInfo *info)
 {
 Segment *seg = new Segment();
 parseSegment( seg, segments.at(i)->getAttributes() );
-info->addSegment(seg);
+if ( seg->getSourceUrl().empty() == false )
+info->addSegment(seg);
 }
 return true;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Removing now unused ElementNotPresentException

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec 29 12:09:57 2011 +0100| [8cb5651435f0057519bac0e2a1ee9b20cef78c95] | 
committer: Jean-Baptiste Kempf

dash: Removing now unused ElementNotPresentException

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |1 -
 .../dash/exceptions/ElementNotPresentException.h   |   43 
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |   26 
 modules/stream_filter/dash/mpd/BasicCMManager.h|   15 +++
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |2 +-
 modules/stream_filter/dash/mpd/MPD.h   |1 -
 .../stream_filter/dash/mpd/ProgramInformation.h|1 -
 modules/stream_filter/dash/mpd/Representation.cpp  |1 -
 modules/stream_filter/dash/mpd/Representation.h|6 ++-
 modules/stream_filter/dash/mpd/SegmentInfo.cpp |1 -
 modules/stream_filter/dash/mpd/SegmentInfo.h   |1 -
 11 files changed, 21 insertions(+), 77 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am 
b/modules/stream_filter/dash/Modules.am
index 3003089..b0431c3 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -11,7 +11,6 @@ SOURCES_stream_filter_dash = \
 adaptationlogic/RateBasedAdaptationLogic.h \
 adaptationlogic/RateBasedAdaptationLogic.cpp \
 exceptions/AttributeNotPresentException.h \
-exceptions/ElementNotPresentException.h \
 exceptions/EOFException.h \
 http/Chunk.cpp \
 http/Chunk.h \
diff --git a/modules/stream_filter/dash/exceptions/ElementNotPresentException.h 
b/modules/stream_filter/dash/exceptions/ElementNotPresentException.h
deleted file mode 100644
index 7e2fc0f..000
--- a/modules/stream_filter/dash/exceptions/ElementNotPresentException.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * ElementNotPresentException.h
- *
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller 
- *  Christian Timmerer  
- *
- * 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 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 ELEMENTNOTPRESENTEXCEPTION_H_
-#define ELEMENTNOTPRESENTEXCEPTION_H_
-
-#include 
-
-namespace dash
-{
-namespace exception
-{
-class ElementNotPresentException : public std::exception
-{
-public:
-ElementNotPresentException() : std::exception() {}
-
-};
-}
-}
-
-#endif /* ELEMENTNOTPRESENTEXCEPTION_H_ */
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp 
b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
index 43519ab..90d65db 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
@@ -41,24 +41,14 @@ BasicCMManager::~BasicCMManager ()
 
 std::vector  BasicCMManager::getSegments (Representation 
*rep)
 {
-std::vector retSegments;
-try
-{
-SegmentInfo* info = rep->getSegmentInfo();
-Segment* initSegment = info->getInitSegment();
-
-retSegments.push_back(initSegment);
-
-std::vector segments = info->getSegments();
-
-for(size_t i = 0; i < segments.size(); i++)
-retSegments.push_back(segments.at(i));
-}
-catch(ElementNotPresentException &e)
-{
-/*TODO Debug */
-}
-
+std::vector  retSegments;
+SegmentInfo*info = rep->getSegmentInfo();
+Segment*initSegment = info->getInitSegment();
+
+if ( initSegment )
+retSegments.push_back( initSegment );
+retSegments.insert( retSegments.end(), info->getSegments().begin(),
+info->getSegments().end() );
 return retSegments;
 }
 const std::vector&BasicCMManager::getPeriods  () const
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.h 
b/modules/stream_filter/dash/mpd/BasicCMManager.h
in

[vlc-commits] dash: Removing now useless AttributeNotPresentException

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec 29 12:22:59 2011 +0100| [692fe79d54ee104f45c83af573c86bb2ad8d3d29] | 
committer: Jean-Baptiste Kempf

dash: Removing now useless AttributeNotPresentException

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |1 -
 .../dash/adaptationlogic/AbstractAdaptationLogic.h |1 -
 .../dash/exceptions/AttributeNotPresentException.h |   42 ---
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |   55 
 modules/stream_filter/dash/mpd/BasicCMManager.h|1 -
 modules/stream_filter/dash/mpd/Group.cpp   |1 -
 modules/stream_filter/dash/mpd/Group.h |1 -
 modules/stream_filter/dash/mpd/MPD.cpp |1 -
 modules/stream_filter/dash/mpd/MPD.h   |1 -
 .../stream_filter/dash/mpd/ProgramInformation.cpp  |1 -
 .../stream_filter/dash/mpd/ProgramInformation.h|2 -
 modules/stream_filter/dash/mpd/Representation.h|3 +-
 12 files changed, 24 insertions(+), 86 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=692fe79d54ee104f45c83af573c86bb2ad8d3d29
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Handling Group @subsegmentAlignmentFlag in parser.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec 29 10:55:31 2011 +0100| [18e70595f65640a48b3dd70486f8297fdb48cded] | 
committer: Jean-Baptiste Kempf

dash: Handling Group @subsegmentAlignmentFlag in parser.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |6 +-
 modules/stream_filter/dash/mpd/Group.cpp |   14 --
 modules/stream_filter/dash/mpd/Group.h   |   11 ++-
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index acafcb2..3c9bacd 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -149,12 +149,16 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 
 for(size_t i = 0; i < groups.size(); i++)
 {
-Group *group = new Group(groups.at(i)->getAttributes());
+const std::mapattr = 
groups.at(i)->getAttributes();
+Group *group = new Group();
 if ( this->parseCommonAttributesElements( groups.at( i ), group, NULL 
) == false )
 {
 delete group;
 continue ;
 }
+std::map::const_iterator  it = attr.find( 
"subsegmentAlignmentFlag" );
+if ( it != attr.end() && it->second == "true" )
+group->setSubsegmentAlignmentFlag( true ); //Otherwise it is false 
by default.
 this->setRepresentations(groups.at(i), group);
 period->addGroup(group);
 }
diff --git a/modules/stream_filter/dash/mpd/Group.cpp 
b/modules/stream_filter/dash/mpd/Group.cpp
index f8158f6..e090afb 100644
--- a/modules/stream_filter/dash/mpd/Group.cpp
+++ b/modules/stream_filter/dash/mpd/Group.cpp
@@ -30,8 +30,8 @@
 using namespace dash::mpd;
 using namespace dash::exception;
 
-Group::Group( const std::map&  attributes) :
-attributes( attributes )
+Group::Group() :
+subsegmentAlignmentFlag( false )
 {
 }
 
@@ -40,12 +40,14 @@ Group::~Group   ()
 vlc_delete_all( this->representations );
 }
 
-std::string Group::getSubSegmentAlignment   () 
throw(AttributeNotPresentException)
+boolGroup::getSubsegmentAlignmentFlag() const
 {
-if(this->attributes.find("subsegmentAlignmentFlag") == 
this->attributes.end())
-throw AttributeNotPresentException();
+return this->subsegmentAlignmentFlag;
+}
 
-return this->attributes["subsegmentAlignmentFlag"];
+void Group::setSubsegmentAlignmentFlag(bool alignment)
+{
+this->subsegmentAlignmentFlag = alignment;
 }
 
 std::vectorGroup::getRepresentations   ()
diff --git a/modules/stream_filter/dash/mpd/Group.h 
b/modules/stream_filter/dash/mpd/Group.h
index 124eff6..602b443 100644
--- a/modules/stream_filter/dash/mpd/Group.h
+++ b/modules/stream_filter/dash/mpd/Group.h
@@ -40,17 +40,18 @@ namespace dash
 class Group : public CommonAttributesElements
 {
 public:
-Group   (const std::map&  
attributes);
-virtual ~Group  ();
+Group();
+virtual ~Group();
 
-std::string getSubSegmentAlignment  () 
throw(dash::exception::AttributeNotPresentException);
+boolgetSubsegmentAlignmentFlag() 
const;
+voidsetSubsegmentAlignmentFlag( 
bool alignment );
 std::vector   getRepresentations  ();
 const Representation*   getRepresentationById   ( 
const std::string &id ) const;
 
-void addRepresentation  (Representation *rep);
+void addRepresentation( Representation *rep );
 
 private:
-std::map  attributes;
+boolsubsegmentAlignmentFlag;
 std::vector   representations;
 };
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Adding support for Representation's TrickMode element

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec 29 11:27:02 2011 +0100| [6f07eccd8d2d91de927d5cc69b64ac65a2ab060f] | 
committer: Jean-Baptiste Kempf

dash: Adding support for Representation's TrickMode element

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp  |   24 +++-
 modules/stream_filter/dash/mpd/BasicCMParser.h|1 +
 modules/stream_filter/dash/mpd/Representation.cpp |   13 +++---
 modules/stream_filter/dash/mpd/Representation.h   |   11 -
 modules/stream_filter/dash/mpd/TrickModeType.cpp  |   12 -
 modules/stream_filter/dash/mpd/TrickModeType.h|6 ++--
 6 files changed, 45 insertions(+), 22 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 3c9bacd..9b8655c 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -150,7 +150,7 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 for(size_t i = 0; i < groups.size(); i++)
 {
 const std::mapattr = 
groups.at(i)->getAttributes();
-Group *group = new Group();
+Group *group = new Group;
 if ( this->parseCommonAttributesElements( groups.at( i ), group, NULL 
) == false )
 {
 delete group;
@@ -164,6 +164,25 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 }
 }
 
+void BasicCMParser::parseTrickMode(Node *node, Representation *repr)
+{
+std::vector trickModes = DOMHelper::getElementByTagName(node, 
"TrickMode", false);
+
+if ( trickModes.size() == 0 )
+return ;
+if ( trickModes.size() > 1 )
+std::cerr << "More than 1 TrickMode element. Only the first one will 
be used." << std::endl;
+
+Node*   trickModeNode = trickModes[0];
+TrickModeType   *trickMode = new TrickModeType;
+const std::mapattr = 
trickModeNode->getAttributes();
+std::map::const_iteratorit = attr.find( 
"alternatePlayoutRate" );
+
+if ( it != attr.end() )
+trickMode->setAlternatePlayoutRate( atoi( it->second.c_str() ) );
+repr->setTrickMode( trickMode );
+}
+
 voidBasicCMParser::setRepresentations   (Node *root, Group *group)
 {
 std::vector representations = DOMHelper::getElementByTagName(root, 
"Representation", false);
@@ -249,9 +268,10 @@ boolBasicCMParser::setSegmentInfo   (Node *root, 
Representation *rep)
 if ( it != attr.end() )
 info->setDuration( str_duration( it->second.c_str() ) );
 
-rep->setSegmentInfo(info);
+rep->setSegmentInfo( info );
 return true;
 }
+std::cerr << "Missing mandatory element: Representation/SegmentInfo" << 
std::endl;
 return false;
 }
 
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index fbf808d..ba0d078 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -59,6 +59,7 @@ namespace dash
 boolsetMPD  ();
 voidsetPeriods  (dash::xml::Node *root);
 voidsetGroups   (dash::xml::Node *root, Period 
*period);
+voidparseTrickMode( dash::xml::Node *node, Representation 
*repr );
 voidsetRepresentations  (dash::xml::Node *root, Group 
*group);
 boolsetSegmentInfo  (dash::xml::Node *root, 
Representation *rep);
 voidsetInitSegment  (dash::xml::Node *root, 
SegmentInfo *info);
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp 
b/modules/stream_filter/dash/mpd/Representation.cpp
index f2dc348..535599c 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -68,22 +68,17 @@ voidRepresentation::setBandwidth( int bandwidth )
 this->bandwidth = bandwidth;
 }
 
-SegmentInfo*Representation::getSegmentInfo  () const 
throw(ElementNotPresentException)
+SegmentInfo*Representation::getSegmentInfo() const
 {
-if(this->segmentInfo == NULL)
-throw ElementNotPresentException();
-
 return this->segmentInfo;
 }
-TrickModeType*  Representation::getTrickModeType() const 
throw(ElementNotPresentException)
-{
-if(this->segmentInfo == NULL)
-throw ElementNotPresentException();
 
+TrickModeType*  Representation::getTrickModeType() const
+{
 return this->trickModeType;
 }
 
-voidRepresentation::setTrickModeType(TrickModeType 
*t

[vlc-commits] dash: Try to fetch mimeType attribute from the parent element.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 28 17:30:13 2011 +0100| [41f7cecbe29a0c91480fd2ea8859d927b43f66ec] | 
committer: Jean-Baptiste Kempf

dash: Try to fetch mimeType attribute from the parent element.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   15 ++-
 modules/stream_filter/dash/mpd/BasicCMParser.h   |4 +++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index dde4c9d..c1db5ad 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -150,7 +150,7 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 for(size_t i = 0; i < groups.size(); i++)
 {
 Group *group = new Group(groups.at(i)->getAttributes());
-if ( this->parseCommonAttributesElements( groups.at( i ), group ) == 
false )
+if ( this->parseCommonAttributesElements( groups.at( i ), group, NULL 
) == false )
 {
 delete group;
 continue ;
@@ -169,7 +169,7 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 const std::mapattributes = 
representations.at(i)->getAttributes();
 
 Representation *rep = new Representation( attributes );
-if ( this->parseCommonAttributesElements( representations.at( i ), rep 
) == false )
+if ( this->parseCommonAttributesElements( representations.at( i ), 
rep, group ) == false )
 {
 delete rep;
 continue ;
@@ -351,7 +351,7 @@ void BasicCMParser::parseContentDescriptor(Node *node, 
const std::string &name,
 }
 }
 
-boolBasicCMParser::parseCommonAttributesElements( Node *node, 
CommonAttributesElements *common) const
+boolBasicCMParser::parseCommonAttributesElements( Node *node, 
CommonAttributesElements *common, CommonAttributesElements *parent ) const
 {
 const std::map&attr = 
node->getAttributes();
 std::map::const_iterator  it;
@@ -359,8 +359,13 @@ boolBasicCMParser::parseCommonAttributesElements( Node 
*node, CommonAttribut
 it = attr.find( "mimeType" );
 if ( it == attr.end() )
 {
-std::cerr << "Missing mandatory attribute: @mimeType" << std::endl;
-return false;
+if ( parent && parent->getMimeType().empty() == false )
+common->setMimeType( parent->getMimeType() );
+else
+{
+std::cerr << "Missing mandatory attribute: @mimeType" << std::endl;
+return false;
+}
 }
 common->setMimeType( it->second );
 //Everything else is optionnal.
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index 9033e13..fbf808d 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -67,7 +67,9 @@ namespace dash
 voidparseContentDescriptor( xml::Node *node, const 
std::string &name,
 void 
(CommonAttributesElements::*addPtr)(ContentDescription*),
 CommonAttributesElements *self 
) const;
-boolparseCommonAttributesElements( dash::xml::Node *node, 
CommonAttributesElements *common ) const;
+boolparseCommonAttributesElements( dash::xml::Node *node,
+   
CommonAttributesElements *common,
+   
CommonAttributesElements *parent ) const;
 boolparseSegment( Segment *seg, const 
std::map &attr );
 ProgramInformation* parseProgramInformation();
 };

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Don't require the Representation @id. Many stream won't provide it.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 28 17:32:34 2011 +0100| [78822a604bee9d8dc0a08496d0a8755e414261fa] | 
committer: Jean-Baptiste Kempf

dash: Don't require the Representation @id. Many stream won't provide it.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index c1db5ad..acafcb2 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -178,12 +178,9 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 
 it = attributes.find( "id" );
 if ( it == attributes.end() )
-{
 std::cerr << "Missing mandatory attribute for Representation: @id" 
<< std::endl;
-delete rep;
-continue ;
-}
-rep->setId( it->second );
+else
+rep->setId( it->second );
 
 it = attributes.find( "bandwidth" );
 if ( it == attributes.end() )

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Reworking profile handling.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Fri 
Dec 30 17:37:51 2011 +0100| [a86490a48f619d51f616d94dad1e5ea46dbe84ce] | 
committer: Jean-Baptiste Kempf

dash: Reworking profile handling.

Adding Full2011 as a supported profile.
For other profiles, do not instantiate a NullManager.
Return NULL directly. This saves code and prevents us from maintaining an
extra interface implementation.
Also it prevents such problems :
http://forum.videolan.org/viewtopic.php?f=13&t=96335&p=320162

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |2 -
 modules/stream_filter/dash/mpd/IMPDManager.h   |4 +-
 modules/stream_filter/dash/mpd/MPD.cpp |6 +-
 .../stream_filter/dash/mpd/MPDManagerFactory.cpp   |   15 +++--
 modules/stream_filter/dash/mpd/MPDManagerFactory.h |1 -
 modules/stream_filter/dash/mpd/NullManager.cpp |   59 
 modules/stream_filter/dash/mpd/NullManager.h   |   56 ---
 7 files changed, 14 insertions(+), 129 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am 
b/modules/stream_filter/dash/Modules.am
index 92070dd..3003089 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -37,8 +37,6 @@ SOURCES_stream_filter_dash = \
 mpd/MPD.h \
 mpd/MPDManagerFactory.cpp \
 mpd/MPDManagerFactory.h \
-mpd/NullManager.cpp \
-mpd/NullManager.h \
 mpd/Period.cpp \
 mpd/Period.h \
 mpd/ProgramInformation.cpp \
diff --git a/modules/stream_filter/dash/mpd/IMPDManager.h 
b/modules/stream_filter/dash/mpd/IMPDManager.h
index 270928b..6bf16a7 100644
--- a/modules/stream_filter/dash/mpd/IMPDManager.h
+++ b/modules/stream_filter/dash/mpd/IMPDManager.h
@@ -19,10 +19,10 @@ namespace dash
 
 enum Profile
 {
-NotValid,
+UnknownProfile,
 Full2011,
 Basic,
-BasicCM,
+BasicCM
 };
 class IMPDManager
 {
diff --git a/modules/stream_filter/dash/mpd/MPD.cpp 
b/modules/stream_filter/dash/mpd/MPD.cpp
index 2973787..7f81586 100644
--- a/modules/stream_filter/dash/mpd/MPD.cpp
+++ b/modules/stream_filter/dash/mpd/MPD.cpp
@@ -31,7 +31,7 @@ using namespace dash::mpd;
 using namespace dash::exception;
 
 MPD::MPD () :
-profile( dash::mpd::NotValid ),
+profile( dash::mpd::UnknownProfile ),
 live( false ),
 availabilityStartTime( -1 ),
 availabilityEndTime( -1 ),
@@ -173,6 +173,8 @@ void MPD::setProfile( const std::string &strProfile )
 {
 if( strProfile == "urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm" )
 this->profile = dash::mpd::BasicCM;
+else if ( strProfile == "urn:mpeg:mpegB:profile:dash:full:2011" )
+this->profile = dash::mpd::Full2011;
 else
-this->profile = dash::mpd::NotValid;
+this->profile = dash::mpd::UnknownProfile;
 }
diff --git a/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp 
b/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
index ada43b2..cc79f29 100644
--- a/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
+++ b/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
@@ -35,16 +35,17 @@ IMPDManager* MPDManagerFactory::create( Node *root )
 BasicCMParser parser(root);
 
 if ( parser.parse() == false )
-return new NullManager();
+return NULL;
 
 Profile profile = parser.getMPD()->getProfile();
 switch( profile )
 {
-case mpd::Basic:return new NullManager();
-case mpd::BasicCM:  return new BasicCMManager( parser.getMPD() );
-case mpd::Full2011: return new NullManager();
-case mpd::NotValid: return new NullManager();
-
-default:return new NullManager();
+case mpd::BasicCM:
+case mpd::Full2011:
+return new BasicCMManager( parser.getMPD() );
+case mpd::Basic:
+case mpd::UnknownProfile:
+default:
+return NULL;
 }
 }
diff --git a/modules/stream_filter/dash/mpd/MPDManagerFactory.h 
b/modules/stream_filter/dash/mpd/MPDManagerFactory.h
index 31a3ba1..5c8114b 100644
--- a/modules/stream_filter/dash/mpd/MPDManagerFactory.h
+++ b/modules/stream_filter/dash/mpd/MPDManagerFactory.h
@@ -26,7 +26,6 @@
 #define MPDMANAGERFACTORY_H_
 
 #include "mpd/IMPDManager.h"
-#include "mpd/NullManager.h"
 #include "mpd/BasicCMManager.h"
 #include "mpd/BasicCMParser.h"
 #include "xml/Node.h"
diff --git a/modules/stream_filter/dash/mpd/NullManager.cpp 
b/modules/stream_filter/dash/mpd/NullManager.cpp
deleted file mode 100644
index 875cd9f..000
--- a/modules/stream_filter/dash/mpd/NullManager.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * NullManager.cpp
- *

[vlc-commits] dash: Removing useless using namespace;

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 28 15:51:53 2011 +0100| [9006d3ca90b997ff559a3f8e9bb70e73f425fc42] | 
committer: Jean-Baptiste Kempf

dash: Removing useless using namespace;

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/xml/DOMParser.cpp |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/dash/xml/DOMParser.cpp 
b/modules/stream_filter/dash/xml/DOMParser.cpp
index ab562f3..4a63d70 100644
--- a/modules/stream_filter/dash/xml/DOMParser.cpp
+++ b/modules/stream_filter/dash/xml/DOMParser.cpp
@@ -28,8 +28,6 @@
 #include "DOMParser.h"
 
 using namespace dash::xml;
-using namespace dash::http;
-using namespace dash::mpd;
 
 DOMParser::DOMParser(stream_t *stream) :
 root( NULL ),

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Handle parsing of ContentProtection, Accessibility, Rating and Viewpoint in CommonAttributesElements

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sun 
Dec 25 20:26:10 2011 +0100| [3f790f57d7cfefed4dd38ee97667b16dc8cc6418] | 
committer: Jean-Baptiste Kempf

dash: Handle parsing of ContentProtection, Accessibility, Rating and Viewpoint 
in CommonAttributesElements

All of these fields are of ContentDescription type, so
ContentProtection, Viewpoint, Rating and Accessibility classes are now
removed in favour of a unique class.
Moreover, the SchemeInformation is defined as a string by the standard.
Therefore, the SchemeInformation class has been removed.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |6 --
 modules/stream_filter/dash/mpd/Accessibility.h |   40 -
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |   39 +
 modules/stream_filter/dash/mpd/BasicCMParser.h |3 +
 .../dash/mpd/CommonAttributesElements.cpp  |   58 ---
 .../dash/mpd/CommonAttributesElements.h|   19 +--
 .../stream_filter/dash/mpd/ContentDescription.cpp  |   29 +++--
 .../stream_filter/dash/mpd/ContentDescription.h|   19 ++
 modules/stream_filter/dash/mpd/ContentProtection.h |   40 -
 modules/stream_filter/dash/mpd/Group.cpp   |   61 ++--
 modules/stream_filter/dash/mpd/Group.h |   16 -
 modules/stream_filter/dash/mpd/Rating.h|   40 -
 modules/stream_filter/dash/mpd/Representation.cpp  |5 +-
 modules/stream_filter/dash/mpd/Representation.h|3 -
 .../stream_filter/dash/mpd/SchemeInformation.cpp   |   38 
 modules/stream_filter/dash/mpd/SchemeInformation.h |   41 -
 modules/stream_filter/dash/mpd/Viewpoint.h |   40 -
 17 files changed, 128 insertions(+), 369 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=3f790f57d7cfefed4dd38ee97667b16dc8cc6418
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: XML: handle text nodes.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sun 
Dec 25 00:51:52 2011 +0100| [f36d6273bf67f2da64888e846102b095d2d8a443] | 
committer: Jean-Baptiste Kempf

dash: XML: handle text nodes.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/xml/DOMParser.cpp |   27 +-
 modules/stream_filter/dash/xml/Node.cpp  |   31 -
 modules/stream_filter/dash/xml/Node.h|5 
 3 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/modules/stream_filter/dash/xml/DOMParser.cpp 
b/modules/stream_filter/dash/xml/DOMParser.cpp
index 4736fba..ab562f3 100644
--- a/modules/stream_filter/dash/xml/DOMParser.cpp
+++ b/modules/stream_filter/dash/xml/DOMParser.cpp
@@ -74,24 +74,29 @@ Node*   DOMParser::processNode  ()
 {
 const char *data;
 int type = xml_ReaderNextNode(this->vlc_reader, &data);
-if(type != -1 && type != XML_READER_TEXT && type != XML_READER_NONE && 
type != XML_READER_ENDELEM)
+if(type != -1 && type != XML_READER_NONE && type != XML_READER_ENDELEM)
 {
 Node *node = new Node();
+node->setType( type );
 
-std::string name= data;
-boolisEmpty = xml_ReaderIsEmptyElement(this->vlc_reader);
-node->setName(name);
+if ( type != XML_READER_TEXT )
+{
+std::string name= data;
+boolisEmpty = xml_ReaderIsEmptyElement(this->vlc_reader);
+node->setName(name);
 
-this->addAttributesToNode(node);
+this->addAttributesToNode(node);
 
-if(isEmpty)
-return node;
+if(isEmpty)
+return node;
 
-Node *subnode = NULL;
-
-while((subnode = this->processNode()) != NULL)
-node->addSubNode(subnode);
+Node *subnode = NULL;
 
+while((subnode = this->processNode()) != NULL)
+node->addSubNode(subnode);
+}
+else
+node->setText( data );
 return node;
 }
 return NULL;
diff --git a/modules/stream_filter/dash/xml/Node.cpp 
b/modules/stream_filter/dash/xml/Node.cpp
index fe8c4ca..8e90e7e 100644
--- a/modules/stream_filter/dash/xml/Node.cpp
+++ b/modules/stream_filter/dash/xml/Node.cpp
@@ -27,11 +27,16 @@
 
 #include "Node.h"
 
+#include 
+#include 
+#include 
+
 using namespace dash::xml;
 
 const std::string   Node::EmptyString = "";
 
-Node::Node  ()
+Node::Node() :
+type( -1 )
 {
 }
 Node::~Node ()
@@ -89,9 +94,31 @@ boolNode::hasText
   () const
 
 const std::string& Node::getText   () const
 {
-return EmptyString;
+if ( this->type == XML_READER_TEXT )
+return this->text;
+else
+{
+assert( this->subNodes.size() == 1 );
+return this->subNodes[0]->getText();
+}
+}
+
+void Node::setText(const std::string &text)
+{
+this->text = text;
 }
+
 const std::map&   Node::getAttributes () const
 {
 return this->attributes;
 }
+
+int Node::getType() const
+{
+return this->type;
+}
+
+void Node::setType(int type)
+{
+this->type = type;
+}
diff --git a/modules/stream_filter/dash/xml/Node.h 
b/modules/stream_filter/dash/xml/Node.h
index e4973a5..f11662f 100644
--- a/modules/stream_filter/dash/xml/Node.h
+++ b/modules/stream_filter/dash/xml/Node.h
@@ -49,13 +49,18 @@ namespace dash
 std::vectorgetAttributeKeys() 
const;
 boolhasText () 
const;
 const std::string&  getText () 
const;
+voidsetText( const std::string 
&text );
 const std::map& getAttributes () 
const;
+int getType() const;
+voidsetType( int type );
 
 private:
 static const std::stringEmptyString;
 std::vector subNodes;
 std::map  attributes;
 std::string name;
+std::string text;
+int type;
 
 };
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Don't use the module when MPD parsing failed.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sun 
Dec 25 01:11:52 2011 +0100| [ecfa2b89cba290ffce7ab514a4c6558b6987f045] | 
committer: Jean-Baptiste Kempf

dash: Don't use the module when MPD parsing failed.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/dash.cpp |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/dash.cpp 
b/modules/stream_filter/dash/dash.cpp
index 68e4c95..45c1905 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -101,6 +101,14 @@ static int Open(vlc_object_t *p_obj)
 new dash::DASHManager( p_conManager, p_node,
   dash::logic::IAdaptationLogic::RateBased );
 
+if ( p_dashManager->getMpdManager()->getMPD() == NULL )
+{
+msg_Err( p_obj, "MPD file parsing failed." );
+delete p_conManager;
+delete p_dashManager;
+free( p_sys );
+return VLC_EGENERIC;
+}
 p_sys->p_dashManager= p_dashManager;
 p_sys->p_node   = p_node;
 p_sys->p_conManager = p_conManager;

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Reworking ProgramInfo parsing.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sun 
Dec 25 00:14:23 2011 +0100| [b247a3a61a3b465f5e15d4af662d7d484b3ce2c5] | 
committer: Jean-Baptiste Kempf

dash: Reworking ProgramInfo parsing.

Information are now computed once at parsing time.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |   24 +
 modules/stream_filter/dash/mpd/BasicCMParser.h |1 +
 modules/stream_filter/dash/mpd/MPD.cpp |6 +--
 modules/stream_filter/dash/mpd/MPD.h   |6 +-
 .../stream_filter/dash/mpd/ProgramInformation.cpp  |   53 
 .../stream_filter/dash/mpd/ProgramInformation.h|   27 +-
 6 files changed, 64 insertions(+), 53 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index cdab94a..fdf463c 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -116,6 +116,7 @@ boolBasicCMParser::setMPD()
 
 this->setMPDBaseUrl(this->root);
 this->setPeriods(this->root);
+this->mpd->setProgramInformation( this->parseProgramInformation() );
 return true;
 }
 voidBasicCMParser::setMPDBaseUrl(Node *root)
@@ -263,6 +264,29 @@ bool BasicCMParser::parseSegment(Segment *seg, const 
std::maproot, 
"ProgramInformation" );
+if ( pInfoNode == NULL )
+return NULL;
+ProgramInformation  *pInfo = new ProgramInformation;
+const std::mapattr = 
pInfoNode->getAttributes();
+std::map::const_iterator  it;
+it = attr.find( "moreInformationURL" );
+if ( it != attr.end() )
+pInfo->setMoreInformationUrl( it->second );
+Node*   title = DOMHelper::getFirstChildElementByName( pInfoNode, "Title" 
);
+if ( title )
+pInfo->setTitle( title->getText() );
+Node*   source = DOMHelper::getFirstChildElementByName( pInfoNode, 
"Source" );
+if ( source )
+pInfo->setSource( source->getText() );
+Node*   copyright = DOMHelper::getFirstChildElementByName( pInfoNode, 
"copyright" );
+if ( copyright )
+pInfo->setCopyright( copyright->getText() );
+return pInfo;
+}
+
 voidBasicCMParser::setInitSegment   (Node *root, SegmentInfo *info)
 {
 const std::vector initSeg = 
DOMHelper::getChildElementByTagName(root, "InitialisationSegmentURL");
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index 9b1d4ad..cfc3847 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -66,6 +66,7 @@ namespace dash
 voidsetMPDBaseUrl   (dash::xml::Node *root);
 boolparseCommonAttributesElements( dash::xml::Node *node, 
CommonAttributesElements *common ) const;
 boolparseSegment( Segment *seg, const 
std::map &attr );
+ProgramInformation* parseProgramInformation();
 };
 }
 }
diff --git a/modules/stream_filter/dash/mpd/MPD.cpp 
b/modules/stream_filter/dash/mpd/MPD.cpp
index 40a84a3..2973787 100644
--- a/modules/stream_filter/dash/mpd/MPD.cpp
+++ b/modules/stream_filter/dash/mpd/MPD.cpp
@@ -109,13 +109,11 @@ void MPD::setTimeShiftBufferDepth(time_t depth)
 this->timeShiftBufferDepth = depth;
 }
 
-ProgramInformation* MPD::getProgramInformation  () 
throw(ElementNotPresentException)
+const ProgramInformation* MPD::getProgramInformation  () const
 {
-if(this->programInfo == NULL)
-throw ElementNotPresentException();
-
 return this->programInfo;
 }
+
 voidMPD::addBaseUrl (BaseUrl *url)
 {
 this->baseUrls.push_back(url);
diff --git a/modules/stream_filter/dash/mpd/MPD.h 
b/modules/stream_filter/dash/mpd/MPD.h
index c55b534..4acd9bc 100644
--- a/modules/stream_filter/dash/mpd/MPD.h
+++ b/modules/stream_filter/dash/mpd/MPD.h
@@ -63,9 +63,9 @@ namespace dash
 voidsetMinBufferTime( time_t time 
);
 time_t  getTimeShiftBufferDepth() 
const;
 voidsetTimeShiftBufferDepth( 
time_t depth );
-const std::vector&  getBaseUrls  () const;
-const std::vector&   getPeriods   () const;
-ProgramInformation* getProgramInformation   () 
throw(dash::exception::ElementNotPresentException);
+const std::vector&   getBaseUrls() const;
+const std::vector&getPeriods() const;
+const ProgramInformation*   getProgramInformation() const;
 
 voidaddPeriod   (Period *period);

[vlc-commits] dash: Don't crash when XML parsing fails.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sun 
Dec 25 00:50:52 2011 +0100| [89c2aa13ad86fe68d833cbe8b7a145c3f4c62df0] | 
committer: Jean-Baptiste Kempf

dash: Don't crash when XML parsing fails.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/xml/DOMParser.cpp |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/xml/DOMParser.cpp 
b/modules/stream_filter/dash/xml/DOMParser.cpp
index a860236..4736fba 100644
--- a/modules/stream_filter/dash/xml/DOMParser.cpp
+++ b/modules/stream_filter/dash/xml/DOMParser.cpp
@@ -65,6 +65,8 @@ boolDOMParser::parse()
 return false;
 
 this->root = this->processNode();
+if ( this->root == NULL )
+return false;
 
 return true;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Reworking segments.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sat 
Dec 24 15:02:37 2011 +0100| [227e3c35225303bf5ef0039e21f798238a7f4d6b] | 
committer: Jean-Baptiste Kempf

dash: Reworking segments.

- Don't differenciate InitSegment and Segment, as the standard define
  them as the same type
- therefore, removing ISegment
- reworking attribut parsing (to be completely handled later)

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |3 -
 .../dash/adaptationlogic/AbstractAdaptationLogic.h |1 -
 .../adaptationlogic/AlwaysBestAdaptationLogic.cpp  |2 +-
 .../adaptationlogic/AlwaysBestAdaptationLogic.h|3 +-
 .../adaptationlogic/RateBasedAdaptationLogic.cpp   |2 +-
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |8 ++--
 modules/stream_filter/dash/mpd/BasicCMManager.h|4 +-
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |   23 +++--
 modules/stream_filter/dash/mpd/BasicCMParser.h |2 +-
 modules/stream_filter/dash/mpd/IMPDManager.h   |3 +-
 modules/stream_filter/dash/mpd/ISegment.h  |   45 -
 modules/stream_filter/dash/mpd/InitSegment.cpp |   48 --
 modules/stream_filter/dash/mpd/InitSegment.h   |   52 
 modules/stream_filter/dash/mpd/NullManager.cpp |2 +-
 modules/stream_filter/dash/mpd/NullManager.h   |5 +-
 modules/stream_filter/dash/mpd/Segment.cpp |   16 ++
 modules/stream_filter/dash/mpd/Segment.h   |   15 ++
 modules/stream_filter/dash/mpd/SegmentInfo.cpp |4 +-
 modules/stream_filter/dash/mpd/SegmentInfo.h   |   11 ++--
 19 files changed, 49 insertions(+), 200 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=227e3c35225303bf5ef0039e21f798238a7f4d6b
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Reworking the way MPD profile is handled

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sat 
Dec 24 15:30:28 2011 +0100| [ce3925e9cf3fb23fe8bda6b75d464fe81bf3c8be] | 
committer: Jean-Baptiste Kempf

dash: Reworking the way MPD profile is handled

It's not the job of the DOMParser to compute a Dash profile. Let the
dash parser handle it.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/DASHManager.cpp |5 +--
 modules/stream_filter/dash/DASHManager.h   |3 +-
 modules/stream_filter/dash/dash.cpp|5 +--
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |8 +-
 modules/stream_filter/dash/mpd/MPD.cpp |   22 +-
 modules/stream_filter/dash/mpd/MPD.h   |5 
 .../stream_filter/dash/mpd/MPDManagerFactory.cpp   |   24 +++
 modules/stream_filter/dash/mpd/MPDManagerFactory.h |5 +---
 modules/stream_filter/dash/xml/DOMParser.cpp   |8 --
 modules/stream_filter/dash/xml/DOMParser.h |1 -
 10 files changed, 48 insertions(+), 38 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp 
b/modules/stream_filter/dash/DASHManager.cpp
index 3941648..cf4d133 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -34,13 +34,12 @@ using namespace dash::logic;
 using namespace dash::mpd;
 using namespace dash::exception;
 
-DASHManager::DASHManager(HTTPConnectionManager *conManager, Node *node, 
IAdaptationLogic::LogicType type, Profile profile)
+DASHManager::DASHManager( HTTPConnectionManager *conManager, Node *node, 
IAdaptationLogic::LogicType type )
 {
 this->conManager= conManager;
 this->node  = node;
 this->logicType = type;
-this->profile   = profile;
-this->mpdManager= mpd::MPDManagerFactory::create(this->profile, 
this->node);
+this->mpdManager= mpd::MPDManagerFactory::create(this->node);
 this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, 
this->mpdManager );
 this->currentChunk  = NULL;
 
diff --git a/modules/stream_filter/dash/DASHManager.h 
b/modules/stream_filter/dash/DASHManager.h
index 8a60262..13a3346 100644
--- a/modules/stream_filter/dash/DASHManager.h
+++ b/modules/stream_filter/dash/DASHManager.h
@@ -38,7 +38,7 @@ namespace dash
 class DASHManager
 {
 public:
-DASHManager (http::HTTPConnectionManager *conManager, 
xml::Node *node, logic::IAdaptationLogic::LogicType type, mpd::Profile profile);
+DASHManager (http::HTTPConnectionManager *conManager, 
xml::Node *node, logic::IAdaptationLogic::LogicType type);
 virtual ~DASHManager();
 
 int read(void *p_buffer, size_t len);
@@ -50,7 +50,6 @@ namespace dash
 http::Chunk *currentChunk;
 logic::IAdaptationLogic *adaptationLogic;
 logic::IAdaptationLogic::LogicType  logicType;
-mpd::Profileprofile;
 xml::Node   *node;
 mpd::IMPDManager*mpdManager;
 };
diff --git a/modules/stream_filter/dash/dash.cpp 
b/modules/stream_filter/dash/dash.cpp
index 896550d..68e4c95 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -98,9 +98,8 @@ static int Open(vlc_object_t *p_obj)
 new dash::http::HTTPConnectionManager(p_stream);
 dash::xml::Node *p_node = parser.getRootNode();
 dash::DASHManager*p_dashManager =
-new dash::DASHManager(p_conManager, p_node,
-  dash::logic::IAdaptationLogic::RateBased,
-  parser.getProfile(p_node));
+new dash::DASHManager( p_conManager, p_node,
+  dash::logic::IAdaptationLogic::RateBased );
 
 p_sys->p_dashManager= p_dashManager;
 p_sys->p_node   = p_node;
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 786c378..7f6b273 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -51,7 +51,13 @@ boolBasicCMParser::parse()
 }
 voidBasicCMParser::setMPD   ()
 {
-this->mpd = new MPD(this->root->getAttributes());
+const std::mapattr = 
this->root->getAttributes();
+this->mpd = new MPD( attr );
+
+std::map::const_iterator  it;
+it = attr.find( "profile" );
+if ( it != attr.end() )
+this->mpd->setProfile( it->second );
 this->setMPDBaseUrl(this->root);
 this->setPeriods(this->root);
 }
d

[vlc-commits] dash: Reworking MPD attributes parsing.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Sat 
Dec 24 19:14:56 2011 +0100| [807ac284c8bda62dfd20c22a5a00b1b54385e58a] | 
committer: Jean-Baptiste Kempf

dash: Reworking MPD attributes parsing.

Mandatory elements are now checked.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   61 ++-
 modules/stream_filter/dash/mpd/BasicCMParser.h   |2 +-
 modules/stream_filter/dash/mpd/MPD.cpp   |   90 +-
 modules/stream_filter/dash/mpd/MPD.h |   29 +--
 4 files changed, 154 insertions(+), 28 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=807ac284c8bda62dfd20c22a5a00b1b54385e58a
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Group: Adding a getter for Representation by id.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 21 23:34:09 2011 +0100| [0af2e5c2c1845e5eaac3f3172acfe24f8fa2d2e3] | 
committer: Jean-Baptiste Kempf

dash: Group: Adding a getter for Representation by id.

This will be used to implement @dependencyId

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/Group.cpp |   14 ++
 modules/stream_filter/dash/mpd/Group.h   |1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/Group.cpp 
b/modules/stream_filter/dash/mpd/Group.cpp
index 69d2787..0eebada 100644
--- a/modules/stream_filter/dash/mpd/Group.cpp
+++ b/modules/stream_filter/dash/mpd/Group.cpp
@@ -84,6 +84,20 @@ std::vectorGroup::getRepresentations
   ()
 return this->representations;
 }
 
+const Representation *Group::getRepresentationById(const std::string &id) const
+{
+std::vector::const_iteratorit = 
this->representations.begin();
+std::vector::const_iteratorend = 
this->representations.end();
+
+while ( it != end )
+{
+if ( (*it)->getId() == id )
+return *it;
+++it;
+}
+return NULL;
+}
+
 voidGroup::addRepresentation
(Representation *rep)
 {
 this->representations.push_back(rep);
diff --git a/modules/stream_filter/dash/mpd/Group.h 
b/modules/stream_filter/dash/mpd/Group.h
index 2fb8ae1..28c0710 100644
--- a/modules/stream_filter/dash/mpd/Group.h
+++ b/modules/stream_filter/dash/mpd/Group.h
@@ -50,6 +50,7 @@ namespace dash
 
 std::string getSubSegmentAlignment  () 
throw(dash::exception::AttributeNotPresentException);
 std::vector   getRepresentations  ();
+const Representation*   getRepresentationById   ( 
const std::string &id ) const;
 Viewpoint*  getViewpoint() 
throw(dash::exception::ElementNotPresentException);
 Accessibility*  getAccessibility() 
throw(dash::exception::ElementNotPresentException);
 Rating* getRating   () 
throw(dash::exception::ElementNotPresentException);

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: BasicCMParser: Handle Representation @dependencyId

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 21 23:46:15 2011 +0100| [9db9d6b9c8575a4836a8142b93ce089d83bdb541] | 
committer: Jean-Baptiste Kempf

dash: BasicCMParser: Handle Representation @dependencyId

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp  |   23 +++-
 modules/stream_filter/dash/mpd/BasicCMParser.h|3 ++
 modules/stream_filter/dash/mpd/Representation.cpp |   20 ++
 modules/stream_filter/dash/mpd/Representation.h   |4 ++-
 4 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 33bdd5f..6c37dc8 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -99,7 +99,6 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 {
 const std::mapattributes = 
representations.at(i)->getAttributes();
 
-//FIXME: handle @dependencyId afterward
 Representation *rep = new Representation( attributes );
 if ( this->parseCommonAttributesElements( representations.at( i ), rep 
) == false )
 {
@@ -130,11 +129,31 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 if ( it != attributes.end() )
 rep->setQualityRanking( atoi( it->second.c_str() ) );
 
+it = attributes.find( "dependencyId" );
+if ( it != attributes.end() )
+this->handleDependencyId( rep, group, it->second );
+
 this->setSegmentInfo(representations.at(i), rep);
 if ( rep->getSegmentInfo() && 
rep->getSegmentInfo()->getSegments().size() > 0 )
-group->addRepresentation(rep);
+group->addRepresentation(rep);
+}
+}
+
+voidBasicCMParser::handleDependencyId( Representation *rep, const Group 
*group, const std::string &dependencyId )
+{
+if ( dependencyId.empty() == true )
+return ;
+std::istringstream  s( dependencyId );
+while ( s )
+{
+std::string id;
+s >> id;
+const Representation*dep = group->getRepresentationById( id );
+if ( dep )
+rep->addDependency( dep );
 }
 }
+
 voidBasicCMParser::setSegmentInfo   (Node *root, Representation *rep)
 {
 Node*segmentInfo = DOMHelper::getFirstChildElementByName( root, 
"SegmentInfo");
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index e8ad31e..2c867dc 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -51,6 +51,9 @@ namespace dash
 MPD*getMPD ();
 
 private:
+voidhandleDependencyId( Representation* rep, const Group* 
group, const std::string& dependencyId );
+
+private:
 dash::xml::Node *root;
 MPD *mpd;
 
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp 
b/modules/stream_filter/dash/mpd/Representation.cpp
index b4774de..debd9f5 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -46,15 +46,6 @@ Representation::~Representation ()
 delete(this->trickModeType);
 }
 
-std::string Representation::getDependencyId () const 
throw(AttributeNotPresentException)
-{
-std::map::const_iterator  it = 
this->attributes.find("dependencyId");
-if ( it == this->attributes.end() )
-throw AttributeNotPresentException();
-
-return it->second;
-}
-
 const std::string&  Representation::getId   () const
 {
 return this->id;
@@ -116,3 +107,14 @@ void Representation::setQualityRanking( int qualityRanking 
)
 if ( qualityRanking > 0 )
 this->qualityRanking = qualityRanking;
 }
+
+const std::list& Representation::getDependencies() 
const
+{
+return this->dependencies;
+}
+
+void Representation::addDependency(const Representation *dep)
+{
+if ( dep != NULL )
+this->dependencies.push_back( dep );
+}
diff --git a/modules/stream_filter/dash/mpd/Representation.h 
b/modules/stream_filter/dash/mpd/Representation.h
index 992f693..162384e 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -55,7 +55,8 @@ namespace dash
 voidsetBandwidth( int bandwidth );
 int getQualityRanking   () const;
 voidsetQualityRanking   ( int 
qualityRanking );
-std::string getDependencyId   

[vlc-commits] dash: Basic CM parser: Parse some Representation attributes

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 21 23:31:21 2011 +0100| [f67415dd2830a66254d94d40193a3c073c4b8a64] | 
committer: Jean-Baptiste Kempf

dash: Basic CM parser: Parse some Representation attributes

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   24 ++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 3fa36b6..33bdd5f 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -106,6 +106,30 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 delete rep;
 continue ;
 }
+std::map::const_iterator  it;
+
+it = attributes.find( "id" );
+if ( it == attributes.end() )
+{
+std::cerr << "Missing mandatory attribute for Representation: @id" 
<< std::endl;
+delete rep;
+continue ;
+}
+rep->setId( it->second );
+
+it = attributes.find( "bandwidth" );
+if ( it == attributes.end() )
+{
+std::cerr << "Missing mandatory attribute for Representation: 
@bandwidth" << std::endl;
+delete rep;
+continue ;
+}
+rep->setBandwidth( atoi( it->second.c_str() ) );
+
+it = attributes.find( "qualityRanking" );
+if ( it != attributes.end() )
+rep->setQualityRanking( atoi( it->second.c_str() ) );
+
 this->setSegmentInfo(representations.at(i), rep);
 if ( rep->getSegmentInfo() && 
rep->getSegmentInfo()->getSegments().size() > 0 )
 group->addRepresentation(rep);

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Group element contains the "common" attributes/elements

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Dec 20 00:14:00 2011 +0100| [998ddf245da00aa3f8a2e478c4af955eefeccc28] | 
committer: Jean-Baptiste Kempf

dash: Group element contains the "common" attributes/elements

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |5 +
 modules/stream_filter/dash/mpd/Group.cpp |   88 --
 modules/stream_filter/dash/mpd/Group.h   |   15 +---
 3 files changed, 22 insertions(+), 86 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 7d162e3..071dc49 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -80,6 +80,11 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 for(size_t i = 0; i < groups.size(); i++)
 {
 Group *group = new Group(groups.at(i)->getAttributes());
+if ( this->parseCommonAttributesElements( groups.at( i ), group ) == 
false )
+{
+delete group;
+continue ;
+}
 this->setRepresentations(groups.at(i), group);
 period->addGroup(group);
 }
diff --git a/modules/stream_filter/dash/mpd/Group.cpp 
b/modules/stream_filter/dash/mpd/Group.cpp
index 5178ddf..69d2787 100644
--- a/modules/stream_filter/dash/mpd/Group.cpp
+++ b/modules/stream_filter/dash/mpd/Group.cpp
@@ -27,14 +27,15 @@
 using namespace dash::mpd;
 using namespace dash::exception;
 
-Group::Group(std::map  attributes)
+Group::Group( const std::map&  attributes) :
+attributes( attributes ),
+contentProtection( NULL ),
+accessibility( NULL ),
+viewpoint( NULL ),
+rating( NULL )
 {
-this->attributes= attributes;
-this->contentProtection = NULL;
-this->accessibility = NULL;
-this->viewpoint = NULL;
-this->rating= NULL;
 }
+
 Group::~Group   ()
 {
 for(size_t i = 1; i < this->representations.size(); i++)
@@ -46,55 +47,6 @@ Group::~Group   ()
 delete(this->accessibility);
 }
 
-std::string Group::getWidth () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("width") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["width"];
-}
-std::string Group::getNumberOfChannels  () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("numberOfChannels") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["numberOfChannels"];
-}
-std::string Group::getLang  () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("lang") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["lang"];
-}
-std::string Group::getParY  () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("pary") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["pary"];
-}
-std::string Group::getParX  () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("parx") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["parx"];
-}
-std::string Group::getSamplingRate  () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("samplingRate") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["samplingRate"];
-}
-std::string Group::getMimeType  () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("mimeType") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["mimeType"];
-}
 std::string Group::getSubSegmentAlignment   () 
throw(AttributeNotPresentException)
 {
 if(this->attributes.find("subsegmentAlignmentFlag") == 
this->attributes.end())
@@ -102,20 +54,7 @@ std::string 
Group::getSubSegmentAlignment   () throw(Attribu
 
 return this->attributes["subsegmentAlignmentFlag"];
 }
-std::string Group::getFrameRate () 
throw(AttributeNotPresentException)
-{
-if(this->attributes.find("frameRate") == this->attributes.end())
-throw AttributeNotPresentException();
-
-return this->attributes["frameRate"];
-}
-std::string Group::getHeight() 
throw(AttributeNotPresentException)
-{
-if(this->att

[vlc-commits] dash: Adding some basic getters to Representation

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 21 23:20:18 2011 +0100| [93049b0934584adb0d6e6aa7c3449a409020f85c] | 
committer: Jean-Baptiste Kempf

dash: Adding some basic getters to Representation

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp  |3 ++
 modules/stream_filter/dash/mpd/Representation.cpp |   39 ++--
 modules/stream_filter/dash/mpd/Representation.h   |   10 -
 3 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 071dc49..3fa36b6 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -73,6 +73,7 @@ voidBasicCMParser::setPeriods   (Node *root)
 this->mpd->addPeriod(period);
 }
 }
+
 voidBasicCMParser::setGroups(Node *root, Period *period)
 {
 std::vector groups = DOMHelper::getElementByTagName(root, "Group", 
false);
@@ -89,6 +90,7 @@ voidBasicCMParser::setGroups(Node *root, 
Period *period)
 period->addGroup(group);
 }
 }
+
 voidBasicCMParser::setRepresentations   (Node *root, Group *group)
 {
 std::vector representations = DOMHelper::getElementByTagName(root, 
"Representation", false);
@@ -97,6 +99,7 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 {
 const std::mapattributes = 
representations.at(i)->getAttributes();
 
+//FIXME: handle @dependencyId afterward
 Representation *rep = new Representation( attributes );
 if ( this->parseCommonAttributesElements( representations.at( i ), rep 
) == false )
 {
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp 
b/modules/stream_filter/dash/mpd/Representation.cpp
index 91bb1e7..b4774de 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -33,6 +33,7 @@ using namespace dash::mpd;
 using namespace dash::exception;
 
 Representation::Representation  (const std::map&  
attributes) :
+qualityRanking( -1 ),
 attributes( attributes ),
 segmentInfo( NULL ),
 trickModeType( NULL )
@@ -52,26 +53,28 @@ std::string Representation::getDependencyId 
() const throw(Attri
 throw AttributeNotPresentException();
 
 return it->second;
-
 }
-std::string Representation::getId   () const 
throw(AttributeNotPresentException)
-{
-std::map::const_iterator  it = 
this->attributes.find("id");
-if ( it == this->attributes.end())
-throw AttributeNotPresentException();
 
-return it->second;
+const std::string&  Representation::getId   () const
+{
+return this->id;
+}
 
+voidRepresentation::setId(const std::string &id)
+{
+if ( id.empty() == false )
+this->id = id;
 }
 
 int Representation::getBandwidth() const
 {
-std::map::const_iterator  it = 
this->attributes.find("bandwidth");
-if ( it == this->attributes.end())
-return -1;
-
-return atoi( it->second.c_str() ) / 8;
+return this->bandwidth;
+}
 
+voidRepresentation::setBandwidth( int bandwidth )
+{
+if ( bandwidth >= 0 )
+this->bandwidth = bandwidth;
 }
 
 SegmentInfo*Representation::getSegmentInfo  () const 
throw(ElementNotPresentException)
@@ -101,3 +104,15 @@ voidRepresentation::setSegmentInfo 
 (SegmentInfo *info)
 {
 this->segmentInfo = info;
 }
+
+
+int Representation::getQualityRanking() const
+{
+return this->qualityRanking;
+}
+
+void Representation::setQualityRanking( int qualityRanking )
+{
+if ( qualityRanking > 0 )
+this->qualityRanking = qualityRanking;
+}
diff --git a/modules/stream_filter/dash/mpd/Representation.h 
b/modules/stream_filter/dash/mpd/Representation.h
index eea176d..992f693 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -44,13 +44,17 @@ namespace dash
 Representation  ( const std::map&  attributes);
 virtual ~Representation ();
 
-std::string getId   () const 
throw(dash::exception::AttributeNotPresentException);
+const std::string&  getId   () const;
+voidsetId   ( const 
std::string &id );
 /*
  *  @return The bitrate required for this representation
  *  in Bytes per seconds.
  *  -1 if an error occurs.
  */
 int 

[vlc-commits] dash: Don't hardcode the isLive information.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Mon 
Nov 28 17:31:37 2011 +0100| [bac93c6f9a06f53260e6e51f7a609d8df3a6bd41] | 
committer: Jean-Baptiste Kempf

dash: Don't hardcode the isLive information.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/dash.cpp   |2 +-
 modules/stream_filter/dash/mpd/BasicCMManager.cpp |5 +
 modules/stream_filter/dash/mpd/BasicCMManager.h   |1 +
 modules/stream_filter/dash/mpd/IMPDManager.h  |3 +++
 modules/stream_filter/dash/mpd/MPD.cpp|   19 +++
 modules/stream_filter/dash/mpd/MPD.h  |2 +-
 6 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/modules/stream_filter/dash/dash.cpp 
b/modules/stream_filter/dash/dash.cpp
index 6c33bd8..896550d 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -106,7 +106,7 @@ static int Open(vlc_object_t *p_obj)
 p_sys->p_node   = p_node;
 p_sys->p_conManager = p_conManager;
 p_sys->position = 0;
-p_sys->isLive   = true;
+p_sys->isLive   = 
p_dashManager->getMpdManager()->getMPD()->isLive();
 p_stream->p_sys = p_sys;
 p_stream->pf_read   = Read;
 p_stream->pf_peek   = Peek;
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp 
b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
index 4a488c6..235a0a5 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
@@ -158,3 +158,8 @@ Period* BasicCMManager::getNextPeriod   
(Period *period)
 
 return NULL;
 }
+
+const MPD*  BasicCMManager::getMPD() const
+{
+return this->mpd;
+}
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.h 
b/modules/stream_filter/dash/mpd/BasicCMManager.h
index ee8072a..e27dc10 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.h
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.h
@@ -57,6 +57,7 @@ namespace dash
 Representation* getBestRepresentation   (Period 
*period);
 std::vector getSegments 
(Representation *rep);
 Representation* getRepresentation   (Period 
*period, long bitrate);
+const MPD*  getMPD  () const;
 
 private:
 MPD *mpd;
diff --git a/modules/stream_filter/dash/mpd/IMPDManager.h 
b/modules/stream_filter/dash/mpd/IMPDManager.h
index c5a3e6e..de264f8 100644
--- a/modules/stream_filter/dash/mpd/IMPDManager.h
+++ b/modules/stream_filter/dash/mpd/IMPDManager.h
@@ -16,6 +16,8 @@ namespace dash
 {
 namespace mpd
 {
+class MPD;
+
 enum Profile
 {
 NotValid,
@@ -32,6 +34,7 @@ namespace dash
 virtual Representation* getBestRepresentation   
(Period *period)= 0;
 virtual std::vector getSegments 
(Representation *rep)   = 0;
 virtual Representation* getRepresentation   
(Period *period, long bitrate)  = 0;
+virtual const MPD*  getMPD  () 
const = 0;
 virtual ~IMPDManager(){}
 };
 }
diff --git a/modules/stream_filter/dash/mpd/MPD.cpp 
b/modules/stream_filter/dash/mpd/MPD.cpp
index 46addc5..309cbbd 100644
--- a/modules/stream_filter/dash/mpd/MPD.cpp
+++ b/modules/stream_filter/dash/mpd/MPD.cpp
@@ -65,14 +65,6 @@ const std::string& MPD::getMinBufferTime   
() const throw(Attrib
 return it->second;
 }
 
-const std::string& MPD::getType() const 
throw(AttributeNotPresentException)
-{
-AttributesMap::const_iterator it = this->attributes.find( "type" );
-if( it == this->attributes.end() )
-throw AttributeNotPresentException();
-
-return it->second;
-}
 const std::string& MPD::getDuration() const 
throw(AttributeNotPresentException)
 {
 AttributesMap::const_iterator it = 
this->attributes.find("mediaPresentationDuration");
@@ -101,3 +93,14 @@ voidMPD::setProgramInformation  
(ProgramInformation *progInf
 {
 this->programInfo = progInfo;
 }
+
+boolMPD::isLive() const
+{
+AttributesMap::const_iterator it = 
this->attributes.find("mediaPresentationDuration");
+
+/*
+Standard specifies a default of "On-Demand",
+so anything that is not "Live" is "On-Demand"
+*/
+return ( it != this->attributes.end() && it->second == "Live" );
+}
diff --git a/modules/stream_filter/dash/mpd/MPD.h 
b/modules/stream_filter/dash/mpd/MPD.h
index 2a69142..80ee6a9 100644
--- a/modul

[vlc-commits] dash: BasicCMParser: Check for attributes at parsing time.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Mon 
Dec 19 23:57:02 2011 +0100| [d38bc3a09f450959c1171f1754c44e2d6fccd40f] | 
committer: Jean-Baptiste Kempf

dash: BasicCMParser: Check for attributes at parsing time.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   79 +-
 modules/stream_filter/dash/mpd/BasicCMParser.h   |1 +
 2 files changed, 79 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp 
b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index feb12ca..7d162e3 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -27,6 +27,9 @@
 
 #include "BasicCMParser.h"
 
+#include 
+#include 
+
 using namespace dash::mpd;
 using namespace dash::xml;
 
@@ -87,7 +90,14 @@ voidBasicCMParser::setRepresentations   (Node *root, 
Group *group)
 
 for(size_t i = 0; i < representations.size(); i++)
 {
-Representation *rep = new 
Representation(representations.at(i)->getAttributes());
+const std::mapattributes = 
representations.at(i)->getAttributes();
+
+Representation *rep = new Representation( attributes );
+if ( this->parseCommonAttributesElements( representations.at( i ), rep 
) == false )
+{
+delete rep;
+continue ;
+}
 this->setSegmentInfo(representations.at(i), rep);
 if ( rep->getSegmentInfo() && 
rep->getSegmentInfo()->getSegments().size() > 0 )
 group->addRepresentation(rep);
@@ -131,3 +141,70 @@ MPD*BasicCMParser::getMPD   ()
 {
 return this->mpd;
 }
+
+boolBasicCMParser::parseCommonAttributesElements( Node *node, 
CommonAttributesElements *common) const
+{
+const std::map&attr = 
node->getAttributes();
+std::map::const_iterator  it;
+//Parse mandatory elements first.
+it = attr.find( "mimeType" );
+if ( it == attr.end() )
+{
+std::cerr << "Missing mandatory attribute: @mimeType" << std::endl;
+return false;
+}
+common->setMimeType( it->second );
+//Everything else is optionnal.
+it = attr.find( "width" );
+if ( it != attr.end() )
+common->setWidth( atoi( it->second.c_str() ) );
+it = attr.find( "height" );
+if ( it != attr.end() )
+common->setHeight( atoi( it->second.c_str() ) );
+it = attr.find( "parx" );
+if ( it != attr.end() )
+common->setParX( atoi( it->second.c_str() ) );
+it = attr.find( "pary" );
+if ( it != attr.end() )
+common->setParY( atoi( it->second.c_str() ) );
+it = attr.find( "frameRate" );
+if ( it != attr.end() )
+common->setFrameRate( atoi( it->second.c_str() ) );
+it = attr.find( "lang" );
+
+if ( it != attr.end() && it->second.empty() == false )
+{
+std::istringstream  s( it->second );
+while ( s )
+{
+std::string lang;
+s >> lang;
+common->addLang( lang );
+}
+}
+it = attr.find( "numberOfChannels" );
+if ( it != attr.end() )
+{
+std::istringstream  s( it->second );
+while ( s )
+{
+std::string channel;
+s >> channel;
+common->addChannel( channel );
+}
+}
+it = attr.find( "samplingRate" );
+if ( it != attr.end() )
+{
+std::istringstream  s( it->second );
+while ( s )
+{
+int rate;
+s >> rate;
+common->addSampleRate( rate );
+}
+}
+//FIXME: Handle : group, maximumRAPPeriod startWithRAP attributes
+//FIXME: Handle : ContentProtection Accessibility Rating Viewpoing 
MultipleViews elements
+return true;
+}
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.h 
b/modules/stream_filter/dash/mpd/BasicCMParser.h
index 5813b91..e8ad31e 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.h
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.h
@@ -62,6 +62,7 @@ namespace dash
 voidsetInitSegment  (dash::xml::Node *root, 
SegmentInfo *info);
 voidsetSegments (dash::xml::Node *root, 
SegmentInfo *info);
 voidsetMPDBaseUrl   (dash::xml::Node *root);
+boolparseCommonAttributesElements( dash::xml::Node *node, 
CommonAttributesElements *common ) const;
 };
 }
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Fixing NullManager interface implementation.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec  1 16:55:38 2011 +0100| [51ddaa77d3d6384147fe8c04ca4d4ca615fe9a09] | 
committer: Jean-Baptiste Kempf

dash: Fixing NullManager interface implementation.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/mpd/NullManager.cpp |4 
 modules/stream_filter/dash/mpd/NullManager.h   |3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/NullManager.cpp 
b/modules/stream_filter/dash/mpd/NullManager.cpp
index 2d7d83c..044297c 100644
--- a/modules/stream_filter/dash/mpd/NullManager.cpp
+++ b/modules/stream_filter/dash/mpd/NullManager.cpp
@@ -53,3 +53,7 @@ Representation* NullManager::getRepresentation   
(Period *, long )
 {
 return NULL;
 }
+const MPD*  NullManager::getMPD() const
+{
+return NULL;
+}
diff --git a/modules/stream_filter/dash/mpd/NullManager.h 
b/modules/stream_filter/dash/mpd/NullManager.h
index 683bd2e..14a6d48 100644
--- a/modules/stream_filter/dash/mpd/NullManager.h
+++ b/modules/stream_filter/dash/mpd/NullManager.h
@@ -27,6 +27,7 @@
 
 #include "mpd/IMPDManager.h"
 
+#include "mpd/MPD.h"
 #include "mpd/Period.h"
 #include "mpd/Representation.h"
 #include "mpd/ISegment.h"
@@ -45,7 +46,7 @@ namespace dash
 Representation* getBestRepresentation   (Period 
*period);
 std::vector getSegments 
(Representation *rep);
 Representation* getRepresentation   (Period 
*period, long bitrate);
-
+const MPD*  getMPD  () const;
 private:
 std::vector   periods;
 std::vector segments;

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] dash: Adding a RepresentationAttributesElements to represent standard' s §5.4.3.2

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Thu 
Dec  1 11:34:11 2011 +0100| [a8ce888feb5181dfb978f4b2cca5a2c5703aefc3] | 
committer: Jean-Baptiste Kempf

dash: Adding a RepresentationAttributesElements to represent standard's §5.4.3.2

This will also save some code in a near future.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/Modules.am  |2 +
 .../dash/mpd/CommonAttributesElements.cpp  |  126 
 .../dash/mpd/CommonAttributesElements.h|   61 ++
 modules/stream_filter/dash/mpd/Representation.cpp  |   82 +-
 modules/stream_filter/dash/mpd/Representation.h|   16 +--
 5 files changed, 193 insertions(+), 94 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=a8ce888feb5181dfb978f4b2cca5a2c5703aefc3
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[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: DashManager: Adding a getMpdManager() method.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Dec  6 13:01:23 2011 +0100| [677c47565a714bd6ba62b8765cce4ae8bb7a8d4b] | 
committer: Jean-Baptiste Kempf

dash: DashManager: Adding a getMpdManager() method.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/dash/DASHManager.cpp |5 +
 modules/stream_filter/dash/DASHManager.h   |1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp 
b/modules/stream_filter/dash/DASHManager.cpp
index b97e2cc..3941648 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -94,3 +94,8 @@ int DASHManager::peek   (const uint8_t **pp_peek, size_t 
i_peek)
 int ret = this->conManager->peek(this->currentChunk, pp_peek, i_peek);
 return ret;
 }
+
+const mpd::IMPDManager* DASHManager::getMpdManager() const
+{
+return this->mpdManager;
+}
diff --git a/modules/stream_filter/dash/DASHManager.h 
b/modules/stream_filter/dash/DASHManager.h
index a9affcb..8a60262 100644
--- a/modules/stream_filter/dash/DASHManager.h
+++ b/modules/stream_filter/dash/DASHManager.h
@@ -43,6 +43,7 @@ namespace dash
 
 int read(void *p_buffer, size_t len);
 int peek(const uint8_t **pp_peek, size_t i_peek);
+const mpd::IMPDManager* getMpdManager() const;
 
 private:
 http::HTTPConnectionManager *conManager;

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] strings: Adding an helper to convert iso8601 durations

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Wed 
Dec 14 18:21:46 2011 +0100| [012d50b9d9078ddd323f06f856fb779c4a1b6236] | 
committer: Jean-Baptiste Kempf

strings: Adding an helper to convert iso8601 durations

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

Signed-off-by: Jean-Baptiste Kempf 

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

 include/vlc_strings.h |2 +
 src/libvlccore.sym|1 +
 src/text/strings.c|   59 +
 3 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/include/vlc_strings.h b/include/vlc_strings.h
index 92e43a2..9b4d094 100644
--- a/include/vlc_strings.h
+++ b/include/vlc_strings.h
@@ -53,6 +53,8 @@ VLC_API char * str_format( vlc_object_t *, const char * );
 VLC_API void filename_sanitize( char * );
 VLC_API void path_sanitize( char * );
 
+VLC_API time_t str_duration( const char * );
+
 /**
  * @}
  */
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 0da29f5..5e84697 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -426,6 +426,7 @@ stream_vaControl
 str_format
 str_format_meta
 str_format_time
+str_duration
 subpicture_Delete
 subpicture_New
 subpicture_NewFromPicture
diff --git a/src/text/strings.c b/src/text/strings.c
index a1df0bb..4b51a6b 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -1275,3 +1275,62 @@ out:
 free (path);
 return ret; /* unknown scheme */
 }
+
+/*
+  Decodes a duration as defined by ISO 8601
+  http://en.wikipedia.org/wiki/ISO_8601#Durations
+  @param str A null-terminated string to convert
+  @return: The duration in seconds. -1 if an error occured.
+
+  Exemple input string: "PT0H9M56.46S"
+ */
+time_t str_duration( const char *psz_duration )
+{
+booltimeDesignatorReached = false;
+time_t  res = 0;
+char*   end_ptr;
+
+if ( psz_duration == NULL )
+return -1;
+if ( ( *(psz_duration++) ) != 'P' )
+return -1;
+do
+{
+double number = strtod( psz_duration, &end_ptr );
+double  mul = 0;
+if ( psz_duration != end_ptr )
+psz_duration = end_ptr;
+switch( *psz_duration )
+{
+case 'M':
+{
+//M can mean month or minutes, if the 'T' flag has been 
reached.
+//We don't handle months though.
+if ( timeDesignatorReached == true )
+mul = 60.0;
+break ;
+}
+case 'Y':
+case 'W':
+break ; //Don't handle this duration.
+case 'D':
+mul = 86400.0;
+break ;
+case 'T':
+timeDesignatorReached = true;
+break ;
+case 'H':
+mul = 3600.0;
+break ;
+case 'S':
+mul = 1.0;
+break ;
+default:
+break ;
+}
+res += (time_t)(mul * number);
+if ( *psz_duration )
+psz_duration++;
+} while ( *psz_duration );
+return res;
+}

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Fix MacOS build

2012-01-24 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Tue Jan 24 
21:05:22 2012 +0200| [f6587cd61c91fbc3ec8fc055ee907df17bd30b2a] | committer: 
Rémi Denis-Courmont

Fix MacOS build

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

 src/posix/darwin_dirs.c |4 
 src/posix/darwin_specific.c |4 
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/posix/darwin_dirs.c b/src/posix/darwin_dirs.c
index b809449..6fc5d87 100644
--- a/src/posix/darwin_dirs.c
+++ b/src/posix/darwin_dirs.c
@@ -39,6 +39,10 @@
 #include 
 #include 
 
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 1024
+#endif
+
 static char *configdir = NULL;
 
 static pthread_once_t once = PTHREAD_ONCE_INIT;
diff --git a/src/posix/darwin_specific.c b/src/posix/darwin_specific.c
index 50f20be..ce11a88 100644
--- a/src/posix/darwin_specific.c
+++ b/src/posix/darwin_specific.c
@@ -37,10 +37,6 @@
 #   include 
 #endif
 
-#ifndef MAXPATHLEN
-# define MAXPATHLEN 1024
-#endif
-
 /*
  * system_Init: fill in program path & retrieve language
  */

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: make sure the main window's position is correctly restored ( fixes #5856)

2012-01-24 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jan 24 
20:03:32 2012 +0100| [d832507736d33cb435ba1830e9bdbace89a68c2e] | committer: 
Felix Paul Kühne

macosx: make sure the main window's position is correctly restored (fixes #5856)

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

 modules/gui/macosx/MainWindow.m |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index ab273f0..1aba7e7 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -411,16 +411,15 @@ static VLCMainWindow *_o_sharedInstance = nil;
 [self setOpaque: NO];
 [self setHasShadow:YES];
 
-NSRect winrect;
+NSRect winrect = [self frame];
 CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
-winrect = [self frame];
 
 [o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - 
f_titleBarHeight,
   winrect.size.width, 
f_titleBarHeight )];
 [[self contentView] addSubview: o_titlebar_view];
 
-winrect.size.height = winrect.size.height + f_titleBarHeight;
-[self setFrame: winrect display:NO animate:NO];
+[self setFrame: winrect display:YES animate:YES];
+previousSavedFrame = winrect;
 winrect = [o_split_view frame];
 winrect.size.height = winrect.size.height - f_titleBarHeight;
 [o_split_view setFrame: winrect];
@@ -429,10 +428,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
 o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view 
frame]];
 [[self contentView] addSubview: o_color_backdrop positioned: 
NSWindowBelow relativeTo: o_split_view];
 [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | 
NSViewWidthSizable];
-
-previousSavedFrame = winrect;
-
-[self display];
 }
 else
 {
@@ -891,6 +886,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)windowResizedOrMoved:(NSNotification *)notification
 {
+previousSavedFrame = [self frame];
 [self saveFrameUsingName: [self frameAutosaveName]];
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Compute the lib directory dynamically

2012-01-24 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Tue Jan 24 
20:46:40 2012 +0200| [97fbfd88063cb127181f684adcb3247734d10530] | committer: 
Rémi Denis-Courmont

Compute the lib directory dynamically

On Linux, this simplifies the code and improves relocability.
On Windows, OS/2 and MacOS, this should fix a small race condition.

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

 include/vlc_configuration.h |2 +-
 modules/lua/vlc.c   |9 -
 src/libvlc.h|2 -
 src/modules/bank.c  |   10 ++---
 src/os2/dirs.c  |   32 +
 src/os2/specific.c  |   21 ---
 src/posix/darwin_dirs.c |   78 +++
 src/posix/darwin_specific.c |   77 --
 src/posix/dirs.c|6 ++-
 src/posix/linux_specific.c  |   44 +++-
 src/posix/specific.c|9 -
 src/win32/dirs.c|   29 +---
 src/win32/specific.c|   35 ---
 13 files changed, 140 insertions(+), 214 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=97fbfd88063cb127181f684adcb3247734d10530
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Compute the lib directory dynamically

2012-01-24 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Tue Jan 24 
20:46:40 2012 +0200| [ae10aea4d3577741425405c529da42c885c23223] | committer: 
Rémi Denis-Courmont

Compute the lib directory dynamically

On Linux, this simplifies the code and improves relocability.
On Windows, OS/2 and MacOS, this should fix a small race condition.

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

 include/vlc_configuration.h |2 +-
 modules/lua/vlc.c   |9 -
 src/libvlc.h|2 -
 src/modules/bank.c  |   10 ++---
 src/os2/dirs.c  |   32 +
 src/os2/specific.c  |   21 ---
 src/posix/darwin_dirs.c |   78 +++
 src/posix/darwin_specific.c |   77 --
 src/posix/dirs.c|4 ++-
 src/posix/linux_specific.c  |   44 +++-
 src/posix/specific.c|9 -
 src/win32/dirs.c|   29 +---
 src/win32/specific.c|   35 ---
 13 files changed, 139 insertions(+), 213 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=ae10aea4d3577741425405c529da42c885c23223
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: replace ar by our $(AR)

2012-01-24 Thread Olivier Gambier
vlc | branch: master | Olivier Gambier  | Tue Jan 24 
18:15:33 2012 +0100| [2171af178491f01eeca2f7e5329d4e6cd3f78909] | committer: 
Rafaël Carré

contrib: live555: replace ar by our $(AR)

Signed-off-by: Rafaël Carré 

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

 contrib/src/live555/rules.mak |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index 80bb137..bc23cf1 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -32,7 +32,7 @@ live555: $(LIVE555_FILE) .sum-live555
 ifdef HAVE_WINCE
cd live && sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw
 endif
-   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -i.orig 
config.$(LIVE_TARGET)
+   cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%ar%$(AR)%' 
-i.orig config.$(LIVE_TARGET)
cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
cd live && sed \
-e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Revert "android: don't use unexisting option"

2012-01-24 Thread Rafaël Carré
vlc | branch: master | Rafaël Carré  | Tue Jan 24 13:37:02 
2012 -0500| [6e6bfaf4f57920eef41fc4fb8edab39e6619aad7] | committer: Rafaël Carré

Revert "android: don't use unexisting option"

This reverts commit 3bbc2f546339d6e0e61a131191caf82a43c49435.
Now it exists again

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

 extras/package/android/configure.sh |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/extras/package/android/configure.sh 
b/extras/package/android/configure.sh
index 5c2ea69..2ec42f9 100755
--- a/extras/package/android/configure.sh
+++ b/extras/package/android/configure.sh
@@ -60,6 +60,7 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux 
--build=x86_64-unknown-linux $
 --disable-lua \
 --disable-libgcrypt \
 --disable-vcd \
+--disable-v4l2 \
 --disable-gnomevfs \
 --disable-dvdread \
 --disable-dvdnav \

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Removing calls to vlc_array_item_at_index

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 18:09:36 2012 +0100| [7dcae00f4d1b4ffa77f63891f0f824be17f76609] | 
committer: Jean-Baptiste Kempf

hls: Removing calls to vlc_array_item_at_index

Using hls_Get and segment_GetSegment instead. Those check for out of
bound access.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 6cdebb3..1e63560 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -240,7 +240,7 @@ static void hls_Free(hls_stream_t *hls)
 {
 for (int n = 0; n < vlc_array_count(hls->segments); n++)
 {
-segment_t *segment = (segment_t 
*)vlc_array_item_at_index(hls->segments, n);
+segment_t *segment = segment_GetSegment(hls, n);
 if (segment) segment_Free(segment);
 }
 vlc_array_destroy(hls->segments);
@@ -310,7 +310,7 @@ static hls_stream_t *hls_Find(vlc_array_t *hls_stream, 
hls_stream_t *hls_new)
 int count = vlc_array_count(hls_stream);
 for (int n = 0; n < count; n++)
 {
-hls_stream_t *hls = vlc_array_item_at_index(hls_stream, n);
+hls_stream_t *hls = hls_Get(hls_stream, n);
 if (hls)
 {
 /* compare */
@@ -401,7 +401,7 @@ static segment_t *segment_Find(hls_stream_t *hls, const int 
sequence)
 if (count <= 0) return NULL;
 for (int n = 0; n < count; n++)
 {
-segment_t *segment = vlc_array_item_at_index(hls->segments, n);
+segment_t *segment = segment_GetSegment(hls, n);
 if (segment == NULL) break;
 if (segment->sequence == sequence)
 return segment;
@@ -1319,7 +1319,7 @@ static int get_HTTPLiveMetaPlaylist(stream_t *s, 
vlc_array_t **streams)
 for (int i = 0; i < vlc_array_count(p_sys->hls_stream); i++)
 {
 hls_stream_t *src, *dst;
-src = (hls_stream_t *)vlc_array_item_at_index(p_sys->hls_stream, i);
+src = hls_Get(p_sys->hls_stream, i);
 if (src == NULL)
 return VLC_EGENERIC;
 
@@ -1449,7 +1449,7 @@ static int hls_ReloadPlaylist(stream_t *s)
 for (int i = 0; i < vlc_array_count(hls_streams); i++)
 {
 hls_stream_t *hls;
-hls = (hls_stream_t *)vlc_array_item_at_index(hls_streams, i);
+hls = hls_Get(hls_streams, i);
 if (hls) hls_Free(hls);
 }
 vlc_array_destroy(hls_streams);
@@ -2049,8 +2049,7 @@ fail:
 /* Free hls streams */
 for (int i = 0; i < vlc_array_count(p_sys->hls_stream); i++)
 {
-hls_stream_t *hls;
-hls = (hls_stream_t *)vlc_array_item_at_index(p_sys->hls_stream, i);
+hls_stream_t *hls = hls_Get(p_sys->hls_stream, i);
 if (hls) hls_Free(hls);
 }
 vlc_array_destroy(p_sys->hls_stream);
@@ -2086,8 +2085,7 @@ static void Close(vlc_object_t *p_this)
 /* Free hls streams */
 for (int i = 0; i < vlc_array_count(p_sys->hls_stream); i++)
 {
-hls_stream_t *hls;
-hls = (hls_stream_t *)vlc_array_item_at_index(p_sys->hls_stream, i);
+hls_stream_t *hls = hls_Get(p_sys->hls_stream, i);
 if (hls) hls_Free(hls);
 }
 vlc_array_destroy(p_sys->hls_stream);
@@ -2450,7 +2448,7 @@ static int segment_Seek(stream_t *s, const uint64_t pos)
 
 for (int n = 0; n < count; n++)
 {
-segment_t *segment = vlc_array_item_at_index(hls->segments, n);
+segment_t *segment = segment_GetSegment(hls, n);
 if (segment == NULL)
 {
 vlc_mutex_unlock(&hls->lock);

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Don't crash if a segment can't be found.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 18:15:41 2012 +0100| [5ea58c91c7314d9735598bf9c20f201207855377] | 
committer: Jean-Baptiste Kempf

hls: Don't crash if a segment can't be found.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index e2a8834..f573404 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1196,6 +1196,8 @@ static int hls_ManageSegmentKeys(stream_t *s, 
hls_stream_t *hls)
 {
 prev_seg = seg;
 seg = segment_GetSegment(hls, i);
+if (seg == NULL )
+continue;
 if (seg->psz_key_path == NULL)
 continue;   /* No key to load ? continue */
 if (seg->b_key_loaded)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Cosmetics: removing useless casts.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 16:37:26 2012 +0100| [dc507fb8d9b01889334c7fab91219e1b33760fba] | 
committer: Jean-Baptiste Kempf

hls: Cosmetics: removing useless casts.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index c844c8a..4d6e550 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -293,7 +293,7 @@ static hls_stream_t *hls_Get(vlc_array_t *hls_stream, const 
int wanted)
 
 static inline hls_stream_t *hls_GetFirst(vlc_array_t *hls_stream)
 {
-return (hls_stream_t*) hls_Get(hls_stream, 0);
+return hls_Get(hls_stream, 0);
 }
 
 static hls_stream_t *hls_GetLast(vlc_array_t *hls_stream)
@@ -302,7 +302,7 @@ static hls_stream_t *hls_GetLast(vlc_array_t *hls_stream)
 if (count <= 0)
 return NULL;
 count--;
-return (hls_stream_t *) hls_Get(hls_stream, count);
+return hls_Get(hls_stream, count);
 }
 
 static hls_stream_t *hls_Find(vlc_array_t *hls_stream, hls_stream_t *hls_new)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Removing warnings.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 16:39:35 2012 +0100| [5f5897cbb70c9e19d36d6f4a6aae1783c5d50f7a] | 
committer: Jean-Baptiste Kempf

hls: Removing warnings.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 4d6e550..6cdebb3 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1176,7 +1176,7 @@ static int hls_DownloadSegmentKey(stream_t *s, segment_t 
*seg)
 len = stream_Read(p_m3u8, aeskey, sizeof(aeskey));
 if (len != AES_BLOCK_SIZE)
 {
-msg_Err(s, "The AES key loaded doesn't have the right size (%d)", len);
+msg_Err(s, "The AES key loaded doesn't have the right size (%zd)", 
len);
 stream_Delete(p_m3u8);
 return VLC_EGENERIC;
 }
@@ -1861,7 +1861,7 @@ static ssize_t read_M3U8_from_stream(stream_t *s, uint8_t 
**buffer)
 if (total_allocated)
 total_allocated *= 2;
 else
-total_allocated = __MIN(bytes+1, sizeof(buf));
+total_allocated = __MIN((uint64_t)bytes+1, sizeof(buf));
 
 p = realloc_or_free(p, total_allocated);
 if (p == NULL)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Removing useless assignments.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 18:12:08 2012 +0100| [efd36363e0b70f8a7b4340a8f57d34142c4f0168] | 
committer: Jean-Baptiste Kempf

hls: Removing useless assignments.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 1e63560..e2a8834 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -248,7 +248,6 @@ static void hls_Free(hls_stream_t *hls)
 vlc_UrlClean(&hls->url);
 free(hls->psz_current_key_path);
 free(hls);
-hls = NULL;
 }
 
 static hls_stream_t *hls_Copy(hls_stream_t *src, const bool b_cp_segments)
@@ -378,7 +377,6 @@ static void segment_Free(segment_t *segment)
 if (segment->data)
 block_Release(segment->data);
 free(segment);
-segment = NULL;
 }
 
 static segment_t *segment_GetSegment(hls_stream_t *hls, const int wanted)

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Fixing a deadlock introduced in previous commit.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 15:43:00 2012 +0100| [5bc01ff93bd031a6fafa83075ac6e4fd50bebdff] | 
committer: Jean-Baptiste Kempf

hls: Fixing a deadlock introduced in previous commit.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index d6b3fe1..c844c8a 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1397,10 +1397,10 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t 
*hls_new, hls_stream_t *
 }
 free(segment->psz_key_path);
 segment->psz_key_path = p->psz_key_path ? 
strdup(p->psz_key_path) : NULL;
-vlc_mutex_unlock(&segment->lock);
 segment_Free(p);
 free(psz_url);
 }
+vlc_mutex_unlock(&segment->lock);
 }
 else
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] HLS restore pos of current segment before seeking

2012-01-24 Thread Frédéric Yhuel
vlc/vlc-1.2 | branch: master | Frédéric Yhuel  | Tue Jan 24 
14:34:52 2012 +0100| [2fd6ea3acc8789698dd3c353d4c8937d60b5750e] | committer: 
Jean-Baptiste Kempf

HLS restore pos of current segment before seeking

This prevents a "bug" when we seek backward and then play again that
segment.

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |   47 +++--
 1 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 8de9638..82e9c37 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -2196,6 +2196,20 @@ check:
 return segment;
 }
 
+static int segment_RestorePos( segment_t *segment )
+{
+if( segment->data )
+{
+uint64_t size = segment->size -segment->data->i_buffer;
+if( size > 0 )
+{
+segment->data->i_buffer += size;
+segment->data->p_buffer -= size;
+}
+}
+return VLC_SUCCESS;
+}
+
 static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read)
 {
 stream_sys_t *p_sys = s->p_sys;
@@ -2219,14 +2233,8 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, 
unsigned int i_read)
 segment->data = NULL;
 }
 else
-{   /* reset playback pointer to start of buffer */
-uint64_t size = segment->size - segment->data->i_buffer;
-if (size > 0)
-{
-segment->data->i_buffer += size;
-segment->data->p_buffer -= size;
-}
-}
+segment_RestorePos( segment );
+
 p_sys->playback.segment++;
 vlc_mutex_unlock(&segment->lock);
 
@@ -2421,6 +2429,7 @@ static uint64_t GetStreamSize(stream_t *s)
 return size;
 }
 
+
 static int segment_Seek(stream_t *s, const uint64_t pos)
 {
 stream_sys_t *p_sys = s->p_sys;
@@ -2436,6 +2445,17 @@ static int segment_Seek(stream_t *s, const uint64_t pos)
 uint64_t size = hls->size;
 int count = vlc_array_count(hls->segments);
 
+/* restore current segment to start position */
+segment_t *segment = segment_GetSegment(hls, p_sys->playback.segment);
+if (segment == NULL)
+{
+vlc_mutex_unlock(&hls->lock);
+return VLC_EGENERIC;
+}
+vlc_mutex_lock(&segment->lock);
+segment_RestorePos( segment );
+vlc_mutex_unlock(&segment->lock);
+
 for (int n = 0; n < count; n++)
 {
 segment_t *segment = vlc_array_item_at_index(hls->segments, n);
@@ -2480,17 +2500,8 @@ static int segment_Seek(stream_t *s, const uint64_t pos)
 vlc_mutex_unlock(&hls->lock);
 return VLC_EGENERIC;
 }
-
 vlc_mutex_lock(&segment->lock);
-if (segment->data)
-{
-uint64_t size = segment->size -segment->data->i_buffer;
-if (size > 0)
-{
-segment->data->i_buffer += size;
-segment->data->p_buffer -= size;
-}
-}
+segment_RestorePos( segment );
 vlc_mutex_unlock(&segment->lock);
 
 /* start download at current playback segment */

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Fixing playlist updating.

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 15:11:04 2012 +0100| [7bafd5e57a078b318e2805a69fc5e4931e86ccc9] | 
committer: Jean-Baptiste Kempf

hls: Fixing playlist updating.

parse_M3U8 uses hls_GetLast to update the HLS current hls stream, so we
have to add it to the streams array before calling parse_M3U8

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |   12 +---
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 3c52b83..d6b3fe1 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1326,21 +1326,11 @@ static int get_HTTPLiveMetaPlaylist(stream_t *s, 
vlc_array_t **streams)
 dst = hls_Copy(src, false);
 if (dst == NULL)
 return VLC_ENOMEM;
-
 vlc_array_append(*streams, dst);
-}
-
-/* Download new playlist file from server */
-for (int i = 0; i < vlc_array_count(*streams); i++)
-{
-hls_stream_t *hls;
-hls = (hls_stream_t *)vlc_array_item_at_index(*streams, i);
-if (hls == NULL)
-return VLC_EGENERIC;
 
 /* Download playlist file from server */
 uint8_t *buf = NULL;
-ssize_t len = read_M3U8_from_url(s, &hls->url, &buf);
+ssize_t len = read_M3U8_from_url(s, &dst->url, &buf);
 if (len < 0)
 err = VLC_EGENERIC;
 else

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] hls: Fixing hls_Copy

2012-01-24 Thread Hugo Beauzée-Luyssen
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen  | Tue 
Jan 24 15:09:55 2012 +0100| [f6399b2266787a93e074fb83bf96b732f7ae8598] | 
committer: Jean-Baptiste Kempf

hls: Fixing hls_Copy

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

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/stream_filter/httplive.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 82e9c37..3c52b83 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -266,6 +266,8 @@ static hls_stream_t *hls_Copy(hls_stream_t *src, const bool 
b_cp_segments)
 dst->sequence = src->sequence;
 dst->version = src->version;
 dst->b_cache = src->b_cache;
+dst->psz_current_key_path = src->psz_current_key_path ?
+strdup( src->psz_current_key_path ) : NULL;
 char *uri = ConstructUrl(&src->url);
 if (uri == NULL)
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: prevent warnings on console when opening the audio effects panel

2012-01-24 Thread Felix Paul Kühne
vlc/vlc-1.2 | branch: master | Felix Paul Kühne  | Tue 
Jan 24 16:46:03 2012 +0100| [d70a28c33b34604a62092321240473fda7599505] | 
committer: Jean-Baptiste Kempf

macosx: prevent warnings on console when opening the audio effects panel

this were caused by an incomplete implementation of a 2.0-next feature
(cherry picked from commit b2899779019541ef80b7385fc1dc7ef96a9ca334)

Signed-off-by: Jean-Baptiste Kempf 

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

 .../Resources/English.lproj/AudioEffects.xib   |  902 +---
 1 files changed, 8 insertions(+), 894 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=d70a28c33b34604a62092321240473fda7599505
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] qtcapture: timing and speed improvements

2012-01-24 Thread Felix Paul Kühne
vlc/vlc-1.2 | branch: master | Felix Paul Kühne  | Tue 
Jan 24 17:15:27 2012 +0100| [4df5d3b085fb9e08ef313a000419d551b75f234f] | 
committer: Jean-Baptiste Kempf

qtcapture: timing and speed improvements

it respects the 'live-caching' setting now, is vastly more responsive and even 
got correct timing.

Thanks to emi and Luca for the ideas and help
(cherry picked from commit e0745f6002c5d0b20a552d98ab3e385798e68815)

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/access/qtcapture.m |   52 ++-
 1 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/modules/access/qtcapture.m b/modules/access/qtcapture.m
index 0080411..b2091a8 100644
--- a/modules/access/qtcapture.m
+++ b/modules/access/qtcapture.m
@@ -79,6 +79,7 @@ vlc_module_end ()
 CVImageBufferRef currentImageBuffer;
 mtime_t currentPts;
 mtime_t previousPts;
+long timeScale;
 }
 - (id)init;
 - (void)outputVideoFrame:(CVImageBufferRef)videoFrame 
withSampleBuffer:(QTSampleBuffer *)sampleBuffer 
fromConnection:(QTCaptureConnection *)connection;
@@ -94,6 +95,7 @@ vlc_module_end ()
 currentImageBuffer = nil;
 currentPts = 0;
 previousPts = 0;
+timeScale = 0;
 }
 return self;
 }
@@ -107,6 +109,11 @@ vlc_module_end ()
 [super dealloc];
 }
 
+- (long)timeScale
+{
+return timeScale;
+}
+
 - (void)outputVideoFrame:(CVImageBufferRef)videoFrame 
withSampleBuffer:(QTSampleBuffer *)sampleBuffer 
fromConnection:(QTCaptureConnection *)connection
 {
 // Store the latest frame
@@ -119,7 +126,9 @@ vlc_module_end ()
 {
 imageBufferToRelease = currentImageBuffer;
 currentImageBuffer = videoFrame;
-currentPts = (mtime_t)(100L / [sampleBuffer 
presentationTime].timeScale * [sampleBuffer presentationTime].timeValue);
+QTTime timeStamp = [sampleBuffer presentationTime];
+timeScale = timeStamp.timeScale;
+currentPts = (mtime_t)(100L / timeScale * timeStamp.timeValue);
 
 /* Try to use hosttime of the sample if available, because iSight Pts 
seems broken */
 NSNumber *hosttime = (NSNumber *)[sampleBuffer 
attributeForKey:QTSampleBufferHostTimeAttribute];
@@ -170,6 +179,8 @@ struct demux_sys_t {
 VLCDecompressedVideoOutput * output;
 int height, width;
 es_out_id_t * p_es_video;
+BOOL b_es_setup;
+es_format_t fmt;
 };
 
 
@@ -206,7 +217,6 @@ static int Open( vlc_object_t *p_this )
 {
 demux_t *p_demux = (demux_t*)p_this;
 demux_sys_t *p_sys = NULL;
-es_format_t fmt;
 int i;
 int i_width;
 int i_height;
@@ -256,7 +266,7 @@ static int Open( vlc_object_t *p_this )
 }
 }
 
-memset( &fmt, 0, sizeof( es_format_t ) );
+memset( &p_sys->fmt, 0, sizeof( es_format_t ) );
 
 QTCaptureDeviceInput * input = nil;
 NSError *o_returnedError;
@@ -318,7 +328,7 @@ static int Open( vlc_object_t *p_this )
 int chroma = VLC_CODEC_UYVY;
 
 /* Now we can init */
-es_format_Init( &fmt, VIDEO_ES, chroma );
+es_format_Init( &p_sys->fmt, VIDEO_ES, chroma );
 
 NSSize encoded_size = [[camera_format 
attributeForKey:QTFormatDescriptionVideoEncodedPixelsSizeAttribute] sizeValue];
 NSSize display_size = [[camera_format 
attributeForKey:QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute] 
sizeValue];
@@ -329,12 +339,13 @@ static int Open( vlc_object_t *p_this )
 par_size.height = display_size.height = encoded_size.height
 = var_InheritInteger (p_this, "qtcapture-height");
 
-fmt.video.i_width = p_sys->width = encoded_size.width;
-fmt.video.i_height = p_sys->height = encoded_size.height;
+p_sys->fmt.video.i_width = p_sys->width = encoded_size.width;
+p_sys->fmt.video.i_height = p_sys->height = encoded_size.height;
+p_sys->fmt.video.i_frame_rate = 25.0; // cave: check with 
setMinimumVideoFrameInterval (see below)
 if( par_size.width != encoded_size.width )
 {
-fmt.video.i_sar_num = (int64_t)encoded_size.height * par_size.width / 
encoded_size.width;
-fmt.video.i_sar_den = encoded_size.width;
+p_sys->fmt.video.i_sar_num = (int64_t)encoded_size.height * 
par_size.width / encoded_size.width;
+p_sys->fmt.video.i_sar_den = encoded_size.width;
 }
 
 msg_Dbg(p_demux, "encoded_size %i %i", (int)encoded_size.width, 
(int)encoded_size.height );
@@ -347,6 +358,8 @@ static int Open( vlc_object_t *p_this )
 [NSNumber numberWithInt: p_sys->width], kCVPixelBufferWidthKey,
 [NSNumber numberWithBool:YES], 
(id)kCVPixelBufferOpenGLCompatibilityKey,
 nil]];
+[p_sys->output setAutomaticallyDropsLateVideoFrames:YES];
+[p_sys->output setMinimumVideoFrameInterval: (1/25)]; // 25 fps
 
 p_sys->session = [[QTCaptureSession alloc] init];
 
@@ -366,11 +379,6 @@ static int Open( vlc_object_t *p_this )
 
 [p_sys->session 

[vlc-commits] macosx: Make streaming wizard output string editable

2012-01-24 Thread Brendon Justin
vlc/vlc-1.2 | branch: master | Brendon Justin  | Tue 
Jan 24 12:22:36 2012 -0500| [25775825be1c29cac635201c8b3c073b9aa8fd2c] | 
committer: Jean-Baptiste Kempf

macosx: Make streaming wizard output string editable

Change the string's text field from static to editable, so options not in the
wizard can be added. Uses the string from this field directly, rather than the
stored string.

Signed-off-by: Felix Paul Kühne 
(cherry picked from commit 40c5ee7f1b0b96fc964ea5a43ec41c0297a20711)

Signed-off-by: Jean-Baptiste Kempf 

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

 .../macosx/Resources/English.lproj/Wizard.xib  |   42 +--
 modules/gui/macosx/wizard.m|   14 ---
 2 files changed, 28 insertions(+), 28 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commitdiff;h=25775825be1c29cac635201c8b3c073b9aa8fd2c
___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove outdated code

2012-01-24 Thread Felix Paul Kühne
vlc/vlc-1.2 | branch: master | Felix Paul Kühne  | Mon 
Jan 23 17:41:57 2012 -0800| [a9b1904817f230f10e3d5b4cc5d02cd8cbd0d457] | 
committer: Jean-Baptiste Kempf

macosx: remove outdated code
(cherry picked from commit af197084313166e5e05ab609403b8eb3511b09f5)

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/gui/macosx/about.h |1 -
 modules/gui/macosx/about.m |   12 
 2 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/about.h b/modules/gui/macosx/about.h
index 9580c6e..731c308 100644
--- a/modules/gui/macosx/about.h
+++ b/modules/gui/macosx/about.h
@@ -60,7 +60,6 @@
 
 + (VLAboutBox *)sharedInstance;
 - (void)showAbout;
-- (void)VLCWillTerminate;
 - (void)showHelp;
 - (IBAction)showGPL:(id)sender;
 - (IBAction)helpGoHome:(id)sender;
diff --git a/modules/gui/macosx/about.m b/modules/gui/macosx/about.m
index e02ae55..374f347 100644
--- a/modules/gui/macosx/about.m
+++ b/modules/gui/macosx/about.m
@@ -82,12 +82,6 @@ static VLAboutBox *_o_sharedInstance = nil;
 {
 if(! b_isSetUp )
 {
-/* we want to know when VLC wants to quit to prevent a crash while 
scrolling our credits */
-[[NSNotificationCenter defaultCenter] addObserver: self
- selector: 
@selector(VLCWillTerminate)
- name: 
NSApplicationWillTerminateNotification
-   object: nil];
-
 /* Get the localized info dictionary (InfoPlist.strings) */
 NSDictionary *o_local_dict;
 o_local_dict = [[NSBundle mainBundle] localizedInfoDictionary];
@@ -194,12 +188,6 @@ static VLAboutBox *_o_sharedInstance = nil;
 }
 }
 
-- (void)VLCWillTerminate
-{
-[o_scroll_timer invalidate];
-[[NSNotificationCenter defaultCenter] removeObserver: self];
-}
-
 /*
 * VLC GPL Window, action called from the about window and the help menu
 */

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: live555: don't replace cc 2 times for macosx

2012-01-24 Thread Rafaël Carré
vlc/vlc-1.2 | branch: master | Rafaël Carré  | Tue Jan 24 
12:01:32 2012 -0500| [23df98e7772af2f77ed76df1092057df7bfdbf37] | committer: 
Jean-Baptiste Kempf

contrib: live555: don't replace cc 2 times for macosx

we could end up with 'ggcc'
forgotten in a6e2d06608df593af6118be34cc2f416d0c6d354
(cherry picked from commit a9739cc0a5ffe72aed386d50b9a08c5cce75d481)

Signed-off-by: Jean-Baptiste Kempf 

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

 contrib/src/live555/rules.mak |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index be0c2b2..80bb137 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -36,7 +36,6 @@ endif
cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
cd live && sed \
-e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' \
-   -e 's%cc%$(CC)%' \
-e 's%$(CXX)%$(CXX)\ $(EXTRA_LDFLAGS)%' \
-i.orig config.macosx
cd live && sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ 
-fPIC\ -DPIC%' -i.orig config.linux

___
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits


  1   2   >