mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
dv: 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-good/-/merge_requests/876>
This commit is contained in:
parent
c428f0080b
commit
0b257dd1d5
6 changed files with 90 additions and 11 deletions
|
@ -22,23 +22,17 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstdvdec.h"
|
#include "gstdvelements.h"
|
||||||
#include "gstdvdemux.h"
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
dv_init (0, 0);
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
if (!gst_element_register (plugin, "dvdemux", GST_RANK_PRIMARY,
|
ret |= GST_ELEMENT_REGISTER (dvdemux, plugin);
|
||||||
gst_dvdemux_get_type ()))
|
ret |= GST_ELEMENT_REGISTER (dvdec, plugin);
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!gst_element_register (plugin, "dvdec", GST_RANK_MARGINAL,
|
return ret;
|
||||||
gst_dvdec_get_type ()))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include <gst/video/gstvideometa.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
|
#include "gstdvelements.h"
|
||||||
#include "gstdvdec.h"
|
#include "gstdvdec.h"
|
||||||
|
|
||||||
/* sizes of one input buffer */
|
/* sizes of one input buffer */
|
||||||
|
@ -131,6 +132,8 @@ gst_dvdec_quality_get_type (void)
|
||||||
|
|
||||||
#define gst_dvdec_parent_class parent_class
|
#define gst_dvdec_parent_class parent_class
|
||||||
G_DEFINE_TYPE (GstDVDec, gst_dvdec, GST_TYPE_ELEMENT);
|
G_DEFINE_TYPE (GstDVDec, gst_dvdec, GST_TYPE_ELEMENT);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvdec, "dvdec", GST_RANK_MARGINAL,
|
||||||
|
GST_TYPE_DVDEC, dv_element_init (plugin));
|
||||||
|
|
||||||
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstObject * parent,
|
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstObject * parent,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <gst/audio/audio.h>
|
#include <gst/audio/audio.h>
|
||||||
|
#include "gstdvelements.h"
|
||||||
#include "gstdvdemux.h"
|
#include "gstdvdemux.h"
|
||||||
#include "gstsmptetimecode.h"
|
#include "gstsmptetimecode.h"
|
||||||
|
|
||||||
|
@ -130,6 +131,8 @@ static GstStaticPadTemplate audio_src_temp = GST_STATIC_PAD_TEMPLATE ("audio",
|
||||||
|
|
||||||
#define gst_dvdemux_parent_class parent_class
|
#define gst_dvdemux_parent_class parent_class
|
||||||
G_DEFINE_TYPE (GstDVDemux, gst_dvdemux, GST_TYPE_ELEMENT);
|
G_DEFINE_TYPE (GstDVDemux, gst_dvdemux, GST_TYPE_ELEMENT);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvdemux, "dvdemux", GST_RANK_PRIMARY,
|
||||||
|
GST_TYPE_DVDEMUX, dv_element_init (plugin));
|
||||||
|
|
||||||
static void gst_dvdemux_finalize (GObject * object);
|
static void gst_dvdemux_finalize (GObject * object);
|
||||||
|
|
||||||
|
|
36
ext/dv/gstdvelement.c
Normal file
36
ext/dv/gstdvelement.c
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
* <2005> Wim Taymans <wim@fluendo.com>
|
||||||
|
*
|
||||||
|
* 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 <libdv/dv.h>
|
||||||
|
#include "gstdvelements.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
dv_element_init (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
static gsize res = FALSE;
|
||||||
|
if (g_once_init_enter (&res)) {
|
||||||
|
dv_init (0, 0);
|
||||||
|
g_once_init_leave (&res, TRUE);
|
||||||
|
}
|
||||||
|
}
|
42
ext/dv/gstdvelements.h
Normal file
42
ext/dv/gstdvelements.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
* Copyright (C) 2020 Huawei Technologies Co., Ltd.
|
||||||
|
* @Author: Julian Bouzas <julian.bouzas@collabora.com>
|
||||||
|
*
|
||||||
|
* 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_DV_ELEMENTS_H__
|
||||||
|
#define __GST_DV_ELEMENTS_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include <gst/video/video.h>
|
||||||
|
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
void dv_element_init (GstPlugin * plugin);
|
||||||
|
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (dvdemux);
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (dvdec);
|
||||||
|
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GST_DV_ELEMENTS_H__ */
|
|
@ -1,5 +1,6 @@
|
||||||
dv_sources = [
|
dv_sources = [
|
||||||
'gstdv.c',
|
'gstdv.c',
|
||||||
|
'gstdvelement.c',
|
||||||
'gstdvdec.c',
|
'gstdvdec.c',
|
||||||
'gstdvdemux.c',
|
'gstdvdemux.c',
|
||||||
'gstsmptetimecode.c',
|
'gstsmptetimecode.c',
|
||||||
|
|
Loading…
Reference in a new issue