]> git.sesse.net Git - vlc/blobdiff - modules/video_output/yuv.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / video_output / yuv.c
index 648124bb1e48d4eca41cd8da63fe8b666e5657ae..845e43bb1609e743fac00fb8127d7233d6f57cd3 100644 (file)
@@ -33,7 +33,7 @@
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
 #include <vlc_picture_pool.h>
-#include <vlc_charset.h>
+#include <vlc_fs.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -41,7 +41,7 @@
 #define YUV_FILE_TEXT N_("device, fifo or filename")
 #define YUV_FILE_LONGTEXT N_("device, fifo or filename to write yuv frames too.")
 
-#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 I420.")
 
@@ -80,10 +80,10 @@ static const char *const ppsz_vout_options[] = {
 };
 
 /* */
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
 /*****************************************************************************
  * vout_display_sys_t: video output descriptor
@@ -92,7 +92,6 @@ struct vout_display_sys_t {
     FILE *f;
     bool  is_first;
     bool  is_yuv4mpeg2;
-    bool  use_dr;
 
     picture_pool_t *pool;
 };
@@ -133,7 +132,6 @@ static int Open(vlc_object_t *object)
             return VLC_EGENERIC;
         }
     }
-    sys->use_dr = chroma == vd->fmt.i_chroma;
     msg_Dbg(vd, "Using chroma %4.4s", (char *)&chroma);
 
     /* */
@@ -143,7 +141,7 @@ static int Open(vlc_object_t *object)
         free(sys);
         return VLC_EGENERIC;
     }
-    sys->f = utf8_fopen(name, "wb");
+    sys->f = vlc_fopen(name, "wb");
 
     if (!sys->f) {
         msg_Err(vd, "Failed to open %s", name);
@@ -166,7 +164,7 @@ static int Open(vlc_object_t *object)
     /* */
     vd->fmt     = fmt;
     vd->info    = info;
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -191,15 +189,12 @@ static void Close(vlc_object_t *object)
 /*****************************************************************************
  *
  *****************************************************************************/
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
-    if (!sys->pool) {
-        sys->pool = picture_pool_NewFromFormat(&vd->fmt, sys->use_dr ? VOUT_MAX_PICTURES : 1);
-        if (!sys->pool)
-            return NULL;
-    }
-    return picture_pool_Get(sys->pool);
+    if (!sys->pool)
+        sys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
+    return sys->pool;
 }
 
 static void Display(vout_display_t *vd, picture_t *picture)