xine-lib  1.2.9
video_overlay.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2014 the xine project
3  *
4  * This file is part of xine, a free video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  */
20 
21 #ifndef HAVE_VIDEO_OVERLAY_H
22 #define HAVE_VIDEO_OVERLAY_H
23 
24 #include <xine/xine_internal.h>
25 
26 #ifdef __GNUC__
27 #define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) {y: (_y), cr: (_cr), cb: (_cb)}
28 #else
29 #define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) { (_cb), (_cr), (_y) }
30 #endif
31 
32 #define MAX_OBJECTS 50
33 #define MAX_EVENTS 50
34 #define MAX_SHOWING (5 + 16)
35 
36 #define OVERLAY_EVENT_NULL 0
37 #define OVERLAY_EVENT_SHOW 1
38 #define OVERLAY_EVENT_HIDE 2
39 #define OVERLAY_EVENT_MENU_BUTTON 3
40 #define OVERLAY_EVENT_FREE_HANDLE 8 /* Frees a handle, previous allocated via get_handle */
41 
42 typedef struct video_overlay_object_s {
43  int32_t handle; /* Used to match Show and Hide events. */
44  uint32_t object_type; /* 0=Subtitle, 1=Menu */
45  int64_t pts; /* Needed for Menu button compares */
46  vo_overlay_t *overlay; /* The image data. */
47  uint32_t *palette; /* If NULL, no palette contained in this event. */
48  uint32_t palette_type; /* 1 Y'CrCB, 2 R'G'B' */
50 
51 /* This will hold all details of an event item, needed for event queue to function */
52 typedef struct video_overlay_event_s {
53  int64_t vpts; /* Time when event will action. 0 means action now */
54 /* Once video_out blend_yuv etc. can take rle_elem_t with Colour, blend and length information.
55  * we can remove clut and blend from this structure.
56  * This will allow for many more colours for OSD.
57  */
58  uint32_t event_type; /* Show SPU, Show OSD, Hide etc. */
59  video_overlay_object_t object; /* The image data. */
61 
63 
64 /* Transport color matrix setting inside those unused "foo" fields.
65  Guard against uninitialized values. */
66 #define _X_SET_CLUT_CM(clut,color_matrix) { \
67  uint8_t *q = (uint8_t *)clut; \
68  q[3] = 'X'; \
69  q[7] = 'C'; \
70  q[11] = 'M'; \
71  q[15] = color_matrix; \
72 }
73 
74 void _x_overlay_clut_yuv2rgb(vo_overlay_t *overlay, int video_color_matrix) XINE_PROTECTED;
75 void _x_overlay_to_argb32(const vo_overlay_t *overlay, uint32_t *rgba, int stride, const char *format) XINE_PROTECTED;
76 
77 #endif
Definition: video_overlay.h:52
int32_t handle
Definition: video_overlay.h:43
#define XINE_MALLOC
Definition: attributes.h:119
void _x_overlay_clut_yuv2rgb(vo_overlay_t *overlay, int video_color_matrix)
Definition: video_overlay.c:498
Definition: video_out.h:476
uint32_t event_type
Definition: video_overlay.h:58
vo_overlay_t * overlay
Definition: video_overlay.h:46
Definition: video_out.h:522
uint32_t object_type
Definition: video_overlay.h:44
uint32_t * palette
Definition: video_overlay.h:47
void _x_overlay_to_argb32(const vo_overlay_t *overlay, uint32_t *rgba, int stride, const char *format)
Definition: video_overlay.c:592
Definition: video_overlay.h:42
#define XINE_PROTECTED
Definition: attributes.h:73
Definition: xine_internal.h:81
video_overlay_object_t object
Definition: video_overlay.h:59
video_overlay_manager_t * _x_video_overlay_new_manager(xine_t *)
Definition: video_overlay.c:726
uint32_t palette_type
Definition: video_overlay.h:48
int64_t pts
Definition: video_overlay.h:45
struct video_overlay_event_s video_overlay_event_t
struct video_overlay_object_s video_overlay_object_t
int64_t vpts
Definition: video_overlay.h:53