• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2021 Igalia, S.L.
3  *     Author: Víctor Jáquez <vjaquez@igalia.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #pragma once
22 
23 #include <gst/va/gstvadisplay.h>
24 #include <gst/video/video.h>
25 #include <va/va.h>
26 #include <va/va_drmcommon.h>
27 
28 G_BEGIN_DECLS
29 
30 /* surfaces */
31 gboolean              va_create_surfaces                  (GstVaDisplay * display,
32                                                            guint rt_format, guint fourcc,
33                                                            guint width, guint height,
34                                                            gint usage_hint,
35                                                            VASurfaceAttribExternalBuffers * ext_buf,
36                                                            VASurfaceID * surfaces,
37                                                            guint num_surfaces);
38 gboolean              va_destroy_surfaces                 (GstVaDisplay * display,
39                                                            VASurfaceID * surfaces,
40                                                            gint num_surfaces);
41 gboolean              va_export_surface_to_dmabuf         (GstVaDisplay * display,
42                                                            VASurfaceID surface,
43                                                            guint32 flags,
44                                                            VADRMPRIMESurfaceDescriptor * desc);
45 gboolean              va_sync_surface                     (GstVaDisplay * display,
46                                                            VASurfaceID surface);
47 gboolean              va_check_surface                    (GstVaDisplay * display,
48                                                            VASurfaceID surface);
49 gboolean              va_copy_surface                     (GstVaDisplay * display,
50                                                            VASurfaceID dst,
51                                                            VASurfaceID src);
52 
53 /* images */
54 gboolean              va_create_image                     (GstVaDisplay * display,
55                                                            GstVideoFormat format,
56                                                            gint width, gint height,
57                                                            VAImage * image);
58 gboolean              va_destroy_image                    (GstVaDisplay * display,
59                                                            VAImageID image_id);
60 gboolean              va_get_image                        (GstVaDisplay * display,
61                                                            VASurfaceID surface,
62                                                            VAImage * image);
63 gboolean              va_get_derive_image                 (GstVaDisplay * display,
64                                                            VASurfaceID surface,
65                                                            VAImage * image);
66 gboolean              va_put_image                        (GstVaDisplay * display,
67                                                            VASurfaceID surface,
68                                                            VAImage * image);
69 gboolean              va_ensure_image                     (GstVaDisplay * display,
70                                                            VASurfaceID surface,
71                                                            GstVideoInfo * info,
72                                                            VAImage * image,
73                                                            gboolean derived);
74 
75 /* mapping */
76 gboolean              va_map_buffer                       (GstVaDisplay * display,
77                                                            VABufferID buffer,
78                                                            gpointer * data);
79 gboolean              va_unmap_buffer                     (GstVaDisplay * display,
80                                                            VABufferID buffer);
81 
82 G_END_DECLS
83