mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
opus: 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-bad/-/merge_requests/2038>
This commit is contained in:
parent
051ae23c2f
commit
358e030c09
3 changed files with 20 additions and 10 deletions
|
@ -23,18 +23,10 @@
|
||||||
|
|
||||||
#include "gstopusparse.h"
|
#include "gstopusparse.h"
|
||||||
|
|
||||||
#include <gst/tag/tag.h>
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
if (!gst_element_register (plugin, "opusparse", GST_RANK_NONE,
|
return GST_ELEMENT_REGISTER (opusparse, plugin);
|
||||||
GST_TYPE_OPUS_PARSE))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
gst_tag_register_musicbrainz_tags ();
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
|
|
||||||
#include <gst/audio/audio.h>
|
#include <gst/audio/audio.h>
|
||||||
#include <gst/pbutils/pbutils.h>
|
#include <gst/pbutils/pbutils.h>
|
||||||
|
#include <gst/tag/tag.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (opusparse_debug);
|
GST_DEBUG_CATEGORY_STATIC (opusparse_debug);
|
||||||
#define GST_CAT_DEFAULT opusparse_debug
|
#define GST_CAT_DEFAULT opusparse_debug
|
||||||
|
@ -65,7 +66,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_STATIC_CAPS ("audio/x-opus")
|
GST_STATIC_CAPS ("audio/x-opus")
|
||||||
);
|
);
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstOpusParse, gst_opus_parse, GST_TYPE_BASE_PARSE);
|
|
||||||
|
|
||||||
static gboolean gst_opus_parse_start (GstBaseParse * parse);
|
static gboolean gst_opus_parse_start (GstBaseParse * parse);
|
||||||
static gboolean gst_opus_parse_stop (GstBaseParse * parse);
|
static gboolean gst_opus_parse_stop (GstBaseParse * parse);
|
||||||
|
@ -73,6 +74,10 @@ static GstFlowReturn gst_opus_parse_handle_frame (GstBaseParse * base,
|
||||||
GstBaseParseFrame * frame, gint * skip);
|
GstBaseParseFrame * frame, gint * skip);
|
||||||
static GstFlowReturn gst_opus_parse_parse_frame (GstBaseParse * base,
|
static GstFlowReturn gst_opus_parse_parse_frame (GstBaseParse * base,
|
||||||
GstBaseParseFrame * frame);
|
GstBaseParseFrame * frame);
|
||||||
|
static gboolean opusparse_element_init (GstPlugin * plugin);
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (GstOpusParse, gst_opus_parse, GST_TYPE_BASE_PARSE);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (opusparse, opusparse_element_init);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_opus_parse_class_init (GstOpusParseClass * klass)
|
gst_opus_parse_class_init (GstOpusParseClass * klass)
|
||||||
|
@ -428,3 +433,14 @@ gst_opus_parse_parse_frame (GstBaseParse * base, GstBaseParseFrame * frame)
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
opusparse_element_init (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
if (!gst_element_register (plugin, "opusparse", GST_RANK_NONE,
|
||||||
|
GST_TYPE_OPUS_PARSE))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
gst_tag_register_musicbrainz_tags ();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -57,6 +57,8 @@ struct _GstOpusParseClass {
|
||||||
|
|
||||||
GType gst_opus_parse_get_type (void);
|
GType gst_opus_parse_get_type (void);
|
||||||
|
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (opusparse);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_OPUS_PARSE_H__ */
|
#endif /* __GST_OPUS_PARSE_H__ */
|
||||||
|
|
Loading…
Reference in a new issue