2414e9da92c3ccce262744ab7d48662cb3d92575
[platform/upstream/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapicontext.h
1 /*
2  *  gstvaapicontext.h - VA context abstraction
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_CONTEXT_H
24 #define GST_VAAPI_CONTEXT_H
25
26 #include <gst/vaapi/gstvaapiobject.h>
27 #include <gst/vaapi/gstvaapiprofile.h>
28 #include <gst/vaapi/gstvaapidisplay.h>
29 #include <gst/vaapi/gstvaapisurface.h>
30 #include <gst/video/video-overlay-composition.h>
31
32 G_BEGIN_DECLS
33
34 #define GST_VAAPI_CONTEXT(obj) \
35     ((GstVaapiContext *)(obj))
36
37 typedef struct _GstVaapiContext                 GstVaapiContext;
38 typedef struct _GstVaapiContextInfo             GstVaapiContextInfo;
39
40 /**
41  * GstVaapiContextInfo:
42  *
43  * Structure holding VA context info like encoded size, decoder
44  * profile and entry-point to use, and maximum number of reference
45  * frames reported by the bitstream.
46  */
47 struct _GstVaapiContextInfo {
48     GstVaapiProfile     profile;
49     GstVaapiEntrypoint  entrypoint;
50     guint               width;
51     guint               height;
52     guint               ref_frames;
53 };
54
55 GstVaapiContext *
56 gst_vaapi_context_new(
57     GstVaapiDisplay    *display,
58     GstVaapiProfile     profile,
59     GstVaapiEntrypoint  entrypoint,
60     guint               width,
61     guint               height
62 );
63
64 GstVaapiContext *
65 gst_vaapi_context_new_full(GstVaapiDisplay *display,
66     const GstVaapiContextInfo *cip);
67
68 gboolean
69 gst_vaapi_context_reset(
70     GstVaapiContext    *context,
71     GstVaapiProfile     profile,
72     GstVaapiEntrypoint  entrypoint,
73     guint               width,
74     guint               height
75 );
76
77 gboolean
78 gst_vaapi_context_reset_full(GstVaapiContext *context,
79     const GstVaapiContextInfo *new_cip);
80
81 GstVaapiID
82 gst_vaapi_context_get_id(GstVaapiContext *context);
83
84 GstVaapiProfile
85 gst_vaapi_context_get_profile(GstVaapiContext *context);
86
87 gboolean
88 gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile);
89
90 GstVaapiEntrypoint
91 gst_vaapi_context_get_entrypoint(GstVaapiContext *context);
92
93 void
94 gst_vaapi_context_get_size(
95     GstVaapiContext *context,
96     guint           *pwidth,
97     guint           *pheight
98 );
99
100 GstVaapiSurfaceProxy *
101 gst_vaapi_context_get_surface_proxy(GstVaapiContext *context);
102
103 guint
104 gst_vaapi_context_get_surface_count(GstVaapiContext *context);
105
106 gboolean
107 gst_vaapi_context_apply_composition(
108     GstVaapiContext            *context,
109     GstVideoOverlayComposition *composition
110 );
111
112 G_END_DECLS
113
114 #endif /* GST_VAAPI_CONTEXT_H */