3 * Copyright (C) 2020 Igalia, S.L.
4 * Author: Víctor Jáquez <vjaquez@igalia.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the0
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
24 #include <gst/codecs/gsth264decoder.h>
25 #include <gst/codecs/gsth265decoder.h>
26 #include <gst/codecs/gstmpeg2decoder.h>
27 #include <gst/codecs/gstvp8decoder.h>
28 #include <gst/codecs/gstvp9decoder.h>
29 #include <gst/codecs/gstav1decoder.h>
31 #include "gstvadevice.h"
32 #include "gstvadecoder.h"
33 #include "gstvaprofile.h"
37 #define GST_VA_BASE_DEC(obj) ((GstVaBaseDec *)(obj))
38 #define GST_VA_BASE_DEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_FROM_INSTANCE (obj), GstVaBaseDecClass))
39 #define GST_VA_BASE_DEC_CLASS(klass) ((GstVaBaseDecClass *)(klass))
41 typedef struct _GstVaBaseDec GstVaBaseDec;
42 typedef struct _GstVaBaseDecClass GstVaBaseDecClass;
51 GstMpeg2Decoder mpeg2;
57 GstDebugCategory *debug_category;
59 GstVaDisplay *display;
60 GstVaDecoder *decoder;
69 GstVideoCodecState *output_state;
70 GstBufferPool *other_pool;
73 GstVideoAlignment valign;
77 gboolean apply_video_crop;
78 GstVideoConverter *convert;
81 struct _GstVaBaseDecClass
86 GstH264DecoderClass h264;
87 GstH265DecoderClass h265;
88 GstMpeg2DecoderClass mpeg2;
89 GstVp8DecoderClass vp8;
90 GstVp9DecoderClass vp9;
91 GstAV1DecoderClass av1;
95 gchar *render_device_path;
96 /* The parent class in GType hierarchy */
97 GstObjectClass *parent_decoder_class;
102 gchar *render_device_path;
108 void gst_va_base_dec_init (GstVaBaseDec * base,
109 GstDebugCategory * cat);
110 void gst_va_base_dec_class_init (GstVaBaseDecClass * klass,
112 const gchar * render_device_path,
115 GstCaps * doc_src_caps,
116 GstCaps * doc_sink_caps);
118 gboolean gst_va_base_dec_close (GstVideoDecoder * decoder);
119 void gst_va_base_dec_get_preferred_format_and_caps_features (GstVaBaseDec * base,
120 GstVideoFormat * format,
121 GstCapsFeatures ** capsfeatures);
122 gboolean gst_va_base_dec_copy_output_buffer (GstVaBaseDec * base,
123 GstVideoCodecFrame * codec_frame);