comparison dvdnav.c @ 401:390fbf2a9602 src

Provide a way to retrieve video resolution. Needed for correct aspect ratio support in VLC. Patch by Jean-Baptiste Kempf /jb*videolan#org\
author rathann
date Tue, 25 May 2010 23:33:59 +0000
parents a70f79850e5f
children 1be2ffbeeb23
comparison
equal deleted inserted replaced
400:3daa43270d2c 401:390fbf2a9602
842 retval = (uint8_t)vm_get_video_aspect(this->vm); 842 retval = (uint8_t)vm_get_video_aspect(this->vm);
843 pthread_mutex_unlock(&this->vm_lock); 843 pthread_mutex_unlock(&this->vm_lock);
844 844
845 return retval; 845 return retval;
846 } 846 }
847 int dvdnav_get_video_resolution(dvdnav_t *this, uint32_t *width, uint32_t *height) {
848 int w, h;
849
850 if(!this->started) {
851 printerr("Virtual DVD machine not started.");
852 return -1;
853 }
854
855 pthread_mutex_lock(&this->vm_lock);
856 vm_get_video_res(this->vm, &w, &h);
857 pthread_mutex_unlock(&this->vm_lock);
858
859 *width = w;
860 *height = h;
861 return 0;
862 }
847 863
848 uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) { 864 uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) {
849 uint8_t retval; 865 uint8_t retval;
850 866
851 if(!this->started) { 867 if(!this->started) {