tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / sys / xvimage / 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_TYPE_H__
39 #define __XV_TYPE_H__
40
41 #define XV_DATA_HEADER  0xDEADCD01
42 #define XV_DATA_VERSION 0x00010001
43
44 /* Return Values */
45 #define XV_OK 0
46 #define XV_HEADER_ERROR -1
47 #define XV_VERSION_MISMATCH -2
48
49 /* Video Mode */
50 #define DISPLAY_MODE_PRI_VIDEO_ON_AND_SEC_VIDEO_CLONE             0
51 #define DISPLAY_MODE_PRI_VIDEO_ON_AND_SEC_VIDEO_FULL_SCREEN       1
52 #define DISPLAY_MODE_PRI_VIDEO_OFF_AND_SEC_VIDEO_FULL_SCREEN      2
53
54 /* Color space range */
55 #define CSC_RANGE_NARROW        0
56 #define CSC_RANGE_WIDE          1
57
58 /* Buffer Type */
59 #define XV_BUF_TYPE_DMABUF  0
60 #define XV_BUF_TYPE_LEGACY  1
61 #define XV_BUF_PLANE_NUM    3
62
63 /* Data structure for XvPutImage / XvShmPutImage */
64 typedef struct
65 {
66     unsigned int _header; /* for internal use only */
67     unsigned int _version; /* for internal use only */
68
69     unsigned int YBuf;
70     unsigned int CbBuf;
71     unsigned int CrBuf;
72     unsigned int BufType;
73     unsigned int dmabuf_fd[XV_BUF_PLANE_NUM];
74     unsigned int gem_handle[XV_BUF_PLANE_NUM];
75     void *bo[XV_BUF_PLANE_NUM];
76 } XV_DATA, * XV_DATA_PTR;
77
78 static void
79 #ifdef __GNUC__
80 __attribute__ ((unused))
81 #endif
82 XV_INIT_DATA (XV_DATA_PTR data)
83 {
84     data->_header = XV_DATA_HEADER;
85     data->_version = XV_DATA_VERSION;
86 }
87
88 static int
89 #ifdef __GNUC__
90 __attribute__ ((unused))
91 #endif
92 XV_VALIDATE_DATA (XV_DATA_PTR data)
93 {
94     if (data->_header != XV_DATA_HEADER)
95         return XV_HEADER_ERROR;
96     if (data->_version != XV_DATA_VERSION)
97         return XV_VERSION_MISMATCH;
98     return XV_OK;
99 }
100
101 #endif
102