Files
BPI-CM9-Linux/aml-comp/multimedia/gst-plugin-aml-demux/aml-qtdemux/gstamlisomp4elements.h
T
2026-08-24 10:03:24 +08:00

189 lines
6.4 KiB
C

/*
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
* Copyright (C) <2003> David A. Schleef <ds@schleef.org>
* Copyright (C) <2006> Wim Taymans <wim@fluendo.com>
* 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_AML_ISOMP4_ELEMENTS_H__
#define __GST_AML_ISOMP4_ELEMENTS_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
G_BEGIN_DECLS
/* adaptations */
#if !GLIB_CHECK_VERSION(2, 67, 4)
#ifndef g_memdup2
#define g_memdup2(ptr,sz) ((G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL))
#endif
#endif
#ifndef GST_ELEMENT_REGISTER_DEFINE_WITH_CODE
/**
* _GST_ELEMENT_REGISTER_DEFINE_BEGIN: (attributes doc.skip=true)
*/
#define _GST_ELEMENT_REGISTER_DEFINE_BEGIN(element) \
G_BEGIN_DECLS \
gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \
{ \
{
/**
* _GST_ELEMENT_REGISTER_DEFINE_END: (attributes doc.skip=true)
*/
#define _GST_ELEMENT_REGISTER_DEFINE_END(element_name, rank, type) \
} \
return gst_element_register (plugin, element_name, rank, type); \
} \
G_END_DECLS
/**
* GST_ELEMENT_REGISTER_DEFINE_CUSTOM:
* @element: The element name in lower case, with words separated by '_'.
* Used to generate `gst_element_register_*(GstPlugin* plugin)`.
* @register_func: pointer to a method with the format: `gboolean register_func (GstPlugin* plugin);`
*
* A convenience macro to define the entry point of an
* element `gst_element_register_*(GstPlugin* plugin)` which uses
* register_func as the main registration method for the element.
* As an example, you may define the element named "streamer-filter"
* with the namespace `my` as following using `element_register_custom`:
*
* ```
* GST_ELEMENT_REGISTER_DEFINE_CUSTOM (my_element, element_register_custom)
* ```
*
* Since: 1.20
*/
#define GST_ELEMENT_REGISTER_DEFINE_CUSTOM(element, register_func) \
G_BEGIN_DECLS \
gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \
{ \
return register_func (plugin); \
} \
G_END_DECLS
/**
* GST_ELEMENT_REGISTER_DEFINE:
* @e: The element name in lower case, with words separated by '_'.
* Used to generate `gst_element_register_*(GstPlugin* plugin)`.
* @e_n: The public name of the element
* @r: The #GstRank of the element (higher rank means more importance when autoplugging, see #GstRank)
* @t: The #GType of the element.
*
* A convenience macro to define the entry point of an
* element `gst_element_register_*(GstPlugin* plugin)`.
* As an example, you may define the element named "streamer-filter"
* with the namespace `my` as following:
*
* ```
* GST_ELEMENT_REGISTER_REGISTER_DEFINE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER)
* ```
*
* Since: 1.20
*/
#define GST_ELEMENT_REGISTER_DEFINE(e, e_n, r, t) _GST_ELEMENT_REGISTER_DEFINE_BEGIN(e) _GST_ELEMENT_REGISTER_DEFINE_END(e_n, r, t)
/**
* GST_ELEMENT_REGISTER_DEFINE_WITH_CODE:
* @e: The element name in lower case, with words separated by '_'.
* Used to generate `gst_element_register_*(GstPlugin* plugin)`.
* @e_n: The public name of the element
* @r: The #GstRank of the element (higher rank means more importance when autoplugging, see #GstRank)
* @t: The #GType of the element.
* @_c_: Custom code that gets inserted in the gst_element_register_*() function.
*
* A convenience macro to define the entry point of an
* element `gst_element_register_*(GstPlugin* plugin)` executing code
* before gst_element_register in `gst_element_register_*(GstPlugin* plugin)`.
* As an example, you may define the element named "stream-filter"
* with the namespace `my` as following:
*
* ```
* #define _pre_register_init \
* my_stream_filter_pre_register (plugin);
* GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER, _pre_register_init)
* ```
*
* Since: 1.20
*/
#define GST_ELEMENT_REGISTER_DEFINE_WITH_CODE(e, e_n, r, t, _c_) _GST_ELEMENT_REGISTER_DEFINE_BEGIN(e) {_c_;} _GST_ELEMENT_REGISTER_DEFINE_END(e_n, r, t)
/**
* GST_ELEMENT_REGISTER_DECLARE:
* @element: The element name in lower case, with words separated by '_'.
*
* This macro can be used to declare a new element.
* It has to be used in combination with #GST_ELEMENT_REGISTER_DEFINE macros
* and must be placed outside any block to declare the element registration
* function.
* As an example, you may declare the element named "stream-filter"
* with the namespace `my` as following:
*
* ```
* GST_ELEMENT_REGISTER_DECLARE (stream_filter)
* ```
*
* Since: 1.20
*/
#define GST_ELEMENT_REGISTER_DECLARE(element) \
G_BEGIN_DECLS \
gboolean G_PASTE(gst_element_register_, element) (GstPlugin * plugin); \
G_END_DECLS
/**
* GST_ELEMENT_REGISTER:
* @element: The element name in lower case, with words separated by '_'.
* @plugin: The #GstPlugin where to register the element.
*
* This macro can be used to register an element into a #GstPlugin.
* This method will be usually called in the plugin init function
* but can also be called with a NULL plugin,
* for example with a static registration of the element.
* It has to be used in combination with #GST_ELEMENT_REGISTER_DECLARE.
*
* ```
* GstPlugin* plugin;
*
* ...
*
* GST_ELEMENT_REGISTER (stream_filter, plugin);
* ```
*
* Since: 1.20
*/
#define GST_ELEMENT_REGISTER(element, plugin) G_PASTE(gst_element_register_, element) (plugin)
#endif
void aml_isomp4_element_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (amlqtdemux);
//GST_ELEMENT_REGISTER_DECLARE (rtpxqtdepay);
//GST_ELEMENT_REGISTER_DECLARE (qtmux);
//GST_ELEMENT_REGISTER_DECLARE (qtmoovrecover);
G_END_DECLS
#endif /* __GST_AML_ISOMP4_ELEMENTS_H__ */