Initialize Tizen 2.3
[adaptation/xorg/driver/xserver-xorg-video-emulfb.git] / src / xv / xv_types.h
1 /**************************************************************************
2
3 xserver-xorg-video-emulfb
4
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: YoungHoon Jung <yhoon.jung@samsung.com>
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
16
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
19 of the Software.
20
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
29 **************************************************************************/
30
31 /*                                                              */
32 /* File name : xv_types.h                                       */
33 /* Author : YoungHoon Jung (yhoon.jung@samsung.com)             */
34 /* Protocol Version : 1.0.1 (Dec 16th 2009)                       */
35 /* This file is for describing Xv APIs' buffer encoding method. */
36 /*                                                              */
37
38 #define XV_PUTIMAGE_HEADER      0xDEADCD01
39 #define XV_PUTIMAGE_VERSION     0x00010001
40
41 /* Return Values */
42 #define XV_OK 0
43 #define XV_HEADER_ERROR -1
44 #define XV_VERSION_MISMATCH -2
45
46 /* Data structure for XvPutImage / XvShmPutImage */
47 typedef struct {
48         unsigned int _header; /* for internal use only */
49         unsigned int _version; /* for internal use only */
50
51         unsigned int YPhyAddr;
52         unsigned int CbPhyAddr;
53         unsigned int CrPhyAddr;
54         unsigned int RotAngle;
55         unsigned int VideoMode;
56 } XV_PUTIMAGE_DATA, * XV_PUTIMAGE_DATA_PTR;
57
58 static void
59 #ifdef __GNUC__
60 __attribute__ ((unused))
61 #endif
62 XV_PUTIMAGE_INIT_DATA(XV_PUTIMAGE_DATA_PTR data)
63 {
64         data->_header = XV_PUTIMAGE_HEADER;
65         data->_version = XV_PUTIMAGE_VERSION;
66 }
67
68
69 static int
70 #ifdef __GNUC__
71 __attribute__ ((unused))
72 #endif
73 XV_PUTIMAGE_VALIDATE_DATA(XV_PUTIMAGE_DATA_PTR data)
74 {
75         if (data->_header != XV_PUTIMAGE_HEADER)
76                 return XV_HEADER_ERROR;
77         if (data->_version != XV_PUTIMAGE_VERSION)
78                 return XV_VERSION_MISMATCH;
79         return XV_OK;
80 }