#------------------------------------
# include section
#-----------------------------------
-gst_base_COPY_HEADERS_TO := gstreamer-0.10/gst/base
+gst_base_COPY_HEADERS_TO := gstreamer-0.11/gst/base
gst_base_COPY_HEADERS := \
../libs/gst/base/gstadapter.h \
../libs/gst/base/gstbasesink.h \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
base_LOCAL_SRC_FILES:= \
libs/gst/base/gstadapter.c \
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
#------------------------------------
# include section
#-----------------------------------
-gst_controller_COPY_HEADERS_TO := gstreamer-0.10/gst/controller
+gst_controller_COPY_HEADERS_TO := gstreamer-0.11/gst/controller
gst_controller_COPY_HEADERS := \
../libs/gst/controller/gstcontroller.h \
../libs/gst/controller/gstcontrolsource.h \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
controller_LOCAL_SRC_FILES:= \
libs/gst/controller/lib.c \
LOCAL_SRC_FILES:= $(addprefix ../,$(controller_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
#------------------------------------
# include section
#-----------------------------------
-gst_dataprotocol_COPY_HEADERS_TO := gstreamer-0.10/gst/dataprotocol
+gst_dataprotocol_COPY_HEADERS_TO := gstreamer-0.11/gst/dataprotocol
gst_dataprotocol_COPY_HEADERS := \
../libs/gst/dataprotocol/dataprotocol.h
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
dataprotocol_LOCAL_SRC_FILES:= \
libs/gst/dataprotocol/dataprotocol.c
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
elements_LOCAL_SRC_FILES:= \
plugins/elements/gstcapsfilter.c \
LOCAL_SHARED_LIBRARIES := \
- libgstbase-0.10 \
- libgstreamer-0.10 \
+ libgstbase-0.11 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0
LOCAL_MODULE:= libgstcoreelements
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/.. \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
LOCAL_SRC_FILES:= ../tools/gst-inspect.c
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
$(LOCAL_PATH) \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../tools \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
LOCAL_SRC_FILES:= ../tools/gst-launch.c
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
$(LOCAL_PATH) \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../tools \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
LOCAL_SRC_FILES:= ../libs/gst/helpers/gst-plugin-scanner.c
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
$(LOCAL_PATH) \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../tools \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#------------------------------------
# include section
#-----------------------------------
-gst_COPY_HEADERS_TO := gstreamer-0.10/gst
+gst_COPY_HEADERS_TO := gstreamer-0.11/gst
gst_COPY_HEADERS_BASE := \
glib-compat.h \
gst.h \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
gst_LOCAL_SRC_FILES_BASE:= \
gst.c \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
indexers_LOCAL_SRC_FILES:= \
plugins/indexers/gstindexers.c \
libxml2
LOCAL_SHARED_LIBRARIES := \
- libgstbase-0.10 \
- libgstreamer-0.10 \
+ libgstbase-0.11 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0
LOCAL_MODULE:= libgstcoreindexers
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/.. \
LOCAL_PATH:= $(call my-dir)
-gst_net_COPY_HEADERS_TO := gstreamer-0.10/gst/net
+gst_net_COPY_HEADERS_TO := gstreamer-0.11/gst/net
gst_net_COPY_HEADERS := \
../libs/gst/net/gstnet.h \
../libs/gst/net/gstnetclientclock.h \
LOCAL_ARM_MODE := arm
-GST_MAJORMINOR:= 0.10
+GST_MAJORMINOR:= 0.11
net_LOCAL_SRC_FILES:= \
libs/gst/net/gstnetclientclock.c \
LOCAL_SRC_FILES:= $(addprefix ../,$(net_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
+ libgstreamer-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
dnl initialize autoconf
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, git and prerelease does Werror too
-AC_INIT(GStreamer, 0.10.31.1,
+AC_INIT(GStreamer, 0.11.0.1,
http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
gstreamer)
AG_GST_INIT
dnl our libraries and install dirs use major.minor as a version
GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
dnl we override it here for release candidates for a new series
-GST_MAJORMINOR=0.10
+GST_MAJORMINOR=0.11
AC_SUBST(GST_MAJORMINOR)
AC_DEFINE_UNQUOTED(GST_MAJORMINOR, "$GST_MAJORMINOR",
[library major.minor version])
-e "s/.* PACKAGE_STRING$/#define PACKAGE_STRING \"$PACKAGE_STRING\"/" \
-e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
-e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
- -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n# define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-0.10"\n#else\n# define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-0.10"\n#endif/' \
+ -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n# define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-0.11"\n#else\n# define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-0.11"\n#endif/' \
-e 's/.* GST_PLUGIN_SCANNER_INSTALLED$/#define GST_PLUGIN_SCANNER_INSTALLED LIBDIR "\\\\gst-plugin-scanner"/' \
-e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
config.h.in >win32/common/config.h-new
gst_bin_add_many
gst_bin_remove_many
gst_bin_find_unlinked_pad
-gst_bin_find_unconnected_pad
<SUBSECTION>
GstBinFlags
gst_buffer_is_span_fast
gst_buffer_span
-gst_buffer_stamp
gst_buffer_join
gst_buffer_merge
GST_STATIC_CAPS_ANY
GST_STATIC_CAPS_NONE
GST_CAPS_IS_SIMPLE
-GST_DEBUG_CAPS
GST_STATIC_CAPS
gst_caps_new_empty
gst_caps_union
gst_caps_normalize
gst_caps_do_simplify
-gst_caps_save_thyself
-gst_caps_load_thyself
gst_caps_replace
gst_caps_to_string
gst_caps_from_string
gst_element_class_get_pad_template
gst_element_class_get_pad_template_list
gst_element_class_install_std_props
-gst_element_class_set_details
gst_element_class_set_details_simple
gst_element_class_set_documentation_uri
gst_element_class_set_icon_name
<SUBSECTION element-pads>
gst_element_add_pad
-gst_element_get_pad
gst_element_create_all_pads
gst_element_get_compatible_pad
gst_element_get_compatible_pad_template
GST_OBJECT_FLAG_UNSET
GST_OBJECT_NAME
GST_OBJECT_PARENT
-GST_OBJECT_IS_DISPOSING
-GST_OBJECT_IS_FLOATING
GST_OBJECT_REFCOUNT
GST_OBJECT_REFCOUNT_VALUE
-GST_CLASS_GET_LOCK
-GST_CLASS_LOCK
-GST_CLASS_TRYLOCK
-GST_CLASS_UNLOCK
GST_OBJECT_LOCK
GST_OBJECT_TRYLOCK
GST_OBJECT_UNLOCK
gst_object_set_parent
gst_object_get_parent
gst_object_unparent
-gst_object_get_name_prefix
-gst_object_set_name_prefix
gst_object_default_deep_notify
gst_object_default_error
gst_object_check_uniqueness
gst_object_has_ancestor
-gst_object_save_thyself
-gst_object_restore_thyself
gst_object_ref
gst_object_unref
gst_object_ref_sink
-gst_object_sink
gst_object_replace
gst_object_get_path_string
-gst_class_signal_connect
-gst_class_signal_emit_by_name
<SUBSECTION Standard>
GST_OBJECT
GST_IS_OBJECT
<SUBSECTION Private>
gst_object_get_type
gst_object_flags_get_type
-GstXmlNodePtr
</SECTION>
gst_pad_iterate_internal_links
gst_pad_iterate_internal_links_default
-gst_pad_set_internal_link_function
-GstPadIntLinkFunction
-gst_pad_get_internal_links
-gst_pad_get_internal_links_default
-
-gst_pad_load_and_link
-
gst_pad_dispatcher
GstPadDispatcherFunction
GST_PAD_STREAM_UNLOCK
GST_PAD_STREAM_UNLOCK_FULL
-GST_FLOW_IS_FATAL
-GST_FLOW_IS_SUCCESS
-
<SUBSECTION Standard>
GstPadClass
GstPadPrivate
GST_PAD_FIXATECAPSFUNC
GST_PAD_GETCAPSFUNC
GST_PAD_GETRANGEFUNC
-GST_PAD_INTLINKFUNC
GST_PAD_ITERINTLINKFUNC
GST_PAD_IS_FLUSHING
GST_PAD_LINKFUNC
gst_pipeline_use_clock
gst_pipeline_auto_clock
-gst_pipeline_set_new_stream_time
-gst_pipeline_get_last_stream_time
-
gst_pipeline_set_auto_flush_bus
gst_pipeline_get_auto_flush_bus
GST_MAGIC_BINARY_VERSION_LEN
gst_registry_get_type
GstRegistryPrivate
-gst_registry_xml_read_cache
-gst_registry_xml_write_cache
</SECTION>
GST_ROUND_DOWN_32
GST_ROUND_DOWN_64
-gst_atomic_int_set
gst_flow_get_name
gst_flow_to_quark
gst_print_element_args
GST_CHECK_VERSION
</SECTION>
-
-<SECTION>
-<FILE>gstxml</FILE>
-<TITLE>GstXML</TITLE>
-GstXML
-
-gst_xml_write
-gst_xml_write_file
-gst_xml_new
-gst_xml_parse_doc
-gst_xml_parse_file
-gst_xml_parse_memory
-gst_xml_get_element
-gst_xml_get_topelements
-gst_xml_make_element
-<SUBSECTION Standard>
-GstXMLClass
-GST_XML
-GST_IS_XML
-GST_XML_CLASS
-GST_IS_XML_CLASS
-GST_XML_GET_CLASS
-GST_TYPE_XML
-<SUBSECTION Private>
-gst_xml_get_type
-</SECTION>
gst_task_get_type
gst_type_find_factory_get_type
gst_uri_handler_get_type
-@GST_LOADSAVE_DOC_TYPES@gst_xml_get_type
% these are not GObject derived types
% this works with gtk-doc 1.10 at least
gst_dp_header_payload_length
gst_dp_header_payload_type
-gst_dp_header_from_buffer
-gst_dp_packet_from_caps
-gst_dp_packet_from_event
-
gst_dp_buffer_from_header
gst_dp_caps_from_packet
gst_dp_event_from_packet
gst_controller_get
gst_controller_get_value_arrays
gst_controller_get_value_array
-gst_controller_set
-gst_controller_set_from_list
-gst_controller_unset
-gst_controller_unset_all
-gst_controller_get_all
-gst_controller_set_interpolation_mode
<SUBSECTION Standard>
GstControllerClass
GstControllerPrivate
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>High percent</NICK>
-<BLURB>High threshold for buffering to finish.</BLURB>
+<BLURB>High threshold for buffering to finish. Only used if use-buffering is True.</BLURB>
<DEFAULT>99</DEFAULT>
</ARG>
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Low percent</NICK>
-<BLURB>Low threshold for buffering to start.</BLURB>
+<BLURB>Low threshold for buffering to start. Only used if use-buffering is True.</BLURB>
<DEFAULT>10</DEFAULT>
</ARG>
--- /dev/null
+Plan for 0.11
+=============
+
+First attempt at making a list of tasks in roughly chronological order.
+
+* General cleanup
+
+ - Remove deprecated methods
+ - Cleanup structs + PADDING
+ - ..
+
+ This should allow us to continue expanding later in the same way that 0.10 was
+ expanded.
+
+
+* Review GstCaps fields
+
+ - go over caps fields for audio, video, compressed media-type etc
+
+ We need to express things with less fields. This would speed up caps, make
+ them less verbose and speed up some elements.
+
+
+* Add GstFlowReturn for events (and query)
+
+ This would allow us to know more precisely what went wrong.
+
+ http://cgit.freedesktop.org/~wtay/gstreamer/log/?h=events2
+
+
+* add return structure for events and query
+
+ Make events return more information. (a seek event might want to return the
+ final position of the keyframe seek and the accuracy of the seek)
+
+ Make bindings easiers. Currently the writability of a query depends on the
+ refcount being exactly 1. If the query is not writable, it simply cannot be
+ answered.
+
+
+* Make GstMiniObject a simple boxed type
+
+ - Move copy and free function to structure
+ - convert GstBuffer, GstEvent, GstMessage, GstQuery,
+
+ We don't need to subclass miniobjects when we have arbitrary metadata.
+
+ Allocation should be more efficient and buffer/metadata/data can be allocated
+ and pooled in one contiguous memory area.
+
+ Typechecking of various types is much more efficient when there is only
+ one class.
+
+ http://cgit.freedesktop.org/~wtay/gstreamer/log/?h=miniobject2
+
+
+* Convert GstCaps to GstMiniObject
+
+ Currently it has its own refcounting and flags.
+
+ http://cgit.freedesktop.org/~wtay/gstreamer/log/?h=miniobject2
+
+
+* GVariant registry
+
+ - allow for mmaped registy (tpm)
+
+* Incremental caps
+
+ - Remove array from caps ?
+ - make caps iterator or is the array the cache for iterator ?
+
+ We need to perform less caps operations when negotiating formats. One way is
+ to only handle small caps objects incrementally.
+
+ http://cgit.freedesktop.org/~ensonic/gstreamer/log/?h=lazycaps
+
+
+* Make GstBufferMetadata
+
+ - Make functions to register metadata
+ - Make common metadata: timeinfo, memory data, video data
+ - Remove GstBuffer Fields
+ - Make methods to add metadata to buffers.
+
+ More flexible metadata for buffers.
+
+ http://cgit.freedesktop.org/~wtay/gstreamer/log/?h=buffermeta
+
+
+* Negotiation of metadata
+
+ - figure out if we need to negotiate the metadata on the caps or if we can
+ gracefully degrade when an element doesn't understand the metadata.
+
+ We need to avoid that elements put metadata on buffers that is essential in
+ handling the buffer contents but that is then not understood by other
+ elements.
+
+
+* Rework reverse negotiation
+
+ - upstream event to notify of a downstream caps change
+ - _alloc_buffer() takes input GstBuffer prototype (or NULL)
+ - _alloc_buffer() never returns changed caps.
+
+ One of the performance problems in 0.10 is that transform elements need to
+ call gst_pad_alloc_buffer() downstream to check if the caps changed. This
+ usually also results in a useless memory allocation.
+
+ We would make a new upstream event to notify downstream elements that new caps
+ are possible somewhere downstream.
+
+ gst_pad_alloc_buffer() would take a GstBuffer as an input argument to make the
+ API easier, we can then use metadata to specify additional contraints for the
+ new buffer (such as strides, etc)
+
+
+* Incremental event progation
+
+ - certain events would be sticky on a pad like for caps
+ - rules for pushing an event downstream
+ - right before pushing a buffer
+ - after link operation
+ - activate for most serialized downstream events
+
+ This would allow an application to have more control over the state of the
+ dataflow in a pipeline.
+
+
+* GstSegment changes
+
+ - remove segment accumulation
+ - add accumulated time to the event
+ - apply segment info to pads
+ - add method on pads to get/adjust sync offset
+ - add method on pads to query current running_time
+
+ The goal is to make the timing model more comprehensible and thus make dynamic
+ pipeline plugging easier.
+
--- /dev/null
+The 0.11 porting guide
+----------------------
+
+* All deprecated methods were removed. Recompile against 0.10 with
+ DISABLE_DEPRECATED and fix issues before attempting to port to 0.11.
+
+* multifdsink, tcpclientsink, tcpclientsrc, tcpserversrc the protocol property
+ is removed, use gdppay and gdpdepay.
+
+* GstObject:
+ GST_OBJECT_DISPOSING flag removed
+ GST_OBJECT_IS_DISPOSING removed
+ GST_OBJECT_FLOATING flag remove, GstObject is now GInitiallyUnowned
+ GST_OBJECT_IS_FLOATING removed, use g_object_is_floating()
+
+ GST_CLASS_GET_LOCK, GST_CLASS_LOCK, GST_CLASS_TRYLOCK, GST_CLASS_UNLOCK,
+ used to be a workaround for thread-unsafe glib < 2.8
+
+ gst_object_ref_sink() has gpointer as result to make it more like the
+ GObject version.
+
+ gst_object_sink() removed, use gst_object_ref_sink() instead.
+
+ gst_class_signal_connect() removed, was only used for XML
+
+ parent-set and parent-unset signals removed. Use notify:parent. Currently
+ still disabled because of deep notify locking issues.
--- /dev/null
+Use cases for 0.11
+------------------
+
+- improve performance
+
+ * incremental caps
+ * cleanup caps fields
+ * Make miniobject a simple boxed type
+ * reverse negotiation with an event
+
+- buffer metadata
+
+ * Handle strides for video
+ * express crop, scaling, region of interest, ...
+ * Better support for foreign objects such as Cairo, OpenGL, OMX, ...
+
+- make dynamic pipelines easier
+
+ * sticky event propagation
+ * newsegment simplifications
+ * per-pad time offsets
lib_LTLIBRARIES = libgstreamer-@GST_MAJORMINOR@.la
-if GST_DISABLE_LOADSAVE
-GST_LOADSAVE_SRC =
-else
-GST_LOADSAVE_SRC = gstxml.c
-endif
-
if GST_DISABLE_REGISTRY
GST_REGISTRY_SRC =
else
built_source_make = gstenumtypes.c gstmarshal.c
EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
- gstmarshal.list gsttrace.c gstxml.c \
+ gstmarshal.list gsttrace.c \
gstregistrybinary.c
gstutils.c \
gstvalue.c \
gstparse.c \
- $(GST_REGISTRY_SRC) \
- $(GST_LOADSAVE_SRC)
+ $(GST_REGISTRY_SRC)
# do not put files in the distribution that are generated
nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = $(built_source_make)
gstutils.h \
gstvalue.h \
gstregistry.h \
- gstparse.h \
- gstxml.h
+ gstparse.h
libgstreamer_@GST_MAJORMINOR@include_HEADERS = $(gst_headers) math-compat.h
glib-compat-private.h \
gst-i18n-lib.h \
gst-i18n-app.h \
- gstelementdetails.h \
+ gstelementmetadata.h \
gstpluginloader.h \
gstquark.h \
gstregistrybinary.h \
-I$(top_builddir) \
-DIN_GOBJECT_INTROSPECTION=1 \
--c-include='gst/gst.h' \
- --library=libgstreamer-0.10.la \
+ --library=libgstreamer-0.11.la \
--include=GLib-2.0 \
--include=GObject-2.0 \
--include=GModule-2.0 \
- --include=libxml2-2.0 \
--libtool="$(top_builddir)/libtool" \
--pkg glib-2.0 \
--pkg gobject-2.0 \
--pkg gmodule-no-export-2.0 \
--pkg gthread-2.0 \
- --pkg libxml-2.0 \
- --pkg-export gstreamer-0.10 \
+ --pkg-export gstreamer-0.11 \
--output $@ \
$(gir_headers) \
$(gir_sources)
#include <gst/gstdatetime.h>
#include <gst/gstdebugutils.h>
#include <gst/gstelement.h>
+#include <gst/gstelementmetadata.h>
#include <gst/gsterror.h>
#include <gst/gstevent.h>
#include <gst/gstghostpad.h>
#include <gst/gsturi.h>
#include <gst/gstutils.h>
#include <gst/gstvalue.h>
-#include <gst/gstxml.h>
#include <gst/gstparse.h>
#include "gstevent.h"
#include "gstbin.h"
#include "gstmarshal.h"
-#include "gstxml.h"
#include "gstinfo.h"
#include "gsterror.h"
#include "gstutils.h"
#include "gstchildproxy.h"
-#ifdef GST_DISABLE_DEPRECATED
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#undef GstXmlNodePtr
-#define GstXmlNodePtr xmlNodePtr
-#include <libxml/parser.h>
-GstXmlNodePtr gst_object_save_thyself (GstObject * object,
- GstXmlNodePtr parent);
-void gst_object_restore_thyself (GstObject * object, GstXmlNodePtr parent);
-GstElement *gst_xml_make_element (xmlNodePtr cur, GstObject * parent);
-#endif
-#endif
-
/* enable for DURATION caching.
* FIXME currently too many elements don't update
* their duration when it changes so we return inaccurate values. */
static gboolean gst_bin_do_latency_func (GstBin * bin);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-static xmlNodePtr gst_bin_save_thyself (GstObject * object, xmlNodePtr parent);
-static void gst_bin_restore_thyself (GstObject * object, xmlNodePtr self);
-#endif
-
static void bin_remove_messages (GstBin * bin, GstObject * src,
GstMessageType types);
static void gst_bin_continue_func (BinContinueData * data);
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_set_details_simple (gstelement_class, "Generic bin",
+ gst_element_class_set_metadata (gstelement_class, "Generic bin",
"Generic/Bin",
"Simple container object",
"Erik Walthinsen <omega@cse.ogi.edu>,"
gobject_class->dispose = gst_bin_dispose;
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- gstobject_class->save_thyself =
- ((gpointer (*)(GstObject * object,
- gpointer self)) * GST_DEBUG_FUNCPTR (gst_bin_save_thyself));
- gstobject_class->restore_thyself =
- ((void (*)(GstObject * object,
- gpointer self)) *GST_DEBUG_FUNCPTR (gst_bin_restore_thyself));
-#endif
-
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_bin_change_state_func);
gstelement_class->get_state = GST_DEBUG_FUNCPTR (gst_bin_get_state_func);
return result;
}
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-static xmlNodePtr
-gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
-{
- GstBin *bin = GST_BIN_CAST (object);
- xmlNodePtr childlist, elementnode;
- GList *children;
- GstElement *child;
-
- if (GST_OBJECT_CLASS (parent_class)->save_thyself)
- GST_OBJECT_CLASS (parent_class)->save_thyself (GST_OBJECT (bin), parent);
-
- childlist = xmlNewChild (parent, NULL, (xmlChar *) "children", NULL);
-
- GST_CAT_INFO (GST_CAT_XML, "[%s]: saving %d children",
- GST_ELEMENT_NAME (bin), bin->numchildren);
-
- children = g_list_last (bin->children);
- while (children) {
- child = GST_ELEMENT_CAST (children->data);
- elementnode = xmlNewChild (childlist, NULL, (xmlChar *) "element", NULL);
- gst_object_save_thyself (GST_OBJECT (child), elementnode);
- children = g_list_previous (children);
- }
- return childlist;
-}
-
-static void
-gst_bin_restore_thyself (GstObject * object, xmlNodePtr self)
-{
- GstBin *bin = GST_BIN_CAST (object);
- xmlNodePtr field = self->xmlChildrenNode;
- xmlNodePtr childlist;
-
- while (field) {
- if (!strcmp ((char *) field->name, "children")) {
- GST_CAT_INFO (GST_CAT_XML, "[%s]: loading children",
- GST_ELEMENT_NAME (object));
- childlist = field->xmlChildrenNode;
- while (childlist) {
- if (!strcmp ((char *) childlist->name, "element")) {
- /* gst_xml_make_element will gst_bin_add() the element to ourself */
- gst_xml_make_element (childlist, GST_OBJECT (bin));
- }
- childlist = childlist->next;
- }
- }
-
- field = field->next;
- }
- if (GST_OBJECT_CLASS (parent_class)->restore_thyself)
- (GST_OBJECT_CLASS (parent_class)->restore_thyself) (object, self);
-}
-#endif /* GST_DISABLE_LOADSAVE */
#include <gst/gst.h>
#include <gobject/gvaluecollector.h>
-#ifdef GST_DISABLE_DEPRECATED
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#include <libxml/parser.h>
-xmlNodePtr gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent);
-GstCaps *gst_caps_load_thyself (xmlNodePtr parent);
-#endif
-#endif
-
#define DEBUG_REFCOUNT
#define CAPS_POISON(caps) G_STMT_START{ \
return TRUE;
}
-/* persistence */
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/**
- * gst_caps_save_thyself:
- * @caps: a #GstCaps structure
- * @parent: a XML parent node
- *
- * Serializes a #GstCaps to XML and adds it as a child node of @parent.
- *
- * Returns: a XML node pointer
- */
-xmlNodePtr
-gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent)
-{
- char *s = gst_caps_to_string (caps);
-
- xmlNewChild (parent, NULL, (xmlChar *) "caps", (xmlChar *) s);
- g_free (s);
- return parent;
-}
-
-/**
- * gst_caps_load_thyself:
- * @parent: a XML node
- *
- * Creates a #GstCaps from its XML serialization.
- *
- * Returns: a new #GstCaps structure
- */
-GstCaps *
-gst_caps_load_thyself (xmlNodePtr parent)
-{
- if (strcmp ("caps", (char *) parent->name) == 0) {
- return gst_caps_from_string ((gchar *) xmlNodeGetContent (parent));
- }
-
- return NULL;
-}
-#endif
-
/* utility */
/**
*/
#define GST_CAPS_IS_SIMPLE(caps) (gst_caps_get_size(caps) == 1)
-#ifndef GST_DISABLE_DEPRECATED
-/**
- * GST_DEBUG_CAPS:
- * @string: a string that should be prepended to the caps data.
- * @caps: the #GstCaps instance to print
- *
- * Convenience macro for printing out the contents of caps with GST_DEBUG().
- *
- * Deprecated: do not use anymore
- */
-#define GST_DEBUG_CAPS(string, caps) \
- GST_DEBUG ( string "%s: " GST_PTR_FORMAT, caps)
-
-#endif /* GST_DISABLE_DEPRECATED */
-
/**
* GST_STATIC_CAPS:
* @string: the string describing the caps
GstCaps * gst_caps_normalize (const GstCaps *caps);
gboolean gst_caps_do_simplify (GstCaps *caps);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED)
-xmlNodePtr gst_caps_save_thyself (const GstCaps *caps,
- xmlNodePtr parent);
-GstCaps * gst_caps_load_thyself (xmlNodePtr parent);
-#endif
-
/* utility */
void gst_caps_replace (GstCaps **caps,
GstCaps *newcaps);
G_BEGIN_DECLS
+/* added to ease the transition to 0.11 */
+#define gst_element_class_set_details_simple gst_element_class_set_metadata
+
+#define gst_element_factory_get_longname(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_LONGNAME)
+#define gst_element_factory_get_klass(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_KLASS)
+#define gst_element_factory_get_description(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_DESCRIPTION)
+#define gst_element_factory_get_author(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_AUTHOR)
+#define gst_element_factory_get_documentation_uri(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_DOC_URI)
+#define gst_element_factory_get_icon_name(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_ICON_NAME)
+
+
#ifndef GST_DISABLE_DEPRECATED
#endif /* not GST_DISABLE_DEPRECATED */
/* FIXME: move include to where we need it */
/*#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) )*/
#ifndef GST_DISABLE_XML
-#ifndef GST_DISABLE_DEPRECATED
-# include <libxml/parser.h>
-#endif
#else
/* FIXME: 0.11 (replace by GST_DISABLE_XML) */
# define GST_DISABLE_LOADSAVE_REGISTRY
#include <gobject/gvaluecollector.h>
#include "gstelement.h"
-#include "gstelementdetails.h"
+#include "gstelementmetadata.h"
#include "gstenumtypes.h"
#include "gstbus.h"
#include "gstmarshal.h"
/* FILL ME */
};
-#ifdef GST_DISABLE_DEPRECATED
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#include <libxml/parser.h>
-xmlNodePtr gst_object_save_thyself (const GstObject * object,
- xmlNodePtr parent);
-GstObject *gst_object_load_thyself (xmlNodePtr parent);
-void gst_pad_load_and_link (xmlNodePtr self, GstObject * parent);
-#endif
-#endif
-
static void gst_element_class_init (GstElementClass * klass);
static void gst_element_init (GstElement * element);
static void gst_element_base_class_init (gpointer g_class);
* gst_element_class_get_request_pad_template (GstElementClass *
element_class, const gchar * name);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-static xmlNodePtr gst_element_save_thyself (GstObject * object,
- xmlNodePtr parent);
-static void gst_element_restore_thyself (GstObject * parent, xmlNodePtr self);
-#endif
-
static GstObjectClass *parent_class = NULL;
static guint gst_element_signals[LAST_SIGNAL] = { 0 };
gobject_class->dispose = gst_element_dispose;
gobject_class->finalize = gst_element_finalize;
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- gstobject_class->save_thyself =
- ((gpointer (*)(GstObject * object,
- gpointer self)) * GST_DEBUG_FUNCPTR (gst_element_save_thyself));
- gstobject_class->restore_thyself =
- ((void (*)(GstObject * object,
- gpointer self)) *GST_DEBUG_FUNCPTR (gst_element_restore_thyself));
-#endif
-
klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state_func);
klass->set_state = GST_DEBUG_FUNCPTR (gst_element_set_state_func);
klass->get_state = GST_DEBUG_FUNCPTR (gst_element_get_state_func);
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
- /* FIXME 0.11: Copy the element details and instead of clearing the
+ /* FIXME 0.11: Instead of clearing the
* pad template list copy the list and increase the refcount of
* the pad templates by one.
*
* of doing things.
* See http://bugzilla.gnome.org/show_bug.cgi?id=491501
*/
- memset (&element_class->details, 0, sizeof (GstElementDetails));
- element_class->meta_data = NULL;
+ element_class->metadata = gst_structure_empty_new ("metadata");
element_class->padtemplates = NULL;
/* set the factory, see gst_element_register() */
g_list_foreach (klass->padtemplates, (GFunc) gst_object_unref, NULL);
g_list_free (klass->padtemplates);
- __gst_element_details_clear (&klass->details);
- if (klass->meta_data) {
- gst_structure_free (klass->meta_data);
- klass->meta_data = NULL;
- }
+
+ gst_structure_free (klass->metadata);
}
static void
return pad;
}
-/**
- * gst_element_get_pad:
- * @element: a #GstElement.
- * @name: the name of the pad to retrieve.
- *
- * Retrieves a pad from @element by name. Tries gst_element_get_static_pad()
- * first, then gst_element_get_request_pad().
- *
- * Deprecated: This function is deprecated as it's unclear if the reference
- * to the result pad should be released with gst_object_unref() in case of a static pad
- * or gst_element_release_request_pad() in case of a request pad.
- * Use gst_element_get_static_pad() or gst_element_get_request_pad() instead.
- *
- * Returns: the #GstPad if found, otherwise %NULL. Unref or Release after usage,
- * depending on the type of the pad.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-GstPad *gst_element_get_pad (GstElement * element, const gchar * name);
-#endif
-GstPad *
-gst_element_get_pad (GstElement * element, const gchar * name)
-{
- GstPad *pad;
-
- g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- pad = gst_element_get_static_pad (element, name);
- if (!pad)
- pad = gst_element_get_request_pad (element, name);
-
- return pad;
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
static GstIteratorItem
iterate_pad (GstIterator * it, GstPad * pad)
{
klass->numpadtemplates++;
}
-static void
-gst_element_class_add_meta_data (GstElementClass * klass,
- const gchar * key, const gchar * value)
-{
- if (!klass->meta_data) {
- /* FIXME: use a quark for "metadata" */
- klass->meta_data = gst_structure_empty_new ("metadata");
- }
-
- gst_structure_set ((GstStructure *) klass->meta_data,
- key, G_TYPE_STRING, value, NULL);
-}
-
-/**
- * gst_element_class_set_documentation_uri:
- * @klass: class to set details for
- * @uri: uri of element documentation
- *
- * Set uri pointing to user documentation. Applications can use this to show
- * help for e.g. effects to users.
- *
- * Since: 0.10.31
- */
-void
-gst_element_class_set_documentation_uri (GstElementClass * klass,
- const gchar * uri)
-{
- g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
-
- gst_element_class_add_meta_data (klass, "doc-uri", uri);
-}
-
/**
- * gst_element_class_set_icon_name:
- * @klass: class to set details for
- * @name: name of an icon
- *
- * Elements that bridge to certain other products can include an icon of that
- * used product. Application can show the icon in menus/selectors to help
- * identifying specific elements.
+ * gst_element_class_add_metadata:
+ * @klass: class to set metadata for
+ * @key: the key to set
+ * @value: the value to set
*
- * Since: 0.10.31
+ * Set @key with @value as metadata in @klass.
*/
void
-gst_element_class_set_icon_name (GstElementClass * klass, const gchar * name)
-{
- g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
-
- gst_element_class_add_meta_data (klass, "icon-name", name);
-}
-
-/* FIXME-0.11: deprecate and remove gst_element_class_set_details*() */
-/**
- * gst_element_class_set_details:
- * @klass: class to set details for
- * @details: details to set
- *
- * Sets the detailed information for a #GstElementClass.
- * <note>This function is for use in _base_init functions only.</note>
- *
- * The @details are copied.
- *
- * Deprecated: Use gst_element_class_set_details_simple() instead.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void
-gst_element_class_set_details (GstElementClass * klass,
- const GstElementDetails * details);
-#endif
-void
-gst_element_class_set_details (GstElementClass * klass,
- const GstElementDetails * details)
+gst_element_class_add_metadata (GstElementClass * klass,
+ const gchar * key, const gchar * value)
{
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
- g_return_if_fail (GST_IS_ELEMENT_DETAILS (details));
+ g_return_if_fail (key != NULL);
+ g_return_if_fail (value != NULL);
- __gst_element_details_copy (&klass->details, details);
+ gst_structure_set ((GstStructure *) klass->metadata,
+ key, G_TYPE_STRING, value, NULL);
}
-#endif
/**
- * gst_element_class_set_details_simple:
- * @klass: class to set details for
+ * gst_element_class_set_metadata:
+ * @klass: class to set metadata for
* @longname: The long English name of the element. E.g. "File Sink"
* @classification: String describing the type of element, as an unordered list
* separated with slashes ('/'). See draft-klass.txt of the design docs
* @description: Sentence describing the purpose of the element.
* E.g: "Write stream to a file"
* @author: Name and contact details of the author(s). Use \n to separate
- * multiple author details. E.g: "Joe Bloggs <joe.blogs at foo.com>"
+ * multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"
*
- * Sets the detailed information for a #GstElementClass. Simpler version of
- * gst_element_class_set_details() that generates less linker overhead.
+ * Sets the detailed information for a #GstElementClass.
* <note>This function is for use in _base_init functions only.</note>
- *
- * The detail parameter strings are copied into the #GstElementDetails for
- * the element class.
- *
- * Since: 0.10.14
*/
void
-gst_element_class_set_details_simple (GstElementClass * klass,
+gst_element_class_set_metadata (GstElementClass * klass,
const gchar * longname, const gchar * classification,
const gchar * description, const gchar * author)
{
- const GstElementDetails details =
- GST_ELEMENT_DETAILS ((gchar *) longname, (gchar *) classification,
- (gchar *) description, (gchar *) author);
-
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
- __gst_element_details_copy (&klass->details, &details);
+ gst_structure_set ((GstStructure *) klass->metadata,
+ GST_ELEMENT_METADATA_LONGNAME, G_TYPE_STRING, longname,
+ GST_ELEMENT_METADATA_KLASS, G_TYPE_STRING, classification,
+ GST_ELEMENT_METADATA_DESCRIPTION, G_TYPE_STRING, description,
+ GST_ELEMENT_METADATA_AUTHOR, G_TYPE_STRING, author, NULL);
}
/**
G_OBJECT_CLASS (parent_class)->finalize (object);
}
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/**
- * gst_element_save_thyself:
- * @element: a #GstElement to save.
- * @parent: the xml parent node.
- *
- * Saves the element as part of the given XML structure.
- *
- * Returns: the new #xmlNodePtr.
- */
-static xmlNodePtr
-gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
-{
- GList *pads;
- GstElementClass *oclass;
- GParamSpec **specs, *spec;
- guint nspecs;
- guint i;
- GValue value = { 0, };
- GstElement *element;
-
- g_return_val_if_fail (GST_IS_ELEMENT (object), parent);
-
- element = GST_ELEMENT_CAST (object);
-
- oclass = GST_ELEMENT_GET_CLASS (element);
-
- xmlNewChild (parent, NULL, (xmlChar *) "name",
- (xmlChar *) GST_ELEMENT_NAME (element));
-
- if (oclass->elementfactory != NULL) {
- GstElementFactory *factory = (GstElementFactory *) oclass->elementfactory;
-
- xmlNewChild (parent, NULL, (xmlChar *) "type",
- (xmlChar *) GST_PLUGIN_FEATURE (factory)->name);
- }
-
- /* params */
- specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &nspecs);
-
- for (i = 0; i < nspecs; i++) {
- spec = specs[i];
- if (spec->flags & G_PARAM_READABLE) {
- xmlNodePtr param;
- char *contents;
-
- g_value_init (&value, spec->value_type);
-
- g_object_get_property (G_OBJECT (element), spec->name, &value);
- param = xmlNewChild (parent, NULL, (xmlChar *) "param", NULL);
- xmlNewChild (param, NULL, (xmlChar *) "name", (xmlChar *) spec->name);
-
- if (G_IS_PARAM_SPEC_STRING (spec))
- contents = g_value_dup_string (&value);
- else if (G_IS_PARAM_SPEC_ENUM (spec))
- contents = g_strdup_printf ("%d", g_value_get_enum (&value));
- else if (G_IS_PARAM_SPEC_INT64 (spec))
- contents = g_strdup_printf ("%" G_GINT64_FORMAT,
- g_value_get_int64 (&value));
- else if (GST_VALUE_HOLDS_STRUCTURE (&value)) {
- if (g_value_get_boxed (&value) != NULL) {
- contents = g_strdup_value_contents (&value);
- } else {
- contents = g_strdup ("NULL");
- }
- } else
- contents = g_strdup_value_contents (&value);
-
- xmlNewChild (param, NULL, (xmlChar *) "value", (xmlChar *) contents);
- g_free (contents);
-
- g_value_unset (&value);
- }
- }
-
- g_free (specs);
-
- pads = g_list_last (GST_ELEMENT_PADS (element));
-
- while (pads) {
- GstPad *pad = GST_PAD_CAST (pads->data);
-
- /* figure out if it's a direct pad or a ghostpad */
- if (GST_ELEMENT_CAST (GST_OBJECT_PARENT (pad)) == element) {
- xmlNodePtr padtag = xmlNewChild (parent, NULL, (xmlChar *) "pad", NULL);
-
- gst_object_save_thyself (GST_OBJECT_CAST (pad), padtag);
- }
- pads = g_list_previous (pads);
- }
-
- return parent;
-}
-
-static void
-gst_element_restore_thyself (GstObject * object, xmlNodePtr self)
-{
- xmlNodePtr children;
- GstElement *element;
- gchar *name = NULL;
- gchar *value = NULL;
-
- element = GST_ELEMENT_CAST (object);
- g_return_if_fail (element != NULL);
-
- /* parameters */
- children = self->xmlChildrenNode;
- while (children) {
- if (!strcmp ((char *) children->name, "param")) {
- xmlNodePtr child = children->xmlChildrenNode;
-
- while (child) {
- if (!strcmp ((char *) child->name, "name")) {
- name = (gchar *) xmlNodeGetContent (child);
- } else if (!strcmp ((char *) child->name, "value")) {
- value = (gchar *) xmlNodeGetContent (child);
- }
- child = child->next;
- }
- /* FIXME: can this just be g_object_set ? */
- gst_util_set_object_arg (G_OBJECT (element), name, value);
- /* g_object_set (G_OBJECT (element), name, value, NULL); */
- g_free (name);
- g_free (value);
- }
- children = children->next;
- }
-
- /* pads */
- children = self->xmlChildrenNode;
- while (children) {
- if (!strcmp ((char *) children->name, "pad")) {
- gst_pad_load_and_link (children, GST_OBJECT_CAST (element));
- }
- children = children->next;
- }
-
- if (GST_OBJECT_CLASS (parent_class)->restore_thyself)
- (GST_OBJECT_CLASS (parent_class)->restore_thyself) (object, self);
-}
-#endif /* GST_DISABLE_LOADSAVE */
-
static void
gst_element_set_bus_func (GstElement * element, GstBus * bus)
{
*
* Since: 0.10.13
*/
-#define GST_STATE_TARGET(elem) (GST_ELEMENT_CAST(elem)->abidata.ABI.target_state)
+#define GST_STATE_TARGET(elem) (GST_ELEMENT_CAST(elem)->target_state)
/**
* GST_STATE_RETURN:
*
* Since: 0.10.24
*/
-#define GST_ELEMENT_START_TIME(elem) (GST_ELEMENT_CAST(elem)->abidata.ABI.start_time)
+#define GST_ELEMENT_START_TIME(elem) (GST_ELEMENT_CAST(elem)->start_time)
/**
* GST_ELEMENT_ERROR:
* @state_cond: Used to signal completion of a state change
* @state_cookie: Used to detect concurrent execution of
* gst_element_set_state() and gst_element_get_state()
+ * @target_state: the target state of an element as set by the application
* @current_state: the current state of an element
* @next_state: the next state of an element, can be #GST_STATE_VOID_PENDING if
* the element is in the correct state.
* @base_time: the time of the clock right before the element is set to
* PLAYING. Subtracting @base_time from the current clock time in the PLAYING
* state will yield the running_time against the clock.
+ * @start_time: the running_time of the last PAUSED state
* @numpads: number of pads of the element, includes both source and sink pads.
* @pads: list of pads
* @numsrcpads: number of source pads of the element.
/* element state */
GCond *state_cond;
guint32 state_cookie;
+ GstState target_state;
GstState current_state;
GstState next_state;
GstState pending_state;
/* allocated clock */
GstClock *clock;
GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
+ GstClockTime start_time;
/* element pads, these lists can only be iterated while holding
* the LOCK or checking the cookie after each LOCK. */
guint32 pads_cookie;
/*< private >*/
- union {
- struct {
- /* state set by application */
- GstState target_state;
- /* running time of the last PAUSED state */
- GstClockTime start_time;
- } ABI;
- /* adding + 0 to mark ABI change to be undone later */
- gpointer _gst_reserved[GST_PADDING + 0];
- } abidata;
+ gpointer _gst_reserved[GST_PADDING];
};
/**
* GstElementClass:
* @parent_class: the parent class structure
- * @details: #GstElementDetails for elements of this class
+ * @metadata: metadata for elements of this class
* @elementfactory: the #GstElementFactory that creates these elements
* @padtemplates: a #GList of #GstPadTemplate
* @numpadtemplates: the number of padtemplates
GstObjectClass parent_class;
/*< public >*/
- /* the element details */
- /* FIXME-0.11: deprecate this in favour of meta_data */
- GstElementDetails details;
+ /* the element metadata */
+ gpointer metadata;
/* factory that the element was created from */
GstElementFactory *elementfactory;
gboolean (*query) (GstElement *element, GstQuery *query);
/*< private >*/
- /* FIXME-0.11: move up and replace details */
- gpointer meta_data;
- gpointer _gst_reserved[GST_PADDING-1];
+ gpointer _gst_reserved[GST_PADDING];
};
/* element class pad templates */
GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
/* element class meta data */
-void gst_element_class_set_documentation_uri (GstElementClass * klass, const gchar *uri);
-void gst_element_class_set_icon_name (GstElementClass * klass, const gchar *name);
-#ifndef GST_DISABLE_DEPRECATED
-void gst_element_class_set_details (GstElementClass *klass, const GstElementDetails *details);
-#endif
-void gst_element_class_set_details_simple (GstElementClass *klass,
+void gst_element_class_set_metadata (GstElementClass *klass,
const gchar *longname,
const gchar *classification,
const gchar *description,
const gchar *author);
+void gst_element_class_add_metadata (GstElementClass * klass,
+ const gchar * key, const gchar * value);
+
/* element instance */
GType gst_element_get_type (void);
gboolean gst_element_remove_pad (GstElement *element, GstPad *pad);
void gst_element_no_more_pads (GstElement *element);
-#ifndef GST_DISABLE_DEPRECATED
-GstPad* gst_element_get_pad (GstElement *element, const gchar *name);
-#endif /* GST_DISABLE_DEPRECATED */
GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name);
GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name);
void gst_element_release_request_pad (GstElement *element, GstPad *pad);
+++ /dev/null
-/* GStreamer
- * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
- * 2000,2004 Wim Taymans <wim@fluendo.com>
- *
- * gstelement.h: Header for GstElement
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GST_ELEMENT_DETAILS_H__
-#define __GST_ELEMENT_DETAILS_H__
-
-G_BEGIN_DECLS
-
-static inline void
-__gst_element_details_clear (GstElementDetails * dp)
-{
- g_free (dp->longname);
- g_free (dp->klass);
- g_free (dp->description);
- g_free (dp->author);
- memset (dp, 0, sizeof (GstElementDetails));
-}
-
-#define VALIDATE_SET(__dest, __src, __entry) \
-G_STMT_START { \
- if (g_utf8_validate (__src->__entry, -1, NULL)) { \
- __dest->__entry = g_strdup (__src->__entry); \
- } else { \
- g_warning ("Invalid UTF-8 in " G_STRINGIFY (__entry) ": %s", \
- __src->__entry); \
- __dest->__entry = g_strdup ("[ERROR: invalid UTF-8]"); \
- } \
-} G_STMT_END
-
-static inline void
-__gst_element_details_set (GstElementDetails * dest,
- const GstElementDetails * src)
-{
- VALIDATE_SET (dest, src, longname);
- VALIDATE_SET (dest, src, klass);
- VALIDATE_SET (dest, src, description);
- VALIDATE_SET (dest, src, author);
-}
-
-static inline void
-__gst_element_details_copy (GstElementDetails * dest,
- const GstElementDetails * src)
-{
- __gst_element_details_clear (dest);
- __gst_element_details_set (dest, src);
-}
-
-G_END_DECLS
-
-#endif /* __GST_ELEMENT_DETAILS_H__ */
#include "gst_private.h"
#include "gstelement.h"
-#include "gstelementdetails.h"
+#include "gstelementmetadata.h"
#include "gstinfo.h"
#include "gsturi.h"
#include "gstregistry.h"
{
GList *item;
- __gst_element_details_clear (&factory->details);
- if (factory->meta_data) {
- gst_structure_free ((GstStructure *) factory->meta_data);
- factory->meta_data = NULL;
+ if (factory->metadata) {
+ gst_structure_free ((GstStructure *) factory->metadata);
+ factory->metadata = NULL;
}
if (factory->type) {
factory->type = G_TYPE_INVALID;
/* provide info needed during class structure setup */
g_type_set_qdata (type, _gst_elementclass_factory, factory);
klass = GST_ELEMENT_CLASS (g_type_class_ref (type));
+#if 0
+ /* FIXME */
if ((klass->details.longname == NULL) ||
(klass->details.klass == NULL) || (klass->details.author == NULL))
goto detailserror;
+#endif
factory->type = type;
- __gst_element_details_copy (&factory->details, &klass->details);
- if (klass->meta_data) {
- factory->meta_data = gst_structure_copy ((GstStructure *) klass->meta_data);
- } else {
- factory->meta_data = NULL;
- }
+ factory->metadata = gst_structure_copy ((GstStructure *) klass->metadata);
+
for (item = klass->padtemplates; item; item = item->next) {
GstPadTemplate *templ = item->data;
GstStaticPadTemplate *newt;
return FALSE;
}
+#if 0
detailserror:
{
GST_WARNING_OBJECT (factory,
gst_element_factory_cleanup (factory);
return FALSE;
}
+#endif
}
/**
return factory->type;
}
-/**
- * gst_element_factory_get_longname:
- * @factory: a #GstElementFactory
- *
- * Gets the longname for this factory
- *
- * Returns: the longname
- */
-G_CONST_RETURN gchar *
-gst_element_factory_get_longname (GstElementFactory * factory)
-{
- g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
-
- return factory->details.longname;
-}
-
-/**
- * gst_element_factory_get_klass:
- * @factory: a #GstElementFactory
- *
- * Gets the class for this factory.
- *
- * Returns: the class
- */
-G_CONST_RETURN gchar *
-gst_element_factory_get_klass (GstElementFactory * factory)
-{
- g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
-
- return factory->details.klass;
-}
-
-/**
- * gst_element_factory_get_description:
- * @factory: a #GstElementFactory
- *
- * Gets the description for this factory.
- *
- * Returns: the description
- */
-G_CONST_RETURN gchar *
-gst_element_factory_get_description (GstElementFactory * factory)
-{
- g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
-
- return factory->details.description;
-}
-
-/**
- * gst_element_factory_get_author:
- * @factory: a #GstElementFactory
- *
- * Gets the author for this factory.
- *
- * Returns: the author
- */
G_CONST_RETURN gchar *
-gst_element_factory_get_author (GstElementFactory * factory)
-{
- g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
-
- return factory->details.author;
-}
-
-static G_CONST_RETURN gchar *
-gst_element_factory_get_meta_data (GstElementFactory * factory,
+gst_element_factory_get_metadata (GstElementFactory * factory,
const gchar * key)
{
- if (!factory->meta_data)
- return NULL;
-
- /* FIXME: do we want to support other types? */
- return gst_structure_get_string ((GstStructure *) factory->meta_data, key);
-}
-
-/**
- * gst_element_factory_get_documentation_uri:
- * @factory: a #GstElementFactory
- *
- * Gets documentation uri for this factory if set.
- *
- * Since: 0.10.31
- *
- * Returns: the documentation uri
- */
-G_CONST_RETURN gchar *
-gst_element_factory_get_documentation_uri (GstElementFactory * factory)
-{
- g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
- return gst_element_factory_get_meta_data (factory, "doc-uri");
-}
-
-/**
- * gst_element_factory_get_documentation_uri:
- * @factory: a #GstElementFactory
- *
- * Gets icon name for this factory if set.
- *
- * Since: 0.10.31
- *
- * Returns: the icon name
- */
-G_CONST_RETURN gchar *
-gst_element_factory_get_icon_name (GstElementFactory * factory)
-{
- g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
- return gst_element_factory_get_meta_data (factory, "icon-name");
+ return gst_structure_get_string ((GstStructure *) factory->metadata, key);
}
/**
gboolean res = FALSE;
const gchar *klass;
- klass = gst_element_factory_get_klass (factory);
+ klass =
+ gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
/* Filter by element type first, as soon as it matches
* one type, we skip all other tests */
G_BEGIN_DECLS
-/* FIXME 0.11: Move GstElementDetails into a private header and use it internally
- * in GstElementFactory, GstElementClass and the registry
- */
-
-typedef struct _GstElementDetails GstElementDetails;
-
-/**
- * GstElementDetails:
- * @longname: long, english name
- * @klass: string describing the type of element, as an unordered list
- * separated with slashes ('/'). See draft-klass.txt of the design docs
- * for more details and common types
- * @description: what the element is about
- * @author: who wrote this thing?
- *
- * This struct defines the public information about a #GstElement. It contains
- * meta-data about the element that is mostly for the benefit of editors.
- *
- * The @klass member can be used by applications to filter elements based
- * on functionality.
- */
-/* FIXME: need translatable stuff in here (how handle in registry)?
- * can't we use _N("long name") in element implementations and use _(longname)
- * in gst_element_factory_get_longname()
- */
-struct _GstElementDetails
-{
- /*< public > */
- gchar *longname;
- gchar *klass;
- gchar *description;
- gchar *author;
-
- /*< private >*/
- gpointer _gst_reserved[GST_PADDING];
-};
-
-/**
- * GST_ELEMENT_DETAILS:
- * @longname: long, english name
- * @klass: string describing the type of element, as an unordered list
- * separated with slashes ('/'). See draft-klass.txt of the design docs
- * for more details and common types
- * @description: what the element is about
- * @author: who wrote this element
- *
- * Macro to initialize #GstElementDetails.
- */
-#define GST_ELEMENT_DETAILS(longname,klass,description,author) \
- { longname, klass, description, author, {NULL} }
-
-/**
- * GST_IS_ELEMENT_DETAILS:
- * @details: the #GstElementDetails to check
- *
- * Tests if element details are initialized.
- */
-/* FIXME: what about adding '&& (*__gst_reserved==NULL)' */
-#define GST_IS_ELEMENT_DETAILS(details) ( \
- (details) && ((details)->longname != NULL) && ((details)->klass != NULL) \
- && ((details)->description != NULL) && ((details)->author != NULL))
-
#define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
#define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
GstElementFactory))
GType type; /* unique GType of element or 0 if not loaded */
- /* FIXME-0.11: deprecate this in favour of meta_data */
- GstElementDetails details;
+ gpointer metadata;
GList * staticpadtemplates; /* GstStaticPadTemplate list */
guint numpadtemplates;
GList * interfaces; /* interface type names this element implements */
/*< private >*/
- /* FIXME-0.11: move up and replace details */
- gpointer meta_data;
- gpointer _gst_reserved[GST_PADDING - 1];
+ gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementFactoryClass {
GstElementFactory * gst_element_factory_find (const gchar *name);
GType gst_element_factory_get_element_type (GstElementFactory *factory);
-G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory);
-G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory);
-G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
-G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
-G_CONST_RETURN gchar * gst_element_factory_get_documentation_uri (GstElementFactory *factory);
-G_CONST_RETURN gchar * gst_element_factory_get_icon_name (GstElementFactory *factory);
+
+G_CONST_RETURN gchar * gst_element_factory_get_metadata (GstElementFactory *factoryi, const gchar *key);
+
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
G_CONST_RETURN GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory);
+
gint gst_element_factory_get_uri_type (GstElementFactory *factory);
gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
+
gboolean gst_element_factory_has_interface (GstElementFactory *factory,
const gchar *interfacename);
--- /dev/null
+/* GStreamer
+ * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
+ * 2000,2004 Wim Taymans <wim@fluendo.com>
+ *
+ * gstelementmetadata.h: Metadata for GstElement classes
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_ELEMENT_METADATA_H__
+#define __GST_ELEMENT_METADATA_H__
+
+G_BEGIN_DECLS
+
+/**
+ * GST_ELEMENT_METADATA_LONGNAME:
+ *
+ * The long English name of the element. E.g. "File Sink"
+ */
+#define GST_ELEMENT_METADATA_LONGNAME "long-name"
+/**
+ * GST_ELEMENT_METADATA_KLASS:
+ *
+ * String describing the type of element, as an unordered list
+ * separated with slashes ('/'). See draft-klass.txt of the design docs
+ * for more details and common types. E.g: "Sink/File"
+ */
+#define GST_ELEMENT_METADATA_KLASS "klass"
+
+/**
+ * GST_ELEMENT_METADATA_DESCRIPTION:
+ *
+ * Sentence describing the purpose of the element.
+ * E.g: "Write stream to a file"
+ */
+#define GST_ELEMENT_METADATA_DESCRIPTION "description"
+/**
+ * GST_ELEMENT_METADATA_AUTHOR:
+ *
+ * Name and contact details of the author(s). Use \n to separate
+ * multiple author details.
+ * E.g: "Joe Bloggs <joe.blogs at foo.com>"
+ */
+#define GST_ELEMENT_METADATA_AUTHOR "author"
+
+/**
+ * GST_ELEMENT_METADATA_DOC_URI:
+ *
+ * Set uri pointing to user documentation. Applications can use this to show
+ * help for e.g. effects to users.
+ */
+#define GST_ELEMENT_METADATA_DOC_URI "doc-uri"
+/**
+ * GST_ELEMENT_METADATA_ICON_NAME:
+ *
+ * Elements that bridge to certain other products can include an icon of that
+ * used product. Application can show the icon in menus/selectors to help
+ * identifying specific elements.
+ */
+#define GST_ELEMENT_METADATA_ICON_NAME "icon-name"
+
+G_END_DECLS
+
+#endif /* __GST_ELEMENT_METADATA_H__ */
static void gst_proxy_pad_dispose (GObject * object);
static void gst_proxy_pad_finalize (GObject * object);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#ifdef GST_DISABLE_DEPRECATED
-#include <libxml/parser.h>
-#endif
-static xmlNodePtr gst_proxy_pad_save_thyself (GstObject * object,
- xmlNodePtr parent);
-#endif
-
static void on_src_target_notify (GstPad * target,
GParamSpec * unused, gpointer user_data);
gobject_class->dispose = gst_proxy_pad_dispose;
gobject_class->finalize = gst_proxy_pad_finalize;
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- {
- GstObjectClass *gstobject_class = (GstObjectClass *) klass;
-
- gstobject_class->save_thyself =
- ((gpointer (*)(GstObject * object,
- gpointer self)) *
- GST_DEBUG_FUNCPTR (gst_proxy_pad_save_thyself));
- }
-#endif
/* Register common function pointer descriptions */
GST_DEBUG_REGISTER_FUNCPTR (gst_proxy_pad_do_query_type);
GST_DEBUG_REGISTER_FUNCPTR (gst_proxy_pad_do_event);
gst_pad_set_unlink_function (pad, gst_proxy_pad_do_unlink);
}
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/**
- * gst_proxy_pad_save_thyself:
- * @pad: a ghost #GstPad to save.
- * @parent: the parent #xmlNodePtr to save the description in.
- *
- * Saves the ghost pad into an xml representation.
- *
- * Returns: the #xmlNodePtr representation of the pad.
- */
-static xmlNodePtr
-gst_proxy_pad_save_thyself (GstObject * object, xmlNodePtr parent)
-{
- xmlNodePtr self;
- GstProxyPad *proxypad;
- GstPad *pad;
- GstPad *peer;
-
- g_return_val_if_fail (GST_IS_PROXY_PAD (object), NULL);
-
- self = xmlNewChild (parent, NULL, (xmlChar *) "ghostpad", NULL);
- xmlNewChild (self, NULL, (xmlChar *) "name",
- (xmlChar *) GST_OBJECT_NAME (object));
- xmlNewChild (self, NULL, (xmlChar *) "parent",
- (xmlChar *) GST_OBJECT_NAME (GST_OBJECT_PARENT (object)));
-
- proxypad = GST_PROXY_PAD_CAST (object);
- pad = GST_PAD_CAST (proxypad);
- peer = GST_PAD_CAST (pad->peer);
-
- if (GST_IS_PAD (pad)) {
- if (GST_PAD_IS_SRC (pad))
- xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "source");
- else if (GST_PAD_IS_SINK (pad))
- xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "sink");
- else
- xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "unknown");
- } else {
- xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "unknown");
- }
- if (GST_IS_PAD (peer)) {
- gchar *content = g_strdup_printf ("%s.%s",
- GST_OBJECT_NAME (GST_PAD_PARENT (peer)), GST_PAD_NAME (peer));
-
- xmlNewChild (self, NULL, (xmlChar *) "peer", (xmlChar *) content);
- g_free (content);
- } else {
- xmlNewChild (self, NULL, (xmlChar *) "peer", NULL);
- }
-
- return self;
-}
-#endif /* GST_DISABLE_LOADSAVE */
-
/***********************************************************************
* Ghost pads, implemented as a pair of proxy pads (sort of)
#define DEBUG_REFCOUNT
/* Object signals and args */
-/* FIXME-0.11: have a read-only parent property instead of the two signals
- * then we get notify::parent for free */
enum
{
- PARENT_SET,
- PARENT_UNSET,
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- OBJECT_SAVED,
-#endif
DEEP_NOTIFY,
LAST_SIGNAL
};
enum
{
- ARG_0,
- ARG_NAME
- /* FILL ME */
+ PROP_0,
+ PROP_NAME,
+ PROP_PARENT,
+ PROP_LAST
};
enum
G_LOCK_DEFINE_STATIC (object_name_mutex);
-typedef struct _GstSignalObject GstSignalObject;
-typedef struct _GstSignalObjectClass GstSignalObjectClass;
-
-static GType gst_signal_object_get_type (void);
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-static guint gst_signal_object_signals[SO_LAST_SIGNAL] = { 0 };
-#endif
-
static void gst_object_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_object_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
+
static void gst_object_dispatch_properties_changed (GObject * object,
guint n_pspecs, GParamSpec ** pspecs);
static gboolean gst_object_set_name_default (GstObject * object);
-#ifdef GST_DISABLE_DEPRECATED
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#undef GstXmlNodePtr
-#define GstXmlNodePtr xmlNodePtr
-#include <libxml/parser.h>
-GstXmlNodePtr gst_object_save_thyself (GstObject * object,
- GstXmlNodePtr parent);
-void gst_object_restore_thyself (GstObject * object, GstXmlNodePtr parent);
-void gst_class_signal_emit_by_name (GstObject * object, const gchar * name,
- GstXmlNodePtr self);
-#endif
-#endif
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-static void gst_object_real_restore_thyself (GstObject * object,
- GstXmlNodePtr self);
-#endif
-
-static GObjectClass *parent_class = NULL;
static guint gst_object_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_ABSTRACT_TYPE (GstObject, gst_object, G_TYPE_OBJECT);
+static GParamSpec *properties[PROP_LAST];
+
+G_DEFINE_ABSTRACT_TYPE (GstObject, gst_object, G_TYPE_INITIALLY_UNOWNED);
static void
gst_object_class_init (GstObjectClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
#ifndef GST_DISABLE_TRACE
_gst_object_trace = gst_alloc_trace_register (g_type_name (GST_TYPE_OBJECT));
#endif
gobject_class->set_property = gst_object_set_property;
gobject_class->get_property = gst_object_get_property;
- g_object_class_install_property (gobject_class, ARG_NAME,
- g_param_spec_string ("name", "Name", "The name of the object",
- NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstObject::parent-set:
- * @gstobject: a #GstObject
- * @parent: the new parent
- *
- * Emitted when the parent of an object is set.
- */
- gst_object_signals[PARENT_SET] =
- g_signal_new ("parent-set", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GstObjectClass, parent_set), NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_OBJECT);
-
- /**
- * GstObject::parent-unset:
- * @gstobject: a #GstObject
- * @parent: the old parent
- *
- * Emitted when the parent of an object is unset.
- */
- gst_object_signals[PARENT_UNSET] =
- g_signal_new ("parent-unset", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, parent_unset), NULL,
- NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_OBJECT);
+ properties[PROP_NAME] =
+ g_param_spec_string ("name", "Name", "The name of the object", NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (gobject_class, PROP_NAME,
+ properties[PROP_NAME]);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- /**
- * GstObject::object-saved:
- * @gstobject: a #GstObject
- * @xml_node: the xmlNodePtr of the parent node
- *
- * Trigered whenever a new object is saved to XML. You can connect to this
- * signal to insert custom XML tags into the core XML.
- */
- /* FIXME This should be the GType of xmlNodePtr instead of G_TYPE_POINTER
- * (if libxml would use GObject)
- */
- gst_object_signals[OBJECT_SAVED] =
- g_signal_new ("object-saved", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, object_saved), NULL,
- NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- klass->restore_thyself =
- ((void (*)(GstObject * object,
- gpointer self)) *gst_object_real_restore_thyself);
-#endif
+ properties[PROP_PARENT] =
+ g_param_spec_object ("parent", "Parent", "The parent of the object",
+ GST_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (gobject_class, PROP_PARENT,
+ properties[PROP_PARENT]);
/**
* GstObject::deep-notify:
G_TYPE_PARAM);
klass->path_string_separator = "/";
- /* FIXME 0.11: Store this directly in the class struct */
- klass->lock = g_slice_new (GStaticRecMutex);
- g_static_rec_mutex_init (klass->lock);
-
- klass->signal_object = g_object_newv (gst_signal_object_get_type (), 0, NULL);
/* see the comments at gst_object_dispatch_properties_changed */
gobject_class->dispatch_properties_changed
#endif
object->flags = 0;
- GST_OBJECT_FLAG_SET (object, GST_OBJECT_FLOATING);
}
/**
* the floating flag while leaving the reference count unchanged. If the object
* is not floating, then this call adds a new normal reference increasing the
* reference count by one.
- *
- * MT safe. This function grabs and releases @object lock.
- *
- * Since: 0.10.24
*/
-void
+gpointer
gst_object_ref_sink (gpointer object)
{
- g_return_if_fail (GST_IS_OBJECT (object));
-
- GST_OBJECT_LOCK (object);
- if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) {
- GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object,
- "unsetting floating flag");
- GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING);
- GST_OBJECT_UNLOCK (object);
- } else {
- GST_OBJECT_UNLOCK (object);
- gst_object_ref (object);
- }
-}
-
-/**
- * gst_object_sink:
- * @object: a #GstObject to sink
- *
- * If @object was floating, the #GST_OBJECT_FLOATING flag is removed
- * and @object is unreffed. When @object was not floating,
- * this function does nothing.
- *
- * Any newly created object has a refcount of 1 and is floating.
- * This function should be used when creating a new object to
- * symbolically 'take ownership' of @object. This done by first doing a
- * gst_object_ref() to keep a reference to @object and then gst_object_sink()
- * to remove and unref any floating references to @object.
- * Use gst_object_set_parent() to have this done for you.
- *
- * MT safe. This function grabs and releases @object lock.
- */
-void
-gst_object_sink (gpointer object)
-{
- g_return_if_fail (GST_IS_OBJECT (object));
-
- GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "sink");
+ g_return_val_if_fail (object != NULL, NULL);
- GST_OBJECT_LOCK (object);
- if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) {
- GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "clear floating flag");
- GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING);
- GST_OBJECT_UNLOCK (object);
- gst_object_unref (object);
- } else {
- GST_OBJECT_UNLOCK (object);
- }
+#ifdef DEBUG_REFCOUNT
+ GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p ref_sink %d->%d",
+ object, ((GObject *) object)->ref_count,
+ ((GObject *) object)->ref_count + 1);
+#endif
+ return g_object_ref_sink (object);
}
/**
GST_OBJECT_PARENT (object) = NULL;
GST_OBJECT_UNLOCK (object);
- parent_class->dispose (object);
+ ((GObjectClass *) gst_object_parent_class)->dispose (object);
return;
gst_alloc_trace_free (_gst_object_trace, object);
#endif
- parent_class->finalize (object);
+ ((GObjectClass *) gst_object_parent_class)->finalize (object);
}
/* Changing a GObject property of a GstObject will result in "deep-notify"
* top-level bin to catch property-change notifications for all contained
* elements.
*
- * This function is not MT safe in glib < 2.8 so we need to lock it with a
- * classwide mutex in that case.
- *
* MT safe.
*/
static void
#endif
/* do the standard dispatching */
- parent_class->dispatch_properties_changed (object, n_pspecs, pspecs);
+ ((GObjectClass *)
+ gst_object_parent_class)->dispatch_properties_changed (object, n_pspecs,
+ pspecs);
gst_object = GST_OBJECT_CAST (object);
#ifndef GST_DISABLE_GST_DEBUG
}
/**
- * gst_object_set_name_prefix:
- * @object: a #GstObject
- * @name_prefix: new name prefix of @object
- *
- * Sets the name prefix of @object to @name_prefix.
- * This function makes a copy of the provided name prefix, so the caller
- * retains ownership of the name prefix it sent.
- *
- * MT safe. This function grabs and releases @object's LOCK.
- *
- * Deprecated: deprecated because the name prefix has never actually been used
- * for anything.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void gst_object_set_name_prefix (GstObject * object, const gchar * name_prefix);
-#endif
-void
-gst_object_set_name_prefix (GstObject * object, const gchar * name_prefix)
-{
- g_return_if_fail (GST_IS_OBJECT (object));
-
- GST_OBJECT_LOCK (object);
- g_free (object->name_prefix);
- object->name_prefix = g_strdup (name_prefix); /* NULL gives NULL */
- GST_OBJECT_UNLOCK (object);
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
- * gst_object_get_name_prefix:
- * @object: a #GstObject
- *
- * Returns a copy of the name prefix of @object.
- * Caller should g_free() the return value after usage.
- * For a prefixless object, this returns NULL, which you can safely g_free()
- * as well.
- *
- * Returns: the name prefix of @object. g_free() after usage.
- *
- * MT safe. This function grabs and releases @object's LOCK.
- *
- * Deprecated: deprecated because the name prefix has never actually been used
- * for anything.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gchar *gst_object_get_name_prefix (GstObject * object);
-#endif
-gchar *
-gst_object_get_name_prefix (GstObject * object)
-{
- gchar *result = NULL;
-
- g_return_val_if_fail (GST_IS_OBJECT (object), NULL);
-
- GST_OBJECT_LOCK (object);
- result = g_strdup (object->name_prefix);
- GST_OBJECT_UNLOCK (object);
-
- return result;
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
* gst_object_set_parent:
* @object: a #GstObject
* @parent: new parent of object
*
* Sets the parent of @object to @parent. The object's reference count will
- * be incremented, and any floating reference will be removed (see gst_object_sink()).
- *
- * This function causes the parent-set signal to be emitted when the parent
- * was successfully set.
+ * be incremented, and any floating reference will be removed (see gst_object_ref_sink()).
*
* Returns: TRUE if @parent could be set or FALSE when @object
* already had a parent or @object and @parent are the same.
if (G_UNLIKELY (object->parent != NULL))
goto had_parent;
- /* sink object, we don't call our own function because we don't
- * need to release/acquire the lock needlessly or touch the refcount
- * in the floating case. */
object->parent = parent;
- if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) {
- GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object,
- "unsetting floating flag");
- GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING);
- GST_OBJECT_UNLOCK (object);
- } else {
- GST_OBJECT_UNLOCK (object);
- gst_object_ref (object);
- }
+ g_object_ref_sink (object);
+ GST_OBJECT_UNLOCK (object);
- g_signal_emit (object, gst_object_signals[PARENT_SET], 0, parent);
+ /* FIXME, this does not work, the deep notify takes the lock from the parent
+ * object and deadlocks when the parent holds its lock when calling this
+ * function (like _element_add_pad()) */
+ /* g_object_notify_by_pspec ((GObject *)object, properties[PROP_PARENT]); */
return TRUE;
object->parent = NULL;
GST_OBJECT_UNLOCK (object);
- g_signal_emit (object, gst_object_signals[PARENT_UNSET], 0, parent);
+ /* g_object_notify_by_pspec ((GObject *)object, properties[PROP_PARENT]); */
gst_object_unref (object);
} else {
}
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/**
- * gst_object_save_thyself:
- * @object: a #GstObject to save
- * @parent: The parent XML node to save @object into
- *
- * Saves @object into the parent XML node.
- *
- * Returns: the new xmlNodePtr with the saved object
- */
-GstXmlNodePtr
-gst_object_save_thyself (GstObject * object, GstXmlNodePtr parent)
-{
- GstObjectClass *oclass;
-
- g_return_val_if_fail (GST_IS_OBJECT (object), parent);
- g_return_val_if_fail (parent != NULL, parent);
-
- oclass = GST_OBJECT_GET_CLASS (object);
-
- if (oclass->save_thyself)
- oclass->save_thyself (object, parent);
-
- g_signal_emit (object, gst_object_signals[OBJECT_SAVED], 0, parent);
-
- return parent;
-}
-
-/**
- * gst_object_restore_thyself:
- * @object: a #GstObject to load into
- * @self: The XML node to load @object from
- *
- * Restores @object with the data from the parent XML node.
- */
-void
-gst_object_restore_thyself (GstObject * object, GstXmlNodePtr self)
-{
- GstObjectClass *oclass;
-
- g_return_if_fail (GST_IS_OBJECT (object));
- g_return_if_fail (self != NULL);
-
- oclass = GST_OBJECT_GET_CLASS (object);
-
- if (oclass->restore_thyself)
- oclass->restore_thyself (object, self);
-}
-
-static void
-gst_object_real_restore_thyself (GstObject * object, GstXmlNodePtr self)
-{
- g_return_if_fail (GST_IS_OBJECT (object));
- g_return_if_fail (self != NULL);
-
- gst_class_signal_emit_by_name (object, "object_loaded", self);
-}
-#endif /* GST_DISABLE_LOADSAVE */
-
static void
gst_object_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
gstobject = GST_OBJECT_CAST (object);
switch (prop_id) {
- case ARG_NAME:
+ case PROP_NAME:
gst_object_set_name (gstobject, g_value_get_string (value));
break;
+ case PROP_PARENT:
+ gst_object_set_parent (gstobject, g_value_get_object (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
gstobject = GST_OBJECT_CAST (object);
switch (prop_id) {
- case ARG_NAME:
+ case PROP_NAME:
g_value_take_string (value, gst_object_get_name (gstobject));
break;
+ case PROP_PARENT:
+ g_value_take_object (value, gst_object_get_parent (gstobject));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
return path;
}
-
-
-struct _GstSignalObject
-{
- GObject object;
-};
-
-struct _GstSignalObjectClass
-{
- GObjectClass parent_class;
-
- /* signals */
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- void (*object_loaded) (GstSignalObject * object, GstObject * new,
- GstXmlNodePtr self);
-#endif
-};
-
-G_DEFINE_TYPE (GstSignalObject, gst_signal_object, G_TYPE_OBJECT);
-
-static void
-gst_signal_object_class_init (GstSignalObjectClass * klass)
-{
- parent_class = g_type_class_peek_parent (klass);
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- gst_signal_object_signals[SO_OBJECT_LOADED] =
- g_signal_new ("object-loaded", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSignalObjectClass, object_loaded),
- NULL, NULL, gst_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2,
- G_TYPE_OBJECT, G_TYPE_POINTER);
-#endif
-}
-
-static void
-gst_signal_object_init (GstSignalObject * object)
-{
-}
-
-/**
- * gst_class_signal_connect
- * @klass: a #GstObjectClass to attach the signal to
- * @name: the name of the signal to attach to
- * @func: the signal function
- * @func_data: a pointer to user data
- *
- * Connect to a class signal.
- *
- * Returns: the signal id.
- */
-guint
-gst_class_signal_connect (GstObjectClass * klass,
- const gchar * name, gpointer func, gpointer func_data)
-{
- /* [0.11] func parameter needs to be changed to a GCallback *
- * doing so now would be an API break. */
- return g_signal_connect (klass->signal_object, name, G_CALLBACK (func),
- func_data);
-}
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/**
- * gst_class_signal_emit_by_name:
- * @object: a #GstObject that emits the signal
- * @name: the name of the signal to emit
- * @self: data for the signal
- *
- * emits the named class signal.
- */
-void
-gst_class_signal_emit_by_name (GstObject * object,
- const gchar * name, GstXmlNodePtr self)
-{
- GstObjectClass *oclass;
-
- oclass = GST_OBJECT_GET_CLASS (object);
-
- g_signal_emit_by_name (oclass->signal_object, name, object, self);
-}
-
-#endif /* GST_DISABLE_LOADSAVE */
#define GST_OBJECT_CAST(obj) ((GstObject*)(obj))
#define GST_OBJECT_CLASS_CAST(klass) ((GstObjectClass*)(klass))
-/* make sure we don't change the object size but still make it compile
- * without libxml */
-#if defined(GST_DISABLE_LOADSAVE) || defined(GST_DISABLE_DEPRECATED)
-#define GstXmlNodePtr gpointer
-#else
-#define GstXmlNodePtr xmlNodePtr
-#endif
-
/**
* GstObjectFlags:
- * @GST_OBJECT_DISPOSING: the object is been destroyed, don't use it anymore
- * @GST_OBJECT_FLOATING: the object has a floating reference count (e.g. its
- * not assigned to a bin)
* @GST_OBJECT_FLAG_LAST: subclasses can add additional flags starting from this flag
*
* The standard flags that an gstobject may have.
*/
typedef enum
{
- GST_OBJECT_DISPOSING = (1<<0),
- GST_OBJECT_FLOATING = (1<<1),
/* padding */
GST_OBJECT_FLAG_LAST = (1<<4)
} GstObjectFlags;
#define GST_OBJECT_FLAG_UNSET(obj,flag) (GST_OBJECT_FLAGS (obj) &= ~(flag))
-/**
- * GST_OBJECT_IS_DISPOSING:
- * @obj: a #GstObject
- *
- * Check if the given object is beeing destroyed.
- */
-#define GST_OBJECT_IS_DISPOSING(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_OBJECT_DISPOSING))
-/**
- * GST_OBJECT_IS_FLOATING:
- * @obj: a #GstObject
- *
- * Check if the given object is floating (has no owner).
- */
-#define GST_OBJECT_IS_FLOATING(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_OBJECT_FLOATING))
-
typedef struct _GstObject GstObject;
typedef struct _GstObjectClass GstObjectClass;
/**
* GstObject:
- * @refcount: unused
* @lock: object LOCK
* @name: The name of the object
- * @name_prefix: unused
* @parent: this object's parent, weak ref
- * @flags: use GST_OBJECT_IS_XXX macros to access the flags
+ * @flags: flags for this object
*
* GStreamer base object class.
*/
struct _GstObject {
- GObject object;
-
- /*< public >*/
- gint refcount; /* unused (FIXME 0.11: remove) */
+ GInitiallyUnowned object;
/*< public >*/ /* with LOCK */
GMutex *lock; /* object LOCK */
gchar *name; /* object name */
- gchar *name_prefix; /* (un)used for debugging (FIXME 0.11: remove) */
GstObject *parent; /* this object's parent, weak ref */
guint32 flags;
};
/**
- * GST_CLASS_GET_LOCK:
- * @obj: a #GstObjectClass
- *
- * This macro will return the class lock used to protect deep_notify signal
- * emission on thread-unsafe glib versions (glib < 2.8).
- */
-#define GST_CLASS_GET_LOCK(obj) (GST_OBJECT_CLASS_CAST(obj)->lock)
-/**
- * GST_CLASS_LOCK:
- * @obj: a #GstObjectClass
- *
- * Lock the class.
- */
-#define GST_CLASS_LOCK(obj) (g_static_rec_mutex_lock(GST_CLASS_GET_LOCK(obj)))
-/**
- * GST_CLASS_TRYLOCK:
- * @obj: a #GstObjectClass
- *
- * Try to lock the class, returns TRUE if class could be locked.
- */
-#define GST_CLASS_TRYLOCK(obj) (g_static_rec_mutex_trylock(GST_CLASS_GET_LOCK(obj)))
-/**
- * GST_CLASS_UNLOCK:
- * @obj: a #GstObjectClass
- *
- * Unlock the class.
- */
-#define GST_CLASS_UNLOCK(obj) (g_static_rec_mutex_unlock(GST_CLASS_GET_LOCK(obj)))
-
-/**
* GstObjectClass:
* @parent_class: parent
* @path_string_separator: separator used by gst_object_get_path_string()
* @signal_object: is used to signal to the whole class
- * @lock: class lock to be used with GST_CLASS_GET_LOCK(), GST_CLASS_LOCK(), GST_CLASS_UNLOCK() and others.
- * @parent_set: default signal handler
- * @parent_unset: default signal handler
- * @object_saved: default signal handler
* @deep_notify: default signal handler
- * @save_thyself: xml serialisation
- * @restore_thyself: xml de-serialisation
*
* GStreamer base object class.
*/
struct _GstObjectClass {
- GObjectClass parent_class;
+ GInitiallyUnownedClass parent_class;
const gchar *path_string_separator;
- GObject *signal_object;
-
- /* FIXME-0.11: remove this, plus the above GST_CLASS_*_LOCK macros */
- GStaticRecMutex *lock;
/* signals */
- /* FIXME-0.11: remove, and pass NULL in g_signal_new(), we never used them */
- void (*parent_set) (GstObject * object, GstObject * parent);
- void (*parent_unset) (GstObject * object, GstObject * parent);
- /* FIXME 0.11: Remove this, it's deprecated */
- void (*object_saved) (GstObject * object, GstXmlNodePtr parent);
void (*deep_notify) (GstObject * object, GstObject * orig, GParamSpec * pspec);
/*< public >*/
/* virtual methods for subclasses */
- /* FIXME 0.11: Remove this, it's deprecated */
- GstXmlNodePtr (*save_thyself) (GstObject * object, GstXmlNodePtr parent);
- void (*restore_thyself) (GstObject * object, GstXmlNodePtr self);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
gboolean gst_object_set_name (GstObject *object, const gchar *name);
gchar* gst_object_get_name (GstObject *object);
-#ifndef GST_DISABLE_DEPRECATED
-void gst_object_set_name_prefix (GstObject *object, const gchar *name_prefix);
-gchar* gst_object_get_name_prefix (GstObject *object);
-#endif
-
/* parentage routines */
gboolean gst_object_set_parent (GstObject *object, GstObject *parent);
GstObject* gst_object_get_parent (GstObject *object);
void gst_object_unparent (GstObject *object);
gboolean gst_object_has_ancestor (GstObject *object, GstObject *ancestor);
-void gst_object_default_deep_notify (GObject *object, GstObject *orig,
+void gst_object_default_deep_notify (GObject *object, GstObject *orig,
GParamSpec *pspec, gchar **excluded_props);
/* refcounting + life cycle */
gpointer gst_object_ref (gpointer object);
void gst_object_unref (gpointer object);
-void gst_object_ref_sink (gpointer object);
-void gst_object_sink (gpointer object);
+gpointer gst_object_ref_sink (gpointer object);
/* replace object pointer */
-void gst_object_replace (GstObject **oldobj, GstObject *newobj);
+void gst_object_replace (GstObject **oldobj, GstObject *newobj);
/* printing out the 'path' of the object */
gchar * gst_object_get_path_string (GstObject *object);
/* misc utils */
gboolean gst_object_check_uniqueness (GList *list, const gchar *name);
-/* load/save */
-#ifndef GST_DISABLE_DEPRECATED
-#ifndef GST_DISABLE_LOADSAVE
-GstXmlNodePtr gst_object_save_thyself (GstObject *object, GstXmlNodePtr parent);
-void gst_object_restore_thyself (GstObject *object, GstXmlNodePtr self);
-#else
-#if defined __GNUC__ && __GNUC__ >= 3
-#pragma GCC poison gst_object_save_thyself
-#pragma GCC poison gst_object_restore_thyself
-#endif
-#endif
-#endif
-
-/* class signal stuff */
-guint gst_class_signal_connect (GstObjectClass *klass,
- const gchar *name,
- gpointer func,
- gpointer func_data);
-
-#ifndef GST_DISABLE_DEPRECATED
-#ifndef GST_DISABLE_LOADSAVE
-void gst_class_signal_emit_by_name (GstObject * object,
- const gchar * name,
- GstXmlNodePtr self);
-#else
-#if defined __GNUC__ && __GNUC__ >= 3
-#pragma GCC poison gst_class_signal_emit_by_name
-#endif
-#endif
-#endif
-
G_END_DECLS
#endif /* __GST_OBJECT_H__ */
static gboolean gst_pad_activate_default (GstPad * pad);
static gboolean gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#ifdef GST_DISABLE_DEPRECATED
-#include <libxml/parser.h>
-#endif
-static xmlNodePtr gst_pad_save_thyself (GstObject * object, xmlNodePtr parent);
-void gst_pad_load_and_link (xmlNodePtr self, GstObject * parent);
-#endif
-
-/* Some deprecated stuff that we need inside here for
- * backwards compatibility */
-#ifdef GST_DISABLE_DEPRECATED
-#ifndef GST_REMOVE_DEPRECATED
-#define GST_PAD_INTLINKFUNC(pad) (GST_PAD_CAST(pad)->intlinkfunc)
-GList *gst_pad_get_internal_links_default (GstPad * pad);
-#endif
-#endif
-
static GstObjectClass *parent_class = NULL;
static guint gst_pad_signals[LAST_SIGNAL] = { 0 };
"The GstPadTemplate of this pad", GST_TYPE_PAD_TEMPLATE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- gstobject_class->save_thyself =
- ((gpointer (*)(GstObject * object,
- gpointer self)) * GST_DEBUG_FUNCPTR (gst_pad_save_thyself));
-#endif
gstobject_class->path_string_separator = ".";
/* Register common function pointer descriptions */
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_event_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_get_query_types_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_query_default);
-#ifndef GST_REMOVE_DEPRECATED
- GST_DEBUG_REGISTER_FUNCPTR (gst_pad_get_internal_links_default);
-#endif
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_iterate_internal_links_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_acceptcaps_default);
GST_PAD_EVENTFUNC (pad) = gst_pad_event_default;
GST_PAD_QUERYTYPEFUNC (pad) = gst_pad_get_query_types_default;
GST_PAD_QUERYFUNC (pad) = gst_pad_query_default;
-#ifndef GST_REMOVE_DEPRECATED
- GST_PAD_INTLINKFUNC (pad) = gst_pad_get_internal_links_default;
-#endif
GST_PAD_ITERINTLINKFUNC (pad) = gst_pad_iterate_internal_links_default;
GST_PAD_ACCEPTCAPSFUNC (pad) = gst_pad_acceptcaps_default;
}
/**
- * gst_pad_set_internal_link_function:
- * @pad: a #GstPad of either direction.
- * @intlink: the #GstPadIntLinkFunction to set.
- *
- * Sets the given internal link function for the pad.
- *
- * Deprecated: Use the thread-safe gst_pad_set_iterate_internal_links_function()
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void
-gst_pad_set_internal_link_function (GstPad * pad,
- GstPadIntLinkFunction intlink);
-#endif
-void
-gst_pad_set_internal_link_function (GstPad * pad, GstPadIntLinkFunction intlink)
-{
- g_return_if_fail (GST_IS_PAD (pad));
-
- GST_PAD_INTLINKFUNC (pad) = intlink;
- GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "internal link set to %s",
- GST_DEBUG_FUNCPTR_NAME (intlink));
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
* gst_pad_set_link_function:
* @pad: a #GstPad.
* @link: the #GstPadLinkFunction to set.
}
-#ifndef GST_REMOVE_DEPRECATED
-typedef struct
-{
- GList *list;
- guint32 cookie;
-} IntLinkIterData;
-
-static void
-int_link_iter_data_free (IntLinkIterData * data)
-{
- g_list_free (data->list);
- g_slice_free (IntLinkIterData, data);
-}
-#endif
-
static GstIteratorItem
iterate_pad (GstIterator * it, GstPad * pad)
{
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
-#ifndef GST_REMOVE_DEPRECATED
- /* when we get here, the default handler for the iterate links is called,
- * which means that the user has not installed a custom one. We first check if
- * there is maybe a custom legacy function we can call. */
- if (GST_PAD_INTLINKFUNC (pad) &&
- GST_PAD_INTLINKFUNC (pad) != gst_pad_get_internal_links_default) {
- IntLinkIterData *data;
-
- /* make an iterator for the list. We can't protect the list with a
- * cookie. If we would take the cookie of the parent element, we need to
- * have a parent, which is not required for GST_PAD_INTLINKFUNC(). We could
- * cache the per-pad list and invalidate the list when a new call to
- * INTLINKFUNC() returned a different list but then this would only work if
- * two concurrent iterators were used and the last iterator would still be
- * thread-unsafe. Just don't use this method anymore. */
- data = g_slice_new (IntLinkIterData);
- data->list = GST_PAD_INTLINKFUNC (pad) (pad);
- data->cookie = 0;
-
- GST_WARNING_OBJECT (pad, "Making unsafe iterator");
-
- cookie = &data->cookie;
- padlist = &data->list;
- owner = data;
- dispose = (GstIteratorDisposeFunction) int_link_iter_data_free;
- /* reuse the pad lock, it's all we have here */
- lock = GST_OBJECT_GET_LOCK (pad);
- } else
-#endif
{
GstElement *parent;
return res;
}
-#ifndef GST_REMOVE_DEPRECATED
-static void
-add_unref_pad_to_list (GstPad * pad, GList ** list)
-{
- *list = g_list_prepend (*list, pad);
- gst_object_unref (pad);
-}
-#endif
-
-/**
- * gst_pad_get_internal_links_default:
- * @pad: the #GstPad to get the internal links of.
- *
- * Gets a list of pads to which the given pad is linked to
- * inside of the parent element.
- * This is the default handler, and thus returns a list of all of the
- * pads inside the parent element with opposite direction.
- *
- * The caller must free this list after use with g_list_free().
- *
- * Returns: a newly allocated #GList of pads, or NULL if the pad has no parent.
- *
- * Not MT safe.
- *
- * Deprecated: This function does not ref the pads in the list so that they
- * could become invalid by the time the application accesses them. It's also
- * possible that the list changes while handling the pads, which the caller of
- * this function is unable to know. Use the thread-safe
- * gst_pad_iterate_internal_links_default() instead.
- */
-#ifndef GST_REMOVE_DEPRECATED
-GList *
-gst_pad_get_internal_links_default (GstPad * pad)
-{
- GList *res = NULL;
- GstElement *parent;
-
- g_return_val_if_fail (GST_IS_PAD (pad), NULL);
-
- GST_WARNING_OBJECT (pad, "Unsafe internal links used");
-
- /* when we get here, the default handler for get_internal_links is called,
- * which means that the user has not installed a custom one. We first check if
- * there is maybe a custom iterate function we can call. */
- if (GST_PAD_ITERINTLINKFUNC (pad) &&
- GST_PAD_ITERINTLINKFUNC (pad) != gst_pad_iterate_internal_links_default) {
- GstIterator *it;
- GstIteratorResult ires;
- gboolean done = FALSE;
-
- it = gst_pad_iterate_internal_links (pad);
- /* loop over the iterator and put all elements into a list, we also
- * immediatly unref them, which is bad. */
- do {
- ires = gst_iterator_foreach (it, (GFunc) add_unref_pad_to_list, &res);
- switch (ires) {
- case GST_ITERATOR_OK:
- case GST_ITERATOR_DONE:
- case GST_ITERATOR_ERROR:
- done = TRUE;
- break;
- case GST_ITERATOR_RESYNC:
- /* restart, discard previous list */
- gst_iterator_resync (it);
- g_list_free (res);
- res = NULL;
- break;
- }
- } while (!done);
-
- gst_iterator_free (it);
- } else {
- /* lock pad, check and ref parent */
- GST_OBJECT_LOCK (pad);
- parent = GST_PAD_PARENT (pad);
- if (!parent || !GST_IS_ELEMENT (parent))
- goto no_parent;
-
- parent = gst_object_ref (parent);
- GST_OBJECT_UNLOCK (pad);
-
- /* now lock the parent while we copy the pads */
- GST_OBJECT_LOCK (parent);
- if (pad->direction == GST_PAD_SRC)
- res = g_list_copy (parent->sinkpads);
- else
- res = g_list_copy (parent->srcpads);
- GST_OBJECT_UNLOCK (parent);
-
- gst_object_unref (parent);
- }
-
- /* At this point pads can be changed and unreffed. Nothing we can do about it
- * because for compatibility reasons this function cannot ref the pads or
- * notify the app that the list changed. */
-
- return res;
-
-no_parent:
- {
- GST_DEBUG_OBJECT (pad, "no parent");
- GST_OBJECT_UNLOCK (pad);
- return NULL;
- }
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
- * gst_pad_get_internal_links:
- * @pad: the #GstPad to get the internal links of.
- *
- * Gets a list of pads to which the given pad is linked to
- * inside of the parent element.
- * The caller must free this list after use.
- *
- * Not MT safe.
- *
- * Returns: a newly allocated #GList of pads, free with g_list_free().
- *
- * Deprecated: This function does not ref the pads in the list so that they
- * could become invalid by the time the application accesses them. It's also
- * possible that the list changes while handling the pads, which the caller of
- * this function is unable to know. Use the thread-safe
- * gst_pad_iterate_internal_links() instead.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-GList *gst_pad_get_internal_links (GstPad * pad);
-#endif
-GList *
-gst_pad_get_internal_links (GstPad * pad)
-{
- GList *res = NULL;
-
- g_return_val_if_fail (GST_IS_PAD (pad), NULL);
-
- GST_WARNING_OBJECT (pad, "Calling unsafe internal links");
-
- if (GST_PAD_INTLINKFUNC (pad))
- res = GST_PAD_INTLINKFUNC (pad) (pad);
-
- return res;
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
static gboolean
gst_pad_event_default_dispatch (GstPad * pad, GstEvent * event)
{
}
}
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/* FIXME: why isn't this on a GstElement ? */
-/**
- * gst_pad_load_and_link:
- * @self: an #xmlNodePtr to read the description from.
- * @parent: the #GstObject element that owns the pad.
- *
- * Reads the pad definition from the XML node and links the given pad
- * in the element to a pad of an element up in the hierarchy.
- */
-void
-gst_pad_load_and_link (xmlNodePtr self, GstObject * parent)
-{
- xmlNodePtr field = self->xmlChildrenNode;
- GstPad *pad = NULL, *targetpad;
- GstPadTemplate *tmpl;
- gchar *peer = NULL;
- gchar **split;
- GstElement *target;
- GstObject *grandparent;
- gchar *name = NULL;
-
- while (field) {
- if (!strcmp ((char *) field->name, "name")) {
- name = (gchar *) xmlNodeGetContent (field);
- pad = gst_element_get_static_pad (GST_ELEMENT (parent), name);
- if ((!pad) || ((tmpl = gst_pad_get_pad_template (pad))
- && (GST_PAD_REQUEST == GST_PAD_TEMPLATE_PRESENCE (tmpl))))
- pad = gst_element_get_request_pad (GST_ELEMENT (parent), name);
- g_free (name);
- } else if (!strcmp ((char *) field->name, "peer")) {
- peer = (gchar *) xmlNodeGetContent (field);
- }
- field = field->next;
- }
- g_return_if_fail (pad != NULL);
-
- if (peer == NULL)
- return;
-
- split = g_strsplit (peer, ".", 2);
-
- if (split[0] == NULL || split[1] == NULL) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_XML, pad,
- "Could not parse peer '%s', leaving unlinked", peer);
-
- g_free (peer);
- return;
- }
- g_free (peer);
-
- g_return_if_fail (split[0] != NULL);
- g_return_if_fail (split[1] != NULL);
-
- grandparent = gst_object_get_parent (parent);
-
- if (grandparent && GST_IS_BIN (grandparent)) {
- target = gst_bin_get_by_name_recurse_up (GST_BIN (grandparent), split[0]);
- } else
- goto cleanup;
-
- if (target == NULL)
- goto cleanup;
-
- targetpad = gst_element_get_static_pad (target, split[1]);
- if (!targetpad)
- targetpad = gst_element_get_request_pad (target, split[1]);
-
- if (targetpad == NULL)
- goto cleanup;
-
- if (gst_pad_get_direction (pad) == GST_PAD_SRC)
- gst_pad_link (pad, targetpad);
- else
- gst_pad_link (targetpad, pad);
-
-cleanup:
- g_strfreev (split);
-}
-
-/**
- * gst_pad_save_thyself:
- * @pad: a #GstPad to save.
- * @parent: the parent #xmlNodePtr to save the description in.
- *
- * Saves the pad into an xml representation.
- *
- * Returns: the #xmlNodePtr representation of the pad.
- */
-static xmlNodePtr
-gst_pad_save_thyself (GstObject * object, xmlNodePtr parent)
-{
- GstPad *pad;
- GstPad *peer;
-
- g_return_val_if_fail (GST_IS_PAD (object), NULL);
-
- pad = GST_PAD_CAST (object);
-
- xmlNewChild (parent, NULL, (xmlChar *) "name",
- (xmlChar *) GST_PAD_NAME (pad));
-
- if (GST_PAD_IS_SRC (pad)) {
- xmlNewChild (parent, NULL, (xmlChar *) "direction", (xmlChar *) "source");
- } else if (GST_PAD_IS_SINK (pad)) {
- xmlNewChild (parent, NULL, (xmlChar *) "direction", (xmlChar *) "sink");
- } else {
- xmlNewChild (parent, NULL, (xmlChar *) "direction", (xmlChar *) "unknown");
- }
-
- if (GST_PAD_PEER (pad) != NULL) {
- gchar *content;
-
- peer = GST_PAD_PEER (pad);
- /* first check to see if the peer's parent's parent is the same */
- /* we just save it off */
- content = g_strdup_printf ("%s.%s",
- GST_OBJECT_NAME (GST_PAD_PARENT (peer)), GST_PAD_NAME (peer));
- xmlNewChild (parent, NULL, (xmlChar *) "peer", (xmlChar *) content);
- g_free (content);
- } else
- xmlNewChild (parent, NULL, (xmlChar *) "peer", NULL);
-
- return parent;
-}
-
-#if 0
-/**
- * gst_ghost_pad_save_thyself:
- * @pad: a ghost #GstPad to save.
- * @parent: the parent #xmlNodePtr to save the description in.
- *
- * Saves the ghost pad into an xml representation.
- *
- * Returns: the #xmlNodePtr representation of the pad.
- */
-xmlNodePtr
-gst_ghost_pad_save_thyself (GstPad * pad, xmlNodePtr parent)
-{
- xmlNodePtr self;
-
- g_return_val_if_fail (GST_IS_GHOST_PAD (pad), NULL);
-
- self = xmlNewChild (parent, NULL, (xmlChar *) "ghostpad", NULL);
- xmlNewChild (self, NULL, (xmlChar *) "name", (xmlChar *) GST_PAD_NAME (pad));
- xmlNewChild (self, NULL, (xmlChar *) "parent",
- (xmlChar *) GST_OBJECT_NAME (GST_PAD_PARENT (pad)));
-
- /* FIXME FIXME FIXME! */
-
- return self;
-}
-#endif /* 0 */
-#endif /* GST_DISABLE_LOADSAVE */
-
/*
* should be called with pad OBJECT_LOCK and STREAM_LOCK held.
* GST_PAD_IS_BLOCKED (pad) == TRUE when this function is
GST_FLOW_CUSTOM_ERROR_2 = -102
} GstFlowReturn;
-/**
- * GST_FLOW_IS_FATAL:
- * @ret: a #GstFlowReturn value
- *
- * Macro to test if the given #GstFlowReturn value indicates a fatal
- * error. This macro is mainly used in elements driving the pipeline to decide
- * whether an error message should be posted on the bus. Note that such
- * elements may also need to post an error message in the #GST_FLOW_NOT_LINKED
- * case which is not caught by this macro.
- *
- * Deprecated: This macro is badly named and can't be used in any real
- * scenarios without additional checks.
- */
-#ifndef GST_DISABLE_DEPRECATED
-#define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
-#endif
-
-/**
- * GST_FLOW_IS_SUCCESS:
- * @ret: a #GstFlowReturn value
- *
- * Macro to test if the given #GstFlowReturn value indicates a
- * successfull result
- * This macro is mainly used in elements to decide if the processing
- * of a buffer was successfull.
- *
- * Since: 0.10.7
- *
- * Deprecated: This macro is badly named and can't be used in any real
- * scenarios without additional checks.
- */
-#ifndef GST_DISABLE_DEPRECATED
-#define GST_FLOW_IS_SUCCESS(ret) ((ret) >= GST_FLOW_OK)
-#endif
-
G_CONST_RETURN gchar* gst_flow_get_name (GstFlowReturn ret);
GQuark gst_flow_to_quark (GstFlowReturn ret);
#define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc)
#define GST_PAD_QUERYTYPEFUNC(pad) (GST_PAD_CAST(pad)->querytypefunc)
#define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc)
-#ifndef GST_DISABLE_DEPRECATED
-#define GST_PAD_INTLINKFUNC(pad) (GST_PAD_CAST(pad)->intlinkfunc)
-#endif
#define GST_PAD_ITERINTLINKFUNC(pad) (GST_PAD_CAST(pad)->iterintlinkfunc)
#define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer)
gboolean gst_pad_stop_task (GstPad *pad);
/* internal links */
-#ifndef GST_DISABLE_DEPRECATED
-void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
-GList* gst_pad_get_internal_links (GstPad *pad);
-GList* gst_pad_get_internal_links_default (GstPad *pad);
-#endif
-
void gst_pad_set_iterate_internal_links_function (GstPad * pad,
GstPadIterIntLinkFunction iterintlink);
GstIterator * gst_pad_iterate_internal_links (GstPad * pad);
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
gpointer data);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED)
-void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
-#endif
-
G_END_DECLS
#endif /* __GST_PAD_H__ */
* For consistency, then, we only produce them with sunken references
* owned by the creator of the object
*/
- if (GST_OBJECT_IS_FLOATING (templ)) {
+ if (g_object_is_floating (templ)) {
gst_object_ref_sink (templ);
}
}
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_set_details_simple (gstelement_class, "Pipeline object",
+ gst_element_class_set_metadata (gstelement_class, "Pipeline object",
"Generic/Bin",
"Complete pipeline object",
"Erik Walthinsen <omega@cse.ogi.edu>, Wim Taymans <wim@fluendo.com>");
return gst_element_get_bus (GST_ELEMENT_CAST (pipeline));
}
-/**
- * gst_pipeline_set_new_stream_time:
- * @pipeline: a #GstPipeline
- * @time: the new running time to set
- *
- * Set the new start time of @pipeline to @time. The start time is used to
- * set the base time on the elements (see gst_element_set_base_time())
- * in the PAUSED->PLAYING state transition.
- *
- * Setting @time to #GST_CLOCK_TIME_NONE will disable the pipeline's management
- * of element base time. The application will then be responsible for
- * performing base time distribution. This is sometimes useful if you want to
- * synchronize capture from multiple pipelines, and you can also ensure that the
- * pipelines have the same clock.
- *
- * MT safe.
- *
- * Deprecated: This function has the wrong name and is equivalent to
- * gst_element_set_start_time().
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void
-gst_pipeline_set_new_stream_time (GstPipeline * pipeline, GstClockTime time);
-#endif
-void
-gst_pipeline_set_new_stream_time (GstPipeline * pipeline, GstClockTime time)
-{
- g_return_if_fail (GST_IS_PIPELINE (pipeline));
-
- gst_element_set_start_time (GST_ELEMENT_CAST (pipeline), time);
-
- if (time == GST_CLOCK_TIME_NONE)
- GST_DEBUG_OBJECT (pipeline, "told not to adjust base_time");
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
- * gst_pipeline_get_last_stream_time:
- * @pipeline: a #GstPipeline
- *
- * Gets the last running time of @pipeline. If the pipeline is PLAYING,
- * the returned time is the running time used to configure the element's
- * base time in the PAUSED->PLAYING state. If the pipeline is PAUSED, the
- * returned time is the running time when the pipeline was paused.
- *
- * This function returns #GST_CLOCK_TIME_NONE if the pipeline was
- * configured to not handle the management of the element's base time
- * (see gst_pipeline_set_new_stream_time()).
- *
- * MT safe.
- *
- * Returns: a #GstClockTime.
- *
- * Deprecated: This function has the wrong name and is equivalent to
- * gst_element_get_start_time().
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-GstClockTime gst_pipeline_get_last_stream_time (GstPipeline * pipeline);
-#endif
-GstClockTime
-gst_pipeline_get_last_stream_time (GstPipeline * pipeline)
-{
- GstClockTime result;
-
- g_return_val_if_fail (GST_IS_PIPELINE (pipeline), GST_CLOCK_TIME_NONE);
-
- result = gst_element_get_start_time (GST_ELEMENT_CAST (pipeline));
-
- return result;
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
static GstClock *
gst_pipeline_provide_clock_func (GstElement * element)
{
GstBus* gst_pipeline_get_bus (GstPipeline *pipeline);
-#ifndef GST_DISABLE_DEPRECATED
-void gst_pipeline_set_new_stream_time (GstPipeline *pipeline, GstClockTime time);
-GstClockTime gst_pipeline_get_last_stream_time (GstPipeline *pipeline);
-#endif
-
void gst_pipeline_use_clock (GstPipeline *pipeline, GstClock *clock);
gboolean gst_pipeline_set_clock (GstPipeline *pipeline, GstClock *clock);
GstClock* gst_pipeline_get_clock (GstPipeline *pipeline);
return quark;
}
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void _gst_plugin_register_static (GstPluginDesc * desc);
-#endif
-/* this function can be called in the GCC constructor extension, before
- * the _gst_plugin_initialize() was called. In that case, we store the
- * plugin description in a list to initialize it when we open the main
- * module later on.
- * When the main module is known, we can register the plugin right away.
- */
-void
-_gst_plugin_register_static (GstPluginDesc * desc)
-{
- g_return_if_fail (desc != NULL);
-
- if (!_gst_plugin_inited) {
- /* We can't use any GLib functions here, since g_thread_init hasn't been
- * called yet, and we can't call it here either, or programs that don't
- * guard their g_thread_init calls in main() will just abort */
- ++_num_static_plugins;
- _static_plugins =
- realloc (_static_plugins, _num_static_plugins * sizeof (GstPluginDesc));
- /* assume strings in the GstPluginDesc are static const or live forever */
- _static_plugins[_num_static_plugins - 1] = *desc;
- } else {
- gst_plugin_register_static (desc->major_version, desc->minor_version,
- desc->name, desc->description, desc->plugin_init, desc->version,
- desc->license, desc->source, desc->package, desc->origin);
- }
-}
-#endif
-
/**
* gst_plugin_register_static:
* @major_version: the major version number of the GStreamer core that the
G_END_DECLS
/**
- * GST_PLUGIN_DEFINE_STATIC:
- * @major: major version number of the gstreamer-core that plugin was compiled for
- * @minor: minor version number of the gstreamer-core that plugin was compiled for
- * @name: short, but unique name of the plugin
- * @description: information about the purpose of the plugin
- * @init: function pointer to the plugin_init method with the signature of <code>static gboolean plugin_init (GstPlugin * plugin)</code>.
- * @version: full version string (e.g. VERSION from config.h)
- * @license: under which licence the package has been released, e.g. GPL, LGPL.
- * @package: the package-name (e.g. PACKAGE_NAME from config.h)
- * @origin: a description from where the package comes from (e.g. the homepage URL)
- *
- * This macro needs to be used to define the entry point and meta data of a
- * local plugin. One would use this macro to define a local plugin that can only
- * be used by the own application.
- *
- * The macro uses a define named PACKAGE for the #GstPluginDesc.source field.
- *
- * Deprecated: Use gst_plugin_register_static() instead. This macro was
- * deprecated because it uses constructors, which is a compiler feature not
- * available on all compilers.
- *
- */
-/* We don't have deprecation guards here on purpose, it's enough to have
- * deprecation guards around _gst_plugin_register_static(), and will result in
- * much better error messages when compiling with -DGST_DISABLE_DEPRECATED */
-#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,package,origin) \
-static void GST_GNUC_CONSTRUCTOR \
-_gst_plugin_static_init__ ##init (void) \
-{ \
- static GstPluginDesc plugin_desc_ = { \
- major, \
- minor, \
- name, \
- (gchar *) description, \
- init, \
- version, \
- license, \
- PACKAGE, \
- package, \
- origin, \
- NULL, \
- GST_PADDING_INIT \
- }; \
- _gst_plugin_register_static (&plugin_desc_); \
-}
-
-/**
* GST_LICENSE_UNKNOWN:
*
* To be used in GST_PLUGIN_DEFINE or GST_PLUGIN_DEFINE_STATIC if usure about
GType gst_plugin_get_type (void);
-#ifndef GST_DISABLE_DEPRECATED
-void _gst_plugin_register_static (GstPluginDesc *desc);
-#endif
-
gboolean gst_plugin_register_static (gint major_version,
gint minor_version,
const gchar *name,
GstPlugin * gst_registry_lookup (GstRegistry *registry, const char *filename);
GstPluginFeature * gst_registry_lookup_feature (GstRegistry *registry, const char *name);
-/* These are only here because at some point they were in a public header
- * (even though they should have been private) and we can't really remove
- * them now (FIXME: 0.11). They don't do anything other than return FALSE. */
-#ifndef GST_DISABLE_DEPRECATED
-gboolean gst_registry_xml_read_cache (GstRegistry * registry, const char *location);
-gboolean gst_registry_xml_write_cache (GstRegistry * registry, const char *location);
-#endif
-
/* convinience defines for the default registry */
/**
}
return res;
}
-
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_registry_xml_read_cache (GstRegistry * registry, const char *location);
-#endif
-/* FIXME 0.11: these symbols are here for backwards compatibility and should
- * be removed or made private */
-gboolean
-gst_registry_xml_read_cache (GstRegistry * registry, const char *location)
-{
- return FALSE;
-}
-
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_registry_xml_write_cache (GstRegistry * registry, const char *location);
-#endif
-gboolean
-gst_registry_xml_write_cache (GstRegistry * registry, const char *location)
-{
- return FALSE;
-}
-#endif /* GST_REMOVE_DEPRECATED */
}
}
- /* pack element factory strings */
- gst_registry_chunks_save_const_string (list, factory->details.author);
- gst_registry_chunks_save_const_string (list, factory->details.description);
- gst_registry_chunks_save_const_string (list, factory->details.klass);
- gst_registry_chunks_save_const_string (list, factory->details.longname);
- if (factory->meta_data) {
- gst_registry_chunks_save_string (list,
- gst_structure_to_string (factory->meta_data));
- } else {
- gst_registry_chunks_save_const_string (list, "");
- }
+ /* pack element metadata strings */
+ gst_registry_chunks_save_string (list,
+ gst_structure_to_string (factory->metadata));
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
GstRegistryChunkTypeFindFactory *tff;
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature);
/* unpack element factory strings */
unpack_string_nocopy (*in, meta_data_str, end, fail);
if (meta_data_str && *meta_data_str) {
- factory->meta_data = gst_structure_from_string (meta_data_str, NULL);
- if (!factory->meta_data) {
+ factory->metadata = gst_structure_from_string (meta_data_str, NULL);
+ if (!factory->metadata) {
GST_ERROR
("Error when trying to deserialize structure for metadata '%s'",
meta_data_str);
goto fail;
}
}
- unpack_string (*in, factory->details.longname, end, fail);
- unpack_string (*in, factory->details.klass, end, fail);
- unpack_string (*in, factory->details.description, end, fail);
- unpack_string (*in, factory->details.author, end, fail);
n = ef->npadtemplates;
- GST_DEBUG ("Element factory : '%s' with npadtemplates=%d",
- factory->details.longname, n);
+ GST_DEBUG ("Element factory : npadtemplates=%d", n);
/* load pad templates */
for (i = 0; i < n; i++) {
}
-/**
- * gst_buffer_stamp:
- * @dest: buffer to stamp
- * @src: buffer to stamp from
- *
- * Copies additional information (the timestamp, duration, and offset start
- * and end) from one buffer to the other.
- *
- * This function does not copy any buffer flags or caps and is equivalent to
- * gst_buffer_copy_metadata(@dest, @src, GST_BUFFER_COPY_TIMESTAMPS).
- *
- * Deprecated: use gst_buffer_copy_metadata() instead, it provides more
- * control.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src);
-#endif
-void
-gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src)
-{
- gst_buffer_copy_metadata (dest, src, GST_BUFFER_COPY_TIMESTAMPS);
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
static gboolean
getcaps_fold_func (GstPad * pad, GValue * ret, GstPad * orig)
{
}
/**
- * gst_atomic_int_set:
- * @atomic_int: pointer to an atomic integer
- * @value: value to set
- *
- * Unconditionally sets the atomic integer to @value.
- *
- * Deprecated: Use g_atomic_int_set().
- *
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-void gst_atomic_int_set (gint * atomic_int, gint value);
-#endif
-void
-gst_atomic_int_set (gint * atomic_int, gint value)
-{
- g_atomic_int_set (atomic_int, value);
-}
-#endif
-
-/**
* gst_pad_add_data_probe:
* @pad: pad to add the data probe handler to
* @handler: function to call when data is passed over pad
}
/**
- * gst_bin_find_unconnected_pad:
- * @bin: bin in which to look for elements with unlinked pads
- * @direction: whether to look for an unlinked source or sink pad
- *
- * Recursively looks for elements with an unlinked pad of the given
- * direction within the specified bin and returns an unlinked pad
- * if one is found, or NULL otherwise. If a pad is found, the caller
- * owns a reference to it and should use gst_object_unref() on the
- * pad when it is not needed any longer.
- *
- * Returns: unlinked pad of the given direction, or NULL.
- *
- * Since: 0.10.3
- *
- * Deprecated: use gst_bin_find_unlinked_pad() instead.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-GstPad *gst_bin_find_unconnected_pad (GstBin * bin, GstPadDirection direction);
-#endif
-GstPad *
-gst_bin_find_unconnected_pad (GstBin * bin, GstPadDirection direction)
-{
- return gst_bin_find_unlinked_pad (bin, direction);
-}
-#endif
-
-/**
* gst_parse_bin_from_description:
* @bin_description: command line describing the bin
* @ghost_unlinked_pads: whether to automatically create ghost pads
void gst_bin_add_many (GstBin *bin, GstElement *element_1, ...) G_GNUC_NULL_TERMINATED;
void gst_bin_remove_many (GstBin *bin, GstElement *element_1, ...) G_GNUC_NULL_TERMINATED;
GstPad * gst_bin_find_unlinked_pad (GstBin *bin, GstPadDirection direction);
-#ifndef GST_DISABLE_DEPRECATED
-GstPad * gst_bin_find_unconnected_pad (GstBin *bin, GstPadDirection direction);
-#endif
/* buffer functions */
GstBuffer * gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2);
GstBuffer * gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2);
-#ifndef GST_DISABLE_DEPRECATED
-void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src);
-#endif /* GST_DISABLE_DEPRECATED */
-
-/* atomic functions */
-#ifndef GST_DISABLE_DEPRECATED
-void gst_atomic_int_set (gint * atomic_int, gint value);
-#endif
/* probes */
gulong gst_pad_add_data_probe (GstPad * pad,
+++ /dev/null
-/* GStreamer
- * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
- * 2000 Wim Taymans <wtay@chello.be>
- *
- * gstxml.c: XML save/restore of pipelines
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/**
- * SECTION:gstxml
- * @short_description: XML save/restore operations of pipelines
- *
- * GStreamer pipelines can be saved to xml files using gst_xml_write_file().
- * They can be loaded back using gst_xml_parse_doc() / gst_xml_parse_file() /
- * gst_xml_parse_memory().
- * Additionally one can load saved pipelines into the gst-editor to inspect the
- * graph.
- *
- * #GstElement implementations need to override the #GstObjectClass.save_thyself()
- * and #GstObjectClass.restore_thyself() virtual functions of #GstObject.
- *
- * Deprecated: This feature is deprecated pipeline serialization to XML is
- * broken for all but the most simple pipelines. It will most likely be
- * removed in future. Don't use it.
- */
-
-#include "gst_private.h"
-
-#include "gstxml.h"
-#include "gstmarshal.h"
-#include "gstinfo.h"
-#include "gstbin.h"
-
-#ifdef GST_DISABLE_DEPRECATED
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#include <libxml/parser.h>
-xmlNodePtr gst_object_save_thyself (const GstObject * object,
- xmlNodePtr parent);
-GstObject *gst_object_load_thyself (xmlNodePtr parent);
-void gst_object_restore_thyself (GstObject * object, GstXmlNodePtr self);
-
-#define GST_TYPE_XML (gst_xml_get_type ())
-#define GST_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XML, GstXML))
-#define GST_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XML))
-#define GST_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_XML, GstXMLClass))
-#define GST_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_XML))
-#define GST_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XML, GstXMLClass))
-
-typedef struct _GstXML GstXML;
-typedef struct _GstXMLClass GstXMLClass;
-
-struct _GstXML
-{
- GstObject object;
-
- /*< public > */
- GList *topelements;
-
- xmlNsPtr ns;
-
- /*< private > */
- gpointer _gst_reserved[GST_PADDING];
-};
-
-struct _GstXMLClass
-{
- GstObjectClass parent_class;
-
- /* signal callbacks */
- void (*object_loaded) (GstXML * xml, GstObject * object, xmlNodePtr self);
- void (*object_saved) (GstXML * xml, GstObject * object, xmlNodePtr self);
-
- gpointer _gst_reserved[GST_PADDING];
-};
-
-GType gst_xml_get_type (void);
-xmlDocPtr gst_xml_write (GstElement * element);
-gint gst_xml_write_file (GstElement * element, FILE * out);
-GstXML *gst_xml_new (void);
-gboolean gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root);
-gboolean gst_xml_parse_file (GstXML * xml, const guchar * fname,
- const guchar * root);
-gboolean gst_xml_parse_memory (GstXML * xml, guchar * buffer, guint size,
- const gchar * root);
-GstElement *gst_xml_get_element (GstXML * xml, const guchar * name);
-GList *gst_xml_get_topelements (GstXML * xml);
-GstElement *gst_xml_make_element (xmlNodePtr cur, GstObject * parent);
-#endif
-#endif
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-
-enum
-{
- OBJECT_LOADED,
- LAST_SIGNAL
-};
-
-static void gst_xml_dispose (GObject * object);
-
-static void gst_xml_object_loaded (GstObject * private, GstObject * object,
- xmlNodePtr self, gpointer data);
-
-static GstObjectClass *parent_class = NULL;
-static guint gst_xml_signals[LAST_SIGNAL] = { 0 };
-
-G_DEFINE_TYPE (GstXML, gst_xml, GST_TYPE_OBJECT);
-
-static void
-gst_xml_class_init (GstXMLClass * klass)
-{
- GObjectClass *gobject_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- gobject_class->dispose = gst_xml_dispose;
-
- /* FIXME G_TYPE_POINTER should be GType of xmlNodePtr
- * (ensonic) can't be fixed, as libxml does not use GObject (unfortunately)
- */
- /**
- * GstXML::object-loaded:
- * @xml: the xml persistence instance
- * @object: the object that has been loaded
- * @xml_node: the related xml_node pointer to the document tree
- *
- * Signals that a new object has been deserialized.
- */
- gst_xml_signals[OBJECT_LOADED] =
- g_signal_new ("object-loaded", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstXMLClass, object_loaded), NULL,
- NULL, gst_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, GST_TYPE_OBJECT,
- G_TYPE_POINTER);
-
-}
-
-static void
-gst_xml_init (GstXML * xml)
-{
- xml->topelements = NULL;
-}
-
-static void
-gst_xml_dispose (GObject * object)
-{
- GstXML *xml = GST_XML (object);
-
- g_list_foreach (xml->topelements, (GFunc) gst_object_unref, NULL);
- g_list_free (xml->topelements);
- xml->topelements = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-/**
- * gst_xml_new:
- *
- * Create a new GstXML parser object.
- *
- * Returns: a pointer to a new GstXML object.
- */
-GstXML *
-gst_xml_new (void)
-{
- return GST_XML (g_object_newv (GST_TYPE_XML, 0, NULL));
-}
-
-/**
- * gst_xml_write:
- * @element: The element to write out
- *
- * Converts the given element into an XML presentation.
- *
- * Returns: a pointer to an XML document
- */
-xmlDocPtr
-gst_xml_write (GstElement * element)
-{
- xmlDocPtr doc;
- xmlNodePtr elementnode;
- xmlNsPtr gst_ns;
-
- doc = xmlNewDoc ((xmlChar *) "1.0");
-
- doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *) "gstreamer", NULL);
-
- gst_ns =
- xmlNewNs (doc->xmlRootNode,
- (xmlChar *) "http://gstreamer.net/gst-core/1.0/", (xmlChar *) "gst");
-
- elementnode = xmlNewChild (doc->xmlRootNode, gst_ns, (xmlChar *) "element",
- NULL);
-
- gst_object_save_thyself (GST_OBJECT (element), elementnode);
-
- return doc;
-}
-
-/**
- * gst_xml_write_file:
- * @element: The element to write out
- * @out: an open file, like stdout
- *
- * Converts the given element into XML and writes the formatted XML to an open
- * file.
- *
- * Returns: number of bytes written on success, -1 otherwise.
- */
-gint
-gst_xml_write_file (GstElement * element, FILE * out)
-{
- xmlDocPtr cur;
-
-#ifdef HAVE_LIBXML2
- xmlOutputBufferPtr buf;
-#endif
- const char *encoding;
- xmlCharEncodingHandlerPtr handler = NULL;
- int indent;
- gboolean ret;
-
- cur = gst_xml_write (element);
- if (!cur)
- return -1;
-
-#ifdef HAVE_LIBXML2
- encoding = (const char *) cur->encoding;
-
- if (encoding != NULL) {
- xmlCharEncoding enc;
-
- enc = xmlParseCharEncoding (encoding);
-
- if (cur->charset != XML_CHAR_ENCODING_UTF8) {
- xmlGenericError (xmlGenericErrorContext,
- "xmlDocDump: document not in UTF8\n");
- return -1;
- }
- if (enc != XML_CHAR_ENCODING_UTF8) {
- handler = xmlFindCharEncodingHandler (encoding);
- if (handler == NULL) {
- xmlFree ((char *) cur->encoding);
- cur->encoding = NULL;
- }
- }
- }
-
- buf = xmlOutputBufferCreateFile (out, handler);
-
- indent = xmlIndentTreeOutput;
- xmlIndentTreeOutput = 1;
- ret = xmlSaveFormatFileTo (buf, cur, NULL, 1);
- xmlIndentTreeOutput = indent;
-#else
- /* apparently this doesn't return anything in libxml1 */
- xmlDocDump (out, cur);
- ret = 1;
-#endif
-
- return ret;
-}
-
-/**
- * gst_xml_parse_doc:
- * @xml: a pointer to a GstXML object
- * @doc: a pointer to an xml document to parse
- * @root: The name of the root object to build
- *
- * Fills the GstXML object with the elements from the
- * xmlDocPtr.
- *
- * Returns: TRUE on success, FALSE otherwise
- */
-gboolean
-gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root)
-{
- xmlNodePtr field, cur;
- xmlNsPtr ns;
-
- cur = xmlDocGetRootElement (doc);
- if (cur == NULL) {
- g_warning ("gstxml: empty document\n");
- return FALSE;
- }
- ns = xmlSearchNsByHref (doc, cur,
- (xmlChar *) "http://gstreamer.net/gst-core/1.0/");
- if (ns == NULL) {
- g_warning ("gstxml: document of wrong type, core namespace not found\n");
- return FALSE;
- }
- if (strcmp ((char *) cur->name, "gstreamer")) {
- g_warning ("gstxml: XML file is in wrong format\n");
- return FALSE;
- }
-
- gst_class_signal_connect (GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (xml)),
- "object_loaded", (gpointer) gst_xml_object_loaded, xml);
-
- xml->ns = ns;
-
- field = cur->xmlChildrenNode;
-
- while (field) {
- if (!strcmp ((char *) field->name, "element") && (field->ns == xml->ns)) {
- GstElement *element;
-
- element = gst_xml_make_element (field, NULL);
-
- xml->topelements = g_list_prepend (xml->topelements, element);
- }
- field = field->next;
- }
-
- xml->topelements = g_list_reverse (xml->topelements);
-
- return TRUE;
-}
-
-/* FIXME 0.9: Why guchar*? */
-/**
- * gst_xml_parse_file:
- * @xml: a pointer to a GstXML object
- * @fname: The filename with the xml description
- * @root: The name of the root object to build
- *
- * Fills the GstXML object with the corresponding elements from
- * the XML file fname. Optionally it will only build the element from
- * the element node root (if it is not NULL). This feature is useful
- * if you only want to build a specific element from an XML file
- * but not the pipeline it is embedded in.
- *
- * Pass "-" as fname to read from stdin. You can also pass a URI
- * of any format that libxml supports, including http.
- *
- * Returns: TRUE on success, FALSE otherwise
- */
-gboolean
-gst_xml_parse_file (GstXML * xml, const guchar * fname, const guchar * root)
-{
- xmlDocPtr doc;
- gboolean ret;
-
- g_return_val_if_fail (fname != NULL, FALSE);
-
- doc = xmlParseFile ((char *) fname);
-
- if (!doc) {
- g_warning ("gstxml: XML file \"%s\" could not be read\n", fname);
- return FALSE;
- }
-
- ret = gst_xml_parse_doc (xml, doc, root);
-
- xmlFreeDoc (doc);
- return ret;
-}
-
-/* FIXME 0.9: guchar* */
-/**
- * gst_xml_parse_memory:
- * @xml: a pointer to a GstXML object
- * @buffer: a pointer to the in memory XML buffer
- * @size: the size of the buffer
- * @root: the name of the root objects to build
- *
- * Fills the GstXML object with the corresponding elements from
- * an in memory XML buffer.
- *
- * Returns: TRUE on success
- */
-gboolean
-gst_xml_parse_memory (GstXML * xml, guchar * buffer, guint size,
- const gchar * root)
-{
- xmlDocPtr doc;
- gboolean ret;
-
- g_return_val_if_fail (buffer != NULL, FALSE);
-
- doc = xmlParseMemory ((char *) buffer, size);
-
- ret = gst_xml_parse_doc (xml, doc, (const xmlChar *) root);
-
- xmlFreeDoc (doc);
- return ret;
-}
-
-static void
-gst_xml_object_loaded (GstObject * private, GstObject * object, xmlNodePtr self,
- gpointer data)
-{
- GstXML *xml = GST_XML (data);
-
- /* FIXME check that this element was created from the same xmlDocPtr... */
- g_signal_emit (xml, gst_xml_signals[OBJECT_LOADED], 0, object, self);
-}
-
-/**
- * gst_xml_get_topelements:
- * @xml: The GstXML to get the elements from
- *
- * Retrieve a list of toplevel elements.
- *
- * Returns: a GList of top-level elements. The caller does not own a copy
- * of the list and must not free or modify the list. The caller also does not
- * own a reference to any of the elements in the list and should obtain its own
- * reference using gst_object_ref() if necessary.
- */
-GList *
-gst_xml_get_topelements (GstXML * xml)
-{
- g_return_val_if_fail (xml != NULL, NULL);
-
- return xml->topelements;
-}
-
-/* FIXME 0.11: why is the arg guchar* instead of gchar*? */
-/**
- * gst_xml_get_element:
- * @xml: The GstXML to get the element from
- * @name: The name of element to retrieve
- *
- * This function is used to get a pointer to the GstElement corresponding
- * to name in the pipeline description. You would use this if you have
- * to do anything to the element after loading.
- *
- * Returns: a pointer to a new GstElement, caller owns returned reference.
- */
-GstElement *
-gst_xml_get_element (GstXML * xml, const guchar * name)
-{
- GstElement *element;
- GList *topelements;
-
- g_return_val_if_fail (xml != NULL, NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- GST_DEBUG ("gstxml: getting element \"%s\"", name);
-
- topelements = gst_xml_get_topelements (xml);
-
- while (topelements) {
- GstElement *top = GST_ELEMENT (topelements->data);
-
- GST_DEBUG ("gstxml: getting element \"%s\"", name);
- if (!strcmp (GST_ELEMENT_NAME (top), (char *) name)) {
- return GST_ELEMENT_CAST (gst_object_ref (top));
- } else {
- if (GST_IS_BIN (top)) {
- element = gst_bin_get_by_name (GST_BIN (top), (gchar *) name);
-
- if (element)
- return element;
- }
- }
- topelements = g_list_next (topelements);
- }
- return NULL;
-}
-
-/**
- * gst_xml_make_element:
- * @cur: the xml node
- * @parent: the parent of this object when it's loaded
- *
- * Load the element from the XML description
- *
- * Returns: the new element
- */
-GstElement *
-gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
-{
- xmlNodePtr children = cur->xmlChildrenNode;
- GstElement *element;
- gchar *name = NULL;
- gchar *type = NULL;
-
- /* first get the needed tags to construct the element */
- while (children) {
- if (!strcmp ((char *) children->name, "name")) {
- name = (gchar *) xmlNodeGetContent (children);
- } else if (!strcmp ((char *) children->name, "type")) {
- type = (gchar *) xmlNodeGetContent (children);
- }
- children = children->next;
- }
- g_return_val_if_fail (name != NULL, NULL);
- g_return_val_if_fail (type != NULL, NULL);
-
- GST_CAT_INFO (GST_CAT_XML, "loading \"%s\" of type \"%s\"", name, type);
-
- element = gst_element_factory_make (type, name);
-
- g_return_val_if_fail (element != NULL, NULL);
-
- g_free (type);
- g_free (name);
-
- /* ne need to set the parent on this object bacause the pads */
- /* will go through the hierarchy to link to their peers */
- if (parent) {
- if (GST_IS_BIN (parent)) {
- gst_bin_add (GST_BIN (parent), element);
- } else {
- gst_object_set_parent (GST_OBJECT (element), parent);
- }
- }
-
- gst_object_restore_thyself (GST_OBJECT (element), cur);
-
- return element;
-}
-
-#else
-
-/* FIXME: keep this dummy _get_type function around for now, so
- * gobject-introspection doesn't fail in the GST_REMOVE_DEPRECATED and
- * GST_DISABLE_LOADSAVE case */
-GType gst_xml_get_type (void);
-
-GType
-gst_xml_get_type (void)
-{
- return g_pointer_type_register_static ("GstXML");
-}
-
-#endif
+++ /dev/null
-/* GStreamer
- * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
- * 2000 Wim Taymans <wim.taymans@chello.be>
- *
- * gstxml.h: Header for XML save/restore operations of pipelines
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GST_XML_H__
-#define __GST_XML_H__
-
-#include <gst/gstconfig.h>
-
-#ifndef GST_DISABLE_DEPRECATED
-#ifndef GST_DISABLE_LOADSAVE
-
-#include <gst/gstelement.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_XML (gst_xml_get_type ())
-#define GST_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XML, GstXML))
-#define GST_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XML))
-#define GST_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_XML, GstXMLClass))
-#define GST_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_XML))
-#define GST_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XML, GstXMLClass))
-
-typedef struct _GstXML GstXML;
-typedef struct _GstXMLClass GstXMLClass;
-
-/**
- * GstXML:
- * @topelements: list of element nodes
- * @ns: name space
- *
- * XML parser object
- */
-struct _GstXML {
- GstObject object;
-
- /*< public >*/
- GList *topelements;
-
- xmlNsPtr ns;
-
- /*< private >*/
- gpointer _gst_reserved[GST_PADDING];
-};
-
-struct _GstXMLClass {
- GstObjectClass parent_class;
-
- /* signal callbacks */
- void (*object_loaded) (GstXML *xml, GstObject *object, xmlNodePtr self);
- void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self);
-
- gpointer _gst_reserved[GST_PADDING];
-};
-
-GType gst_xml_get_type (void);
-
-
-/* create an XML document out of a pipeline */
-xmlDocPtr gst_xml_write (GstElement *element);
-
-/* write a formatted representation of a pipeline to an open file */
-gint gst_xml_write_file (GstElement *element, FILE *out);
-
-GstXML* gst_xml_new (void);
-
-gboolean gst_xml_parse_doc (GstXML *xml, xmlDocPtr doc, const guchar *root);
-gboolean gst_xml_parse_file (GstXML *xml, const guchar *fname, const guchar *root);
-gboolean gst_xml_parse_memory (GstXML *xml, guchar *buffer, guint size, const gchar *root);
-
-
-GstElement* gst_xml_get_element (GstXML *xml, const guchar *name);
-GList* gst_xml_get_topelements (GstXML *xml);
-
-GstElement* gst_xml_make_element (xmlNodePtr cur, GstObject *parent);
-
-G_END_DECLS
-
-#else /* GST_DISABLE_LOADSAVE */
-
-#if defined __GNUC__ && __GNUC__ >= 3
-#pragma GCC poison gst_xml_write
-#pragma GCC poison gst_xml_new
-#pragma GCC poison gst_xml_parse_doc
-#pragma GCC poison gst_xml_parse_file
-#pragma GCC poison gst_xml_parse_memory
-#pragma GCC poison gst_xml_get_element
-#pragma GCC poison gst_xml_get_topelements
-#endif
-
-#endif /* GST_DISABLE_LOADSAVE */
-
-#endif
-
-#endif /* __GST_XML_H__ */
-I$(top_srcdir)/libs \
$(gir_cincludes) \
--add-include-path=$(top_builddir)/gst \
- --library=libgstbase-0.10.la \
- --include=Gst-0.10 \
+ --library=libgstbase-0.11.la \
+ --include=Gst-0.11 \
--libtool="$(top_builddir)/libtool" \
- --pkg gstreamer-0.10 \
- --pkg-export gstreamer-base-0.10 \
+ --pkg gstreamer-0.11 \
+ --pkg-export gstreamer-base-0.11 \
--output $@ \
$(gir_headers) \
$(gir_sources)
-I$(top_srcdir)/libs \
$(gir_cincludes) \
--add-include-path=$(top_builddir)/gst \
- --library=libgstcheck-0.10.la \
- --include=Gst-0.10 \
+ --library=libgstcheck-0.11.la \
+ --include=Gst-0.11 \
--libtool="$(top_builddir)/libtool" \
- --pkg gstreamer-0.10 \
- --pkg-export gstreamer-check-0.10 \
+ --pkg gstreamer-0.11 \
+ --pkg-export gstreamer-check-0.11 \
--output $@ \
$(gir_headers) \
$(gir_sources)
-I$(top_srcdir) \
$(gir_cincludes) \
--add-include-path=$(top_builddir)/gst \
- --library=libgstcontroller-0.10.la \
- --include=Gst-0.10 \
+ --library=libgstcontroller-@GST_MAJORMINOR@.la \
+ --include=Gst-@GST_MAJORMINOR@ \
--libtool="$(top_builddir)/libtool" \
- --pkg gstreamer-0.10 \
- --pkg-export gstreamer-controller-0.10 \
+ --pkg gstreamer-@GST_MAJORMINOR@ \
+ --pkg-export gstreamer-controller-@GST_MAJORMINOR@ \
--output $@ \
$(gir_headers) \
$(gir_sources)
};
/* helper */
-#ifndef GST_REMOVE_DEPRECATED
-static void
-gst_controlled_property_add_interpolation_control_source (GstControlledProperty
- * self)
-{
- GstControlSource *csource =
- GST_CONTROL_SOURCE (gst_interpolation_control_source_new ());
-
- GST_INFO
- ("Adding a GstInterpolationControlSource because of backward compatibility");
- g_return_if_fail (!self->csource);
- gst_control_source_bind (GST_CONTROL_SOURCE (csource), self->pspec);
- self->csource = csource;
-}
-#endif
/*
* gst_controlled_property_new:
}
return type;
}
-
-/* FIXME: backward compatibility functions */
-
-/*
- * gst_controlled_property_set_interpolation_mode:
- * @self: the controlled property object to change
- * @mode: the new interpolation mode
- *
- * Sets the given Interpolation mode for the controlled property and activates
- * the respective interpolation hooks.
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: %TRUE for success
- */
-#ifndef GST_REMOVE_DEPRECATED
-static gboolean
-gst_controlled_property_set_interpolation_mode (GstControlledProperty * self,
- GstInterpolateMode mode)
-{
- GstInterpolationControlSource *icsource;
-
- /* FIXME: backward compat, add GstInterpolationControlSource */
- if (!self->csource)
- gst_controlled_property_add_interpolation_control_source (self);
-
- g_return_val_if_fail (GST_IS_INTERPOLATION_CONTROL_SOURCE (self->csource),
- FALSE);
-
- icsource = GST_INTERPOLATION_CONTROL_SOURCE (self->csource);
-
- return gst_interpolation_control_source_set_interpolation_mode (icsource,
- mode);
-}
-#endif
-
-/**
- * gst_controller_set:
- * @self: the controller object which handles the properties
- * @property_name: the name of the property to set
- * @timestamp: the time the control-change is schedules for
- * @value: the control-value
- *
- * Set the value of given controller-handled property at a certain time.
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: FALSE if the values couldn't be set (ex : properties not handled by controller), TRUE otherwise
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_controller_set (GstController * self, const gchar * property_name,
- GstClockTime timestamp, GValue * value);
-#endif
-gboolean
-gst_controller_set (GstController * self, const gchar * property_name,
- GstClockTime timestamp, GValue * value)
-{
- gboolean res = FALSE;
- GstControlledProperty *prop;
-
- g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
- g_return_val_if_fail (property_name, FALSE);
-
- g_mutex_lock (self->lock);
- if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- /* FIXME: backward compat, add GstInterpolationControlSource */
- if (!prop->csource)
- gst_controlled_property_add_interpolation_control_source (prop);
-
- if (!GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource))
- goto out;
- res =
- gst_interpolation_control_source_set (GST_INTERPOLATION_CONTROL_SOURCE
- (prop->csource), timestamp, value);
- }
-
-out:
- g_mutex_unlock (self->lock);
-
- return res;
-}
-#endif
-
-/**
- * gst_controller_set_from_list:
- * @self: the controller object which handles the properties
- * @property_name: the name of the property to set
- * @timedvalues: a list with #GstTimedValue items
- *
- * Sets multiple timed values at once.
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: %FALSE if the values couldn't be set (ex : properties not handled by controller), %TRUE otherwise
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_controller_set_from_list (GstController * self, const gchar * property_name,
- GSList * timedvalues);
-#endif
-gboolean
-gst_controller_set_from_list (GstController * self, const gchar * property_name,
- GSList * timedvalues)
-{
- gboolean res = FALSE;
- GstControlledProperty *prop;
-
- g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
- g_return_val_if_fail (property_name, FALSE);
-
- g_mutex_lock (self->lock);
- if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- /* FIXME: backward compat, add GstInterpolationControlSource */
- if (!prop->csource)
- gst_controlled_property_add_interpolation_control_source (prop);
-
- if (!GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource))
- goto out;
-
- res =
- gst_interpolation_control_source_set_from_list
- (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource), timedvalues);
- }
-
-out:
- g_mutex_unlock (self->lock);
-
- return res;
-}
-#endif
-
-/**
- * gst_controller_unset:
- * @self: the controller object which handles the properties
- * @property_name: the name of the property to unset
- * @timestamp: the time the control-change should be removed from
- *
- * Used to remove the value of given controller-handled property at a certain
- * time.
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: %FALSE if the values couldn't be unset (ex : properties not handled by controller), %TRUE otherwise
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_controller_unset (GstController * self, const gchar * property_name,
- GstClockTime timestamp);
-#endif
-gboolean
-gst_controller_unset (GstController * self, const gchar * property_name,
- GstClockTime timestamp)
-{
- gboolean res = FALSE;
- GstControlledProperty *prop;
-
- g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
- g_return_val_if_fail (property_name, FALSE);
- g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
-
- g_mutex_lock (self->lock);
- if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- if (!prop->csource || !GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource))
- goto out;
-
- res =
- gst_interpolation_control_source_unset (GST_INTERPOLATION_CONTROL_SOURCE
- (prop->csource), timestamp);
- }
-
-out:
- g_mutex_unlock (self->lock);
-
- return res;
-}
-#endif
-
-/**
- * gst_controller_unset_all:
- * @self: the controller object which handles the properties
- * @property_name: the name of the property to unset
- *
- * Used to remove all time-stamped values of given controller-handled property
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: %FALSE if the values couldn't be unset (ex : properties not handled
- * by controller), %TRUE otherwise
- * Since: 0.10.5
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean gst_controller_unset_all (GstController * self,
- const gchar * property_name);
-#endif
-gboolean
-gst_controller_unset_all (GstController * self, const gchar * property_name)
-{
- GstControlledProperty *prop;
-
- g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
- g_return_val_if_fail (property_name, FALSE);
-
- g_mutex_lock (self->lock);
- if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- if (!prop->csource || !GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource))
- goto out;
-
- gst_interpolation_control_source_unset_all (GST_INTERPOLATION_CONTROL_SOURCE
- (prop->csource));
- }
-
-out:
- g_mutex_unlock (self->lock);
-
- return TRUE;
-}
-#endif
-
-/**
- * gst_controller_get_all:
- * @self: the controller to get the list from
- * @property_name: the name of the property to get the list for
- *
- * Returns a read-only copy of the list of #GstTimedValue for the given property.
- * Free the list after done with it.
- *
- * <note><para>This doesn't modify the controlled GObject property!</para></note>
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: a copy of the list, or %NULL if the property isn't handled by the controller
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-const GList *gst_controller_get_all (GstController * self,
- const gchar * property_name);
-#endif
-const GList *
-gst_controller_get_all (GstController * self, const gchar * property_name)
-{
- const GList *res = NULL;
- GstControlledProperty *prop;
-
- g_return_val_if_fail (GST_IS_CONTROLLER (self), NULL);
- g_return_val_if_fail (property_name, NULL);
-
- g_mutex_lock (self->lock);
- if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- if (!prop->csource || !GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource))
- goto out;
-
- res =
- gst_interpolation_control_source_get_all
- (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource));
- }
-
-out:
- g_mutex_unlock (self->lock);
-
- return res;
-}
-#endif
-
-/**
- * gst_controller_set_interpolation_mode:
- * @self: the controller object
- * @property_name: the name of the property for which to change the interpolation
- * @mode: interpolation mode
- *
- * Sets the given interpolation mode on the given property.
- *
- * <note><para>User interpolation is not yet available and quadratic interpolation
- * is deprecated and maps to cubic interpolation.</para></note>
- *
- * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource
- * directly.
- *
- * Returns: %TRUE if the property is handled by the controller, %FALSE otherwise
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_controller_set_interpolation_mode (GstController * self,
- const gchar * property_name, GstInterpolateMode mode);
-#endif
-gboolean
-gst_controller_set_interpolation_mode (GstController * self,
- const gchar * property_name, GstInterpolateMode mode)
-{
- gboolean res = FALSE;
- GstControlledProperty *prop;
-
- g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
- g_return_val_if_fail (property_name, FALSE);
-
- g_mutex_lock (self->lock);
- if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- res = gst_controlled_property_set_interpolation_mode (prop, mode);
- }
- g_mutex_unlock (self->lock);
-
- return res;
-}
-#endif
gboolean gst_controller_init (int * argc, char ***argv);
-/* FIXME: deprecated functions */
-#ifndef GST_DISABLE_DEPRECATED
-gboolean gst_controller_set (GstController * self, const gchar * property_name,
- GstClockTime timestamp, GValue * value);
-gboolean gst_controller_set_from_list (GstController * self,
- const gchar * property_name, GSList * timedvalues);
-
-gboolean gst_controller_unset (GstController * self, const gchar * property_name,
- GstClockTime timestamp);
-gboolean gst_controller_unset_all (GstController * self, const gchar * property_name);
-
-const GList *gst_controller_get_all (GstController * self,
- const gchar * property_name);
-
-gboolean gst_controller_set_interpolation_mode (GstController * self,
- const gchar * property_name, GstInterpolateMode mode);
-#endif /* GST_DISABLE_DEPRECATED */
-
G_END_DECLS
#endif /* __GST_CONTROLLER_H__ */
-I$(top_srcdir) \
$(gir_cincludes) \
--add-include-path=$(top_builddir)/gst \
- --library=libgstdataprotocol-0.10.la \
- --include=Gst-0.10 \
+ --library=libgstdataprotocol-@GST_MAJORMINOR@.la \
+ --include=Gst-@GST_MAJORMINOR@ \
--libtool="$(top_builddir)/libtool" \
- --pkg gstreamer-0.10 \
- --pkg-export=gstreamer-dataprotocol-0.10 \
+ --pkg gstreamer-@GST_MAJORMINOR@ \
+ --pkg-export=gstreamer-dataprotocol-@GST_MAJORMINOR@ \
--output $@ \
$(gir_headers) \
$(gir_sources)
/*** PACKETIZER FUNCTIONS ***/
-/**
- * gst_dp_header_from_buffer:
- * @buffer: a #GstBuffer to create a header for
- * @flags: the #GstDPHeaderFlag to create the header with
- * @length: a guint pointer to store the header length in
- * @header: a guint8 * pointer to store a newly allocated header byte array in
- *
- * Creates a GDP header from the given buffer.
- *
- * Deprecated: use a #GstDPPacketizer
- *
- * Returns: %TRUE if the header was successfully created.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags,
- guint * length, guint8 ** header);
-#endif
-gboolean
-gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags,
- guint * length, guint8 ** header)
-{
- return gst_dp_header_from_buffer_any (buffer, flags, length, header,
- GST_DP_VERSION_0_2);
-}
-#endif
-
static gboolean
gst_dp_header_from_buffer_1_0 (const GstBuffer * buffer, GstDPHeaderFlag flags,
guint * length, guint8 ** header)
GST_DP_VERSION_1_0);
}
-/**
- * gst_dp_packet_from_caps:
- * @caps: a #GstCaps to create a packet for
- * @flags: the #GstDPHeaderFlag to create the header with
- * @length: a guint pointer to store the header length in
- * @header: a guint8 pointer to store a newly allocated header byte array in
- * @payload: a guint8 pointer to store a newly allocated payload byte array in
- *
- * Creates a GDP packet from the given caps.
- *
- * Deprecated: use a #GstDPPacketizer
- *
- * Returns: %TRUE if the packet was successfully created.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
- guint * length, guint8 ** header, guint8 ** payload);
-#endif
-gboolean
-gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
- guint * length, guint8 ** header, guint8 ** payload)
-{
- return gst_dp_packet_from_caps_any (caps, flags, length, header, payload,
- GST_DP_VERSION_0_2);
-}
-#endif
-
static gboolean
gst_dp_packet_from_caps_1_0 (const GstCaps * caps, GstDPHeaderFlag flags,
guint * length, guint8 ** header, guint8 ** payload)
GST_DP_VERSION_1_0);
}
-/**
- * gst_dp_packet_from_event:
- * @event: a #GstEvent to create a packet for
- * @flags: the #GstDPHeaderFlag to create the header with
- * @length: a guint pointer to store the header length in
- * @header: a guint8 pointer to store a newly allocated header byte array in
- * @payload: a guint8 pointer to store a newly allocated payload byte array in
- *
- * Creates a GDP packet from the given event.
- *
- * Deprecated: use a #GstDPPacketizer
- *
- * Returns: %TRUE if the packet was successfully created.
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-gboolean
-gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags,
- guint * length, guint8 ** header, guint8 ** payload);
-#endif
-gboolean
-gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags,
- guint * length, guint8 ** header, guint8 ** payload)
-{
- guint8 *h;
- guint pl_length; /* length of payload */
-
- g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
- g_return_val_if_fail (length, FALSE);
- g_return_val_if_fail (header, FALSE);
- g_return_val_if_fail (payload, FALSE);
-
- /* first construct payload, since we need the length */
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_UNKNOWN:
- GST_WARNING ("Unknown event, ignoring");
- return FALSE;
- case GST_EVENT_EOS:
- case GST_EVENT_FLUSH_START:
- case GST_EVENT_FLUSH_STOP:
- case GST_EVENT_NEWSEGMENT:
- pl_length = 0;
- *payload = NULL;
- break;
- case GST_EVENT_SEEK:
- {
- gdouble rate;
- GstFormat format;
- GstSeekFlags flags;
- GstSeekType cur_type, stop_type;
- gint64 cur, stop;
-
- gst_event_parse_seek ((GstEvent *) event, &rate, &format, &flags,
- &cur_type, &cur, &stop_type, &stop);
-
- pl_length = 4 + 4 + 4 + 8 + 4 + 8;
- *payload = g_malloc0 (pl_length);
- /* FIXME write rate */
- GST_WRITE_UINT32_BE (*payload, (guint32) format);
- GST_WRITE_UINT32_BE (*payload + 4, (guint32) flags);
- GST_WRITE_UINT32_BE (*payload + 8, (guint32) cur_type);
- GST_WRITE_UINT64_BE (*payload + 12, (guint64) cur);
- GST_WRITE_UINT32_BE (*payload + 20, (guint32) stop_type);
- GST_WRITE_UINT64_BE (*payload + 24, (guint64) stop);
- break;
- }
- case GST_EVENT_QOS:
- case GST_EVENT_NAVIGATION:
- case GST_EVENT_TAG:
- GST_WARNING ("Unhandled event type %d, ignoring", GST_EVENT_TYPE (event));
- return FALSE;
- default:
- GST_WARNING ("Unknown event type %d, ignoring", GST_EVENT_TYPE (event));
- return FALSE;
- }
-
- /* now we can create and fill the header */
- h = g_malloc0 (GST_DP_HEADER_LENGTH);
- *length = GST_DP_HEADER_LENGTH;
-
- /* version, flags, type */
- GST_DP_INIT_HEADER (h, GST_DP_VERSION_0_2, flags,
- GST_DP_PAYLOAD_EVENT_NONE + GST_EVENT_TYPE (event));
-
- /* length */
- GST_WRITE_UINT32_BE (h + 6, (guint32) pl_length);
- /* timestamp */
- GST_WRITE_UINT64_BE (h + 10, GST_EVENT_TIMESTAMP (event));
-
- GST_DP_SET_CRC (h, flags, *payload, pl_length);
-
- GST_LOG ("created header from event:");
- gst_dp_dump_byte_array (h, GST_DP_HEADER_LENGTH);
-
- *header = h;
- return TRUE;
-}
-#endif
-
static gboolean
gst_dp_packet_from_event_1_0 (const GstEvent * event, GstDPHeaderFlag flags,
guint * length, guint8 ** header, guint8 ** payload)
ret->version = version;
switch (version) {
-#ifndef GST_REMOVE_DEPRECATED
- case GST_DP_VERSION_0_2:
- ret->header_from_buffer = gst_dp_header_from_buffer;
- ret->packet_from_caps = gst_dp_packet_from_caps;
- ret->packet_from_event = gst_dp_packet_from_event;
- break;
-#endif
case GST_DP_VERSION_1_0:
ret->header_from_buffer = gst_dp_header_from_buffer_1_0;
ret->packet_from_caps = gst_dp_packet_from_caps_1_0;
GstDPPayloadType
gst_dp_header_payload_type (const guint8 * header);
-/* converting from GstBuffer/GstEvent/GstCaps */
-#ifndef GST_DISABLE_DEPRECATED
-gboolean gst_dp_header_from_buffer (const GstBuffer * buffer,
- GstDPHeaderFlag flags,
- guint * length,
- guint8 ** header);
-#endif
-#ifndef GST_DISABLE_DEPRECATED
-gboolean gst_dp_packet_from_caps (const GstCaps * caps,
- GstDPHeaderFlag flags,
- guint * length,
- guint8 ** header,
- guint8 ** payload);
-#endif
-#ifndef GST_DISABLE_DEPRECATED
-gboolean gst_dp_packet_from_event (const GstEvent * event,
- GstDPHeaderFlag flags,
- guint * length,
- guint8 ** header,
- guint8 ** payload);
-#endif
/* converting to GstBuffer/GstEvent/GstCaps */
GstBuffer * gst_dp_buffer_from_header (guint header_length,
const guint8 * header);
-I$(top_srcdir)/libs \
$(gir_cincludes) \
--add-include-path=$(top_builddir)/gst \
- --library=libgstnet-0.10.la \
- --include=Gst-0.10 \
+ --library=libgstnet-@GST_MAJORMINOR@.la \
+ --include=Gst-@GST_MAJORMINOR@ \
--libtool="$(top_builddir)/libtool" \
- --pkg gstreamer-0.10 \
- --pkg-export="gstreamer-net-0.10" \
+ --pkg gstreamer-@GST_MAJORMINOR@ \
+ --pkg-export="gstreamer-net-@GST_MAJORMINOR@" \
--output $@ \
$(gir_headers) \
$(gir_sources)
fail_if (object1 == NULL, "Failed to create instance of GstFakeObject");
fail_unless (GST_IS_OBJECT (object1),
"GstFakeObject instance is not a GstObject");
- fail_unless (GST_OBJECT_IS_FLOATING (object1),
+ fail_unless (g_object_is_floating (object1),
"GstFakeObject instance is not floating");
/* check the parent */
fail_if (result == TRUE, "GstFakeObject accepted itself as parent");
/* should still be floating */
- fail_unless (GST_OBJECT_IS_FLOATING (object1),
+ fail_unless (g_object_is_floating (object1),
"GstFakeObject instance is not floating");
/* create another object */
"Failed to create another instance of GstFakeObject");
fail_unless (GST_IS_OBJECT (object2),
"second GstFakeObject instance is not a GstObject");
- fail_unless (GST_OBJECT_IS_FLOATING (object1),
+ fail_unless (g_object_is_floating (object1),
"GstFakeObject instance is not floating");
/* try to set other object as parent */
"GstFakeObject could not accept other object as parent");
/* should not be floating anymore */
- fail_if (GST_OBJECT_IS_FLOATING (object1),
+ fail_if (g_object_is_floating (object1),
"GstFakeObject instance is still floating");
/* parent should still be floating */
- fail_unless (GST_OBJECT_IS_FLOATING (object2),
+ fail_unless (g_object_is_floating (object2),
"GstFakeObject instance is not floating");
/* check the parent */
fail_if (parent != NULL, "GstFakeObject has parent");
/* object should not be floating */
- fail_if (GST_OBJECT_IS_FLOATING (object1),
+ fail_if (g_object_is_floating (object1),
"GstFakeObject instance is floating again");
gst_object_unref (object1);
#include <gst/check/gstcheck.h>
-#ifdef GST_DISABLE_DEPRECATED
-void _gst_plugin_register_static (GstPluginDesc * desc);
-#endif
-
-/* keep in sync with GST_GNUC_CONSTRUCTOR in gstmacros.h (ideally we'd just
- * do it there, but I don't want to touch that now, and also we really want
- * to deprecate this macro in the long run, I think) */
-#if defined (__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
-#define GST_GNUC_CONSTRUCTOR_DEFINED
-#else
-#undef GST_GNUC_CONSTRUCTOR_DEFINED
-#endif
-
-#ifdef GST_GNUC_CONSTRUCTOR_DEFINED
-/* ------------------------------------------------------------------------- */
-/* To make sure the old and deprecated GST_PLUGIN_DEFINE_STATIC still works */
-
-static guint plugin_init_counter; /* 0 */
-
-static gboolean
-plugin1_init (GstPlugin * plugin)
-{
- ++plugin_init_counter;
- return TRUE;
-}
-
-static gboolean
-plugin2_init (GstPlugin * plugin)
-{
- ++plugin_init_counter;
- return TRUE;
-}
-
-static gboolean
-plugin3_init (GstPlugin * plugin)
-{
- ++plugin_init_counter;
- return TRUE;
-}
-
-GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin-1",
- "some static elements 1", plugin1_init, VERSION, GST_LICENSE, PACKAGE,
- GST_PACKAGE_ORIGIN);
-
-GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin-2",
- "some static elements 2", plugin2_init, VERSION, GST_LICENSE, PACKAGE,
- GST_PACKAGE_ORIGIN);
-
-GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin-3",
- "some static elements 3", plugin3_init, VERSION, GST_LICENSE, PACKAGE,
- GST_PACKAGE_ORIGIN);
-
-GST_START_TEST (test_old_register_static)
-{
- fail_unless (plugin_init_counter == 3);
-}
-
-GST_END_TEST;
-
-#endif /* GST_GNUC_CONSTRUCTOR_DEFINED */
-
static gboolean
register_check_elements (GstPlugin * plugin)
return TRUE;
}
-static GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "check elements",
- "check elements",
- register_check_elements,
- VERSION,
- GST_LICENSE,
- PACKAGE,
- GST_PACKAGE_NAME,
- GST_PACKAGE_ORIGIN,
- NULL,
- GST_PADDING_INIT
-};
-
GST_START_TEST (test_register_static)
{
GstPlugin *plugin;
- _gst_plugin_register_static (&plugin_desc);
fail_unless (gst_plugin_register_static (GST_VERSION_MAJOR,
GST_VERSION_MINOR, "more-elements", "more-elements",
register_check_elements, VERSION, GST_LICENSE, PACKAGE,
{"GstElementClass", sizeof (GstElementClass), 488} ,
{"GstElementFactory", sizeof (GstElementFactory), 280} ,
{"GstElementFactoryClass", sizeof (GstElementFactoryClass), 304} ,
- {"GstElementDetails", sizeof (GstElementDetails), 64} ,
{"GstEvent", sizeof (GstEvent), 64} ,
{"GstEventClass", sizeof (GstEventClass), 64} ,
{"GstFormatDefinition", sizeof (GstFormatDefinition), 32} ,
GST_END_TEST;
-#ifndef GST_REMOVE_DEPRECATED /* these tests use deprecated API, that we disable by default */
-
-/* test creation of header from buffer and back again */
-GST_START_TEST (test_buffer)
-{
- GstBuffer *buffer;
- GstBuffer *newbuffer;
-
- guint header_length;
- guint8 *header;
-
- /* create buffer */
- GST_DEBUG ("Creating a new 8-byte buffer with ts 0.5 sec, dur 1 sec");
- buffer = gst_buffer_new_and_alloc (8);
- GST_BUFFER_TIMESTAMP (buffer) = (GstClockTime) (GST_SECOND * 0.5);
- GST_BUFFER_DURATION (buffer) = (GstClockTime) GST_SECOND;
- GST_BUFFER_OFFSET (buffer) = (guint64) 10;
- GST_BUFFER_OFFSET_END (buffer) = (guint64) 19;
- GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS);
- memmove (GST_BUFFER_DATA (buffer), "a buffer", 8);
-
- /* create a buffer with CRC checking */
- fail_unless (gst_dp_header_from_buffer (buffer, GST_DP_HEADER_FLAG_CRC,
- &header_length, &header), "Could not create header from buffer.");
-
- /* validate the header */
- fail_unless (gst_dp_validate_header (header_length, header),
- "Could not validate header");
- /* create a new, empty buffer with the right size */
- newbuffer = gst_dp_buffer_from_header (header_length, header);
- fail_unless (newbuffer != NULL, "Could not create a new buffer from header");
- fail_unless (GST_IS_BUFFER (newbuffer), "Created buffer is not a GstBuffer");
- /* read/copy the data */
- memmove (GST_BUFFER_DATA (newbuffer), GST_BUFFER_DATA (buffer),
- GST_BUFFER_SIZE (buffer));
- /* validate the buffer */
- fail_unless (gst_dp_validate_payload (header_length, header,
- GST_BUFFER_DATA (newbuffer)), "Could not validate payload");
-
- GST_DEBUG ("new buffer timestamp: %" GST_TIME_FORMAT,
- GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (newbuffer)));
- GST_DEBUG ("new buffer duration: %" GST_TIME_FORMAT,
- GST_TIME_ARGS (GST_BUFFER_DURATION (newbuffer)));
- GST_DEBUG ("new buffer offset: %" G_GUINT64_FORMAT,
- GST_BUFFER_OFFSET (newbuffer));
- GST_DEBUG ("new buffer offset_end: %" G_GUINT64_FORMAT,
- GST_BUFFER_OFFSET_END (newbuffer));
- fail_unless (GST_BUFFER_TIMESTAMP (newbuffer) ==
- GST_BUFFER_TIMESTAMP (buffer), "Timestamps don't match !");
- fail_unless (GST_BUFFER_DURATION (newbuffer) == GST_BUFFER_DURATION (buffer),
- "Durations don't match !");
- fail_unless (GST_BUFFER_OFFSET (newbuffer) == GST_BUFFER_OFFSET (buffer),
- "Offsets don't match !");
- fail_unless (GST_BUFFER_OFFSET_END (newbuffer) ==
- GST_BUFFER_OFFSET_END (buffer), "Offset ends don't match !");
- fail_unless (GST_BUFFER_FLAG_IS_SET (newbuffer, GST_BUFFER_FLAG_IN_CAPS),
- "GST_BUFFER_IN_CAPS flag should have been copied !");
-
- /* clean up */
- gst_buffer_unref (buffer);
- gst_buffer_unref (newbuffer);
- g_free (header);
-}
-
-GST_END_TEST;
-
-GST_START_TEST (test_caps)
-{
- gchar *string, *newstring;
- GstCaps *caps, *newcaps;
-
- guint header_length;
- guint8 *header, *payload;
-
- caps = gst_caps_from_string ("audio/x-raw-float, "
- "rate = (int) [ 11025, 48000 ], "
- "channels = (int) [ 1, 2 ], " "endianness = (int) BYTE_ORDER, "
- "width = (int) 32, " "buffer-frames = (int) 0");
- string = gst_caps_to_string (caps);
- GST_DEBUG ("Created caps: %s", string);
- fail_unless (gst_dp_packet_from_caps (caps, 0, &header_length, &header,
- &payload), "Could not create packet from caps.");
-
- /* validate the packet */
- fail_unless (gst_dp_validate_packet (header_length, header, payload),
- "Could not validate packet");
- newcaps = gst_dp_caps_from_packet (header_length, header, payload);
- fail_unless (newcaps != NULL, "Could not create caps from packet");
- fail_unless (GST_IS_CAPS (newcaps));
- newstring = gst_caps_to_string (newcaps);
- GST_DEBUG ("Received caps: %s", newstring);
- fail_unless (strcmp (string, newstring) == 0,
- "Created caps do not match original caps");
-
- /* cleanup */
- gst_caps_unref (caps);
- gst_caps_unref (newcaps);
- g_free (header);
- g_free (payload);
- g_free (string);
- g_free (newstring);
-}
-
-GST_END_TEST;
-
-GST_START_TEST (test_event)
-{
- GstEvent *send;
- GstEvent *receive;
- guint header_length;
- guint8 *header, *payload;
-
- GST_DEBUG ("Testing EOS event at 1s");
- send = gst_event_new_eos ();
- GST_EVENT_TIMESTAMP (send) = GST_SECOND;
- fail_unless (gst_dp_packet_from_event (send, GST_DP_HEADER_FLAG_CRC,
- &header_length, &header, &payload),
- "Could not create packet from eos event");
-
- receive = gst_dp_event_from_packet (header_length, header, payload);
-
- GST_DEBUG ("EOS, timestamp %" GST_TIME_FORMAT,
- GST_TIME_ARGS (GST_EVENT_TIMESTAMP (receive)));
- fail_unless (GST_EVENT_TYPE (receive) == GST_EVENT_EOS,
- "Received event is not EOS");
- fail_unless (GST_EVENT_TIMESTAMP (receive) == GST_SECOND,
- "EOS timestamp is not 1.0 sec");
-
- /* clean up */
- g_free (header);
- g_free (payload);
- gst_event_unref (send);
- gst_event_unref (receive);
-
- GST_DEBUG ("Testing FLUSH event at 2s");
- send = gst_event_new_flush_start ();
- GST_EVENT_TIMESTAMP (send) = GST_SECOND * 2;
- fail_unless (gst_dp_packet_from_event (send, GST_DP_HEADER_FLAG_CRC,
- &header_length, &header, &payload),
- "Could not create packet from flush event");
-
- receive = gst_dp_event_from_packet (header_length, header, payload);
-
- GST_DEBUG ("Flush, timestamp %" GST_TIME_FORMAT,
- GST_TIME_ARGS (GST_EVENT_TIMESTAMP (receive)));
- fail_unless (GST_EVENT_TYPE (receive) == GST_EVENT_FLUSH_START,
- "Received event is not flush");
- fail_unless (GST_EVENT_TIMESTAMP (receive) == GST_SECOND * 2,
- "Flush timestamp is not 2.0 sec");
-
- /* clean up */
- g_free (header);
- g_free (payload);
- gst_event_unref (send);
- gst_event_unref (receive);
-
- GST_DEBUG ("Testing SEEK event with 1 second at 3 seconds");
- send =
- gst_event_new_seek (1.0, GST_FORMAT_TIME, 0, GST_SEEK_TYPE_SET,
- GST_SECOND, GST_SEEK_TYPE_NONE, 0);
- GST_EVENT_TIMESTAMP (send) = GST_SECOND * 3;
- fail_unless (gst_dp_packet_from_event (send, GST_DP_HEADER_FLAG_CRC,
- &header_length, &header, &payload),
- "Could not create packet from seek event");
-
- receive = gst_dp_event_from_packet (header_length, header, payload);
-
- {
- gdouble rate;
- GstFormat format;
- GstSeekFlags flags;
- GstSeekType cur_type, stop_type;
- gint64 cur, stop;
-
- gst_event_parse_seek (receive, &rate, &format, &flags,
- &cur_type, &cur, &stop_type, &stop);
-
- GST_DEBUG ("Seek, timestamp %" GST_TIME_FORMAT ", to %" GST_TIME_FORMAT,
- GST_TIME_ARGS (GST_EVENT_TIMESTAMP (receive)), GST_TIME_ARGS (cur));
- fail_unless (GST_EVENT_TYPE (receive) == GST_EVENT_SEEK,
- "Returned event is not seek");
- fail_unless (GST_EVENT_TIMESTAMP (receive) == GST_SECOND * 3,
- "Seek timestamp is not 3.0 sec");
- fail_unless (format == GST_FORMAT_TIME, "Seek format is not time");
- fail_unless (cur == GST_SECOND, "Seek cur is not 1.0 sec");
- }
-
- /* clean up */
- g_free (header);
- g_free (payload);
- gst_event_unref (send);
- gst_event_unref (receive);
-}
-
-GST_END_TEST;
-
-/* try to segfault the thing by passing NULLs, short headers, etc.. */
-GST_START_TEST (test_memory)
-{
- guint8 foo[5];
- GstBuffer *buffer;
- GstCaps *caps;
- GstEvent *event;
- guint length;
- guint8 *header;
- guint8 *payload;
-
- /* check 0 sized input, data pointer can be NULL or anything. CRC is always 0,
- * though. */
- fail_if (gst_dp_crc (NULL, 0) != 0);
- fail_if (gst_dp_crc (foo, 0) != 0);
-
- /* this is very invalid input and gives a warning. */
- ASSERT_CRITICAL (gst_dp_crc (NULL, 1));
- ASSERT_CRITICAL (gst_dp_header_payload_length (NULL));
- ASSERT_CRITICAL (gst_dp_header_payload_type (NULL));
-
- /* wrong */
- ASSERT_CRITICAL (gst_dp_header_from_buffer (NULL, 0, NULL, NULL));
-
- /* empty buffer has NULL as data pointer */
- buffer = gst_buffer_new_and_alloc (0);
-
- /* no place to store the length and/or header data */
- ASSERT_CRITICAL (gst_dp_header_from_buffer (buffer, 0, NULL, NULL));
- ASSERT_CRITICAL (gst_dp_header_from_buffer (buffer, 0, &length, NULL));
-
- /* this should work fine */
- fail_if (gst_dp_header_from_buffer (buffer, 0, &length, &header) != TRUE);
- fail_unless (length != 0);
- fail_unless (header != NULL);
-
- /* this should validate */
- fail_if (gst_dp_validate_header (length, header) == FALSE);
-
- /* NULL header pointer */
- ASSERT_CRITICAL (gst_dp_validate_header (length, NULL));
- /* short header */
- ASSERT_CRITICAL (gst_dp_validate_header (5, header));
-
- g_free (header);
-
- /* this should work and not crash trying to calc a CRC on a 0 sized buffer */
- fail_if (gst_dp_header_from_buffer (buffer,
- GST_DP_HEADER_FLAG_CRC_HEADER | GST_DP_HEADER_FLAG_CRC_PAYLOAD,
- &length, &header) != TRUE);
-
- /* this should validate */
- fail_if (gst_dp_validate_header (length, header) == FALSE);
-
- /* there was no payload, NULL as payload data should validate the CRC
- * checks and all. */
- fail_if (gst_dp_validate_payload (length, header, NULL) == FALSE);
-
- /* and the whole packet as well */
- fail_if (gst_dp_validate_packet (length, header, NULL) == FALSE);
-
- /* some bogus length */
- ASSERT_CRITICAL (gst_dp_validate_packet (5, header, NULL));
- gst_buffer_unref (buffer);
-
- /* create buffer from header data, integrity tested elsewhere */
- buffer = gst_dp_buffer_from_header (length, header);
- fail_if (buffer == NULL);
- gst_buffer_unref (buffer);
- g_free (header);
-
- ASSERT_CRITICAL (gst_dp_packet_from_caps (NULL, 0, NULL, NULL, NULL));
-
- /* some caps stuff */
- caps = gst_caps_new_empty ();
- ASSERT_CRITICAL (gst_dp_packet_from_caps (caps, 0, NULL, NULL, NULL));
- ASSERT_CRITICAL (gst_dp_packet_from_caps (caps, 0, &length, NULL, NULL));
- ASSERT_CRITICAL (gst_dp_packet_from_caps (caps, 0, &length, &header, NULL));
-
- fail_if (gst_dp_packet_from_caps (caps, 0, &length, &header,
- &payload) != TRUE);
- fail_if (strcmp ((const gchar *) payload, "EMPTY") != 0);
- gst_caps_unref (caps);
-
- caps = gst_dp_caps_from_packet (length, header, payload);
- fail_if (caps == NULL);
- gst_caps_unref (caps);
-
- g_free (header);
- g_free (payload);
-
- /* some event stuff */
- event = gst_event_new_eos ();
- ASSERT_CRITICAL (gst_dp_packet_from_event (event, 0, NULL, NULL, NULL));
- ASSERT_CRITICAL (gst_dp_packet_from_event (event, 0, &length, NULL, NULL));
- ASSERT_CRITICAL (gst_dp_packet_from_event (event, 0, &length, &header, NULL));
-
- /* payload is not NULL from previous test and points to freed memory, very
- * invalid. */
- fail_if (payload == NULL);
- fail_if (gst_dp_packet_from_event (event, 0, &length, &header,
- &payload) != TRUE);
-
- /* the EOS event has no payload */
- fail_if (payload != NULL);
- gst_event_unref (event);
-
- event = gst_dp_event_from_packet (length, header, payload);
- fail_if (event == NULL);
- fail_if (GST_EVENT_TYPE (event) != GST_EVENT_EOS);
- gst_event_unref (event);
-
- g_free (header);
- g_free (payload);
-}
-
-GST_END_TEST;
-
-#endif
-
static Suite *
gst_dp_suite (void)
{
suite_add_tcase (s, tc_chain);
tcase_add_checked_fixture (tc_chain, gst_dp_init, NULL);
tcase_add_test (tc_chain, test_conversion);
-#ifndef GST_REMOVE_DEPRECATED
- tcase_add_test (tc_chain, test_buffer);
- tcase_add_test (tc_chain, test_caps);
- tcase_add_test (tc_chain, test_event);
- tcase_add_test (tc_chain, test_memory);
-#endif
return s;
}
echo
done
-for mm in 0.9 0.10
+for mm in 0.9 0.10 0.11
do
for module in gstreamer gstreamer-base gstreamer-check gstreamer-controller\
gstreamer-dataprotocol gstreamer-plugins-base gstreamer-net\
command_output "gst-inspect fakesrc"
command_output "gst-inspect fakesink"
command_output "gst-launch fakesrc num-buffers=5 ! fakesink"
-for mm in 0.6 0.7 0.8 0.9 0.10
+for mm in 0.6 0.7 0.8 0.9 0.10 0.11
do
echo "+ GSTREAMER INFORMATION ($mm)"
command_output "which gst-inspect-$mm"
echo "+ GSTREAMER PLUG-INS INFORMATION"
command_output "gst-inspect volume"
-for mm in 0.6 0.7 0.8 0.9 0.10
+for mm in 0.6 0.7 0.8 0.9 0.10 0.11
do
command_output "gst-inspect-$mm volume"
done
}
static gboolean
-print_factory_details_meta_data (GQuark field_id, const GValue * value,
+print_factory_details_metadata (GQuark field_id, const GValue * value,
gpointer user_data)
{
gchar *val = g_strdup_value_contents (value);
char s[20];
n_print ("Factory Details:\n");
- n_print (" Long name:\t%s\n", factory->details.longname);
- n_print (" Class:\t%s\n", factory->details.klass);
- n_print (" Description:\t%s\n", factory->details.description);
- n_print (" Author(s):\t%s\n", factory->details.author);
n_print (" Rank:\t\t%s (%d)\n",
get_rank_name (s, GST_PLUGIN_FEATURE (factory)->rank),
GST_PLUGIN_FEATURE (factory)->rank);
- if (factory->meta_data != NULL) {
- gst_structure_foreach ((GstStructure *) factory->meta_data,
- print_factory_details_meta_data, NULL);
- }
+ gst_structure_foreach ((GstStructure *) factory->metadata,
+ print_factory_details_metadata, NULL);
n_print ("\n");
}
n_print (" Has change_state() function: %s\n",
GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
-#ifndef GST_DISABLE_LOADSAVE
- n_print (" Has custom save_thyself() function: %s\n",
- GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
- n_print (" Has custom restore_thyself() function: %s\n",
- GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
-#endif
}
static void
/* convenience macro so we don't have to litter the code with if(!quiet) */
#define PRINT if(!quiet)g_print
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-static GstElement *
-xmllaunch_parse_cmdline (const gchar ** argv)
-{
- GstElement *pipeline = NULL, *e;
- GstXML *xml;
- gboolean err;
- const gchar *arg;
- gchar *element, *property, *value;
- GList *l;
- gint i = 0;
-
- if (!(arg = argv[0])) {
- g_printerr ("%s",
- _("Usage: gst-xmllaunch <file.xml> [ element.property=value ... ]\n"));
- exit (1);
- }
-
- xml = gst_xml_new ();
- /* FIXME guchar from gstxml.c */
- err = gst_xml_parse_file (xml, (guchar *) arg, NULL);
-
- if (err != TRUE) {
- g_printerr (_("ERROR: parse of xml file '%s' failed.\n"), arg);
- exit (1);
- }
-
- l = gst_xml_get_topelements (xml);
- if (!l) {
- g_printerr (_("ERROR: no toplevel pipeline element in file '%s'.\n"), arg);
- exit (1);
- }
-
- if (l->next) {
- g_printerr ("%s",
- _("WARNING: only one toplevel element is supported at this time.\n"));
- }
-
- pipeline = GST_ELEMENT (l->data);
-
- while ((arg = argv[++i])) {
- element = g_strdup (arg);
- property = strchr (element, '.');
- value = strchr (element, '=');
-
- if (!(element < property && property < value)) {
- g_printerr (_("ERROR: could not parse command line argument %d: %s.\n"),
- i, element);
- g_free (element);
- exit (1);
- }
-
- *property++ = '\0';
- *value++ = '\0';
-
- e = gst_bin_get_by_name (GST_BIN (pipeline), element);
- if (!e) {
- g_printerr (_("WARNING: element named '%s' not found.\n"), element);
- } else {
- gst_util_set_object_arg (G_OBJECT (e), property, value);
- }
- g_free (element);
- }
-
- if (!l)
- return NULL;
-
- gst_object_ref (pipeline);
- gst_object_unref (xml);
- return pipeline;
-}
-#endif
-
#ifndef DISABLE_FAULT_HANDLER
#ifndef USE_SIGINFO
static void
N_("Output messages"), NULL},
{"exclude", 'X', 0, G_OPTION_ARG_NONE, &exclude_args,
N_("Do not output status information of TYPE"), N_("TYPE1,TYPE2,...")},
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- {"output", 'o', 0, G_OPTION_ARG_STRING, &savefile,
- N_("Save xml representation of pipeline to FILE and exit"), N_("FILE")},
-#endif
{"no-fault", 'f', 0, G_OPTION_ARG_NONE, &no_fault,
N_("Do not install a fault handler"), NULL},
{"no-sigusr-handler", '\0', 0, G_OPTION_ARG_NONE, &no_sigusr_handler,
/* make a null-terminated version of argv */
argvn = g_new0 (char *, argc);
memcpy (argvn, argv + 1, sizeof (char *) * (argc - 1));
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- if (strstr (argv[0], "gst-xmllaunch")) {
- /* FIXME 0.11: remove xmllaunch entirely */
- g_warning ("gst-xmllaunch is deprecated and broken for all but the most "
- "simple pipelines. It will most likely be removed in future. Don't "
- "use it.\n");
- pipeline = xmllaunch_parse_cmdline ((const gchar **) argvn);
- } else
-#endif
{
pipeline =
(GstElement *) gst_parse_launchv ((const gchar **) argvn, &error);
g_signal_connect (pipeline, "deep-notify",
G_CALLBACK (gst_object_default_deep_notify), exclude_list);
}
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
- if (savefile) {
- g_warning ("Pipeline serialization to XML is deprecated and broken for "
- "all but the most simple pipelines. It will most likely be removed "
- "in future. Don't use it.\n");
-
- gst_xml_write_file (GST_ELEMENT (pipeline), fopen (savefile, "w"));
- }
-#endif
if (!savefile) {
GstState state, pending;
}
}
+static gboolean
+put_factory_metadata (GQuark field_id, const GValue * value, gpointer user_data)
+{
+ const gchar *key = g_quark_to_string (field_id);
+ const gchar *val = g_value_get_string (value);
+
+ PUT_ESCAPED (2, key, val);
+
+ return TRUE;
+}
+
static gint
print_element_info (GstElementFactory * factory)
{
gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
PUT_START_TAG (1, "details");
- PUT_ESCAPED (2, "long-name", factory->details.longname);
- PUT_ESCAPED (2, "class", factory->details.klass);
- PUT_ESCAPED (2, "description", factory->details.description);
- PUT_ESCAPED (2, "authors", factory->details.author);
+ gst_structure_foreach ((GstStructure *) factory->metadata,
+ put_factory_metadata, NULL);
PUT_END_TAG (1, "details");
output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
PUT_STRING (2, "<state-change function=\"%s\"/>",
GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
-#ifndef GST_DISABLE_LOADSAVE
- PUT_STRING (2, "<save function=\"%s\"/>",
- GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
- PUT_STRING (2, "<load function=\"%s\"/>",
- GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
-#endif
PUT_END_TAG (1, "element-implementation");
PUT_START_TAG (1, "clocking-interaction");
{
local cur
- : ${GST_REGISTRY:=~/.gstreamer-0.10/registry.xml}
- : ${GST_COMPLETE:=~/.gstreamer-0.10/complete}
+ : ${GST_REGISTRY:=~/.gstreamer-0.11/registry.xml}
+ : ${GST_COMPLETE:=~/.gstreamer-0.11/complete}
if [ ! -f "${GST_REGISTRY}" ] ; then
return 0