]> git.sesse.net Git - vlc/blobdiff - modules/video_output/omapfb.c
Removed non converted hd1000v video output module.
[vlc] / modules / video_output / omapfb.c
index 3a1c7f315f49a18ec12867a856578602ad458f8a..9646cbdfba57a7c68e0febcc1a89780a9818be1d 100644 (file)
@@ -27,7 +27,6 @@
 # include "config.h"
 #endif
 
-#include <errno.h>                                                 /* ENOMEM */
 #include <fcntl.h>                                                 /* open() */
 #include <unistd.h>                                               /* close() */
 
@@ -46,6 +45,7 @@
 #include <vlc_vout.h>
 #include <vlc_vout_window.h>
 #include <vlc_playlist.h>
+#include <vlc_fs.h>
 
 /*****************************************************************************
 * Local prototypes
@@ -79,7 +79,7 @@ static void ToggleFullScreen ( vout_thread_t * );
 #define DEVICE_LONGTEXT N_( \
     "OMAP Framebuffer device to use for rendering (usually /dev/fb0).")
 
-#define CHROMA_TEXT N_("Chroma used.")
+#define CHROMA_TEXT N_("Chroma used")
 #define CHROMA_LONGTEXT N_( \
     "Force use of a specific chroma for output. Default is Y420 (specific to N770/N8xx hardware)." )
 
@@ -88,7 +88,7 @@ static void ToggleFullScreen ( vout_thread_t * );
     "Embed the framebuffer overlay into a X11 window" )
 
 vlc_module_begin();
-    set_shortname( "OMAP framebuffer" );
+    set_shortname( N_("OMAP framebuffer") );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VOUT );
     add_file( FB_DEV_VAR, "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
@@ -231,7 +231,9 @@ static int Init( vout_thread_t *p_vout )
     vout_sys_t *p_sys = (vout_sys_t *)p_vout->p_sys;
 
     // We want to keep the same aspect
-    p_vout->fmt_out.i_aspect = p_vout->output.i_aspect = p_vout->render.i_aspect;
+    p_vout->output.i_aspect = p_vout->render.i_aspect;
+    p_vout->fmt_out.i_sar_num = p_vout->render.i_aspect * p_vout->render.i_height;
+    p_vout->fmt_out.i_sar_den = VOUT_ASPECT_FACTOR      * p_vout->render.i_width;
     // We ask where the video should be displayed in the video area
     vout_PlacePicture( p_vout, p_sys->main_window.i_width,
                        p_sys->main_window.i_height,
@@ -270,7 +272,7 @@ static int Init( vout_thread_t *p_vout )
     }
 
     p_vout->output.i_chroma =
-    p_vout->fmt_out.i_chroma = VLC_CODEC_I420;
+    p_vout->fmt_out.i_chroma = VLC_FOURCC( 'Y','4','2','0' );
     p_sys->i_color_format = OMAPFB_COLOR_YUV420;
 
     // place in the framebuffer where we have to write
@@ -453,7 +455,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
         return VLC_EGENERIC;
     }
 
-    p_sys->i_fd = open( psz_device, O_RDWR );
+    p_sys->i_fd = vlc_open( psz_device, O_RDWR );
     if( p_sys->i_fd == -1 )
     {
         msg_Err( p_vout, "cannot open %s (%m)", psz_device );
@@ -478,13 +480,13 @@ static int OpenDisplay( vout_thread_t *p_vout )
 
     if( ioctl( p_sys->i_fd, FBIOGET_VSCREENINFO, &p_sys->fb_vinfo ) )
     {
-        msg_Err( p_vout, "Can't get VSCREENINFO: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't get VSCREENINFO: %m" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
     if( ioctl( p_sys->i_fd, FBIOGET_FSCREENINFO, &p_sys->fb_finfo ) )
     {
-        msg_Err( p_vout, "Can't get FSCREENINFO: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't get FSCREENINFO: %m" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
@@ -496,7 +498,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     if( (p_sys->p_video = (uint8_t *)mmap( 0, p_sys->i_page_size, PROT_READ | PROT_WRITE, MAP_SHARED,
                                             p_sys->i_fd, 0 )) == MAP_FAILED )
     {
-        msg_Err( p_vout, "Can't mmap: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't mmap: %m" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
@@ -504,7 +506,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     p_sys->p_display = XOpenDisplay( NULL );
 
     /* Open /dev/null and map it */
-    p_sys->i_null_fd = open( "/dev/zero", O_RDWR );
+    p_sys->i_null_fd = vlc_open( "/dev/zero", O_RDWR );
     if( p_sys->i_null_fd == -1 )
     {
         msg_Err( p_vout, "cannot open /dev/zero (%m)" );
@@ -516,7 +518,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     if( (p_sys->p_null = (uint8_t *)mmap( 0, p_sys->i_page_size, PROT_READ | PROT_WRITE,
                                           MAP_PRIVATE, p_sys->i_null_fd, 0 )) == MAP_FAILED )
     {
-        msg_Err( p_vout, "Can't mmap 2: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't mmap 2: %m" );
         munmap( p_sys->p_video, p_sys->i_page_size );
         close( p_sys->i_null_fd );
         close( p_sys->i_fd );