X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvideo_output%2Fvout_internal.h;h=a182e72f2ff891e8a81fe606e0dcb9fbf645a65e;hb=8f2f41dcc6a3868b40833d5247143e6d7f387288;hp=7f5972d6ade80d83e7bb5cc919551b495a269970;hpb=b1c90ec51b105550b6feabf26a43b8afc1b6dda9;p=vlc diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h index 7f5972d6ad..a182e72f2f 100644 --- a/src/video_output/vout_internal.h +++ b/src/video_output/vout_internal.h @@ -30,80 +30,144 @@ #ifndef _VOUT_INTERNAL_H #define _VOUT_INTERNAL_H 1 +#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 + +/* */ struct vout_thread_sys_t { - /* */ - vlc_mutex_t vfilter_lock; /**< video filter2 change lock */ + /* module */ + char *psz_module_name; + + /* Video output configuration */ + config_chain_t *p_cfg; /* */ - 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 */ + 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) */ + + /* Thread & synchronization */ + vlc_thread_t thread; + vlc_cond_t change_wait; + bool b_ready; + bool b_done; + bool b_error; + vout_control_t control; /* */ - bool b_direct; /**< rendered are like direct ? */ - filter_t *p_chroma; + 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; - /** - * 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 */ + /* */ + unsigned int i_par_num; /**< monitor pixel aspect-ratio */ + unsigned int i_par_den; /**< monitor pixel aspect-ratio */ + bool is_late_dropped; /* Statistics */ - int i_picture_lost; - int i_picture_displayed; -#if 0 - 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 */ -#endif - - /* Pause */ - bool b_paused; - mtime_t i_pause_date; + 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; - char *psz_vf2; - - /* Misc */ - bool b_snapshot; /**< take one snapshot on the next loop */ - /* Show media title on videoutput */ - bool b_title_show; - mtime_t i_title_timeout; - int i_title_position; -}; + /* Snapshot interface */ + vout_snapshot_t snapshot; -/* DO NOT use vout_RenderPicture unless you are in src/video_ouput */ -picture_t *vout_RenderPicture( vout_thread_t *, picture_t *, - subpicture_t *, bool b_paused ); + /* Subpicture unit */ + spu_t *p_spu; -/* DO NOT use vout_CountPictureAvailable unless your are in src/input/decoder.c (no exception) */ -int vout_CountPictureAvailable( vout_thread_t * ); - -/** - * This function will (un)pause the display of pictures. - * It is thread safe - */ -void vout_ChangePause( vout_thread_t *, bool b_paused, mtime_t i_date ); + /* */ + vlc_mouse_t mouse; -/** - * This function will apply an offset on subtitle subpicture. - */ -void spu_OffsetSubtitleDate( spu_t *p_spu, mtime_t i_duration ); + /* */ + 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 */ +}; -/** - * This function will return and reset internal statistics. +/** \defgroup vout_changes Flags for changes + * These flags are set in the vout_thread_t::i_changes field when another + * thread changed a variable + * @{ */ -void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_lost ); +/** 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_IntfInit( vout_thread_t * ); + +/* */ +int vout_OpenWrapper (vout_thread_t *, const char *); +void vout_CloseWrapper(vout_thread_t *); +int vout_InitWrapper(vout_thread_t *); +void vout_EndWrapper(vout_thread_t *); +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