2 * gstvaapicontext.h - VA context abstraction (private)
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6 * Copyright (C) 2011-2014 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_CONTEXT_H
26 #define GST_VAAPI_CONTEXT_H
28 #include <gst/video/video-overlay-composition.h>
29 #include "gstvaapiobject.h"
30 #include "gstvaapiobject_priv.h"
31 #include "gstvaapiprofile.h"
32 #include "gstvaapidisplay.h"
33 #include "gstvaapisurface.h"
34 #include "gstvaapivideopool.h"
38 #define GST_VAAPI_CONTEXT(obj) \
39 ((GstVaapiContext *) (obj))
41 typedef struct _GstVaapiContextInfo GstVaapiContextInfo;
42 typedef struct _GstVaapiContext GstVaapiContext;
43 typedef struct _GstVaapiContextClass GstVaapiContextClass;
46 * GstVaapiContextInfo:
48 * Structure holding VA context info like encoded size, decoder
49 * profile and entry-point to use, and maximum number of reference
50 * frames reported by the bitstream.
52 * Note: @rc_mode is only valid for VA context used for encoding,
53 * i.e. if @entrypoint is set to @GST_VAAPI_ENTRYPOINT_SLICE_ENCODE.
55 struct _GstVaapiContextInfo
57 GstVaapiProfile profile;
58 GstVaapiEntrypoint entrypoint;
59 GstVaapiRateControl rc_mode;
68 * A VA context wrapper.
70 struct _GstVaapiContext
73 GstVaapiObject parent_instance;
75 GstVaapiContextInfo info;
77 VAEntrypoint va_entrypoint;
80 GstVaapiVideoPool *surfaces_pool;
81 GPtrArray *overlays[2];
86 * GstVaapiContextClass:
88 * A VA context wrapper class.
90 struct _GstVaapiContextClass
93 GstVaapiObjectClass parent_class;
98 gst_vaapi_context_new (GstVaapiDisplay * display,
99 const GstVaapiContextInfo * cip);
103 gst_vaapi_context_reset (GstVaapiContext * context,
104 const GstVaapiContextInfo * new_cip);
108 gst_vaapi_context_get_id (GstVaapiContext * context);
111 GstVaapiSurfaceProxy *
112 gst_vaapi_context_get_surface_proxy (GstVaapiContext * context);
116 gst_vaapi_context_get_surface_count (GstVaapiContext * context);
120 gst_vaapi_context_apply_composition (GstVaapiContext * context,
121 GstVideoOverlayComposition * composition);
125 gst_vaapi_context_get_attribute (GstVaapiContext * context,
126 VAConfigAttribType type, guint * out_value_ptr);
130 #endif /* GST_VAAPI_CONTEXT_H */