X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvideo_output%2Fvout_internal.h;h=c256736d166a58c015d0295b0b57dc48fd4dcd98;hb=4bfd8cb7103f6776d4463de001edee8e30f9e9b9;hp=d6b8fe24a342800f9be8fcbbac769c15fff3de8e;hpb=8f0d6292981f4487f106398a5bcfe497fbb7c59e;p=vlc diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h index d6b8fe24a3..c256736d16 100644 --- a/src/video_output/vout_internal.h +++ b/src/video_output/vout_internal.h @@ -33,35 +33,64 @@ #include #include #include +#include #include "vout_control.h" #include "control.h" #include "snapshot.h" #include "statistic.h" #include "chrono.h" -/* Number of pictures required to computes the FPS rate */ -#define VOUT_FPS_SAMPLES 20 +/* It should be high enough to absorbe jitter due to difficult picture(s) + * to decode but not too high as memory is not that cheap. + * + * It can be made lower at compilation time if needed, but performance + * may be degraded. + */ +#define VOUT_MAX_PICTURES (20) + +/** + * Number of frames used to estimate the maximum filter chain latency. + * For performance, it is best to use a power of 2 + */ +#define VOUT_FILTER_DELAYS (8) /* */ struct vout_thread_sys_t { - /* module */ - char *psz_module_name; + /* Splitter module if used */ + char *splitter_name; - /* Video output configuration */ - config_chain_t *p_cfg; + /* Input thread for dvd menu interactions */ + vlc_object_t *input; /* */ - video_format_t fmt_render; /* render format (from the decoder) */ - video_format_t fmt_in; /* input (modified render) format */ - video_format_t fmt_out; /* output format (for the video output) */ + video_format_t original; /* Original format ie coming from the decoder */ + unsigned dpb_size; + + /* Snapshot interface */ + vout_snapshot_t snapshot; + + /* Statistics */ + vout_statistic_t statistic; + + /* Subpicture unit */ + vlc_mutex_t spu_lock; + spu_t *p_spu; + + /* Monitor Pixel Aspect Ratio */ + unsigned int i_par_num; + unsigned int i_par_den; + + /* Video output window */ + struct { + bool is_unused; + vout_window_cfg_t cfg; + vout_window_t *object; + } window; /* Thread & synchronization */ vlc_thread_t thread; - vlc_cond_t change_wait; - bool b_ready; - bool b_done; - bool b_error; + bool dead; vout_control_t control; /* */ @@ -98,81 +127,56 @@ struct vout_thread_sys_t } title; /* */ - unsigned int i_par_num; /**< monitor pixel aspect-ratio */ - unsigned int i_par_den; /**< monitor pixel aspect-ratio */ bool is_late_dropped; - /* Statistics */ - vout_statistic_t statistic; - - /* Filter chain */ - char *psz_filter_chain; - bool b_filter_change; - /* Video filter2 chain */ vlc_mutex_t vfilter_lock; - filter_chain_t *p_vf2_chain; - - /* Snapshot interface */ - vout_snapshot_t snapshot; - - /* Subpicture unit */ - spu_t *p_spu; + filter_chain_t *vfilter_chain; + unsigned vfilter_delay_index; + mtime_t vfilter_delay[VOUT_FILTER_DELAYS]; /* */ 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 */ - - uint16_t i_changes; /**< changes made to the thread. - \see \ref vout_changes */ + 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 */ }; -/** \defgroup vout_changes Flags for changes - * These flags are set in the vout_thread_t::i_changes field when another - * thread changed a variable - * @{ - */ -/** cropping parameters changed */ -#define VOUT_CROP_CHANGE 0x1000 -/** aspect ratio changed */ -#define VOUT_ASPECT_CHANGE 0x2000 -/**@}*/ - /* 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); +void vout_ControlChangeFilters(vout_thread_t *, const char *); +void vout_ControlChangeSubFilters(vout_thread_t *, const char *); +void vout_ControlChangeSubMargin(vout_thread_t *, int); /* */ void vout_IntfInit( vout_thread_t * ); /* */ -int vout_OpenWrapper (vout_thread_t *, const char *); -void vout_CloseWrapper(vout_thread_t *); +int vout_OpenWrapper (vout_thread_t *, const char *, const vout_display_state_t *); +void vout_CloseWrapper(vout_thread_t *, vout_display_state_t *); int vout_InitWrapper(vout_thread_t *); void vout_EndWrapper(vout_thread_t *); -int vout_ManageWrapper(vout_thread_t *); +void 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 *); - -/* */ -int vout_ShowTextRelative( vout_thread_t *, int, char *, const text_style_t *, int, int, int, mtime_t ); -int vout_ShowTextAbsolute( vout_thread_t *, int, const char *, const text_style_t *, int, int, int, mtime_t, mtime_t ); - +void spu_Attach( spu_t *, vlc_object_t *input, bool ); +void spu_ChangeMargin(spu_t *, int); #endif