]> git.sesse.net Git - vlc/blobdiff - modules/video_output/fb.c
Fix Metacube header handling with multiple header blocks.
[vlc] / modules / video_output / fb.c
index 78c480aa04b7a775c69dc01dad0f06bf4f751892..b860288df5612bc1f548759d242507405624fadb 100644 (file)
@@ -179,6 +179,9 @@ static int Open(vlc_object_t *object)
     vout_display_t     *vd = (vout_display_t *)object;
     vout_display_sys_t *sys;
 
+    if (vout_display_IsWindowed(vd))
+        return VLC_EGENERIC;
+
     /* Allocate instance and initialize some members */
     vd->sys = sys = calloc(1, sizeof(*sys));
     if (!sys)
@@ -254,10 +257,10 @@ static int Open(vlc_object_t *object)
         Close(VLC_OBJECT(vd));
         return VLC_EGENERIC;
     }
-    vout_display_DeleteWindow(vd, NULL);
 
     /* */
-    video_format_t fmt = vd->fmt;
+    video_format_t fmt;
+    video_format_ApplyRotation(&fmt, &vd->fmt);
 
     if (sys->chroma) {
         fmt.i_chroma = sys->chroma;
@@ -314,7 +317,7 @@ static int Open(vlc_object_t *object)
 
     /* */
     vout_display_SendEventFullscreen(vd, true);
-    vout_display_SendEventDisplaySize(vd, fmt.i_visible_width, fmt.i_visible_height, true);
+    vout_display_SendEventDisplaySize(vd, fmt.i_visible_width, fmt.i_visible_height);
     return VLC_SUCCESS;
 }
 
@@ -327,7 +330,7 @@ static void Close(vlc_object_t *object)
     vout_display_sys_t *sys = vd->sys;
 
     if (sys->pool)
-        picture_pool_Delete(sys->pool);
+        picture_pool_Release(sys->pool);
     if (!sys->is_hw_accel && sys->picture)
         picture_Release(sys->picture);
 
@@ -394,20 +397,8 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
 }
 static int Control(vout_display_t *vd, int query, va_list args)
 {
-    vout_display_sys_t *sys = vd->sys;
-
-    switch (query) {
-    case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: {
-        const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
-        if (cfg->display.width  != sys->width ||
-            cfg->display.height != sys->height)
-            return VLC_EGENERIC;
-        return VLC_SUCCESS;
-    }
-    default:
-        msg_Err(vd, "Unsupported query in vout display fb");
-        return VLC_EGENERIC;
-    }
+    (void) vd; (void) query; (void) args;
+    return VLC_EGENERIC;
 }
 
 /* following functions are local */
@@ -591,7 +582,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
 
     switch (sys->var_info.bits_per_pixel) {
     case 8:
-        sys->palette = malloc(8 * 256 * sizeof(uint16_t));
+        sys->palette = malloc(4 * 256 * sizeof(uint16_t));
         if (!sys->palette) {
             /* Restore fb config */
             ioctl(sys->fd, FBIOPUT_VSCREENINFO, &sys->old_info);
@@ -602,9 +593,9 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
         sys->fb_cmap.start = 0;
         sys->fb_cmap.len = 256;
         sys->fb_cmap.red = sys->palette;
-        sys->fb_cmap.green = sys->palette + 256 * sizeof(uint16_t);
-        sys->fb_cmap.blue = sys->palette + 2 * 256 * sizeof(uint16_t);
-        sys->fb_cmap.transp = sys->palette + 3 * 256 * sizeof(uint16_t);
+        sys->fb_cmap.green = sys->palette + 256;
+        sys->fb_cmap.blue = sys->palette + 2 * 256;
+        sys->fb_cmap.transp = sys->palette + 3 * 256;
 
         /* Save the colormap */
         ioctl(sys->fd, FBIOGETCMAP, &sys->fb_cmap);