video_output.h 4.12 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
28
29
30
31
    int *               pi_status;                    /* temporary status flag */

    /* Common display properties */
    int                 i_width;                /* current output method width */
    int                 i_height;              /* current output method height */
    int                 i_screen_depth;                      /* bits per pixel */
    int                 i_bytes_per_pixel;                /* real screen depth */
Vincent Seguin's avatar
Vincent Seguin committed
32
33
    float               f_x_ratio;                 /* horizontal display ratio */
    float               f_y_ratio;                   /* vertical display ratio */
Michel Kaempf's avatar
Michel Kaempf committed
34
35
36
37
38
39
40
41

#ifdef STATS    
    /* Statistics */
    count_t         c_loops;                               /* number of loops */
    count_t         c_idle_loops;                     /* number of idle loops */
    count_t         c_pictures;           /* number of pictures added to heap */
#endif

42
43
44
45
46
47
48
    /* Output method */
    p_vout_sys_t        p_sys;                         /* system output method */

    /* Video heap */
    int                 i_pictures;                       /* current heap size */
    picture_t           p_picture[VOUT_MAX_PICTURES];              /* pictures */

49
50
51
52
53
54
55
56
57
    /* 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 */
    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
58
59
60
61
62
} vout_thread_t;

/*******************************************************************************
 * Prototypes
 *******************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
63
vout_thread_t * vout_CreateThread               ( 
64
#ifdef VIDEO_X11
65
                                                  char *psz_display, Window root_window, 
Vincent Seguin's avatar
Vincent Seguin committed
66
67
68
#endif
                                                  int i_width, int i_height, int *pi_status
                                                );
Michel Kaempf's avatar
Michel Kaempf committed
69

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

Vincent Seguin's avatar
Vincent Seguin committed
72
73
74
75
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
76
77
78
79
80
81
82
83
84
85
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
86
87
88
89
90
91
92
93
94