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;
43 GstClockTime timestamp;
44 GstClockTime duration;
45 GDestroyNotify destroy_func;
46 gpointer destroy_data;
47 GstVaapiRectangle crop_rect;
48 guint has_crop_rect : 1;
51 #define GST_VAAPI_SURFACE_PROXY_FLAGS GST_VAAPI_MINI_OBJECT_FLAGS
52 #define GST_VAAPI_SURFACE_PROXY_FLAG_IS_SET GST_VAAPI_MINI_OBJECT_FLAG_IS_SET
53 #define GST_VAAPI_SURFACE_PROXY_FLAG_SET GST_VAAPI_MINI_OBJECT_FLAG_SET
54 #define GST_VAAPI_SURFACE_PROXY_FLAG_UNSET GST_VAAPI_MINI_OBJECT_FLAG_UNSET
57 * GST_VAAPI_SURFACE_PROXY_SURFACE:
58 * @proxy: a #GstVaapiSurfaceProxy
60 * Macro that evaluates to the #GstVaapiSurface of @proxy.
61 * This is an internal macro that does not do any run-time type check.
63 #undef GST_VAAPI_SURFACE_PROXY_SURFACE
64 #define GST_VAAPI_SURFACE_PROXY_SURFACE(proxy) \
65 GST_VAAPI_SURFACE_PROXY(proxy)->surface
68 * GST_VAAPI_SURFACE_PROXY_SURFACE_ID:
69 * @proxy: a #GstVaapiSurfaceProxy
71 * Macro that evaluates to the VA surface ID of the underlying @proxy
74 * This is an internal macro that does not do any run-time type check.
76 #undef GST_VAAPI_SURFACE_PROXY_SURFACE_ID
77 #define GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy) \
78 GST_VAAPI_OBJECT_ID(GST_VAAPI_SURFACE_PROXY(proxy)->surface)
81 * GST_VAAPI_SURFACE_PROXY_TIMESTAMP:
82 * @proxy: a #GstVaapiSurfaceProxy
84 * Macro that evaluates to the presentation timestamp of the
85 * underlying @proxy surface.
87 * This is an internal macro that does not do any run-time type check.
89 #undef GST_VAAPI_SURFACE_PROXY_TIMESTAMP
90 #define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy) \
91 GST_VAAPI_SURFACE_PROXY(proxy)->timestamp
94 * GST_VAAPI_SURFACE_PROXY_DURATION:
95 * @proxy: a #GstVaapiSurfaceProxy
97 * Macro that evaluates to the presentation duration of the
98 * underlying @proxy surface.
100 * This is an internal macro that does not do any run-time type check.
102 #undef GST_VAAPI_SURFACE_PROXY_DURATION
103 #define GST_VAAPI_SURFACE_PROXY_DURATION(proxy) \
104 GST_VAAPI_SURFACE_PROXY(proxy)->duration
107 * GST_VAAPI_SURFACE_PROXY_CROP_RECT:
108 * @proxy: a #GstVaapiSurfaceProxy
110 * Macro that evaluates to the video cropping rectangle of the underlying @proxy surface.
112 * This is an internal macro that does not do any run-time type check.
114 #undef GST_VAAPI_SURFACE_PROXY_CROP_RECT
115 #define GST_VAAPI_SURFACE_PROXY_CROP_RECT(proxy) \
116 (GST_VAAPI_SURFACE_PROXY(proxy)->has_crop_rect ? \
117 &GST_VAAPI_SURFACE_PROXY(proxy)->crop_rect : NULL)
119 #endif /* GST_VAAPI_SURFACE_PROXY_PRIV_H */