1 /**************************************************************************
3 * Copyright 2009 Younes Manton.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include <X11/Xlibint.h>
30 #include <X11/extensions/XvMClib.h>
32 Status
XvMCCreateSubpicture(Display
*dpy
, XvMCContext
*context
, XvMCSubpicture
*subpicture
,
33 unsigned short width
, unsigned short height
, int xvimage_id
)
38 return XvMCBadContext
;
42 /*if (width > || height > )
48 subpicture
->subpicture_id
= XAllocID(dpy
);
49 subpicture
->context_id
= context
->context_id
;
50 subpicture
->xvimage_id
= xvimage_id
;
51 subpicture
->width
= width
;
52 subpicture
->height
= height
;
53 subpicture
->num_palette_entries
= 0;
54 subpicture
->entry_bytes
= 0;
55 subpicture
->component_order
[0] = 0;
56 subpicture
->component_order
[1] = 0;
57 subpicture
->component_order
[2] = 0;
58 subpicture
->component_order
[3] = 0;
59 /* TODO: subpicture->privData = ;*/
66 Status
XvMCClearSubpicture(Display
*dpy
, XvMCSubpicture
*subpicture
, short x
, short y
,
67 unsigned short width
, unsigned short height
, unsigned int color
)
72 return XvMCBadSubpicture
;
74 /* TODO: Assert clear rect is within bounds? Or clip? */
79 Status
XvMCCompositeSubpicture(Display
*dpy
, XvMCSubpicture
*subpicture
, XvImage
*image
,
80 short srcx
, short srcy
, unsigned short width
, unsigned short height
,
81 short dstx
, short dsty
)
86 return XvMCBadSubpicture
;
90 if (subpicture
->xvimage_id
!= image
->id
)
93 /* TODO: Assert rects are within bounds? Or clip? */
98 Status
XvMCDestroySubpicture(Display
*dpy
, XvMCSubpicture
*subpicture
)
103 return XvMCBadSubpicture
;
105 return BadImplementation
;
108 Status
XvMCSetSubpicturePalette(Display
*dpy
, XvMCSubpicture
*subpicture
, unsigned char *palette
)
113 return XvMCBadSubpicture
;
117 /* We don't support paletted subpictures */
121 Status
XvMCBlendSubpicture(Display
*dpy
, XvMCSurface
*target_surface
, XvMCSubpicture
*subpicture
,
122 short subx
, short suby
, unsigned short subw
, unsigned short subh
,
123 short surfx
, short surfy
, unsigned short surfw
, unsigned short surfh
)
128 return XvMCBadSurface
;
131 return XvMCBadSubpicture
;
133 if (target_surface
->context_id
!= subpicture
->context_id
)
136 /* TODO: Assert rects are within bounds? Or clip? */
140 Status
XvMCBlendSubpicture2(Display
*dpy
, XvMCSurface
*source_surface
, XvMCSurface
*target_surface
,
141 XvMCSubpicture
*subpicture
, short subx
, short suby
, unsigned short subw
, unsigned short subh
,
142 short surfx
, short surfy
, unsigned short surfw
, unsigned short surfh
)
146 if (!source_surface
|| !target_surface
)
147 return XvMCBadSurface
;
150 return XvMCBadSubpicture
;
152 if (source_surface
->context_id
!= subpicture
->context_id
)
155 if (source_surface
->context_id
!= subpicture
->context_id
)
158 /* TODO: Assert rects are within bounds? Or clip? */
162 Status
XvMCSyncSubpicture(Display
*dpy
, XvMCSubpicture
*subpicture
)
167 return XvMCBadSubpicture
;
172 Status
XvMCFlushSubpicture(Display
*dpy
, XvMCSubpicture
*subpicture
)
177 return XvMCBadSubpicture
;
182 Status
XvMCGetSubpictureStatus(Display
*dpy
, XvMCSubpicture
*subpicture
, int *status
)
187 return XvMCBadSubpicture
;