vout_internal.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vout_internal.h : Internal vout definitions
00003  *****************************************************************************
00004  * Copyright (C) 2008 the VideoLAN team
00005  * Copyright (C) 2008 Laurent Aimar
00006  * $Id: 07b62ecc570162d4b28cee4a4972934a341966df $
00007  *
00008  * Authors: Laurent Aimar < fenrir _AT_ videolan _DOT_ org >
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 
00026 #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
00027 # error This header file can only be included from LibVLC.
00028 #endif
00029 
00030 #ifndef _VOUT_INTERNAL_H
00031 #define _VOUT_INTERNAL_H 1
00032 
00033 #include <vlc_picture_fifo.h>
00034 #include <vlc_picture_pool.h>
00035 #include <vlc_vout_display.h>
00036 #include <vlc_vout_wrapper.h>
00037 #include "vout_control.h"
00038 #include "control.h"
00039 #include "snapshot.h"
00040 #include "statistic.h"
00041 #include "chrono.h"
00042 
00043 /* It should be high enough to absorbe jitter due to difficult picture(s)
00044  * to decode but not too high as memory is not that cheap.
00045  *
00046  * It can be made lower at compilation time if needed, but performance
00047  * may be degraded.
00048  */
00049 #define VOUT_MAX_PICTURES (20)
00050 
00051 /**
00052  * Number of frames used to estimate the maximum filter chain latency.
00053  * For performance, it is best to use a power of 2
00054  */
00055 #define VOUT_FILTER_DELAYS (8)
00056 
00057 /* */
00058 struct vout_thread_sys_t
00059 {
00060     /* Splitter module if used */
00061     char            *splitter_name;
00062 
00063     /* Input thread for dvd menu interactions */
00064     vlc_object_t    *input;
00065 
00066     /* */
00067     video_format_t  original;   /* Original format ie coming from the decoder */
00068     unsigned        dpb_size;
00069 
00070     /* Snapshot interface */
00071     vout_snapshot_t snapshot;
00072 
00073     /* Statistics */
00074     vout_statistic_t statistic;
00075 
00076     /* Subpicture unit */
00077     vlc_mutex_t     spu_lock;
00078     spu_t           *p_spu;
00079 
00080     /* Monitor Pixel Aspect Ratio */
00081     unsigned int    i_par_num;
00082     unsigned int    i_par_den;
00083 
00084     /* Video output window */
00085     struct {
00086         bool              is_unused;
00087         vout_window_cfg_t cfg;
00088         vout_window_t     *object;
00089     } window;
00090 
00091     /* Thread & synchronization */
00092     vlc_thread_t    thread;
00093     bool            dead;
00094     vout_control_t  control;
00095 
00096     /* */
00097     struct {
00098         char           *title;
00099         vout_display_t *vd;
00100         bool           use_dr;
00101         picture_t      *filtered;
00102     } display;
00103 
00104     struct {
00105         mtime_t     date;
00106         mtime_t     timestamp;
00107         int         qtype;
00108         bool        is_interlaced;
00109         picture_t   *decoded;
00110     } displayed;
00111 
00112     struct {
00113         mtime_t     last;
00114         mtime_t     timestamp;
00115     } step;
00116 
00117     struct {
00118         bool        is_on;
00119         mtime_t     date;
00120     } pause;
00121 
00122     /* OSD title configuration */
00123     struct {
00124         bool        show;
00125         mtime_t     timeout;
00126         int         position;
00127     } title;
00128 
00129     /* */
00130     bool            is_late_dropped;
00131 
00132     /* Video filter2 chain */
00133     struct {
00134         vlc_mutex_t     lock;
00135         filter_chain_t *chain;
00136         unsigned        delay_index;
00137         mtime_t         delay[VOUT_FILTER_DELAYS];
00138     } filter;
00139 
00140     /* */
00141     vlc_mouse_t     mouse;
00142 
00143     /* */
00144     vlc_mutex_t     picture_lock;                 /**< picture heap lock */
00145     picture_pool_t  *private_pool;
00146     picture_pool_t  *display_pool;
00147     picture_pool_t  *decoder_pool;
00148     picture_fifo_t  *decoder_fifo;
00149     bool            is_decoder_pool_slow;
00150     vout_chrono_t   render;           /**< picture render time estimator */
00151 };
00152 
00153 /* TODO to move them to vlc_vout.h */
00154 void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
00155 void vout_ControlChangeOnTop(vout_thread_t *, bool is_on_top);
00156 void vout_ControlChangeDisplayFilled(vout_thread_t *, bool is_filled);
00157 void vout_ControlChangeZoom(vout_thread_t *, int num, int den);
00158 void vout_ControlChangeSampleAspectRatio(vout_thread_t *, unsigned num, unsigned den);
00159 void vout_ControlChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
00160 void vout_ControlChangeCropWindow(vout_thread_t *, int x, int y, int width, int height);
00161 void vout_ControlChangeCropBorder(vout_thread_t *, int left, int top, int right, int bottom);
00162 void vout_ControlChangeFilters(vout_thread_t *, const char *);
00163 void vout_ControlChangeSubFilters(vout_thread_t *, const char *);
00164 void vout_ControlChangeSubMargin(vout_thread_t *, int);
00165 
00166 /* */
00167 void vout_IntfInit( vout_thread_t * );
00168 
00169 /* */
00170 int  vout_OpenWrapper (vout_thread_t *, const char *, const vout_display_state_t *);
00171 void vout_CloseWrapper(vout_thread_t *, vout_display_state_t *);
00172 int  vout_InitWrapper(vout_thread_t *);
00173 void vout_EndWrapper(vout_thread_t *);
00174 void vout_ManageWrapper(vout_thread_t *);
00175 void vout_RenderWrapper(vout_thread_t *, picture_t *);
00176 void vout_DisplayWrapper(vout_thread_t *, picture_t *);
00177 
00178 /* */
00179 int spu_ProcessMouse(spu_t *, const vlc_mouse_t *, const video_format_t *);
00180 void spu_Attach( spu_t *, vlc_object_t *input, bool );
00181 void spu_ChangeMargin(spu_t *, int);
00182 
00183 #endif
00184 

Generated on Mon Nov 22 07:55:21 2010 for VLC by  doxygen 1.5.6