lcevcdecoder: Add lcevch265decodebin and lcevch266decodebin elements

Similar to lcevch264decodebin, these new elements are needed for LCEVC H265 and
H266 video streams to be decoded properly with autoplugging elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9427>
This commit is contained in:
Julian Bouzas 2025-07-22 11:05:08 -04:00 committed by GStreamer Marge Bot
parent 7411337812
commit b375b7d3e9
6 changed files with 220 additions and 0 deletions

View File

@ -0,0 +1,72 @@
/* GStreamer
* Copyright (C) <2025> V-Nova International Limited
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstlcevch265decodebin.h"
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-h265, lcevc = (boolean) true")
);
struct _GstLcevcH265DecodeBin
{
GstLcevcDecodeBin parent;
};
#define gst_lcevc_h265_decode_bin_parent_class parent_class
G_DEFINE_TYPE (GstLcevcH265DecodeBin, gst_lcevc_h265_decode_bin,
GST_TYPE_LCEVC_DECODE_BIN);
GST_ELEMENT_REGISTER_DEFINE (lcevch265decodebin, "lcevch265decodebin",
GST_RANK_PRIMARY + GST_LCEVC_DECODE_BIN_RANK_OFFSET,
GST_TYPE_LCEVC_H265_DECODE_BIN);
static GstCaps *
gst_lcevc_h265_decode_bin_get_base_decoder_sink_caps (GstLcevcDecodeBin * base)
{
return gst_caps_new_simple ("video/x-h265",
"lcevc", G_TYPE_BOOLEAN, FALSE, NULL);
}
static void
gst_lcevc_h265_decode_bin_class_init (GstLcevcH265DecodeBinClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstLcevcDecodeBinClass *ldb_class = GST_LCEVC_DECODE_BIN_CLASS (klass);
gst_element_class_add_static_pad_template (element_class, &sink_template);
gst_element_class_set_static_metadata (element_class,
"H.265 + MPEG-5 LCEVC Decode Bin", "Codec/Decoder/Video",
"Wrapper bin to decode H265 with LCEVC data.",
"Julian Bouzas <julian.bouzas@collabora.com>");
ldb_class->get_base_decoder_sink_caps =
gst_lcevc_h265_decode_bin_get_base_decoder_sink_caps;
}
static void
gst_lcevc_h265_decode_bin_init (GstLcevcH265DecodeBin * self)
{
}

View File

@ -0,0 +1,34 @@
/* GStreamer
* Copyright (C) <2025> V-Nova International Limited
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_LCEVC_H265_DECODE_BIN_H__
#define __GST_LCEVC_H265_DECODE_BIN_H__
#include "gstlcevcdecodebin.h"
G_BEGIN_DECLS
#define GST_TYPE_LCEVC_H265_DECODE_BIN (gst_lcevc_h265_decode_bin_get_type())
G_DECLARE_FINAL_TYPE (GstLcevcH265DecodeBin, gst_lcevc_h265_decode_bin,
GST, LCEVC_H265_DECODE_BIN, GstLcevcDecodeBin);
GST_ELEMENT_REGISTER_DECLARE (lcevch265decodebin);
G_END_DECLS
#endif

View File

@ -0,0 +1,72 @@
/* GStreamer
* Copyright (C) <2025> V-Nova International Limited
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstlcevch266decodebin.h"
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-h266, lcevc = (boolean) true")
);
struct _GstLcevcH266DecodeBin
{
GstLcevcDecodeBin parent;
};
#define gst_lcevc_h266_decode_bin_parent_class parent_class
G_DEFINE_TYPE (GstLcevcH266DecodeBin, gst_lcevc_h266_decode_bin,
GST_TYPE_LCEVC_DECODE_BIN);
GST_ELEMENT_REGISTER_DEFINE (lcevch266decodebin, "lcevch266decodebin",
GST_RANK_PRIMARY + GST_LCEVC_DECODE_BIN_RANK_OFFSET,
GST_TYPE_LCEVC_H266_DECODE_BIN);
static GstCaps *
gst_lcevc_h266_decode_bin_get_base_decoder_sink_caps (GstLcevcDecodeBin * base)
{
return gst_caps_new_simple ("video/x-h266",
"lcevc", G_TYPE_BOOLEAN, FALSE, NULL);
}
static void
gst_lcevc_h266_decode_bin_class_init (GstLcevcH266DecodeBinClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstLcevcDecodeBinClass *ldb_class = GST_LCEVC_DECODE_BIN_CLASS (klass);
gst_element_class_add_static_pad_template (element_class, &sink_template);
gst_element_class_set_static_metadata (element_class,
"H.266 + MPEG-5 LCEVC Decode Bin", "Codec/Decoder/Video",
"Wrapper bin to decode H266 with LCEVC data.",
"Julian Bouzas <julian.bouzas@collabora.com>");
ldb_class->get_base_decoder_sink_caps =
gst_lcevc_h266_decode_bin_get_base_decoder_sink_caps;
}
static void
gst_lcevc_h266_decode_bin_init (GstLcevcH266DecodeBin * self)
{
}

View File

@ -0,0 +1,34 @@
/* GStreamer
* Copyright (C) <2025> V-Nova International Limited
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_LCEVC_H266_DECODE_BIN_H__
#define __GST_LCEVC_H266_DECODE_BIN_H__
#include "gstlcevcdecodebin.h"
G_BEGIN_DECLS
#define GST_TYPE_LCEVC_H266_DECODE_BIN (gst_lcevc_h266_decode_bin_get_type())
G_DECLARE_FINAL_TYPE (GstLcevcH266DecodeBin, gst_lcevc_h266_decode_bin,
GST, LCEVC_H266_DECODE_BIN, GstLcevcDecodeBin);
GST_ELEMENT_REGISTER_DECLARE (lcevch266decodebin);
G_END_DECLS
#endif

View File

@ -4,11 +4,15 @@ lcevcdecoder_sources = [
'gstlcevcdec.c',
'gstlcevcdecodebin.c',
'gstlcevch264decodebin.c',
'gstlcevch265decodebin.c',
'gstlcevch266decodebin.c',
]
lcevcdecoder_headers = [
'gstlcevcdec.h',
'gstlcevch264decodebin.h',
'gstlcevch265decodebin.h',
'gstlcevch266decodebin.h',
'gstlcevcdecutils.h',
'gstlcevcdecodebin.h',
]

View File

@ -25,6 +25,8 @@
#include "gstlcevcdec.h"
#include "gstlcevch264decodebin.h"
#include "gstlcevch265decodebin.h"
#include "gstlcevch266decodebin.h"
static gboolean
plugin_init (GstPlugin * plugin)
@ -33,6 +35,8 @@ plugin_init (GstPlugin * plugin)
ret |= GST_ELEMENT_REGISTER (lcevcdec, plugin);
ret |= GST_ELEMENT_REGISTER (lcevch264decodebin, plugin);
ret |= GST_ELEMENT_REGISTER (lcevch265decodebin, plugin);
ret |= GST_ELEMENT_REGISTER (lcevch266decodebin, plugin);
return ret;
}