1 /*******************************************************************************
2 * video.h: common video definitions
4 *******************************************************************************
5 * This header is required by all modules which have to handle pictures. It
6 * includes all common video types and constants.
7 *******************************************************************************
12 *******************************************************************************/
14 /*******************************************************************************
15 * yuv_data_t: type for storing one Y, U or V sample.
16 *******************************************************************************/
17 typedef u8 yuv_data_t;
19 /*******************************************************************************
20 * picture_t: video picture
21 *******************************************************************************
22 * Any picture destined to be displayed by a video output thread should be
23 * stored in this structure from it's creation to it's effective display.
24 * Picture type and flags should only be modified by the output thread. Note
25 * that an empty picture MUST have its flags set to 0.
26 *******************************************************************************/
27 typedef struct picture_s
29 /* Type and flags - should NOT be modified except by the vout thread */
30 int i_type; /* picture type */
31 int i_status; /* picture flags */
32 int i_matrix_coefficients; /* in YUV type, encoding type */
34 /* Picture static properties - those properties are fixed at initialization
35 * and should NOT be modified */
36 int i_width; /* picture width */
37 int i_height; /* picture height */
38 int i_chroma_width; /* chroma width */
40 /* Picture dynamic properties - those properties can be changed by the
42 int i_display_horizontal_offset; /* ISO/IEC 13818-2 6.3.12 */
43 int i_display_vertical_offset; /* ISO/IEC 13818-2 6.3.12 */
44 int i_display_width; /* useful picture width */
45 int i_display_height; /* useful picture height */
46 int i_aspect_ratio; /* aspect ratio */
48 /* Link reference counter - it can be modified using vout_Link and
49 * vout_Unlink functions, or directly if the picture is independant */
50 int i_refcount; /* link reference counter */
52 /* Macroblock counter - the decoder use it to verify if it has
53 * decoded all the macroblocks of the picture */
55 vlc_mutex_t lock_deccount;
57 /* Video properties - those properties should not be modified once
58 * the picture is in a heap, but can be freely modified if it is
60 mtime_t date; /* display date */
62 /* Picture data - data can always be freely modified. p_data itself
63 * (the pointer) should NEVER be modified. In YUV format, the p_y, p_u and
64 * p_v data pointers refers to different areas of p_data, and should not
66 void * p_data; /* picture data */
67 yuv_data_t * p_y; /* pointer to beginning of Y image in p_data */
68 yuv_data_t * p_u; /* pointer to beginning of U image in p_data */
69 yuv_data_t * p_v; /* pointer to beginning of V image in p_data */
73 #define EMPTY_PICTURE 0 /* picture slot is empty and available */
74 #define YUV_420_PICTURE 100 /* 4:2:0 YUV picture */
75 #define YUV_422_PICTURE 101 /* 4:2:2 YUV picture */
76 #define YUV_444_PICTURE 102 /* 4:4:4 YUV picture */
79 #define FREE_PICTURE 0 /* picture is free and not allocated */
80 #define RESERVED_PICTURE 1 /* picture is allocated and reserved */
81 #define READY_PICTURE 2 /* picture is ready for display */
82 #define DISPLAYED_PICTURE 3 /* picture has been displayed but is linked */
83 #define DESTROYED_PICTURE 4 /* picture is allocated but no more used */
85 /* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
86 #define AR_SQUARE_PICTURE 1 /* square pixels */
87 #define AR_3_4_PICTURE 2 /* 3:4 picture (TV) */
88 #define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */
89 #define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */
91 /*******************************************************************************
92 * subtitle_t: video subtitle
93 *******************************************************************************
94 * Any subtitle destined to be displayed by a video output thread should be
95 * stored in this structure from it's creation to it's effective display.
96 * Subtitle type and flags should only be modified by the output thread. Note
97 * that an empty subtitle MUST have its flags set to 0.
98 *******************************************************************************/
99 typedef struct subtitle_s
101 /* Type and flags - should NOT be modified except by the vout thread */
102 int i_type; /* subtitle type */
103 int i_status; /* subtitle flags */
105 /* Other properties */
106 mtime_t begin_date; /* beginning of display date */
107 mtime_t end_date; /* end of display date */
109 /* Subtitle data - data can always be freely modified. p_data itself
110 * (the pointer) should NEVER be modified. */
111 void * p_data; /* subtitle data */
115 #define EMPTY_SUBTITLE 0 /* subtitle slot is empty and available */
116 #define RLE_SUBTITLE 100 /* RLE encoded subtitle */
118 /* Subtitle status */
119 #define FREE_SUBTITLE 0 /* subtitle is free and not allocated */
120 #define RESERVED_SUBTITLE 1 /* subtitle is allocated and reserved */
121 #define READY_SUBTITLE 2 /* subtitle is ready for display */
122 #define DISPLAYED_SUBTITLE 3 /* subtitle has been displayed but is linked */
123 #define DESTROYED_SUBTITLE 4 /* subtitle is allocated but no more used */