Initialize Tizen 2.3
[framework/multimedia/gst-plugins-ext0.10.git] / mobile / xvimagesrc / src / xv_types.h
1 /**************************************************************************
2
3 xserver-xorg-video-exynos
4
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: Boram Park <boram1288.park@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 : Boram Park (boram1288.park@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 #ifndef XV_TYPES_H_
39 #define XV_TYPES_H_
40
41 G_BEGIN_DECLS
42
43 #define XV_PUTIMAGE_HEADER      0xDEADCD01
44 #define XV_PUTIMAGE_VERSION     0x00010001
45
46 #define XV_PUTSTILL_HEADER      0xDEADCD02
47 #define XV_PUTSTILL_VERSION     0x00010001
48
49 /* Return Values */
50 #define XV_OK 0
51 #define XV_HEADER_ERROR -1
52 #define XV_VERSION_MISMATCH -2
53
54 #define XV_BUF_TYPE_DMABUF  0
55 #define XV_BUF_TYPE_LEGACY  1
56
57 /* Data structure for XvPutImage / XvShmPutImage */
58 typedef struct
59 {
60     unsigned int _header; /* for internal use only */
61     unsigned int _version; /* for internal use only */
62
63     unsigned int YBuf;
64     unsigned int CbBuf;
65     unsigned int CrBuf;
66
67     unsigned int BufType;
68 } XV_PUTIMAGE_DATA, * XV_PUTIMAGE_DATA_PTR;
69
70 /* Data structure for XvPutImage / XvShmPutImage */
71 typedef struct
72 {
73     unsigned int _header; /* for internal use only */
74     unsigned int _version; /* for internal use only */
75
76     unsigned int YBuf;
77     unsigned int CbBuf;
78     unsigned int CrBuf;
79
80     unsigned int BufIndex;
81     unsigned int BufType;
82 } XV_PUTSTILL_DATA, * XV_PUTSTILL_DATA_PTR;
83
84 static void
85 #ifdef __GNUC__
86 __attribute__ ((unused))
87 #endif
88 XV_PUTIMAGE_INIT_DATA (XV_PUTIMAGE_DATA_PTR data)
89 {
90     data->_header = XV_PUTIMAGE_HEADER;
91     data->_version = XV_PUTIMAGE_VERSION;
92 }
93
94
95 static int
96 #ifdef __GNUC__
97 __attribute__ ((unused))
98 #endif
99 XV_PUTIMAGE_VALIDATE_DATA (XV_PUTIMAGE_DATA_PTR data)
100 {
101     if (data->_header != XV_PUTIMAGE_HEADER)
102         return XV_HEADER_ERROR;
103     if (data->_version != XV_PUTIMAGE_VERSION)
104         return XV_VERSION_MISMATCH;
105     return XV_OK;
106 }
107
108 static void
109 #ifdef __GNUC__
110 __attribute__ ((unused))
111 #endif
112 XV_PUTSTILL_INIT_DATA (XV_PUTSTILL_DATA_PTR data)
113 {
114     data->_header = XV_PUTSTILL_HEADER;
115     data->_version = XV_PUTSTILL_VERSION;
116 }
117
118
119 static int
120 #ifdef __GNUC__
121 __attribute__ ((unused))
122 #endif
123 XV_PUTSTILL_VALIDATE_DATA (XV_PUTSTILL_DATA_PTR data)
124 {
125     if (data->_header != XV_PUTSTILL_HEADER)
126         return XV_HEADER_ERROR;
127     if (data->_version != XV_PUTSTILL_VERSION)
128         return XV_VERSION_MISMATCH;
129     return XV_OK;
130 }
131
132 G_END_DECLS
133
134 #endif