- /* Thread properties and locks */
- boolean_t b_die; /* `die' flag */
- boolean_t b_error; /* `error' flag */
- boolean_t b_active; /* `active' flag */
- pthread_t thread_id; /* id for pthread functions */
- pthread_mutex_t lock; /* thread lock */
- int * pi_status; /* temporary status flag */
-
- /* Common display properties */
- boolean_t b_info; /* print additionnal informations */
- boolean_t b_grayscale; /* color or grayscale display */
- int i_width; /* current output method width */
- int i_height; /* current output method height */
- int i_bytes_per_line;/* bytes per line (including virtual) */
- int i_screen_depth; /* bits per pixel */
- int i_bytes_per_pixel; /* real screen depth */
- float f_x_ratio; /* horizontal display ratio */
- float f_y_ratio; /* vertical display ratio */
- float f_gamma; /* gamma */
-
- /* Changed properties values - some of them are treated directly by the
- * thread, the over may be ignored or handled by vout_SysManage */
- boolean_t b_gamma_change; /* gamma change indicator */
- int i_new_width; /* new width */
- int i_new_height; /* new height */
-
-#ifdef STATS
- /* Statistics - these numbers are not supposed to be accurate */
- count_t c_loops; /* number of loops */
- count_t c_idle_loops; /* number of idle loops */
- count_t c_fps_samples; /* picture counts */
- mtime_t fps_sample[ VOUT_FPS_SAMPLES ]; /* FPS samples dates */
-#endif
-
-#ifdef DEBUG_VIDEO
- /* Video debugging informations */
- mtime_t picture_render_time; /* last picture rendering time */
-#endif
-
- /* Output method */
- p_vout_sys_t p_sys; /* system output method */
-
- /* Video heap */
- picture_t p_picture[VOUT_MAX_PICTURES]; /* pictures */
-
- /* YUV translation tables - they have to be casted to the appropriate width
- * on use. All tables are allocated in the same memory block, based at
- * p_trans_base, and shifted depending of the output thread configuration */
- byte_t * p_trans_base; /* base for all translation tables */
- void * p_trans_red;
- void * p_trans_green;
- void * p_trans_blue;
- void * p_trans_gray;
-
- /* YUV translation tables, for optimized C YUV transform ?? */
-} vout_thread_t;
-
-/*******************************************************************************
+ VLC_COMMON_MEMBERS
+
+ /* Thread properties and lock */
+ vlc_mutex_t picture_lock; /* picture heap lock */
+ vlc_mutex_t subpicture_lock; /* subpicture heap lock */
+ vlc_mutex_t change_lock; /* thread change lock */
+ vout_sys_t * p_sys; /* system output method */
+
+ /* Current display properties */
+ uint16_t i_changes; /* changes made to the thread */
+ float f_gamma; /* gamma */
+ vlc_bool_t b_grayscale; /* color or grayscale display */
+ vlc_bool_t b_info; /* print additional information */
+ vlc_bool_t b_interface; /* render interface */
+ vlc_bool_t b_scale; /* allow picture scaling */
+ vlc_bool_t b_fullscreen; /* toogle fullscreen display */
+ vlc_bool_t b_override_aspect; /* aspect ratio overriden */
+ mtime_t render_time; /* last picture render time */
+ unsigned int i_window_width; /* video window width */
+ unsigned int i_window_height; /* video window height */
+
+ /* Plugin used and shortcuts to access its capabilities */
+ module_t * p_module;
+ int ( *pf_init ) ( vout_thread_t * );
+ void ( *pf_end ) ( vout_thread_t * );
+ int ( *pf_manage ) ( vout_thread_t * );
+ void ( *pf_render ) ( vout_thread_t *, picture_t * );
+ void ( *pf_display ) ( vout_thread_t *, picture_t * );
+
+ /* Statistics - 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 */
+
+ /* Video heap and translation tables */
+ int i_heap_size; /* heap size */
+ picture_heap_t render; /* rendered pictures */
+ picture_heap_t output; /* direct buffers */
+ vlc_bool_t b_direct; /* rendered are like direct ? */
+ vout_chroma_t chroma; /* translation tables */
+
+ /* Picture and subpicture heaps */
+ picture_t p_picture[2*VOUT_MAX_PICTURES]; /* pictures */
+ subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */
+
+ /* Bitmap fonts */
+ vout_font_t * p_default_font; /* default font */
+ vout_font_t * p_large_font; /* large font */
+
+ /* Statistics */
+ count_t c_loops;
+ count_t c_pictures, c_late_pictures;
+ mtime_t display_jitter; /* average deviation from the PTS */
+ count_t c_jitter_samples; /* number of samples used for the *
+ * calculation of the jitter */
+
+ /* Filter chain */
+ char *psz_filter_chain;
+ vlc_bool_t b_filter_change;
+};
+
+#define I_OUTPUTPICTURES p_vout->output.i_pictures
+#define PP_OUTPUTPICTURE p_vout->output.pp_picture
+#define I_RENDERPICTURES p_vout->render.i_pictures
+#define PP_RENDERPICTURE p_vout->render.pp_picture
+
+/* Flags for changes - these flags are set in the i_changes field when another
+ * thread changed a variable */
+#define VOUT_INFO_CHANGE 0x0001 /* b_info changed */
+#define VOUT_GRAYSCALE_CHANGE 0x0002 /* b_grayscale changed */
+#define VOUT_INTF_CHANGE 0x0004 /* b_interface changed */
+#define VOUT_SCALE_CHANGE 0x0008 /* b_scale changed */
+#define VOUT_GAMMA_CHANGE 0x0010 /* gamma changed */
+#define VOUT_CURSOR_CHANGE 0x0020 /* b_cursor changed */
+#define VOUT_FULLSCREEN_CHANGE 0x0040 /* b_fullscreen changed */
+#define VOUT_SIZE_CHANGE 0x0200 /* size changed */
+#define VOUT_DEPTH_CHANGE 0x0400 /* depth changed */
+#define VOUT_CHROMA_CHANGE 0x0800 /* change chroma tables */
+
+#define MAX_JITTER_SAMPLES 20
+
+/*****************************************************************************