video_output.h 5.59 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.
 *******************************************************************************
 * Requires:
 *  "config.h"
 *  "common.h"
 *  "mtime.h"
13
 *  "vlc_thread.h"
Michel Kaempf's avatar
Michel Kaempf committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *  "video.h"
 *******************************************************************************/

/*******************************************************************************
 * vout_thread_t: video output thread descriptor
 *******************************************************************************
 * Any independant video output device, such as an X11 window, is represented
 * by a video output thread, and described using following structure.
 *******************************************************************************/
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
29
30
    pthread_t           thread_id;                 /* id for pthread functions */
    pthread_mutex_t     lock;                                   /* thread lock */
Michel Kaempf's avatar
Michel Kaempf committed
31
32
33
34
35
36
37
    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
38
39
    float               f_x_ratio;                 /* horizontal display ratio */
    float               f_y_ratio;                   /* vertical display ratio */
Michel Kaempf's avatar
Michel Kaempf committed
40
41

    /* Output method */
Vincent Seguin's avatar
Vincent Seguin committed
42
    p_vout_sys_t        p_sys;                         /* system output method */
Michel Kaempf's avatar
Michel Kaempf committed
43
44
45

    /* Video heap */
    int                 i_pictures;                       /* current heap size */
Vincent Seguin's avatar
Vincent Seguin committed
46
    picture_t           p_picture[VOUT_MAX_PICTURES];              /* pictures */
Michel Kaempf's avatar
Michel Kaempf committed
47
48
49
50
51
52
53
54
55
56
57

#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

    /* Rendering functions - these functions are of vout_render_blank_t and 
     * vout_render_line_t, but are not declared here using these types since
     * they require vout_thread_t to be defined */
Vincent Seguin's avatar
Vincent Seguin committed
58
/*    void (* RenderRGBBlank)         ( struct vout_thread_s *p_vout, pixel_t pixel,
Michel Kaempf's avatar
Michel Kaempf committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
                                      int i_x, int i_y, int i_width, int i_height );
    void (* RenderPixelBlank)       ( struct vout_thread_s *p_vout, pixel_t pixel,
                                      int i_x, int i_y, int i_width, int i_height );
    void (* RenderRGBLine)          ( struct vout_thread_s *p_vout, picture_t *p_pic,
                                      int i_x, int i_y, int i_pic_x, int i_pic_y, 
                                      int i_width, int i_line_width, int i_ratio ); 
    void (* RenderPixelLine)        ( struct vout_thread_s *p_vout, picture_t *p_pic,
                                      int i_x, int i_y, int i_pic_x, int i_pic_y, 
                                      int i_width, int i_line_width, int i_ratio ); 
    void (* RenderRGBMaskLine)      ( struct vout_thread_s *p_vout, picture_t *p_pic,
                                      int i_x, int i_y, int i_pic_x, int i_pic_y, 
                                      int i_width, int i_line_width, int i_ratio ); 
    void (* RenderPixelMaskLine)    ( struct vout_thread_s *p_vout, picture_t *p_pic,
                                      int i_x, int i_y, int i_pic_x, int i_pic_y, 
                                      int i_width, int i_line_width, int i_ratio ); 
Vincent Seguin's avatar
Vincent Seguin committed
74
  */  /* ?? add YUV types */
Michel Kaempf's avatar
Michel Kaempf committed
75
76
77
78
79
} vout_thread_t;

/*******************************************************************************
 * Prototypes
 *******************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
80
81
vout_thread_t * vout_CreateThread               ( 
#if defined(VIDEO_X11)
82
                                                  char *psz_display, Window root_window, 
Vincent Seguin's avatar
Vincent Seguin committed
83
84
85
86
87
#elif defined(VIDEO_FB)
                                                  //??void
#endif
                                                  int i_width, int i_height, int *pi_status
                                                );
Michel Kaempf's avatar
Michel Kaempf committed
88

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

Vincent Seguin's avatar
Vincent Seguin committed
91
92
93
94
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
95
96
97
98
99
100
101
102
103
104
105
106
107
void            vout_LinkPicture                ( vout_thread_t *p_vout, picture_t *p_pic );
void            vout_UnlinkPicture              ( vout_thread_t *p_vout, picture_t *p_pic );

#ifdef DEBUG
void            vout_PrintHeap                  ( vout_thread_t *p_vout, char *psz_str );
#endif







Vincent Seguin's avatar
Vincent Seguin committed
108
109
110
111
112
113
114
115
116