Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapiutils.h
1 /*
2  *  gstvaapiutils.h - VA-API utilities
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011-2012 Intel Corporation
6  *
7  *  This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Lesser General Public License
9  *  as published by the Free Software Foundation; either version 2.1
10  *  of the License, or (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public
18  *  License along with this library; if not, write to the Free
19  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  *  Boston, MA 02110-1301 USA
21  */
22
23 #ifndef GST_VAAPI_UTILS_H
24 #define GST_VAAPI_UTILS_H
25
26 #include "config.h"
27 #include <glib.h>
28 #include <va/va.h>
29
30 /** Check VA status for success or print out an error */
31 G_GNUC_INTERNAL
32 gboolean
33 vaapi_check_status(VAStatus status, const char *msg);
34
35 /** Maps VA buffer */
36 G_GNUC_INTERNAL
37 void *
38 vaapi_map_buffer(VADisplay dpy, VABufferID buf_id);
39
40 /** Unmaps VA buffer */
41 G_GNUC_INTERNAL
42 void
43 vaapi_unmap_buffer(VADisplay dpy, VABufferID buf_id, void **pbuf);
44
45 /** Creates and maps VA buffer */
46 G_GNUC_INTERNAL
47 gboolean
48 vaapi_create_buffer(
49     VADisplay     dpy,
50     VAContextID   ctx,
51     int           type,
52     unsigned int  size,
53     gconstpointer data,
54     VABufferID   *buf_id,
55     gpointer     *mapped_data
56 );
57
58 /** Destroy VA buffer */
59 G_GNUC_INTERNAL
60 void
61 vaapi_destroy_buffer(VADisplay dpy, VABufferID *buf_id);
62
63 /** Return a string representation of a VAProfile */
64 G_GNUC_INTERNAL
65 const char *string_of_VAProfile(VAProfile profile);
66
67 /** Return a string representation of a VAEntrypoint */
68 G_GNUC_INTERNAL
69 const char *string_of_VAEntrypoint(VAEntrypoint entrypoint);
70
71 /* Return a string representation of a VADisplayAttributeType */
72 G_GNUC_INTERNAL
73 const char *
74 string_of_VADisplayAttributeType(VADisplayAttribType attribute_type);
75
76 G_GNUC_INTERNAL
77 guint
78 from_GstVaapiSurfaceRenderFlags(guint flags);
79
80 G_GNUC_INTERNAL
81 guint
82 to_GstVaapiSurfaceStatus(guint va_flags);
83
84 G_GNUC_INTERNAL
85 guint
86 from_GstVaapiRotation(guint value);
87
88 G_GNUC_INTERNAL
89 guint
90 to_GstVaapiRotation(guint value);
91
92 G_GNUC_INTERNAL
93 guint
94 from_GstVaapiRateControl(guint value);
95
96 G_GNUC_INTERNAL
97 guint
98 to_GstVaapiRateControl(guint value);
99
100 G_GNUC_INTERNAL
101 const char *
102 string_of_VARateControl(guint rate_control);
103
104 #endif /* GST_VAAPI_UTILS_H */