decoder: propagate MVC metadata ("view-id", head of multiview set).
[platform/upstream/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapisurfaceproxy_priv.h
1 /*
2  *  gstvaapisurfaceproxy_priv.h - VA surface proxy (private definitions)
3  *
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>
8  *
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.
13  *
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.
18  *
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
23  */
24
25 #ifndef GST_VAAPI_SURFACE_PROXY_PRIV_H
26 #define GST_VAAPI_SURFACE_PROXY_PRIV_H
27
28 #include "gstvaapiminiobject.h"
29 #include "gstvaapisurfaceproxy.h"
30 #include "gstvaapiobject_priv.h"
31 #include "gstvaapisurface_priv.h"
32
33 #define GST_VAAPI_SURFACE_PROXY(obj) \
34     ((GstVaapiSurfaceProxy *)(obj))
35
36 struct _GstVaapiSurfaceProxy {
37     /*< private >*/
38     GstVaapiMiniObject  parent_instance;
39     GstVaapiSurfaceProxy *parent;
40
41     GstVaapiVideoPool  *pool;
42     GstVaapiSurface    *surface;
43     guintptr            view_id;
44     GstClockTime        timestamp;
45     GstClockTime        duration;
46     GDestroyNotify      destroy_func;
47     gpointer            destroy_data;
48     GstVaapiRectangle   crop_rect;
49     guint               has_crop_rect   : 1;
50 };
51
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
56
57 /**
58  * GST_VAAPI_SURFACE_PROXY_SURFACE:
59  * @proxy: a #GstVaapiSurfaceProxy
60  *
61  * Macro that evaluates to the #GstVaapiSurface of @proxy.
62  * This is an internal macro that does not do any run-time type check.
63  */
64 #undef  GST_VAAPI_SURFACE_PROXY_SURFACE
65 #define GST_VAAPI_SURFACE_PROXY_SURFACE(proxy) \
66     GST_VAAPI_SURFACE_PROXY(proxy)->surface
67
68 /**
69  * GST_VAAPI_SURFACE_PROXY_SURFACE_ID:
70  * @proxy: a #GstVaapiSurfaceProxy
71  *
72  * Macro that evaluates to the VA surface ID of the underlying @proxy
73  * surface.
74  *
75  * This is an internal macro that does not do any run-time type check.
76  */
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)
80
81 /**
82  * GST_VAAPI_SURFACE_PROXY_VIEW_ID:
83  * @proxy: a #GstVaapiSurfaceProxy
84  *
85  * Macro that evaluates to the decoded view ID of the underlying @proxy
86  * surface.
87  *
88  * This is an internal macro that does not do any run-time type check.
89  */
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
93
94 /**
95  * GST_VAAPI_SURFACE_PROXY_TIMESTAMP:
96  * @proxy: a #GstVaapiSurfaceProxy
97  *
98  * Macro that evaluates to the presentation timestamp of the
99  * underlying @proxy surface.
100  *
101  * This is an internal macro that does not do any run-time type check.
102  */
103 #undef  GST_VAAPI_SURFACE_PROXY_TIMESTAMP
104 #define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy) \
105     GST_VAAPI_SURFACE_PROXY(proxy)->timestamp
106
107 /**
108  * GST_VAAPI_SURFACE_PROXY_DURATION:
109  * @proxy: a #GstVaapiSurfaceProxy
110  *
111  * Macro that evaluates to the presentation duration of the
112  * underlying @proxy surface.
113  *
114  * This is an internal macro that does not do any run-time type check.
115  */
116 #undef  GST_VAAPI_SURFACE_PROXY_DURATION
117 #define GST_VAAPI_SURFACE_PROXY_DURATION(proxy) \
118     GST_VAAPI_SURFACE_PROXY(proxy)->duration
119
120 /**
121  * GST_VAAPI_SURFACE_PROXY_CROP_RECT:
122  * @proxy: a #GstVaapiSurfaceProxy
123  *
124  * Macro that evaluates to the video cropping rectangle of the underlying @proxy surface.
125  *
126  * This is an internal macro that does not do any run-time type check.
127  */
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)
132
133 #endif /* GST_VAAPI_SURFACE_PROXY_PRIV_H */