2 * gstvaapisurfaceproxy_priv.h - VA surface proxy (private definitions)
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6 * Copyright (C) 2011-2013 Intel Corporation
7 * Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA
25 #ifndef GST_VAAPI_SURFACE_PROXY_PRIV_H
26 #define GST_VAAPI_SURFACE_PROXY_PRIV_H
28 #include "gstvaapiminiobject.h"
29 #include "gstvaapisurfaceproxy.h"
30 #include "gstvaapiobject_priv.h"
31 #include "gstvaapisurface_priv.h"
33 #define GST_VAAPI_SURFACE_PROXY(obj) \
34 ((GstVaapiSurfaceProxy *)(obj))
36 struct _GstVaapiSurfaceProxy {
38 GstVaapiMiniObject parent_instance;
39 GstVaapiSurfaceProxy *parent;
41 GstVaapiVideoPool *pool;
42 GstVaapiSurface *surface;
44 GstClockTime timestamp;
45 GstClockTime duration;
46 GDestroyNotify destroy_func;
47 gpointer destroy_data;
48 GstVaapiRectangle crop_rect;
49 guint has_crop_rect : 1;
52 #define GST_VAAPI_SURFACE_PROXY_FLAGS GST_VAAPI_MINI_OBJECT_FLAGS
53 #define GST_VAAPI_SURFACE_PROXY_FLAG_IS_SET GST_VAAPI_MINI_OBJECT_FLAG_IS_SET
54 #define GST_VAAPI_SURFACE_PROXY_FLAG_SET GST_VAAPI_MINI_OBJECT_FLAG_SET
55 #define GST_VAAPI_SURFACE_PROXY_FLAG_UNSET GST_VAAPI_MINI_OBJECT_FLAG_UNSET
58 * GST_VAAPI_SURFACE_PROXY_SURFACE:
59 * @proxy: a #GstVaapiSurfaceProxy
61 * Macro that evaluates to the #GstVaapiSurface of @proxy.
62 * This is an internal macro that does not do any run-time type check.
64 #undef GST_VAAPI_SURFACE_PROXY_SURFACE
65 #define GST_VAAPI_SURFACE_PROXY_SURFACE(proxy) \
66 GST_VAAPI_SURFACE_PROXY(proxy)->surface
69 * GST_VAAPI_SURFACE_PROXY_SURFACE_ID:
70 * @proxy: a #GstVaapiSurfaceProxy
72 * Macro that evaluates to the VA surface ID of the underlying @proxy
75 * This is an internal macro that does not do any run-time type check.
77 #undef GST_VAAPI_SURFACE_PROXY_SURFACE_ID
78 #define GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy) \
79 GST_VAAPI_OBJECT_ID(GST_VAAPI_SURFACE_PROXY(proxy)->surface)
82 * GST_VAAPI_SURFACE_PROXY_VIEW_ID:
83 * @proxy: a #GstVaapiSurfaceProxy
85 * Macro that evaluates to the decoded view ID of the underlying @proxy
88 * This is an internal macro that does not do any run-time type check.
90 #undef GST_VAAPI_SURFACE_PROXY_VIEW_ID
91 #define GST_VAAPI_SURFACE_PROXY_VIEW_ID(proxy) \
92 GST_VAAPI_SURFACE_PROXY(proxy)->view_id
95 * GST_VAAPI_SURFACE_PROXY_TIMESTAMP:
96 * @proxy: a #GstVaapiSurfaceProxy
98 * Macro that evaluates to the presentation timestamp of the
99 * underlying @proxy surface.
101 * This is an internal macro that does not do any run-time type check.
103 #undef GST_VAAPI_SURFACE_PROXY_TIMESTAMP
104 #define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy) \
105 GST_VAAPI_SURFACE_PROXY(proxy)->timestamp
108 * GST_VAAPI_SURFACE_PROXY_DURATION:
109 * @proxy: a #GstVaapiSurfaceProxy
111 * Macro that evaluates to the presentation duration of the
112 * underlying @proxy surface.
114 * This is an internal macro that does not do any run-time type check.
116 #undef GST_VAAPI_SURFACE_PROXY_DURATION
117 #define GST_VAAPI_SURFACE_PROXY_DURATION(proxy) \
118 GST_VAAPI_SURFACE_PROXY(proxy)->duration
121 * GST_VAAPI_SURFACE_PROXY_CROP_RECT:
122 * @proxy: a #GstVaapiSurfaceProxy
124 * Macro that evaluates to the video cropping rectangle of the underlying @proxy surface.
126 * This is an internal macro that does not do any run-time type check.
128 #undef GST_VAAPI_SURFACE_PROXY_CROP_RECT
129 #define GST_VAAPI_SURFACE_PROXY_CROP_RECT(proxy) \
130 (GST_VAAPI_SURFACE_PROXY(proxy)->has_crop_rect ? \
131 &GST_VAAPI_SURFACE_PROXY(proxy)->crop_rect : NULL)
133 #endif /* GST_VAAPI_SURFACE_PROXY_PRIV_H */