]> git.sesse.net Git - vlc/blobdiff - modules/video_output/fb.c
Qt: reinstate the small QSplitter on Mac for the playlist
[vlc] / modules / video_output / fb.c
index 1426ad9babaa69eea8f0842656ceb7cb6c7dcfa6..2d54669c34d8f906ede21d51172d48b5db357164 100644 (file)
@@ -83,14 +83,14 @@ vlc_module_begin ()
     set_shortname("Framebuffer")
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
-    add_file(FB_DEV_VAR, "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
-              false)
-    add_bool("fb-tty", true, NULL, TTY_TEXT, TTY_LONGTEXT, true)
-    add_string( "fb-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
+    add_loadfile(FB_DEV_VAR, "/dev/fb0", DEVICE_TEXT, DEVICE_LONGTEXT,
+                 false)
+    add_bool("fb-tty", true, TTY_TEXT, TTY_LONGTEXT, true)
+    add_string( "fb-chroma", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
     add_obsolete_string("fb-aspect-ratio")
-    add_integer("fb-mode", 4, NULL, FB_MODE_TEXT, FB_MODE_LONGTEXT,
+    add_integer("fb-mode", 4, FB_MODE_TEXT, FB_MODE_LONGTEXT,
                  true)
-    add_bool("fb-hw-accel", true, NULL, HW_ACCEL_TEXT, HW_ACCEL_LONGTEXT,
+    add_bool("fb-hw-accel", true, HW_ACCEL_TEXT, HW_ACCEL_LONGTEXT,
               true)
     set_description(N_("GNU/Linux framebuffer video output"))
     set_capability("vout display", 30)
@@ -108,7 +108,9 @@ static void           Manage (vout_display_t *);
 /* */
 static int  OpenDisplay  (vout_display_t *, bool force_resolution);
 static void CloseDisplay (vout_display_t *);
+#if 0
 static void SwitchDisplay(int i_signal);
+#endif
 static void TextMode     (int tty);
 static void GfxMode      (int tty);
 
@@ -123,8 +125,10 @@ struct vout_display_sys_t {
     struct termios      old_termios;
 
     /* Original configuration information */
+#if 0
     struct sigaction            sig_usr1;           /* USR1 previous handler */
     struct sigaction            sig_usr2;           /* USR2 previous handler */
+#endif
     struct vt_mode              vt_mode;                 /* previous VT mode */
 
     /* Framebuffer information */
@@ -144,7 +148,7 @@ struct vout_display_sys_t {
     int      bytes_per_pixel;
 
     /* Video memory */
-    uint8_t     *video_ptr;                                  /* base adress */
+    uint8_t     *video_ptr;                                 /* base address */
     size_t      video_size;                                    /* page size */
 
     picture_t       *picture;
@@ -182,11 +186,11 @@ static int Open(vlc_object_t *object)
         return VLC_ENOMEM;
 
     /* Does the framebuffer uses hw acceleration? */
-    sys->is_hw_accel = var_CreateGetBool(vd, "fb-hw-accel");
+    sys->is_hw_accel = var_InheritBool(vd, "fb-hw-accel");
 
     /* Set tty and fb devices */
     sys->tty = 0; /* 0 == /dev/tty0 == current console */
-    sys->is_tty = var_CreateGetBool(vd, "fb-tty");
+    sys->is_tty = var_InheritBool(vd, "fb-tty");
 #if !defined(WIN32) &&  defined(HAVE_ISATTY)
     /* Check that stdin is a TTY */
     if (sys->is_tty && !isatty(0)) {
@@ -198,7 +202,7 @@ static int Open(vlc_object_t *object)
                  "there is no way to return to the TTY");
 #endif
 
-    const int mode = var_CreateGetInteger(vd, "fb-mode");
+    const int mode = var_InheritInteger(vd, "fb-mode");
     bool force_resolution = true;
     switch (mode) {
     case 0: /* QCIF */
@@ -223,7 +227,7 @@ static int Open(vlc_object_t *object)
         break;
     }
 
-    char *chroma = var_CreateGetNonEmptyString(vd, "fb-chroma");
+    char *chroma = var_InheritString(vd, "fb-chroma");
     if (chroma) {
         sys->chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES, chroma);
 
@@ -251,6 +255,7 @@ 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;
@@ -455,6 +460,7 @@ static int TtyInit(vout_display_t *vd)
 
     ioctl(sys->tty, VT_RELDISP, VT_ACKACQ);
 
+#if 0
     /* Set-up tty signal handler to be aware of tty changes */
     struct sigaction sig_tty;
     memset(&sig_tty, 0, sizeof(sig_tty));
@@ -466,6 +472,7 @@ static int TtyInit(vout_display_t *vd)
         /* FIXME SIGUSR1 could have succeed */
         goto error_signal;
     }
+#endif
 
     /* Set-up tty according to new signal handler */
     if (-1 == ioctl(sys->tty, VT_GETMODE, &sys->vt_mode)) {
@@ -485,9 +492,11 @@ static int TtyInit(vout_display_t *vd)
     return VLC_SUCCESS;
 
 error:
+#if 0
     sigaction(SIGUSR1, &sys->sig_usr1, NULL);
     sigaction(SIGUSR2, &sys->sig_usr2, NULL);
 error_signal:
+#endif
     tcsetattr(0, 0, &sys->old_termios);
     TextMode(sys->tty);
     return VLC_EGENERIC;
@@ -499,9 +508,11 @@ static void TtyExit(vout_display_t *vd)
     /* Reset the terminal */
     ioctl(sys->tty, VT_SETMODE, &sys->vt_mode);
 
+#if 0
     /* Remove signal handlers */
     sigaction(SIGUSR1, &sys->sig_usr1, NULL);
     sigaction(SIGUSR2, &sys->sig_usr2, NULL);
+#endif
 
     /* Reset the keyboard state */
     tcsetattr(0, 0, &sys->old_termios);
@@ -700,6 +711,7 @@ static void CloseDisplay(vout_display_t *vd)
     }
 }
 
+#if 0
 /*****************************************************************************
  * SwitchDisplay: VT change signal handler
  *****************************************************************************
@@ -708,8 +720,6 @@ static void CloseDisplay(vout_display_t *vd)
  *****************************************************************************/
 static void SwitchDisplay(int i_signal)
 {
-    VLC_UNUSED(i_signal);
-#if 0
     vout_display_t *vd;
 
     vlc_mutex_lock(&p_vout_bank->lock);
@@ -737,8 +747,8 @@ static void SwitchDisplay(int i_signal)
     }
 
     vlc_mutex_unlock(&p_vout_bank->lock);
-#endif
 }
+#endif
 
 /*****************************************************************************
  * TextMode and GfxMode : switch tty to text/graphic mode