rawparse: allow per feature registration

Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1029>
This commit is contained in:
Stéphane Cerveau 2020-12-01 15:14:00 +01:00 committed by GStreamer Marge Bot
parent a379e0e5f1
commit 3d3831656d
6 changed files with 74 additions and 13 deletions

View file

@ -77,6 +77,7 @@
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <string.h>
#include "gstrawparseelements.h"
#include "gstrawaudioparse.h"
#include "unalignedaudio.h"
@ -122,6 +123,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define gst_raw_audio_parse_parent_class parent_class
G_DEFINE_TYPE (GstRawAudioParse, gst_raw_audio_parse, GST_TYPE_RAW_BASE_PARSE);
GST_ELEMENT_REGISTER_DEFINE (rawaudioparse, "rawaudioparse",
GST_RANK_NONE, GST_TYPE_RAW_AUDIO_PARSE);
static void gst_raw_audio_parse_set_property (GObject * object, guint prop_id,
GValue const *value, GParamSpec * pspec);

View file

@ -0,0 +1,37 @@
/*
* Copyright (C) <2020> The GStreamer Contributors.
*
* 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_RAWPARSE_ELEMENTS_H__
#define __GST_RAWPARSE_ELEMENTS_H__
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
G_BEGIN_DECLS
GST_ELEMENT_REGISTER_DECLARE (unalignedaudioparse);
GST_ELEMENT_REGISTER_DECLARE (unalignedvideoparse);
GST_ELEMENT_REGISTER_DECLARE (rawaudioparse);
GST_ELEMENT_REGISTER_DECLARE (rawvideoparse);
G_END_DECLS
#endif /* __GST_RAWPARSE_ELEMENTS_H__ */

View file

@ -75,6 +75,7 @@
#endif
#include <string.h>
#include "gstrawparseelements.h"
#include "gstrawvideoparse.h"
#include "unalignedvideo.h"
@ -127,6 +128,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define gst_raw_video_parse_parent_class parent_class
G_DEFINE_TYPE (GstRawVideoParse, gst_raw_video_parse, GST_TYPE_RAW_BASE_PARSE);
GST_ELEMENT_REGISTER_DEFINE (rawvideoparse, "rawvideoparse",
GST_RANK_NONE, GST_TYPE_RAW_VIDEO_PARSE);
static void gst_raw_video_parse_set_property (GObject * object, guint prop_id,
GValue const *value, GParamSpec * pspec);

View file

@ -24,6 +24,7 @@
#include <gst/gst.h>
#include <gst/audio/audio.h>
#include "gstunalignedaudioparse.h"
#include "gstrawparseelements.h"
#include "unalignedaudio.h"
GST_DEBUG_CATEGORY (unaligned_audio_parse_debug);
@ -51,6 +52,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
);
G_DEFINE_TYPE (GstUnalignedAudioParse, gst_unaligned_audio_parse, GST_TYPE_BIN);
GST_ELEMENT_REGISTER_DEFINE (unalignedaudioparse,
"unalignedaudioparse", GST_RANK_MARGINAL, GST_TYPE_UNALIGNED_AUDIO_PARSE);
static void
gst_unaligned_audio_parse_class_init (GstUnalignedAudioParseClass * klass)

View file

@ -24,6 +24,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
#include "gstunalignedvideoparse.h"
#include "gstrawparseelements.h"
#include "unalignedvideo.h"
GST_DEBUG_CATEGORY (unaligned_video_parse_debug);
@ -50,6 +51,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
);
G_DEFINE_TYPE (GstUnalignedVideoParse, gst_unaligned_video_parse, GST_TYPE_BIN);
GST_ELEMENT_REGISTER_DEFINE (unalignedvideoparse,
"unalignedvideoparse", GST_RANK_MARGINAL, GST_TYPE_UNALIGNED_VIDEO_PARSE);
static void
gst_unaligned_video_parse_class_init (GstUnalignedVideoParseClass * klass)

View file

@ -1,26 +1,38 @@
/*
* Copyright (C) <2016> Carlos Rafael Giani <dv at pseudoterminal dot org>
*
* 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 <gst/gst.h>
#include "gstrawaudioparse.h"
#include "gstrawvideoparse.h"
#include "gstunalignedaudioparse.h"
#include "gstunalignedvideoparse.h"
#include "gstrawparseelements.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
gboolean ret = TRUE;
gboolean ret = FALSE;
ret &= gst_element_register (plugin, "unalignedaudioparse", GST_RANK_MARGINAL,
gst_unaligned_audio_parse_get_type ());
ret &= gst_element_register (plugin, "unalignedvideoparse", GST_RANK_MARGINAL,
gst_unaligned_video_parse_get_type ());
ret &= gst_element_register (plugin, "rawaudioparse", GST_RANK_NONE,
gst_raw_audio_parse_get_type ());
ret &= gst_element_register (plugin, "rawvideoparse", GST_RANK_NONE,
gst_raw_video_parse_get_type ());
ret |= GST_ELEMENT_REGISTER (unalignedaudioparse, plugin);
ret |= GST_ELEMENT_REGISTER (unalignedvideoparse, plugin);
ret |= GST_ELEMENT_REGISTER (rawaudioparse, plugin);
ret |= GST_ELEMENT_REGISTER (rawvideoparse, plugin);
return ret;
}