]> git.sesse.net Git - vlc/blob - include/video_output.h
Correction de quelques erreurs dans l'interface et vout.
[vlc] / include / video_output.h
1 /*******************************************************************************
2  * video_output.h : video output thread
3  * (c)1999 VideoLAN
4  *******************************************************************************
5  * This module describes the programming interface for video output threads.
6  * It includes functions allowing to open a new thread, send pictures to a
7  * thread, and destroy a previously oppenned video output thread.
8  *******************************************************************************
9  * Requires:
10  *  "config.h"
11  *  "common.h"
12  *  "mtime.h"
13  *  "vlc_thread.h"
14  *  "video.h"
15  *******************************************************************************/
16
17 /*******************************************************************************
18  * vout_thread_t: video output thread descriptor
19  *******************************************************************************
20  * Any independant video output device, such as an X11 window, is represented
21  * by a video output thread, and described using following structure.
22  *******************************************************************************/
23 typedef struct vout_thread_s
24 {
25     /* Thread properties and locks */
26     boolean_t           b_die;                                   /* `die' flag */
27     boolean_t           b_error;                               /* `error' flag */
28     boolean_t           b_active;                             /* `active' flag */
29     pthread_t           thread_id;                 /* id for pthread functions */
30     pthread_mutex_t     lock;                                   /* thread lock */
31     int *               pi_status;                    /* temporary status flag */
32
33     /* Common display properties */
34     int                 i_width;                /* current output method width */
35     int                 i_height;              /* current output method height */
36     int                 i_screen_depth;                      /* bits per pixel */
37     int                 i_bytes_per_pixel;                /* real screen depth */
38     float               f_x_ratio;                 /* horizontal display ratio */
39     float               f_y_ratio;                   /* vertical display ratio */
40
41     /* Output method */
42     p_vout_sys_t        p_sys;                         /* system output method */
43
44     /* Video heap */
45     int                 i_pictures;                       /* current heap size */
46     picture_t           p_picture[VOUT_MAX_PICTURES];              /* pictures */
47
48 #ifdef STATS    
49     /* Statistics */
50     count_t         c_loops;                               /* number of loops */
51     count_t         c_idle_loops;                     /* number of idle loops */
52     count_t         c_pictures;           /* number of pictures added to heap */
53 #endif
54
55     /* Rendering functions - these functions are of vout_render_blank_t and 
56      * vout_render_line_t, but are not declared here using these types since
57      * they require vout_thread_t to be defined */
58 /*    void (* RenderRGBBlank)         ( struct vout_thread_s *p_vout, pixel_t pixel,
59                                       int i_x, int i_y, int i_width, int i_height );
60     void (* RenderPixelBlank)       ( struct vout_thread_s *p_vout, pixel_t pixel,
61                                       int i_x, int i_y, int i_width, int i_height );
62     void (* RenderRGBLine)          ( struct vout_thread_s *p_vout, picture_t *p_pic,
63                                       int i_x, int i_y, int i_pic_x, int i_pic_y, 
64                                       int i_width, int i_line_width, int i_ratio ); 
65     void (* RenderPixelLine)        ( struct vout_thread_s *p_vout, picture_t *p_pic,
66                                       int i_x, int i_y, int i_pic_x, int i_pic_y, 
67                                       int i_width, int i_line_width, int i_ratio ); 
68     void (* RenderRGBMaskLine)      ( struct vout_thread_s *p_vout, picture_t *p_pic,
69                                       int i_x, int i_y, int i_pic_x, int i_pic_y, 
70                                       int i_width, int i_line_width, int i_ratio ); 
71     void (* RenderPixelMaskLine)    ( struct vout_thread_s *p_vout, picture_t *p_pic,
72                                       int i_x, int i_y, int i_pic_x, int i_pic_y, 
73                                       int i_width, int i_line_width, int i_ratio ); 
74   */  /* ?? add YUV types */
75 } vout_thread_t;
76
77 /*******************************************************************************
78  * Prototypes
79  *******************************************************************************/
80 vout_thread_t * vout_CreateThread               ( 
81 #if defined(VIDEO_X11)
82                                                   char *psz_display, Window root_window, 
83 #elif defined(VIDEO_FB)
84                                                   //??void
85 #endif
86                                                   int i_width, int i_height, int *pi_status
87                                                 );
88
89 void            vout_DestroyThread              ( vout_thread_t *p_vout, int *pi_status );
90
91 picture_t *     vout_CreatePicture              ( vout_thread_t *p_vout, int i_type, 
92                                                   int i_width, int i_height, int i_bytes_per_line );
93 void            vout_DestroyPicture             ( vout_thread_t *p_vout, picture_t *p_pic );
94 void            vout_DisplayPicture             ( vout_thread_t *p_vout, picture_t *p_pic );
95 void            vout_LinkPicture                ( vout_thread_t *p_vout, picture_t *p_pic );
96 void            vout_UnlinkPicture              ( vout_thread_t *p_vout, picture_t *p_pic );
97
98 #ifdef DEBUG
99 void            vout_PrintHeap                  ( vout_thread_t *p_vout, char *psz_str );
100 #endif
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116