• 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/base/gstbasetransform.h>
24 
25 #include "gstvafilter.h"
26 
27 G_BEGIN_DECLS
28 
29 #define GST_TYPE_VA_BASE_TRANSFORM            (gst_va_base_transform_get_type())
30 #define GST_VA_BASE_TRANSFORM(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_VA_BASE_TRANSFORM, GstVaBaseTransform))
31 #define GST_IS_VA_BASE_TRANSFORM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VA_BASE_TRANSFORM))
32 #define GST_VA_BASE_TRANSFORM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  GST_TYPE_VA_BASE_TRANSFORM, GstVaBaseTransformClass))
33 #define GST_IS_VA_BASE_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GST_TYPE_VA_BASE_TRANSFORM))
34 #define GST_VA_BASE_TRANSFORM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  GST_TYPE_VA_BASE_TRANSFORM, GstVaBaseTransformClass))
35 
36 typedef struct _GstVaBaseTransform GstVaBaseTransform;
37 typedef struct _GstVaBaseTransformClass GstVaBaseTransformClass;
38 typedef struct _GstVaBaseTransformPrivate GstVaBaseTransformPrivate;
39 
40 struct _GstVaBaseTransform
41 {
42   GstBaseTransform parent;
43 
44   /*< public >*/
45   GstVaDisplay *display;
46   GstVaFilter *filter;
47 
48   GstCaps *in_caps;
49   GstCaps *out_caps;
50   GstVideoInfo in_info;
51   GstVideoInfo out_info;
52 
53   gboolean negotiated;
54 
55   guint extra_min_buffers;
56 
57   /*< private >*/
58   GstVaBaseTransformPrivate *priv;
59 
60   gpointer _padding[GST_PADDING];
61 };
62 
63 struct _GstVaBaseTransformClass
64 {
65   GstBaseTransformClass parent_class;
66 
67   /*< public >*/
68   gboolean (*set_info) (GstVaBaseTransform *self,
69                         GstCaps *incaps, GstVideoInfo *in_info,
70                         GstCaps *outcaps, GstVideoInfo *out_info);
71 
72   void (*update_properties) (GstVaBaseTransform *self);
73 
74   /*< private >*/
75   gchar *render_device_path;
76 
77   gpointer _padding[GST_PADDING];
78 };
79 
80 GType                 gst_va_base_transform_get_type      (void);
81 
82 GstAllocator *        gst_va_base_transform_allocator_from_caps
83                                                           (GstVaBaseTransform * self,
84                                                            GstCaps * caps);
85 
86 GstFlowReturn         gst_va_base_transform_import_buffer (GstVaBaseTransform * self,
87                                                            GstBuffer * inbuf,
88                                                            GstBuffer ** buf);
89 
90 GstCaps *             gst_va_base_transform_get_filter_caps
91                                                           (GstVaBaseTransform * self);
92 
93 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaBaseTransform, gst_object_unref)
94 
95 G_END_DECLS
96