1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
/*
* Copyright (c) 2011 Intel Corporation. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Shengquan Yuan <shengquan.yuan@intel.com>
* Zhaohan Ren <zhaohan.ren@intel.com>
*
*/
#ifndef _PSB_X11_H_
#define _PSB_X11_H_
#include <X11/Xutil.h>
#include <inttypes.h>
#include "psb_drv_video.h"
#include "psb_drm.h"
#include "psb_surface.h"
#include "psb_output.h"
#include "psb_surface_ext.h"
#include <va/va.h>
#define USING_OVERLAY_PORT 1
#define USING_TEXTURE_PORT 2
typedef struct {
/*src coordinate*/
short srcx;
short srcy;
unsigned short sWidth;
unsigned short sHeight;
/*dest coordinate*/
short destx;
short desty;
unsigned short dWidth;
unsigned short dHeight;
} psb_overlay_rect_t, *psb_overlay_rect_p;
typedef struct {
int i32Left;
int i32Top;
int i32Right;
int i32Bottom;
unsigned int ui32Width;
unsigned int ui32Height;
} psb_x11_win_t;
typedef struct x11_rect_list {
psb_x11_win_t rect;
struct x11_rect_list * next;
} psb_x11_clip_list_t;
typedef struct _psb_x11_output_s {
/* information for xvideo */
XvPortID textured_portID;
XvPortID overlay_portID;
XvImage *textured_xvimage;
XvImage *overlay_xvimage;
PsbXvVAPutSurfaceRec imgdata_vasrf;
GC gc;
Drawable output_drawable;
int is_pixmap;
Drawable output_drawable_save;
GC extend_gc;
Drawable extend_drawable;
unsigned short output_width;
unsigned short output_height;
int using_port;
int bIsVisible;
psb_x11_win_t winRect;
psb_x11_clip_list_t *pClipBoxList;
unsigned int ui32NumClipBoxList;
unsigned int frame_count;
int ignore_dpm;
/*for video rotation with overlay adaptor*/
psb_surface_p rotate_surface;
int rotate_surfaceID;
int rotate;
unsigned int sprite_enabled;
} psb_x11_output_s, *psb_x11_output_p;
VAStatus psb_putsurface_coverlay(
VADriverContextP ctx,
VASurfaceID surface,
Drawable draw, /* X Drawable */
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
VARectangle *cliprects, /* client supplied clip list */
unsigned int number_cliprects, /* number of clip rects in the clip list */
unsigned int flags /* de-interlacing flags */
);
VAStatus psb_putsurface_xvideo(
VADriverContextP ctx,
VASurfaceID surface,
Drawable draw,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
VARectangle *cliprects, /* client supplied clip list */
unsigned int number_cliprects, /* number of clip rects in the clip list */
unsigned int flags /* de-interlacing flags */
);
VAStatus psb_putsurface_ctexture(
VADriverContextP ctx,
VASurfaceID surface,
Drawable draw,
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
unsigned int flags /* de-interlacing flags */
);
VAStatus psb_init_xvideo(VADriverContextP ctx, psb_x11_output_p output);
VAStatus psb_deinit_xvideo(VADriverContextP ctx);
#endif
|