]> git.sesse.net Git - vlc/blobdiff - src/video_output/vout_internal.h
Clean up crop/aspect ratio changes and associated video format.
[vlc] / src / video_output / vout_internal.h
index 1aab60aed0d6f0b11593b301392682ca73354a04..f8baf521147b95744c81a5177dc688a6c172cd16 100644 (file)
 #ifndef _VOUT_INTERNAL_H
 #define _VOUT_INTERNAL_H 1
 
+#include <vlc_picture_fifo.h>
+#include <vlc_picture_pool.h>
+#include <vlc_vout_display.h>
 #include "vout_control.h"
+#include "control.h"
 #include "snapshot.h"
 #include "statistic.h"
-
-/* Number of pictures required to computes the FPS rate */
-#define VOUT_FPS_SAMPLES                20
+#include "chrono.h"
 
 /* */
 struct vout_thread_sys_t
@@ -46,8 +48,8 @@ struct vout_thread_sys_t
     /* Video output configuration */
     config_chain_t *p_cfg;
 
-    /* Place holder for the vout_wrapper code */
-    vout_sys_t      *p_sys;
+    /* */
+    video_format_t  original; /* Original format ie coming from the decoder */
 
     /* Thread & synchronization */
     vlc_thread_t    thread;
@@ -55,80 +57,91 @@ struct vout_thread_sys_t
     bool            b_ready;
     bool            b_done;
     bool            b_error;
+    vout_control_t  control;
 
     /* */
-    bool            b_picture_displayed;
-    bool            b_picture_empty;
-    mtime_t         i_picture_displayed_date;
-    picture_t       *p_picture_displayed;
-    int             i_picture_qtype;
-    bool            b_picture_interlaced;
-    vlc_cond_t      picture_wait;
-
-    /* */
-    vlc_mutex_t     vfilter_lock;         /**< video filter2 lock */
+    struct {
+        char           *title;
+        vout_display_t *vd;
+        bool           use_dr;
+        picture_t      *filtered;
+    } display;
+
+    struct {
+        mtime_t     date;
+        mtime_t     timestamp;
+        int         qtype;
+        bool        is_interlaced;
+        picture_t   *decoded;
+    } displayed;
+
+    struct {
+        mtime_t     last;
+        mtime_t     timestamp;
+    } step;
+
+    struct {
+        bool        is_on;
+        mtime_t     date;
+    } pause;
+
+    /* OSD title configuration */
+    struct {
+        bool        show;
+        mtime_t     timeout;
+        int         position;
+    } title;
 
     /* */
-    uint32_t        render_time;           /**< last picture render time */
     unsigned int    i_par_num;           /**< monitor pixel aspect-ratio */
     unsigned int    i_par_den;           /**< monitor pixel aspect-ratio */
-
-    /**
-     * These numbers are not supposed to be accurate, but are a
-     * good indication of the thread status */
-    count_t         c_fps_samples;                         /**< picture counts */
-    mtime_t         p_fps_sample[VOUT_FPS_SAMPLES];     /**< FPS samples dates */
+    bool            is_late_dropped;
 
     /* Statistics */
     vout_statistic_t statistic;
 
-    /* Pause */
-    bool            b_paused;
-    mtime_t         i_pause_date;
-
     /* Filter chain */
-    bool           b_first_vout;  /* True if it is the first vout of the filter chain */
     char           *psz_filter_chain;
     bool            b_filter_change;
 
     /* Video filter2 chain */
+    vlc_mutex_t     vfilter_lock;
     filter_chain_t *p_vf2_chain;
-    char           *psz_vf2;
 
     /* Snapshot interface */
     vout_snapshot_t snapshot;
 
-    /* Show media title on videoutput */
-    bool            b_title_show;
-    mtime_t         i_title_timeout;
-    int             i_title_position;
-
-    char            *psz_title;
-
     /* Subpicture unit */
     spu_t          *p_spu;
 
     /* */
     vlc_mouse_t     mouse;
+
+    /* */
+    vlc_mutex_t         picture_lock;                 /**< picture heap lock */
+    picture_pool_t      *private_pool;
+    picture_pool_t      *display_pool;
+    picture_pool_t      *decoder_pool;
+    picture_fifo_t      *decoder_fifo;
+    bool                is_decoder_pool_slow;
+    vout_chrono_t       render;           /**< picture render time estimator */
+
+    vlc_mutex_t         change_lock;                 /**< thread change lock */
 };
 
+/* TODO to move them to vlc_vout.h */
+void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
+void vout_ControlChangeOnTop(vout_thread_t *, bool is_on_top);
+void vout_ControlChangeDisplayFilled(vout_thread_t *, bool is_filled);
+void vout_ControlChangeZoom(vout_thread_t *, int num, int den);
+void vout_ControlChangeSampleAspectRatio(vout_thread_t *, unsigned num, unsigned den);
+void vout_ControlChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
+void vout_ControlChangeCropWindow(vout_thread_t *, int x, int y, int width, int height);
+void vout_ControlChangeCropBorder(vout_thread_t *, int left, int top, int right, int bottom);
+
 /* */
-int vout_AllocatePicture( vlc_object_t *, picture_t *, uint32_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den );
-#define vout_AllocatePicture(a,b,c,d,e,f,g) \
-        vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f,g)
-
-/* DO NOT use vout_RenderPicture/vout_IntfInit unless you are in src/video_ouput */
-picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
-                               subpicture_t *,
-                               mtime_t render_date );
 void vout_IntfInit( vout_thread_t * );
 
-/* DO NOT use vout_UsePictureLocked unless you are in src/video_ouput
- *
- * This function supposes that you call it with picture_lock taken.
- */
-void vout_UsePictureLocked( vout_thread_t *p_vout, picture_t *p_pic  );
-
 /* */
 int  vout_OpenWrapper (vout_thread_t *, const char *);
 void vout_CloseWrapper(vout_thread_t *);
@@ -138,5 +151,8 @@ int  vout_ManageWrapper(vout_thread_t *);
 void vout_RenderWrapper(vout_thread_t *, picture_t *);
 void vout_DisplayWrapper(vout_thread_t *, picture_t *);
 
+/* */
+int spu_ProcessMouse(spu_t *, const vlc_mouse_t *, const video_format_t *);
+
 #endif