video_output.h 4.86 KB
Newer Older
Michel Kaempf's avatar
Michel Kaempf committed
1
2
3
4
5
6
7
8
9
10
11
12
/*******************************************************************************
 * video_output.h : video output thread
 * (c)1999 VideoLAN
 *******************************************************************************
 * This module describes the programming interface for video output threads.
 * It includes functions allowing to open a new thread, send pictures to a
 * thread, and destroy a previously oppenned video output thread.
 *******************************************************************************/

/*******************************************************************************
 * vout_thread_t: video output thread descriptor
 *******************************************************************************
13
14
15
 * Any independant video output device, such as an X11 window or a GGI device,
 * is represented by a video output thread, and described using following 
 * structure.
Michel Kaempf's avatar
Michel Kaempf committed
16
17
18
19
20
21
22
 *******************************************************************************/
typedef struct vout_thread_s
{
    /* Thread properties and locks */
    boolean_t           b_die;                                   /* `die' flag */
    boolean_t           b_error;                               /* `error' flag */
    boolean_t           b_active;                             /* `active' flag */
Vincent Seguin's avatar
Vincent Seguin committed
23
24
    pthread_t           thread_id;                 /* id for pthread functions */
    pthread_mutex_t     lock;                                   /* thread lock */
Michel Kaempf's avatar
Michel Kaempf committed
25
26
27
    int *               pi_status;                    /* temporary status flag */

    /* Common display properties */
28
29
    boolean_t           b_info;              /* print additionnal informations */    
    boolean_t           b_grayscale;             /* color or grayscale display */    
Michel Kaempf's avatar
Michel Kaempf committed
30
31
    int                 i_width;                /* current output method width */
    int                 i_height;              /* current output method height */
32
    int                 i_bytes_per_line;/* bytes per line (including virtual) */    
Michel Kaempf's avatar
Michel Kaempf committed
33
34
    int                 i_screen_depth;                      /* bits per pixel */
    int                 i_bytes_per_pixel;                /* real screen depth */
Vincent Seguin's avatar
Vincent Seguin committed
35
36
    float               f_x_ratio;                 /* horizontal display ratio */
    float               f_y_ratio;                   /* vertical display ratio */
Michel Kaempf's avatar
Michel Kaempf committed
37

38
39
40
41
42
    /* New size for resizeable windows - they may be ignored or handled by
     * vout_SysManage */
    int                 i_new_width;                              /* new width */    
    int                 i_new_height;                            /* new height */    

Michel Kaempf's avatar
Michel Kaempf committed
43
#ifdef STATS    
44
    /* Statistics - these numbers are not supposed to be accurate */
45
46
    count_t             c_loops;                            /* number of loops */
    count_t             c_idle_loops;                  /* number of idle loops */
47
48
    count_t             c_fps_samples;                       /* picture counts */    
    mtime_t             fps_sample[ VOUT_FPS_SAMPLES ];   /* FPS samples dates */
49
50
51
52
53
#endif

#ifdef DEBUG_VIDEO
    /* Video debugging informations */
    mtime_t             picture_render_time;    /* last picture rendering time */
Michel Kaempf's avatar
Michel Kaempf committed
54
55
#endif

56
57
58
59
60
61
    /* Output method */
    p_vout_sys_t        p_sys;                         /* system output method */

    /* Video heap */
    picture_t           p_picture[VOUT_MAX_PICTURES];              /* pictures */

62
63
64
    /* YUV translation tables, for 15,16 and 24/32 bpp displays. 16 bits and 32
     * bits pointers points on the same data.
     * CAUTION: these tables are translated: their origin is -384 */
65
66
67
68
69
70
    u16 *               pi_trans16_red;
    u16 *               pi_trans16_green;
    u16 *               pi_trans16_blue;
    u32 *               pi_trans32_red;
    u32 *               pi_trans32_green;
    u32 *               pi_trans32_blue;          
Michel Kaempf's avatar
Michel Kaempf committed
71
72
73
74
75
} vout_thread_t;

/*******************************************************************************
 * Prototypes
 *******************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
76
vout_thread_t * vout_CreateThread               ( 
77
#ifdef VIDEO_X11
78
                                                  char *psz_display, Window root_window, 
Vincent Seguin's avatar
Vincent Seguin committed
79
80
81
#endif
                                                  int i_width, int i_height, int *pi_status
                                                );
Michel Kaempf's avatar
Michel Kaempf committed
82

Vincent Seguin's avatar
Vincent Seguin committed
83
void            vout_DestroyThread              ( vout_thread_t *p_vout, int *pi_status );
Michel Kaempf's avatar
Michel Kaempf committed
84

Vincent Seguin's avatar
Vincent Seguin committed
85
86
87
88
picture_t *     vout_CreatePicture              ( vout_thread_t *p_vout, int i_type, 
						  int i_width, int i_height, int i_bytes_per_line );
void            vout_DestroyPicture             ( vout_thread_t *p_vout, picture_t *p_pic );
void            vout_DisplayPicture             ( vout_thread_t *p_vout, picture_t *p_pic );
Michel Kaempf's avatar
Michel Kaempf committed
89
90
91
92
93
94
95
96
97
98
void            vout_LinkPicture                ( vout_thread_t *p_vout, picture_t *p_pic );
void            vout_UnlinkPicture              ( vout_thread_t *p_vout, picture_t *p_pic );








Vincent Seguin's avatar
Vincent Seguin committed
99
100
101
102
103
104
105
106
107