[vlc-commits] commit: Added a patch to the contribs to have a dvdnav_get_video_resolution () function in libdvdnav. (Laurent Aimar )

git at videolan.org git at videolan.org
Mon May 24 23:59:56 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon May 24 23:53:30 2010 +0200| [4f36a3e7b0e62d3dfed0b87eccf925e3017f1998] | committer: Laurent Aimar 

Added a patch to the contribs to have a dvdnav_get_video_resolution() function in libdvdnav.

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

 extras/contrib/src/Makefile                        |    1 +
 .../contrib/src/Patches/libdvdnav-resolution.patch |   80 ++++++++++++++++++++
 2 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
index 70b093a..23b343b 100644
--- a/extras/contrib/src/Makefile
+++ b/extras/contrib/src/Makefile
@@ -1213,6 +1213,7 @@ ifdef SVN
 libdvdnav:
 	$(SVN) co $(LIBDVDNAV_SVN)  libdvdnav
 	patch -d libdvdnav -p0 < Patches/libdvdnav.patch
+	patch -d libdvdnav -p0 < Patches/libdvdnav-resolution.patch
 	(cd $@; ./autogen.sh noconfig)
 else
 libdvdnav-$(LIBDVDNAV_VERSION).tar.gz:
diff --git a/extras/contrib/src/Patches/libdvdnav-resolution.patch b/extras/contrib/src/Patches/libdvdnav-resolution.patch
new file mode 100644
index 0000000..bc4ee01
--- /dev/null
+++ b/extras/contrib/src/Patches/libdvdnav-resolution.patch
@@ -0,0 +1,80 @@
+Index: src/dvdnav/dvdnav.h
+===================================================================
+--- src/dvdnav/dvdnav.h	(revision 1191)
++++ src/dvdnav/dvdnav.h	(working copy)
+@@ -553,6 +553,11 @@
+ uint8_t dvdnav_get_video_aspect(dvdnav_t *self);
+ 
+ /*
++ * Get video resolution.
++ */
++int dvdnav_get_video_resolution(dvdnav_t *self, uint32_t *width, uint32_t *height);
++
++/*
+  * Get video scaling permissions.
+  * The scaling permission does only change on VTS boundaries.
+  * See the DVDNAV_VTS_CHANGE event.
+Index: src/vm/vm.c
+===================================================================
+--- src/vm/vm.c	(revision 1191)
++++ src/vm/vm.c	(working copy)
+@@ -858,8 +858,8 @@
+     break;
+   }
+ }
++#endif
+ 
+-/* currently unused */
+ void vm_get_video_res(vm_t *vm, int *width, int *height) {
+   video_attr_t attr = vm_get_video_attr(vm);
+ 
+@@ -883,7 +883,6 @@
+     break;
+   }
+ }
+-#endif
+ 
+ int vm_get_video_aspect(vm_t *vm) {
+   int aspect = vm_get_video_attr(vm).display_aspect_ratio;
+Index: src/vm/vm.h
+===================================================================
+--- src/vm/vm.h	(revision 1191)
++++ src/vm/vm.h	(working copy)
+@@ -159,8 +159,8 @@
+ /* currently unused */
+ void vm_get_audio_info(vm_t *vm, int *current, int *num_avail);
+ void vm_get_subp_info(vm_t *vm, int *current, int *num_avail);
++#endif
+ void vm_get_video_res(vm_t *vm, int *width, int *height);
+-#endif
+ int  vm_get_video_aspect(vm_t *vm);
+ int  vm_get_video_scale_permission(vm_t *vm);
+ video_attr_t vm_get_video_attr(vm_t *vm);
+Index: src/dvdnav.c
+===================================================================
+--- src/dvdnav.c	(revision 1191)
++++ src/dvdnav.c	(working copy)
+@@ -844,7 +844,23 @@
+ 
+   return retval;
+ }
++int dvdnav_get_video_resolution(dvdnav_t *this, uint32_t *width, uint32_t *height) {
++  int w, h;
+ 
++  if(!this->started) {
++    printerr("Virtual DVD machine not started.");
++    return -1;
++  }
++
++  pthread_mutex_lock(&this->vm_lock);
++  vm_get_video_res(this->vm, &w, &h);
++  pthread_mutex_unlock(&this->vm_lock);
++  
++  *width  = w;
++  *height = h;
++  return 0;
++}
++
+ uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) {
+   uint8_t         retval;
+ 



More information about the vlc-commits mailing list