mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-27 06:20:12 +00:00
Merge HEAD from CAPS-MERGE-2 to CAPS-MERGE-3
Original commit message from CVS: Merge HEAD from CAPS-MERGE-2 to CAPS-MERGE-3
This commit is contained in:
parent
945bc373d1
commit
3754e36428
121 changed files with 2103 additions and 2344 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2003-12-16 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gst.c:
|
||||
* gst/gstplugin.c:
|
||||
rename --enable-segfault to --disable-segtrap
|
||||
|
||||
2003-12-15 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gst.c: (init_popt_callback):
|
||||
* gst/gstplugin.c: (_gst_plugin_fault_handler_restore),
|
||||
(_gst_plugin_fault_handler_sighandler),
|
||||
(_gst_plugin_fault_handler_setup), (gst_plugin_load_file):
|
||||
Implemented fault handlers for catching SIGSEGV while loading
|
||||
plug-ins
|
||||
|
||||
2003-12-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* fix documentation build using docbook2..., works on fc1 and rh9
|
||||
* fix distcheck on fc1
|
||||
|
||||
2003-11-14 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* put GST_CACHE_DIR in config.h, as ordered by iain
|
||||
|
|
|
@ -24,6 +24,8 @@ all-local: gst-element-check-@GST_MAJORMINOR@.m4
|
|||
gst-element-check-@GST_MAJORMINOR@.m4: gst-element-check.m4
|
||||
cp $(srcdir)/gst-element-check.m4 gst-element-check-@GST_MAJORMINOR@.m4
|
||||
|
||||
ACLOCAL_AMFLAGS = -I common/m4
|
||||
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
aclocal_DATA = gst-element-check-@GST_MAJORMINOR@.m4
|
||||
|
||||
|
|
|
@ -470,7 +470,6 @@ dnl ############################
|
|||
|
||||
dnl set license and copyright notice
|
||||
AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
|
||||
AC_DEFINE(GST_COPYRIGHT, "(c) 1999-2003 The GStreamer Team", [copyright message in plugins])
|
||||
dnl package name in plugins
|
||||
AC_ARG_WITH(package-name,
|
||||
AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
|
||||
|
@ -479,7 +478,7 @@ AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
|
|||
no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
|
||||
*) GST_PACKAGE="${withval}" ;;
|
||||
esac],
|
||||
[GST_PACKAGE="Gstreamer"]) dnl Default value
|
||||
[GST_PACKAGE="GStreamer"]) dnl Default value
|
||||
AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
|
||||
AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
|
||||
dnl package origin URL
|
||||
|
@ -602,6 +601,7 @@ tests/seeking/Makefile
|
|||
tests/sched/Makefile
|
||||
tests/threadstate/Makefile
|
||||
testsuite/Makefile
|
||||
testsuite/bins/Makefile
|
||||
testsuite/bytestream/Makefile
|
||||
testsuite/caps/Makefile
|
||||
testsuite/caps2/Makefile
|
||||
|
@ -617,10 +617,8 @@ testsuite/refcounting/Makefile
|
|||
testsuite/tags/Makefile
|
||||
testsuite/threads/Makefile
|
||||
examples/Makefile
|
||||
examples/autoplug/Makefile
|
||||
examples/cutter/Makefile
|
||||
examples/helloworld/Makefile
|
||||
examples/helloworld2/Makefile
|
||||
examples/launch/Makefile
|
||||
examples/manual/Makefile
|
||||
examples/mixer/Makefile
|
||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -38,8 +38,8 @@ Recommends: libgstreamer-dev (= ${Source-Version})
|
|||
Description: Core GStreamer documentation
|
||||
Core GStreamer documentation
|
||||
.
|
||||
Gstreamer Manual
|
||||
Gstreamer Plugin Writers Guide
|
||||
GStreamer Manual
|
||||
GStreamer Plugin Writers Guide
|
||||
Various API docs
|
||||
|
||||
Package: gstreamer-tools
|
||||
|
|
4
debian/control.in
vendored
4
debian/control.in
vendored
|
@ -38,8 +38,8 @@ Recommends: libgstreamer-dev (= ${Source-Version})
|
|||
Description: Core GStreamer documentation
|
||||
Core GStreamer documentation
|
||||
.
|
||||
Gstreamer Manual
|
||||
Gstreamer Plugin Writers Guide
|
||||
GStreamer Manual
|
||||
GStreamer Plugin Writers Guide
|
||||
Various API docs
|
||||
|
||||
Package: gstreamer-tools
|
||||
|
|
|
@ -17,10 +17,9 @@
|
|||
|
||||
<!ENTITY CVS SYSTEM "cvs.xml">
|
||||
<!ENTITY DEVELOPING SYSTEM "developing.xml">
|
||||
|
||||
]>
|
||||
|
||||
<article class="faq">
|
||||
<article class="faq" id="index">
|
||||
<articleinfo>
|
||||
<title>GStreamer FAQ</title>
|
||||
<abstract>
|
||||
|
|
|
@ -258,7 +258,7 @@ uninstall-local:
|
|||
echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
|
||||
rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
|
||||
fi)
|
||||
rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR)
|
||||
if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR); fi
|
||||
else
|
||||
install-data-local:
|
||||
uninstall-local:
|
||||
|
|
|
@ -83,7 +83,6 @@ well as the object hierarchy that defines elements and bins, along
|
|||
with some more specialized elements.</para>
|
||||
|
||||
&Gst;
|
||||
&GstAutoplug;
|
||||
&GstBin;
|
||||
&GstBuffer;
|
||||
&GstConfig;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!-- ##### SECTION Title ##### -->
|
||||
Gstreamer
|
||||
GStreamer
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Media library supporting arbitrary formats and filter graphs.
|
||||
|
@ -112,14 +112,6 @@ pipeline</ulink> and Microsoft's DirectShow for some background.
|
|||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_init_get_popt_table ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_version ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -265,6 +265,7 @@ The basic structure of a buffer.
|
|||
@offset_end:
|
||||
@pool:
|
||||
@pool_private:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### FUNCTION gst_buffer_new ##### -->
|
||||
<para>
|
||||
|
|
|
@ -92,6 +92,7 @@ The bufferpool structure
|
|||
@buffer_copy:
|
||||
@buffer_free:
|
||||
@user_data:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### USER_FUNCTION GstBufferPoolBufferNewFunction ##### -->
|
||||
<para>
|
||||
|
|
|
@ -44,13 +44,6 @@ If a subsystem is disabled in GStreamer, a value is defined in
|
|||
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_DISABLE_AUTOPLUG ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_DISABLE_ENUMTYPES ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ The base structure
|
|||
@flags: The flags of this GstData
|
||||
@free: A pointer to a custom free function
|
||||
@copy: A pointer to a custom copy function
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### USER_FUNCTION GstDataFreeFunction ##### -->
|
||||
<para>
|
||||
|
|
|
@ -64,6 +64,7 @@ describes the element, mostly for the benefit of editors.
|
|||
@klass:
|
||||
@description:
|
||||
@author:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### FUNCTION gst_element_factory_find ##### -->
|
||||
<para>
|
||||
|
|
|
@ -785,8 +785,11 @@ Flags for the pad.
|
|||
|
||||
</para>
|
||||
|
||||
@padlist:
|
||||
@pad:
|
||||
@Varargs:
|
||||
@Returns:
|
||||
<!-- # Unused Parameters # -->
|
||||
@padlist:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_selectv ##### -->
|
||||
|
@ -794,9 +797,11 @@ Flags for the pad.
|
|||
|
||||
</para>
|
||||
|
||||
@padlist:
|
||||
@Returns:
|
||||
<!-- # Unused Parameters # -->
|
||||
@pad:
|
||||
@Varargs:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_dispatcher ##### -->
|
||||
|
@ -1090,6 +1095,7 @@ The realpad object
|
|||
@intlinkfunc:
|
||||
@bufferpoolfunc:
|
||||
@probedisp:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### MACRO GST_RPAD_DIRECTION ##### -->
|
||||
<para>
|
||||
|
|
|
@ -69,6 +69,7 @@ The plugin object
|
|||
@numfeatures:
|
||||
@manager:
|
||||
@module:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### USER_FUNCTION GstPluginInitFunc ##### -->
|
||||
<para>
|
||||
|
@ -96,9 +97,9 @@ loaded will use this variable to initialize the plugin.
|
|||
@plugin_exit:
|
||||
@version:
|
||||
@license:
|
||||
@copyright:
|
||||
@package:
|
||||
@origin:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### FUNCTION gst_plugin_set_name ##### -->
|
||||
<para>
|
||||
|
|
|
@ -1992,6 +1992,12 @@ to the current function, i.e. "('element')"
|
|||
@format: printf-style format string
|
||||
@args...: printf arguments
|
||||
|
||||
<!-- ##### MACRO GST_DISABLE_AUTOPLUG ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_DISABLE_TYPEFIND ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -8950,6 +8956,13 @@ of an element he doesn't need anymore.
|
|||
@format:
|
||||
@args...:
|
||||
|
||||
<!-- ##### FUNCTION gst_init_get_popt_table ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gst_link_get_type ##### -->
|
||||
=======
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ The registry object
|
|||
@loaded:
|
||||
@plugins:
|
||||
@paths:
|
||||
@_gst_reserved:
|
||||
|
||||
<!-- ##### FUNCTION gst_registry_load ##### -->
|
||||
<para>
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
if DOC_HTML
|
||||
install-data-local: html
|
||||
mkdir -p $(docdir)
|
||||
cp -pr $(HTML_DAT) $(docdir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)
|
||||
cp -pr $(HTML_DAT) $(DESTDIR)$(docdir)
|
||||
|
||||
uninstall-local:
|
||||
for part in $(HTML_DAT); do rm -rf $(docdir)/$$part; done
|
||||
rmdir $(docdir)
|
||||
for part in $(HTML_DAT); do rm -rf $(DESTDIR)$(docdir)/$$part; done
|
||||
if test -d $(DESTDIR)$(docdir); then rmdir $(DESTDIR)$(docdir); fi
|
||||
else
|
||||
install-data-local:
|
||||
uninstall-local:
|
||||
|
|
|
@ -257,7 +257,7 @@ uninstall-local:
|
|||
echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
|
||||
rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
|
||||
fi)
|
||||
rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR)
|
||||
if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR); fi
|
||||
else
|
||||
install-data-local:
|
||||
uninstall-local:
|
||||
|
|
|
@ -95,7 +95,7 @@ html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
|
|||
@echo "*** Generating HTML output ***"
|
||||
@-mkdir -p html
|
||||
@cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
|
||||
@cd $(BUILDDIR) && xmlto html -o ../html $(MAIN)
|
||||
@cd $(BUILDDIR) && docbook2html -o ../html -V '%use-id-as-filename%' $(MAIN)
|
||||
@test "x$(CSS)" != "x" && \
|
||||
echo "Copying .css files: $(CSS)" && \
|
||||
cp $(srcdir)/$(CSS) html
|
||||
|
@ -165,8 +165,9 @@ $(BUILDIMAGESDIR)/%.ps: %.png
|
|||
@cat $< | pngtopnm | pnmtops -noturn > $@ 2> /dev/null
|
||||
|
||||
# make sure xml validates properly
|
||||
#check-local:
|
||||
# xmllint -noout -valid $(srcdir)/$(MAIN)
|
||||
check-local: $(BUILDDIR)/$(MAIN)
|
||||
@cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
|
||||
cd $(BUILDDIR) && xmllint -noout -valid $(MAIN)
|
||||
|
||||
### this is a website upload target
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
<!-- ############ sect1 ############# -->
|
||||
|
||||
<sect1 id="sect1-boiler-source" xreflabel="Getting the Gstreamer Plugin Templates">
|
||||
<title>Getting the Gstreamer Plugin Templates</title>
|
||||
<sect1 id="sect1-boiler-source" xreflabel="Getting the GStreamer Plugin Templates">
|
||||
<title>Getting the GStreamer Plugin Templates</title>
|
||||
<para>
|
||||
There are currently two ways to develop a new plugin for &GStreamer;: You
|
||||
can write the entire plugin by hand, or you can copy an existing plugin
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<!ENTITY GstLibRef "<emphasis>GStreamer Library Reference</emphasis>">
|
||||
]>
|
||||
|
||||
<book id="book-gst-plugin-writers-guide">
|
||||
<book id="index">
|
||||
&TITLEPAGE;
|
||||
|
||||
<!-- ############# part ############### -->
|
||||
|
|
|
@ -4,7 +4,7 @@ else
|
|||
GST_LOADSAVE_DIRS = xml typefind
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
dirs = \
|
||||
helloworld \
|
||||
queue \
|
||||
queue2 \
|
||||
|
@ -17,22 +17,9 @@ SUBDIRS = \
|
|||
cutter \
|
||||
pingpong \
|
||||
manual \
|
||||
retag \
|
||||
$(GST_LOADSAVE_DIRS)
|
||||
|
||||
DIST_SUBDIRS = helloworld \
|
||||
queue \
|
||||
queue2 \
|
||||
queue3 \
|
||||
queue4 \
|
||||
launch \
|
||||
thread \
|
||||
plugins \
|
||||
mixer \
|
||||
cutter \
|
||||
pingpong \
|
||||
manual \
|
||||
xml \
|
||||
typefind \
|
||||
retag
|
||||
|
||||
SUBDIRS = $(dirs) \
|
||||
$(GST_LOADSAVE_DIRS)
|
||||
|
||||
DIST_SUBDIRS = $(dirs) xml typefind
|
||||
|
|
2
examples/autoplug/.gitignore
vendored
2
examples/autoplug/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
autoplug
|
||||
xmlTest.gst
|
|
@ -1,4 +0,0 @@
|
|||
noinst_PROGRAMS = autoplug
|
||||
|
||||
autoplug_LDADD = $(GST_LIBS)
|
||||
autoplug_CFLAGS = $(GST_CFLAGS)
|
|
@ -1,152 +0,0 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
static void
|
||||
gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline)
|
||||
{
|
||||
GstElement *osssink, *videosink, *videoelement, *colorspace;
|
||||
GstElement *new_element;
|
||||
GstAutoplug *autoplug;
|
||||
GstElement *autobin;
|
||||
GstElement *filesrc;
|
||||
GstElement *cache;
|
||||
|
||||
GST_DEBUG ("GstPipeline: play have type");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
||||
filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
|
||||
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
|
||||
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
|
||||
|
||||
/* unlink the typefind from the pipeline and remove it */
|
||||
gst_element_unlink_pads (cache, "src", typefind, "sink");
|
||||
gst_bin_remove (GST_BIN (autobin), typefind);
|
||||
|
||||
/* and an audio sink */
|
||||
osssink = gst_element_factory_make ("osssink", "play_audio");
|
||||
g_assert (osssink != NULL);
|
||||
|
||||
videosink = gst_bin_new ("videosink");
|
||||
/* and an video sink */
|
||||
videoelement = gst_element_factory_make ("xvideosink", "play_video");
|
||||
g_assert (videosink != NULL);
|
||||
|
||||
colorspace = gst_element_factory_make ("colorspace", "colorspace");
|
||||
g_assert (colorspace != NULL);
|
||||
|
||||
gst_element_link_pads (colorspace, "src", videoelement, "sink");
|
||||
gst_bin_add (GST_BIN (videosink), colorspace);
|
||||
gst_bin_add (GST_BIN (videosink), videoelement);
|
||||
|
||||
gst_element_add_ghost_pad (videosink,
|
||||
gst_element_get_pad (colorspace, "sink"), "sink");
|
||||
|
||||
autoplug = gst_autoplug_factory_make ("staticrender");
|
||||
g_assert (autoplug != NULL);
|
||||
|
||||
new_element = gst_autoplug_to_renderers (autoplug,
|
||||
caps,
|
||||
videosink,
|
||||
osssink,
|
||||
NULL);
|
||||
|
||||
if (!new_element) {
|
||||
g_print ("could not autoplug, no suitable codecs found...\n");
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
gst_element_set_name (new_element, "new_element");
|
||||
|
||||
gst_bin_add (GST_BIN (autobin), new_element);
|
||||
|
||||
g_object_set (G_OBJECT (cache), "reset", TRUE, NULL);
|
||||
|
||||
gst_element_link_pads (cache, "src", new_element, "sink");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
gst_xml_write_file (GST_ELEMENT (pipeline), fopen ("xmlTest.gst", "w"));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
gst_play_cache_empty (GstElement *element, GstElement *pipeline)
|
||||
{
|
||||
GstElement *autobin;
|
||||
GstElement *filesrc;
|
||||
GstElement *cache;
|
||||
GstElement *new_element;
|
||||
|
||||
fprintf (stderr, "have cache empty\n");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
||||
filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
|
||||
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
|
||||
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
|
||||
new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element");
|
||||
|
||||
gst_element_unlink_many (filesrc, cache, new_element, NULL);
|
||||
gst_bin_remove (GST_BIN (autobin), cache);
|
||||
gst_element_link_pads (filesrc, "src", new_element, "sink");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
fprintf (stderr, "done with cache_empty\n");
|
||||
}
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
GstElement *filesrc;
|
||||
GstElement *pipeline;
|
||||
GstElement *autobin;
|
||||
GstElement *typefind;
|
||||
GstElement *cache;
|
||||
|
||||
g_thread_init(NULL);
|
||||
gst_init(&argc,&argv);
|
||||
|
||||
if (argc != 2) {
|
||||
g_print("usage: %s <filename>\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* create a new pipeline to hold the elements */
|
||||
pipeline = gst_pipeline_new("pipeline");
|
||||
g_assert(pipeline != NULL);
|
||||
|
||||
/* create a disk reader */
|
||||
filesrc = gst_element_factory_make("filesrc", "disk_source");
|
||||
g_assert(filesrc != NULL);
|
||||
g_object_set(G_OBJECT(filesrc),"location", argv[1],NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), filesrc);
|
||||
|
||||
autobin = gst_bin_new ("autobin");
|
||||
cache = gst_element_factory_make ("autoplugcache", "cache");
|
||||
g_signal_connect (G_OBJECT (cache), "cache_empty", G_CALLBACK (gst_play_cache_empty), pipeline);
|
||||
|
||||
typefind = gst_element_factory_make ("typefind", "typefind");
|
||||
g_signal_connect (G_OBJECT (typefind), "have_type", G_CALLBACK (gst_play_have_type), pipeline);
|
||||
gst_bin_add (GST_BIN (autobin), cache);
|
||||
gst_bin_add (GST_BIN (autobin), typefind);
|
||||
|
||||
gst_element_link_pads (cache, "src", typefind, "sink");
|
||||
gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink");
|
||||
|
||||
gst_bin_add (GST_BIN( pipeline), autobin);
|
||||
gst_element_link_pads (filesrc, "src", autobin, "sink");
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||
|
||||
while (gst_bin_iterate (GST_BIN (pipeline)));
|
||||
|
||||
/* stop the pipeline */
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||
|
||||
gst_object_unref (GST_OBJECT (pipeline));
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -422,11 +422,6 @@ GST_PLUGIN_DEFINE (
|
|||
"0.1", /* The version number of the plugin */
|
||||
"LGPL", /* ieffective license the plugin can be shipped with. Must be
|
||||
* valid for all libraries it links to, too. */
|
||||
"(c) 2003 E. Xamplewriter",
|
||||
/* Copyright holder for this plugin. This does not include
|
||||
* the libraries it links to, contrary to the license. This
|
||||
* field should be considered informational and not legally
|
||||
* binding */
|
||||
"my nifty plugin package",
|
||||
/* package this plugin belongs to. */
|
||||
"http://www.mydomain.com"
|
||||
|
|
|
@ -10,7 +10,7 @@ libgstspider_la_CFLAGS = $(GST_CFLAGS)
|
|||
libgstspider_la_LIBADD =
|
||||
libgstspider_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
|
||||
noinst_HEADERS = gstspider.h gstsearchfuncs.h
|
||||
noinst_HEADERS = gstspider.h gstspideridentity.h gstsearchfuncs.h
|
||||
|
||||
noinst_PROGRAMS = spidertest
|
||||
|
||||
|
|
|
@ -593,6 +593,15 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad)
|
|||
GST_DEBUG ("trying to plug from %s:%s to %s",
|
||||
GST_DEBUG_PAD_NAME (srcpad), GST_ELEMENT_NAME (conn->src));
|
||||
|
||||
/* see if they match already */
|
||||
if (gst_pad_link (srcpad, conn->src->sink)) {
|
||||
GST_DEBUG ("%s:%s and %s:%s can link directly",
|
||||
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (conn->src->sink));
|
||||
gst_pad_unlink (srcpad, conn->src->sink);
|
||||
gst_spider_create_and_plug (conn, NULL);
|
||||
return GST_PAD_LINK_OK;
|
||||
}
|
||||
|
||||
/* find a path from src to sink */
|
||||
plugpath = gst_autoplug_sp (gst_pad_get_caps (srcpad), gst_pad_get_caps (conn->src->sink), spider->factories);
|
||||
|
||||
|
@ -664,7 +673,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -335,7 +335,7 @@ gst_aggregator_loop (GstElement *element)
|
|||
|
||||
debug = "loop_select";
|
||||
|
||||
pad = gst_pad_select (aggregator->sinkpads);
|
||||
pad = gst_pad_selectv (aggregator->sinkpads);
|
||||
buf = GST_BUFFER (gst_pad_pull (pad));
|
||||
|
||||
gst_aggregator_push (aggregator, pad, buf, debug);
|
||||
|
|
|
@ -95,7 +95,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -195,7 +195,7 @@ gst_tee_getcaps (GstPad *pad)
|
|||
pads = gst_element_get_pad_list (GST_ELEMENT (tee));
|
||||
|
||||
while (pads) {
|
||||
GstPad *srcpad = GST_PAD_CAST (pads->data);
|
||||
GstPad *srcpad = GST_PAD (pads->data);
|
||||
GstPad *peer;
|
||||
const GstCaps2 *peercaps;
|
||||
GstCaps2 *newcaps;
|
||||
|
|
|
@ -367,16 +367,17 @@ stop_typefinding (GstTypeFindElement *typefind)
|
|||
if (push_cached_buffers) {
|
||||
GstBuffer *buffer;
|
||||
guint size = gst_buffer_store_get_size (typefind->store, 0);
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (typefind, "seeking back to current position %u", size);
|
||||
if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink),
|
||||
gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, size))) {
|
||||
GST_WARNING_OBJECT (typefind, "could not seek to required position %u, hope for the best", size);
|
||||
}
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
gst_buffer_store_clear (typefind->store);
|
||||
}
|
||||
|
|
|
@ -367,16 +367,17 @@ stop_typefinding (GstTypeFindElement *typefind)
|
|||
if (push_cached_buffers) {
|
||||
GstBuffer *buffer;
|
||||
guint size = gst_buffer_store_get_size (typefind->store, 0);
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (typefind, "seeking back to current position %u", size);
|
||||
if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink),
|
||||
gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, size))) {
|
||||
GST_WARNING_OBJECT (typefind, "could not seek to required position %u, hope for the best", size);
|
||||
}
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
gst_buffer_store_clear (typefind->store);
|
||||
}
|
||||
|
|
11
gst/gst.c
11
gst/gst.c
|
@ -55,6 +55,9 @@ static gboolean gst_initialized = FALSE;
|
|||
static gboolean _gst_initialization_failure = FALSE;
|
||||
extern gint _gst_trace_on;
|
||||
|
||||
/* set to TRUE when segfaults need to be left as is */
|
||||
gboolean _gst_disable_segtrap = FALSE;
|
||||
|
||||
extern GThreadFunctions gst_thread_dummy_functions;
|
||||
|
||||
|
||||
|
@ -96,6 +99,7 @@ enum {
|
|||
ARG_PLUGIN_SPEW,
|
||||
ARG_PLUGIN_PATH,
|
||||
ARG_PLUGIN_LOAD,
|
||||
ARG_SEGTRAP_DISABLE,
|
||||
ARG_SCHEDULER,
|
||||
ARG_REGISTRY
|
||||
};
|
||||
|
@ -122,6 +126,7 @@ static const struct poptOption gstreamer_options[] = {
|
|||
{"gst-plugin-spew", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_SPEW, N_("enable verbose plugin loading diagnostics"), NULL},
|
||||
{"gst-plugin-path", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_PATH, N_("'" G_SEARCHPATH_SEPARATOR_S "'--separated path list for loading plugins"), "PATHS"},
|
||||
{"gst-plugin-load", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_LOAD, N_("comma-separated list of plugins to preload in addition to the list stored in env variable GST_PLUGIN_PATH"), "PLUGINS"},
|
||||
{"gst-disable-segtrap",NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_SEGTRAP_DISABLE,N_("disable trapping of segmentation faults during plugin loading"), NULL},
|
||||
{"gst-scheduler", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_SCHEDULER, N_("scheduler to use ('"GST_SCHEDULER_DEFAULT_NAME"' is the default)"), "SCHEDULER"},
|
||||
{"gst-registry", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_REGISTRY, N_("registry to use") , "REGISTRY"},
|
||||
POPT_TABLEEND
|
||||
|
@ -467,11 +472,10 @@ static GstPluginDesc plugin_desc = {
|
|||
NULL,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN,
|
||||
|
||||
GST_STRUCT_PADDING_INIT
|
||||
GST_PADDING_INIT
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -700,6 +704,9 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
|
|||
case ARG_PLUGIN_LOAD:
|
||||
split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
|
||||
break;
|
||||
case ARG_SEGTRAP_DISABLE:
|
||||
_gst_disable_segtrap = TRUE;
|
||||
break;
|
||||
case ARG_SCHEDULER:
|
||||
gst_scheduler_factory_set_default_name (arg);
|
||||
break;
|
||||
|
|
71
gst/gstbin.c
71
gst/gstbin.c
|
@ -891,6 +891,77 @@ gst_bin_get_list (GstBin * bin)
|
|||
return bin->children;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_bin_get_by_interface:
|
||||
* @bin: bin to find element in
|
||||
* @interface: interface to be implemented by interface
|
||||
*
|
||||
* Looks for the first element inside the bin that implements the given
|
||||
* interface. If such an element is found, it returns the element. You can
|
||||
* cast this element to the given interface afterwards.
|
||||
* If you want all elements that implement the interface, use
|
||||
* gst_bin_get_all_by_interface(). The function recurses bins inside bins.
|
||||
*
|
||||
* Returns: An element inside the bin implementing the interface.
|
||||
*/
|
||||
GstElement *
|
||||
gst_bin_get_by_interface (GstBin *bin, const GType interface)
|
||||
{
|
||||
GList *walk;
|
||||
|
||||
g_return_val_if_fail (GST_IS_BIN (bin), NULL);
|
||||
g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface), NULL);
|
||||
|
||||
walk = bin->children;
|
||||
while (walk) {
|
||||
if (G_TYPE_CHECK_INSTANCE_TYPE (walk->data, interface))
|
||||
return GST_ELEMENT (walk->data);
|
||||
if (GST_IS_BIN (walk->data)) {
|
||||
GstElement *ret;
|
||||
ret = gst_bin_get_by_interface (GST_BIN (walk->data), interface);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
walk = g_list_next (walk);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_bin_get_all_by_interface:
|
||||
* @bin: bin to find elements in
|
||||
* @interface: interface to be implemented by interface
|
||||
*
|
||||
* Looks for all element inside the bin that implements the given
|
||||
* interface. You can safely cast all returned elements to the given interface.
|
||||
* The function recurses bins inside bins. You need to free the list using
|
||||
* g_list_free() after use.
|
||||
*
|
||||
* Returns: An element inside the bin implementing the interface.
|
||||
*/
|
||||
GList *
|
||||
gst_bin_get_all_by_interface (GstBin *bin, const GType interface)
|
||||
{
|
||||
GList *walk, *ret = NULL;
|
||||
|
||||
g_return_val_if_fail (GST_IS_BIN (bin), NULL);
|
||||
g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface), NULL);
|
||||
|
||||
walk = bin->children;
|
||||
while (walk) {
|
||||
if (G_TYPE_CHECK_INSTANCE_TYPE (walk->data, interface))
|
||||
ret = g_list_prepend (ret, walk->data);
|
||||
if (GST_IS_BIN (walk->data)) {
|
||||
ret = g_list_concat (ret,
|
||||
gst_bin_get_all_by_interface (GST_BIN (walk->data), interface));
|
||||
}
|
||||
walk = g_list_next (walk);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_bin_sync_children_state:
|
||||
* @bin: #Gstbin to sync state
|
||||
|
|
19
gst/gstbin.h
19
gst/gstbin.h
|
@ -34,17 +34,8 @@ extern GType _gst_bin_type;
|
|||
#define GST_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BIN))
|
||||
#define GST_IS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BIN))
|
||||
#define GST_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BIN, GstBinClass))
|
||||
|
||||
#define GST_BIN_CAST(obj) ((GstBin*)(obj))
|
||||
#define GST_BIN_CLASS_CAST(klass) ((GstBinClass*)(klass))
|
||||
|
||||
#ifdef GST_TYPE_PARANOID
|
||||
# define GST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin))
|
||||
# define GST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass))
|
||||
#else
|
||||
# define GST_BIN GST_BIN_CAST
|
||||
# define GST_BIN_CLASS GST_BIN_CLASS_CAST
|
||||
#endif
|
||||
#define GST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin))
|
||||
#define GST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass))
|
||||
|
||||
typedef void (*GstBinPrePostIterateFunction) (GstBin *bin, gpointer user_data);
|
||||
|
||||
|
@ -76,7 +67,7 @@ struct _GstBin {
|
|||
|
||||
GstElementState child_states[GST_NUM_STATES];
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstBinClass {
|
||||
|
@ -95,7 +86,7 @@ struct _GstBinClass {
|
|||
void (*element_added) (GstBin *bin, GstElement *child);
|
||||
void (*element_removed) (GstBin *bin, GstElement *child);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_bin_get_type (void);
|
||||
|
@ -112,6 +103,8 @@ GstElement* gst_bin_get_by_name (GstBin *bin, const gchar *name);
|
|||
GstElement* gst_bin_get_by_name_recurse_up (GstBin *bin, const gchar *name);
|
||||
G_CONST_RETURN GList*
|
||||
gst_bin_get_list (GstBin *bin);
|
||||
GstElement* gst_bin_get_by_interface (GstBin *bin, const GType interface);
|
||||
GList * gst_bin_get_all_by_interface (GstBin *bin, const GType interface);
|
||||
|
||||
gboolean gst_bin_iterate (GstBin *bin);
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ struct _GstBuffer {
|
|||
/* pointer to pool private data of parent buffer in case of a subbuffer */
|
||||
gpointer pool_private;
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* bufferpools */
|
||||
|
@ -139,7 +139,7 @@ struct _GstBufferPool {
|
|||
|
||||
gpointer user_data;
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* allocation */
|
||||
|
|
|
@ -213,7 +213,7 @@ void gst_caps2_append (GstCaps2 *caps1, GstCaps2 *caps2)
|
|||
}
|
||||
g_ptr_array_free(caps2->structs, TRUE);
|
||||
#ifdef USE_POISONING
|
||||
memset (caps, 0xff, sizeof(GstCaps2));
|
||||
memset (caps2, 0xff, sizeof(GstCaps2));
|
||||
#endif
|
||||
g_free(caps2);
|
||||
}
|
||||
|
|
|
@ -600,6 +600,7 @@ gboolean
|
|||
gst_clock_handle_discont (GstClock *clock, guint64 time)
|
||||
{
|
||||
GstClockTime itime = G_GINT64_CONSTANT (0);
|
||||
GstClockClass *cclass = GST_CLOCK_GET_CLASS (clock);;
|
||||
|
||||
GST_CAT_DEBUG (GST_CAT_CLOCK, "clock discont %" G_GUINT64_FORMAT
|
||||
" %" G_GUINT64_FORMAT " %d",
|
||||
|
@ -609,22 +610,9 @@ gst_clock_handle_discont (GstClock *clock, guint64 time)
|
|||
return TRUE;
|
||||
|
||||
GST_LOCK (clock);
|
||||
if (clock->accept_discont) {
|
||||
GstClockClass *cclass;
|
||||
|
||||
cclass = GST_CLOCK_GET_CLASS (clock);
|
||||
|
||||
if (cclass->get_internal_time) {
|
||||
itime = cclass->get_internal_time (clock);
|
||||
}
|
||||
}
|
||||
else {
|
||||
GST_UNLOCK (clock);
|
||||
GST_CAT_DEBUG (GST_CAT_CLOCK, "clock discont refused %" G_GUINT64_FORMAT
|
||||
" %" G_GUINT64_FORMAT,
|
||||
time, clock->start_time);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
clock->start_time = itime - time;
|
||||
clock->last_time = time;
|
||||
|
|
|
@ -137,7 +137,7 @@ struct _GstClock {
|
|||
GCond *active_cond;
|
||||
gboolean stats;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstClockClass {
|
||||
|
@ -159,7 +159,7 @@ struct _GstClockClass {
|
|||
void (*unschedule) (GstClock *clock, GstClockEntry *entry);
|
||||
void (*unlock) (GstClock *clock, GstClockEntry *entry);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_clock_get_type (void);
|
||||
|
|
|
@ -75,7 +75,7 @@ struct _GstData {
|
|||
GstDataFreeFunction free; /* free the data */
|
||||
GstDataCopyFunction copy; /* copy the data */
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* function used by subclasses only */
|
||||
|
|
|
@ -1867,7 +1867,7 @@ gst_element_unlink (GstElement *src, GstElement *dest)
|
|||
srcpads = gst_element_get_pad_list (src);
|
||||
|
||||
while (srcpads) {
|
||||
pad = GST_PAD_CAST (srcpads->data);
|
||||
pad = GST_PAD (srcpads->data);
|
||||
|
||||
/* we only care about real src pads */
|
||||
if (GST_IS_REAL_PAD (pad) && GST_PAD_IS_SRC (pad)) {
|
||||
|
@ -1909,7 +1909,7 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir)
|
|||
GList *pads = element->pads;
|
||||
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "getting a random pad");
|
||||
while (pads) {
|
||||
GstPad *pad = GST_PAD_CAST (pads->data);
|
||||
GstPad *pad = GST_PAD (pads->data);
|
||||
|
||||
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "checking pad %s:%s",
|
||||
GST_DEBUG_PAD_NAME (pad));
|
||||
|
@ -2522,7 +2522,7 @@ gst_element_pads_activate (GstElement *element, gboolean active)
|
|||
GList *pads = element->pads;
|
||||
|
||||
while (pads) {
|
||||
GstPad *pad = GST_PAD_CAST (pads->data);
|
||||
GstPad *pad = GST_PAD (pads->data);
|
||||
pads = g_list_next (pads);
|
||||
|
||||
if (!GST_IS_REAL_PAD (pad))
|
||||
|
@ -3228,10 +3228,10 @@ gst_element_get_managing_bin (GstElement *element)
|
|||
|
||||
g_return_val_if_fail (element != NULL, NULL);
|
||||
|
||||
bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (element)));
|
||||
bin = GST_BIN (gst_object_get_parent (GST_OBJECT (element)));
|
||||
|
||||
while (bin && !GST_FLAG_IS_SET (GST_OBJECT_CAST (bin), GST_BIN_FLAG_MANAGER))
|
||||
bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (bin)));
|
||||
while (bin && !GST_FLAG_IS_SET (GST_OBJECT (bin), GST_BIN_FLAG_MANAGER))
|
||||
bin = GST_BIN (gst_object_get_parent (GST_OBJECT (bin)));
|
||||
|
||||
return bin;
|
||||
}
|
||||
|
|
|
@ -45,10 +45,10 @@ struct _GstElementDetails {
|
|||
gchar *description; /* insights of one form or another */
|
||||
gchar *author; /* who wrote this thing? */
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
#define GST_ELEMENT_DETAILS(longname,klass,description,author) \
|
||||
{ longname, klass, description, author, GST_STRUCT_PADDING_INIT }
|
||||
{ longname, klass, description, author, GST_PADDING_INIT }
|
||||
#define GST_IS_ELEMENT_DETAILS(details) ( \
|
||||
(details) && ((details)->longname != NULL) && ((details)->klass != NULL) \
|
||||
&& ((details)->description != NULL) && ((details)->author != NULL))
|
||||
|
@ -73,20 +73,11 @@ struct _GstElementDetails {
|
|||
extern GType _gst_element_type;
|
||||
|
||||
#define GST_TYPE_ELEMENT (_gst_element_type)
|
||||
|
||||
#define GST_ELEMENT_CAST(obj) ((GstElement*)(obj))
|
||||
#define GST_ELEMENT_CLASS_CAST(klass) ((GstElementClass*)(klass))
|
||||
#define GST_IS_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_ELEMENT))
|
||||
#define GST_IS_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_ELEMENT))
|
||||
#define GST_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ELEMENT, GstElementClass))
|
||||
|
||||
#ifdef GST_TYPE_PARANOID
|
||||
# define GST_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement))
|
||||
# define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
|
||||
#else
|
||||
# define GST_ELEMENT GST_ELEMENT_CAST
|
||||
# define GST_ELEMENT_CLASS GST_ELEMENT_CLASS_CAST
|
||||
#endif
|
||||
#define GST_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement))
|
||||
#define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
|
||||
|
||||
/* convenience functions */
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
|
@ -184,7 +175,7 @@ struct _GstElement {
|
|||
GAsyncQueue *prop_value_queue;
|
||||
GMutex *property_mutex;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstElementClass {
|
||||
|
@ -241,7 +232,7 @@ struct _GstElementClass {
|
|||
GstIndex* (*get_index) (GstElement *element);
|
||||
void (*set_index) (GstElement *element, GstIndex *index);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
|
||||
|
@ -408,13 +399,13 @@ struct _GstElementFactory {
|
|||
|
||||
GList * interfaces; /* interfaces this element implements */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstElementFactoryClass {
|
||||
GstPluginFeatureClass parent_class;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_element_factory_get_type (void);
|
||||
|
@ -431,8 +422,8 @@ G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factor
|
|||
G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
|
||||
G_CONST_RETURN gchar * gst_element_factory_get_version (GstElementFactory *factory);
|
||||
G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
|
||||
guint gst_element_factory_get_num_padtemplates (GstElementFactory *factory);
|
||||
G_CONST_RETURN GList * gst_element_factory_get_padtemplates (GstElementFactory *factory);
|
||||
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
|
||||
G_CONST_RETURN GList * gst_element_factory_get_pad_templates (GstElementFactory *factory);
|
||||
guint gst_element_factory_get_uri_type (GstElementFactory *factory);
|
||||
gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ gst_event_new_seek (GstSeekType type, gint64 offset)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_event_new_discontinuousv:
|
||||
* gst_event_new_discontinuous_valist:
|
||||
* @new_media: A flag indicating a new media type starts
|
||||
* @format1: The format of the discont value
|
||||
* @var_args: more discont values and formats
|
||||
|
@ -207,7 +207,7 @@ gst_event_new_seek (GstSeekType type, gint64 offset)
|
|||
* Returns: A new discontinuous event.
|
||||
*/
|
||||
GstEvent*
|
||||
gst_event_new_discontinuousv (gboolean new_media, GstFormat format1, va_list var_args)
|
||||
gst_event_new_discontinuous_valist (gboolean new_media, GstFormat format1, va_list var_args)
|
||||
{
|
||||
GstEvent *event;
|
||||
gint count = 0;
|
||||
|
@ -251,7 +251,7 @@ gst_event_new_discontinuous (gboolean new_media, GstFormat format1, ...)
|
|||
|
||||
va_start (var_args, format1);
|
||||
|
||||
event = gst_event_new_discontinuousv (new_media, format1, var_args);
|
||||
event = gst_event_new_discontinuous_valist (new_media, format1, var_args);
|
||||
|
||||
va_end (var_args);
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ struct _GstEvent {
|
|||
} structure;
|
||||
} event_data;
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
void _gst_event_initialize (void);
|
||||
|
@ -215,7 +215,7 @@ GstEvent* gst_event_new_size (GstFormat format, gint64 value);
|
|||
/* discontinous event */
|
||||
GstEvent* gst_event_new_discontinuous (gboolean new_media,
|
||||
GstFormat format1, ...);
|
||||
GstEvent* gst_event_new_discontinuousv (gboolean new_media,
|
||||
GstEvent* gst_event_new_discontinuous_valist (gboolean new_media,
|
||||
GstFormat format1,
|
||||
va_list var_args);
|
||||
gboolean gst_event_discont_get_value (GstEvent *event, GstFormat format, gint64 *value);
|
||||
|
|
|
@ -168,7 +168,7 @@ struct _GstIndex {
|
|||
GHashTable *writers;
|
||||
gint last_id;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstIndexClass {
|
||||
|
@ -189,7 +189,7 @@ struct _GstIndexClass {
|
|||
/* signals */
|
||||
void (*entry_added) (GstIndex *index, GstIndexEntry *entry);
|
||||
|
||||
GST_CLASS_PADDING;
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_index_get_type (void);
|
||||
|
@ -253,13 +253,13 @@ struct _GstIndexFactory {
|
|||
gchar *longdesc; /* long description of the index (well, don't overdo it..) */
|
||||
GType type; /* unique GType of the index */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstIndexFactoryClass {
|
||||
GstPluginFeatureClass parent;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_index_factory_get_type (void);
|
||||
|
|
|
@ -353,7 +353,7 @@ extern gboolean __gst_debug_enabled;
|
|||
#endif /* G_HAVE_ISO_VARARGS */
|
||||
|
||||
#else /* GST_DEBUG_ENABLE_DEPRECATED */
|
||||
/* This is a workaround so the old debugging stuff of Gstreamer 0.6 works.
|
||||
/* This is a workaround so the old debugging stuff of GStreamer 0.6 works.
|
||||
This is undocumented and will go when 0.8 comes out. */
|
||||
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
|
|
|
@ -28,19 +28,21 @@
|
|||
#include "gstinterface.h"
|
||||
#include "gstlog.h"
|
||||
|
||||
static void gst_interface_class_init (GstInterfaceClass *ifklass);
|
||||
static gboolean gst_interface_supported_default (GstInterface *iface,
|
||||
static void
|
||||
gst_implements_interface_class_init (GstImplementsInterfaceClass *ifklass);
|
||||
static gboolean
|
||||
gst_implements_interface_supported_default (GstImplementsInterface *iface,
|
||||
GType iface_type);
|
||||
|
||||
GType
|
||||
gst_interface_get_type (void)
|
||||
gst_implements_interface_get_type (void)
|
||||
{
|
||||
static GType gst_interface_type = 0;
|
||||
|
||||
if (!gst_interface_type) {
|
||||
static const GTypeInfo gst_interface_info = {
|
||||
sizeof (GstInterfaceClass),
|
||||
(GBaseInitFunc) gst_interface_class_init,
|
||||
sizeof (GstImplementsInterfaceClass),
|
||||
(GBaseInitFunc) gst_implements_interface_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -52,7 +54,7 @@ gst_interface_get_type (void)
|
|||
};
|
||||
|
||||
gst_interface_type = g_type_register_static (G_TYPE_INTERFACE,
|
||||
"GstInterface",
|
||||
"GstImplementsInterface",
|
||||
&gst_interface_info, 0);
|
||||
|
||||
g_type_interface_add_prerequisite (gst_interface_type,
|
||||
|
@ -63,13 +65,13 @@ gst_interface_get_type (void)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_interface_class_init (GstInterfaceClass *klass)
|
||||
gst_implements_interface_class_init (GstImplementsInterfaceClass *klass)
|
||||
{
|
||||
klass->supported = gst_interface_supported_default;
|
||||
klass->supported = gst_implements_interface_supported_default;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_interface_supported_default (GstInterface *interface,
|
||||
gst_implements_interface_supported_default (GstImplementsInterface *interface,
|
||||
GType iface_type)
|
||||
{
|
||||
/* Well, if someone didn't set the virtual function,
|
||||
|
@ -93,12 +95,12 @@ gst_element_implements_interface (GstElement *element,
|
|||
{
|
||||
if (G_TYPE_CHECK_INSTANCE_TYPE (G_OBJECT (element),
|
||||
iface_type)) {
|
||||
GstInterface *iface;
|
||||
GstInterfaceClass *ifclass;
|
||||
GstImplementsInterface *iface;
|
||||
GstImplementsInterfaceClass *ifclass;
|
||||
|
||||
iface = G_TYPE_CHECK_INSTANCE_CAST (G_OBJECT (element),
|
||||
iface_type, GstInterface);
|
||||
ifclass = GST_INTERFACE_GET_CLASS (iface);
|
||||
iface_type, GstImplementsInterface);
|
||||
ifclass = GST_IMPLEMENTS_INTERFACE_GET_CLASS (iface);
|
||||
|
||||
if (ifclass->supported != NULL &&
|
||||
ifclass->supported (iface, iface_type) == TRUE) {
|
||||
|
@ -110,7 +112,7 @@ gst_element_implements_interface (GstElement *element,
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_interface_cast:
|
||||
* gst_implements_interface_cast:
|
||||
* @from: the object (any sort) from which to cast to the interface
|
||||
* @type: the interface type to cast to
|
||||
*
|
||||
|
@ -118,15 +120,15 @@ gst_element_implements_interface (GstElement *element,
|
|||
* interface is supported for this specific instance.
|
||||
*/
|
||||
|
||||
GstInterface *
|
||||
gst_interface_cast (gpointer from,
|
||||
gpointer
|
||||
gst_implements_interface_cast (gpointer from,
|
||||
GType iface_type)
|
||||
{
|
||||
GstInterface *iface;
|
||||
GstImplementsInterface *iface;
|
||||
|
||||
/* check cast, give warning+fail if it's invalid */
|
||||
if (!(iface = G_TYPE_CHECK_INSTANCE_CAST (from, iface_type,
|
||||
GstInterface))) {
|
||||
GstImplementsInterface))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -142,7 +144,7 @@ gst_interface_cast (gpointer from,
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_interface_cast:
|
||||
* gst_implements_interface_cast:
|
||||
* @from: the object (any sort) from which to check from for the interface
|
||||
* @type: the interface type to check for
|
||||
*
|
||||
|
@ -151,17 +153,17 @@ gst_interface_cast (gpointer from,
|
|||
*/
|
||||
|
||||
gboolean
|
||||
gst_interface_check (gpointer from,
|
||||
gst_implements_interface_check (gpointer from,
|
||||
GType type)
|
||||
{
|
||||
GstInterface *iface;
|
||||
GstImplementsInterface *iface;
|
||||
|
||||
/* check cast, return FALSE if it fails, don't give a warning... */
|
||||
if (!G_TYPE_CHECK_INSTANCE_TYPE (from, type)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
iface = G_TYPE_CHECK_INSTANCE_CAST (from, type, GstInterface);
|
||||
iface = G_TYPE_CHECK_INSTANCE_CAST (from, type, GstImplementsInterface);
|
||||
|
||||
/* now, if we're an element (or derivative), is this thing
|
||||
* actually implemented for real? */
|
||||
|
|
|
@ -20,57 +20,60 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_INTERFACE_H__
|
||||
#define __GST_INTERFACE_H__
|
||||
#ifndef __GST_IMPLEMENTS_INTERFACE_H__
|
||||
#define __GST_IMPLEMENTS_INTERFACE_H__
|
||||
|
||||
#include <gst/gstelement.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_INTERFACE \
|
||||
(gst_interface_get_type ())
|
||||
#define GST_INTERFACE(obj) \
|
||||
(GST_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_INTERFACE, GstInterface))
|
||||
#define GST_INTERFACE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_INTERFACE, GstInterfaceClass))
|
||||
#define GST_IS_INTERFACE(obj) \
|
||||
(GST_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_INTERFACE))
|
||||
#define GST_IS_INTERFACE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_INTERFACE))
|
||||
#define GST_INTERFACE_GET_CLASS(inst) \
|
||||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_INTERFACE, GstInterfaceClass))
|
||||
#define GST_TYPE_IMPLEMENTS_INTERFACE \
|
||||
(gst_implements_interface_get_type ())
|
||||
#define GST_IMPLEMENTS_INTERFACE(obj) \
|
||||
(GST_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_IMPLEMENTS_INTERFACE, \
|
||||
GstImplementsInterface))
|
||||
#define GST_IMPLEMENTS_INTERFACE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_IMPLEMENTS_INTERFACE, \
|
||||
GstImplementsInterfaceClass))
|
||||
#define GST_IS_IMPLEMENTS_INTERFACE(obj) \
|
||||
(GST_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_IMPLEMENTS_INTERFACE))
|
||||
#define GST_IS_IMPLEMENTS_INTERFACE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_IMPLEMENTS_INTERFACE))
|
||||
#define GST_IMPLEMENTS_INTERFACE_GET_CLASS(inst) \
|
||||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_IMPLEMENTS_INTERFACE, \
|
||||
GstImplementsInterfaceClass))
|
||||
|
||||
typedef struct _GstInterface GstInterface;
|
||||
typedef struct _GstImplementsInterface GstImplementsInterface;
|
||||
|
||||
/* This small extra virtual function is here to provide an
|
||||
* interface functionality on a per-instance basis rather
|
||||
* than a per-class basis, which is the case for glib.
|
||||
*/
|
||||
typedef struct _GstInterfaceClass {
|
||||
typedef struct _GstImplementsInterfaceClass {
|
||||
GTypeInterface parent;
|
||||
|
||||
/* virtual functions */
|
||||
gboolean (* supported) (GstInterface *iface,
|
||||
gboolean (* supported) (GstImplementsInterface *iface,
|
||||
GType iface_type);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
} GstInterfaceClass;
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
} GstImplementsInterfaceClass;
|
||||
|
||||
#define GST_INTERFACE_CHECK_INSTANCE_CAST(obj, type, cast_t) \
|
||||
((cast_t *) gst_interface_cast ((obj), (type)))
|
||||
#define GST_INTERFACE_CHECK_INSTANCE_TYPE(obj, type) \
|
||||
(gst_interface_check ((obj), (type)))
|
||||
#define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST(obj, type, cast_t) \
|
||||
((cast_t *) gst_implements_interface_cast ((obj), (type)))
|
||||
#define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE(obj, type) \
|
||||
(gst_implements_interface_check ((obj), (type)))
|
||||
|
||||
GType gst_interface_get_type (void);
|
||||
GType gst_implements_interface_get_type (void);
|
||||
|
||||
/* wrapper functions to check for functionality implementation */
|
||||
gboolean gst_element_implements_interface(GstElement *element,
|
||||
gboolean gst_element_implements_interface (GstElement *element,
|
||||
GType iface_type);
|
||||
GstInterface * gst_interface_cast (gpointer from,
|
||||
gpointer gst_implements_interface_cast (gpointer from,
|
||||
GType type);
|
||||
gboolean gst_interface_check (gpointer from,
|
||||
gboolean gst_implements_interface_check (gpointer from,
|
||||
GType type);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_INTERFACE_H__ */
|
||||
#endif /* __GST_IMPLEMENTS_INTERFACE_H__ */
|
||||
|
|
|
@ -39,17 +39,8 @@ extern GType _gst_object_type;
|
|||
#define GST_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_OBJECT))
|
||||
#define GST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_OBJECT))
|
||||
#define GST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_OBJECT, GstObjectClass))
|
||||
|
||||
#define GST_OBJECT_CAST(obj) ((GstObject*)(obj))
|
||||
#define GST_OBJECT_CLASS_CAST(klass) ((GstObjectClass*)(klass))
|
||||
|
||||
#ifdef GST_TYPE_PARANOID
|
||||
# define GST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_OBJECT, GstObject))
|
||||
# define GST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_OBJECT, GstObjectClass))
|
||||
#else
|
||||
# define GST_OBJECT GST_OBJECT_CAST
|
||||
# define GST_OBJECT_CLASS GST_OBJECT_CLASS_CAST
|
||||
#endif
|
||||
#define GST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_OBJECT, GstObject))
|
||||
#define GST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_OBJECT, GstObjectClass))
|
||||
|
||||
/* make sure we don't change the object size but stil make it compile
|
||||
* without libxml */
|
||||
|
@ -77,7 +68,7 @@ struct _GstObject {
|
|||
|
||||
guint32 flags;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* signal_object is used to signal to the whole class */
|
||||
|
@ -99,10 +90,10 @@ struct _GstObjectClass {
|
|||
xmlNodePtr (*save_thyself) (GstObject *object, xmlNodePtr parent);
|
||||
void (*restore_thyself) (GstObject *object, xmlNodePtr self);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
#define GST_FLAGS(obj) (GST_OBJECT_CAST (obj)->flags)
|
||||
#define GST_FLAGS(obj) (GST_OBJECT (obj)->flags)
|
||||
#define GST_FLAG_IS_SET(obj,flag) (GST_FLAGS (obj) & (1<<(flag)))
|
||||
#define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (1<<(flag))); }G_STMT_END
|
||||
#define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(1<<(flag))); }G_STMT_END
|
||||
|
@ -114,10 +105,10 @@ struct _GstObjectClass {
|
|||
#define GST_OBJECT_FLOATING(obj) (GST_FLAG_IS_SET (obj, GST_FLOATING))
|
||||
|
||||
/* CR1: object locking - GObject 2.0 doesn't have threadsafe locking */
|
||||
#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT_CAST(obj)->lock))
|
||||
#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CAST(obj)->lock))
|
||||
#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CAST(obj)->lock))
|
||||
#define GST_GET_LOCK(obj) (GST_OBJECT_CAST(obj)->lock)
|
||||
#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT(obj)->lock))
|
||||
#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT(obj)->lock))
|
||||
#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT(obj)->lock))
|
||||
#define GST_GET_LOCK(obj) (GST_OBJECT(obj)->lock)
|
||||
|
||||
|
||||
/* normal GObject stuff */
|
||||
|
|
89
gst/gstpad.c
89
gst/gstpad.c
|
@ -565,7 +565,7 @@ gst_pad_get_event_masks (GstPad *pad)
|
|||
g_return_val_if_fail (rpad, FALSE);
|
||||
|
||||
if (GST_RPAD_EVENTMASKFUNC (rpad))
|
||||
return GST_RPAD_EVENTMASKFUNC (rpad) (GST_PAD_CAST (pad));
|
||||
return GST_RPAD_EVENTMASKFUNC (rpad) (GST_PAD (pad));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ gst_pad_get_query_types (GstPad *pad)
|
|||
g_return_val_if_fail (rpad, FALSE);
|
||||
|
||||
if (GST_RPAD_QUERYTYPEFUNC (rpad))
|
||||
return GST_RPAD_QUERYTYPEFUNC (rpad) (GST_PAD_CAST (pad));
|
||||
return GST_RPAD_QUERYTYPEFUNC (rpad) (GST_PAD (pad));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -888,15 +888,15 @@ gst_pad_unlink (GstPad *srcpad,
|
|||
(GST_RPAD_DIRECTION (realsink) == GST_PAD_SINK));
|
||||
|
||||
if (GST_RPAD_UNLINKFUNC (realsrc)) {
|
||||
GST_RPAD_UNLINKFUNC (realsrc) (GST_PAD_CAST (realsrc));
|
||||
GST_RPAD_UNLINKFUNC (realsrc) (GST_PAD (realsrc));
|
||||
}
|
||||
if (GST_RPAD_UNLINKFUNC (realsink)) {
|
||||
GST_RPAD_UNLINKFUNC (realsink) (GST_PAD_CAST (realsink));
|
||||
GST_RPAD_UNLINKFUNC (realsink) (GST_PAD (realsink));
|
||||
}
|
||||
|
||||
/* get the schedulers before we unlink */
|
||||
src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc));
|
||||
sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink));
|
||||
src_sched = gst_pad_get_scheduler (GST_PAD (realsrc));
|
||||
sink_sched = gst_pad_get_scheduler (GST_PAD (realsink));
|
||||
|
||||
/* first clear peers */
|
||||
GST_RPAD_PEER (realsrc) = NULL;
|
||||
|
@ -905,8 +905,8 @@ gst_pad_unlink (GstPad *srcpad,
|
|||
/* now tell the scheduler */
|
||||
if (src_sched && src_sched == sink_sched) {
|
||||
gst_scheduler_pad_unlink (src_sched,
|
||||
GST_PAD_CAST (realsrc),
|
||||
GST_PAD_CAST (realsink));
|
||||
GST_PAD (realsrc),
|
||||
GST_PAD (realsink));
|
||||
}
|
||||
|
||||
/* hold a reference, as they can go away in the signal handlers */
|
||||
|
@ -933,8 +933,8 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink)
|
|||
GstScheduler *src_sched, *sink_sched;
|
||||
gint num_decoupled = 0;
|
||||
|
||||
src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc));
|
||||
sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink));
|
||||
src_sched = gst_pad_get_scheduler (GST_PAD (realsrc));
|
||||
sink_sched = gst_pad_get_scheduler (GST_PAD (realsink));
|
||||
|
||||
if (src_sched && sink_sched) {
|
||||
if (GST_FLAG_IS_SET (GST_PAD_PARENT (realsrc), GST_ELEMENT_DECOUPLED))
|
||||
|
@ -1115,13 +1115,13 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad,
|
|||
g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_LINKED],
|
||||
0, realsrc);
|
||||
|
||||
src_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsrc));
|
||||
sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (realsink));
|
||||
src_sched = gst_pad_get_scheduler (GST_PAD (realsrc));
|
||||
sink_sched = gst_pad_get_scheduler (GST_PAD (realsink));
|
||||
|
||||
/* now tell the scheduler */
|
||||
if (src_sched && src_sched == sink_sched) {
|
||||
gst_scheduler_pad_link (src_sched,
|
||||
GST_PAD_CAST (realsrc), GST_PAD_CAST (realsink));
|
||||
GST_PAD (realsrc), GST_PAD (realsink));
|
||||
}
|
||||
else {
|
||||
GST_CAT_INFO (GST_CAT_PADS, "not telling link to scheduler %s:%s and %s:%s, %p %p",
|
||||
|
@ -1239,7 +1239,7 @@ gst_pad_get_scheduler (GstPad *pad)
|
|||
GstRealPad *peer = GST_RPAD_PEER (pad);
|
||||
|
||||
if (peer) {
|
||||
scheduler = gst_element_get_scheduler (gst_pad_get_parent (GST_PAD_CAST (peer)));
|
||||
scheduler = gst_element_get_scheduler (gst_pad_get_parent (GST_PAD (peer)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1984,11 +1984,11 @@ gst_pad_get_caps (GstPad *pad)
|
|||
GstCaps2 *caps;
|
||||
|
||||
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function");
|
||||
caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad));
|
||||
caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD (realpad));
|
||||
|
||||
if (caps == NULL) {
|
||||
g_critical ("pad %s:%s returned NULL caps from getcaps function\n",
|
||||
GST_ELEMENT_NAME(GST_PAD_PARENT(GST_PAD_CAST(realpad))),
|
||||
GST_ELEMENT_NAME(GST_PAD_PARENT(GST_PAD (realpad))),
|
||||
GST_PAD_NAME(realpad));
|
||||
caps = gst_caps2_new_any ();
|
||||
}
|
||||
|
@ -2477,7 +2477,7 @@ gst_pad_push (GstPad *pad, GstData *data)
|
|||
if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data))
|
||||
return;
|
||||
|
||||
(peer->chainhandler) (GST_PAD_CAST (peer), data);
|
||||
(peer->chainhandler) (GST_PAD (peer), data);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -2531,7 +2531,7 @@ restart:
|
|||
GST_DEBUG_FUNCPTR_NAME (peer->gethandler),
|
||||
GST_DEBUG_PAD_NAME (peer));
|
||||
|
||||
data = (peer->gethandler) (GST_PAD_CAST (peer));
|
||||
data = (peer->gethandler) (GST_PAD (peer));
|
||||
|
||||
if (data) {
|
||||
if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data))
|
||||
|
@ -2555,7 +2555,7 @@ restart:
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_pad_select:
|
||||
* gst_pad_selectv:
|
||||
* @padlist: a #GList of pads.
|
||||
*
|
||||
* Waits for a buffer on any of the list of pads.
|
||||
|
@ -2564,7 +2564,7 @@ restart:
|
|||
* Use #gst_pad_pull() to get the buffer.
|
||||
*/
|
||||
GstPad*
|
||||
gst_pad_select (GList *padlist)
|
||||
gst_pad_selectv (GList *padlist)
|
||||
{
|
||||
GstPad *pad;
|
||||
|
||||
|
@ -2574,7 +2574,7 @@ gst_pad_select (GList *padlist)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_pad_selectv:
|
||||
* gst_pad_select:
|
||||
* @pad: a first #GstPad to perform the select on.
|
||||
* @...: A NULL-terminated list of more pads to select on.
|
||||
*
|
||||
|
@ -2584,10 +2584,9 @@ gst_pad_select (GList *padlist)
|
|||
* Use #gst_pad_pull() to get the buffer.
|
||||
*/
|
||||
GstPad*
|
||||
gst_pad_selectv (GstPad *pad, ...)
|
||||
gst_pad_select (GstPad *pad, ...)
|
||||
{
|
||||
GstPad *result;
|
||||
GList *padlist = NULL;
|
||||
va_list var_args;
|
||||
|
||||
if (pad == NULL)
|
||||
|
@ -2595,15 +2594,39 @@ gst_pad_selectv (GstPad *pad, ...)
|
|||
|
||||
va_start (var_args, pad);
|
||||
|
||||
result = gst_pad_select_valist (pad, var_args);
|
||||
|
||||
va_end (var_args);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_select_valist:
|
||||
* @pad: a first #GstPad to perform the select on.
|
||||
* @varargs: A va_list of more pads to select on.
|
||||
*
|
||||
* Waits for a buffer on the given set of pads.
|
||||
*
|
||||
* Returns: the #GstPad that has a buffer available.
|
||||
* Use #gst_pad_pull() to get the buffer.
|
||||
*/
|
||||
GstPad*
|
||||
gst_pad_select_valist (GstPad *pad, va_list var_args)
|
||||
{
|
||||
GstPad *result;
|
||||
GList *padlist = NULL;
|
||||
|
||||
if (pad == NULL)
|
||||
return NULL;
|
||||
|
||||
while (pad) {
|
||||
padlist = g_list_prepend (padlist, pad);
|
||||
pad = va_arg (var_args, GstPad *);
|
||||
}
|
||||
result = gst_pad_select (padlist);
|
||||
result = gst_pad_selectv (padlist);
|
||||
g_list_free (padlist);
|
||||
|
||||
va_end (var_args);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -2990,7 +3013,7 @@ gst_pad_get_internal_links (GstPad *pad)
|
|||
rpad = GST_PAD_REALIZE (pad);
|
||||
|
||||
if (GST_RPAD_INTLINKFUNC (rpad))
|
||||
res = GST_RPAD_INTLINKFUNC (rpad) (GST_PAD_CAST (rpad));
|
||||
res = GST_RPAD_INTLINKFUNC (rpad) (GST_PAD (rpad));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -3016,7 +3039,7 @@ gst_pad_event_default_dispatch (GstPad *pad, GstElement *element,
|
|||
gst_pad_push (eventpad, GST_DATA (event));
|
||||
}
|
||||
else {
|
||||
GstPad *peerpad = GST_PAD_CAST (GST_RPAD_PEER (eventpad));
|
||||
GstPad *peerpad = GST_PAD (GST_RPAD_PEER (eventpad));
|
||||
|
||||
/* we only send the event on one pad, multi-sinkpad elements
|
||||
* should implement a handler */
|
||||
|
@ -3101,7 +3124,7 @@ gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
|
|||
GstRealPad *int_peer = GST_RPAD_PEER (int_rpad);
|
||||
|
||||
if (int_peer) {
|
||||
res = dispatch (GST_PAD_CAST (int_peer), data);
|
||||
res = dispatch (GST_PAD (int_peer), data);
|
||||
if (res)
|
||||
break;
|
||||
}
|
||||
|
@ -3140,7 +3163,7 @@ gst_pad_send_event (GstPad *pad, GstEvent *event)
|
|||
GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (rpad));
|
||||
|
||||
if (GST_RPAD_EVENTHANDLER (rpad))
|
||||
success = GST_RPAD_EVENTHANDLER (rpad) (GST_PAD_CAST (rpad), event);
|
||||
success = GST_RPAD_EVENTHANDLER (rpad) (GST_PAD (rpad), event);
|
||||
else {
|
||||
g_warning ("pad %s:%s has no event handler", GST_DEBUG_PAD_NAME (rpad));
|
||||
gst_event_unref (event);
|
||||
|
@ -3230,7 +3253,7 @@ gst_pad_convert (GstPad *pad,
|
|||
rpad = GST_PAD_REALIZE (pad);
|
||||
|
||||
if (GST_RPAD_CONVERTFUNC (rpad)) {
|
||||
return GST_RPAD_CONVERTFUNC (rpad) (GST_PAD_CAST (rpad), src_format,
|
||||
return GST_RPAD_CONVERTFUNC (rpad) (GST_PAD (rpad), src_format,
|
||||
src_value, dest_format, dest_value);
|
||||
}
|
||||
|
||||
|
@ -3309,7 +3332,7 @@ gst_pad_query (GstPad *pad, GstQueryType type,
|
|||
g_return_val_if_fail (rpad, FALSE);
|
||||
|
||||
if (GST_RPAD_QUERYFUNC (rpad))
|
||||
return GST_RPAD_QUERYFUNC (rpad) (GST_PAD_CAST (pad), type, format, value);
|
||||
return GST_RPAD_QUERYFUNC (rpad) (GST_PAD (pad), type, format, value);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -3359,7 +3382,7 @@ gst_pad_get_formats (GstPad *pad)
|
|||
rpad = GST_PAD_REALIZE (pad);
|
||||
|
||||
if (GST_RPAD_FORMATSFUNC (rpad))
|
||||
return GST_RPAD_FORMATSFUNC (rpad) (GST_PAD_CAST (pad));
|
||||
return GST_RPAD_FORMATSFUNC (rpad) (GST_PAD (pad));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
64
gst/gstpad.h
64
gst/gstpad.h
|
@ -40,65 +40,36 @@ extern GType _gst_pad_type;
|
|||
extern GType _gst_real_pad_type;
|
||||
extern GType _gst_ghost_pad_type;
|
||||
|
||||
#define GST_TYPE_PARANOID
|
||||
|
||||
/*
|
||||
* Pad base class
|
||||
*/
|
||||
#define GST_TYPE_PAD (_gst_pad_type)
|
||||
|
||||
#define GST_PAD_CAST(obj) ((GstPad*)(obj))
|
||||
#define GST_PAD_CLASS_CAST(klass) ((GstPadClass*)(klass))
|
||||
#define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
|
||||
#define GST_IS_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD || \
|
||||
G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
|
||||
#define GST_IS_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
|
||||
|
||||
#ifdef GST_TYPE_PARANOID
|
||||
# define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
|
||||
# define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
|
||||
#else
|
||||
# define GST_PAD GST_PAD_CAST
|
||||
# define GST_PAD_CLASS GST_PAD_CLASS_CAST
|
||||
#endif
|
||||
#define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
|
||||
#define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
|
||||
|
||||
/*
|
||||
* Real Pads
|
||||
*/
|
||||
#define GST_TYPE_REAL_PAD (_gst_real_pad_type)
|
||||
|
||||
#define GST_REAL_PAD_CAST(obj) ((GstRealPad*)(obj))
|
||||
#define GST_REAL_PAD_CLASS_CAST(klass) ((GstRealPadClass*)(klass))
|
||||
#define GST_IS_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REAL_PAD))
|
||||
#define GST_IS_REAL_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD)
|
||||
#define GST_IS_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD))
|
||||
|
||||
#ifdef GST_TYPE_PARANOID
|
||||
# define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad))
|
||||
# define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass))
|
||||
#else
|
||||
# define GST_REAL_PAD GST_REAL_PAD_CAST
|
||||
# define GST_REAL_PAD_CLASS GST_REAL_PAD_CLASS_CAST
|
||||
#endif
|
||||
#define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad))
|
||||
#define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass))
|
||||
|
||||
/*
|
||||
* Ghost Pads
|
||||
*/
|
||||
#define GST_TYPE_GHOST_PAD (_gst_ghost_pad_type)
|
||||
|
||||
#define GST_GHOST_PAD_CAST(obj) ((GstGhostPad*)(obj))
|
||||
#define GST_GHOST_PAD_CLASS_CAST(klass) ((GstGhostPadClass*)(klass))
|
||||
#define GST_IS_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD))
|
||||
#define GST_IS_GHOST_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
|
||||
#define GST_IS_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
|
||||
|
||||
#ifdef GST_TYPE_PARANOID
|
||||
# define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad))
|
||||
# define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass))
|
||||
#else
|
||||
# define GST_GHOST_PAD GST_GHOST_PAD_CAST
|
||||
# define GST_GHOST_PAD_CLASS GST_GHOST_PAD_CLASS_CAST
|
||||
#endif
|
||||
#define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad))
|
||||
#define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass))
|
||||
|
||||
|
||||
/*typedef struct _GstPad GstPad; */
|
||||
|
@ -175,13 +146,13 @@ struct _GstPad {
|
|||
|
||||
GstPadTemplate *padtemplate; /* the template for this pad */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstPadClass {
|
||||
GstObjectClass parent_class;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstRealPad {
|
||||
|
@ -224,7 +195,7 @@ struct _GstRealPad {
|
|||
|
||||
GstProbeDispatcher probedisp;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstRealPadClass {
|
||||
|
@ -236,7 +207,7 @@ struct _GstRealPadClass {
|
|||
void (*linked) (GstPad *pad, GstPad *peer);
|
||||
void (*unlinked) (GstPad *pad, GstPad *peer);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstGhostPad {
|
||||
|
@ -244,13 +215,13 @@ struct _GstGhostPad {
|
|||
|
||||
GstRealPad *realpad;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstGhostPadClass {
|
||||
GstPadClass parent_class;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
|
||||
|
@ -292,7 +263,7 @@ struct _GstGhostPadClass {
|
|||
#define GST_PAD_REALIZE(pad) (GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad))
|
||||
#define GST_PAD_DIRECTION(pad) GST_RPAD_DIRECTION(GST_PAD_REALIZE(pad))
|
||||
#define GST_PAD_CAPS(pad) GST_RPAD_CAPS(GST_PAD_REALIZE(pad))
|
||||
#define GST_PAD_PEER(pad) GST_PAD_CAST(GST_RPAD_PEER(GST_PAD_REALIZE(pad)))
|
||||
#define GST_PAD_PEER(pad) GST_PAD(GST_RPAD_PEER(GST_PAD_REALIZE(pad)))
|
||||
|
||||
/* Some check functions (unused?) */
|
||||
#define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
|
||||
|
@ -337,7 +308,7 @@ struct _GstPadTemplate {
|
|||
GstPadPresence presence;
|
||||
GstCaps2 *caps;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstPadTemplateClass {
|
||||
|
@ -346,7 +317,7 @@ struct _GstPadTemplateClass {
|
|||
/* signal callbacks */
|
||||
void (*pad_created) (GstPadTemplate *templ, GstPad *pad);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstStaticPadTemplate {
|
||||
|
@ -445,8 +416,9 @@ void gst_pad_push (GstPad *pad, GstData *data);
|
|||
GstData* gst_pad_pull (GstPad *pad);
|
||||
gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
|
||||
gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
|
||||
GstPad* gst_pad_select (GList *padlist);
|
||||
GstPad* gst_pad_selectv (GstPad *pad, ...);
|
||||
GstPad* gst_pad_selectv (GList *padlist);
|
||||
GstPad* gst_pad_select (GstPad *pad, ...);
|
||||
GstPad* gst_pad_select_valist (GstPad *pad, va_list varargs);
|
||||
|
||||
|
||||
/* convert/query/format functions */
|
||||
|
|
|
@ -41,13 +41,13 @@ typedef struct _GstPipelineClass GstPipelineClass;
|
|||
struct _GstPipeline {
|
||||
GstBin bin;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstPipelineClass {
|
||||
GstBinClass parent_class;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_pipeline_get_type (void);
|
||||
|
|
104
gst/gstplugin.c
104
gst/gstplugin.c
|
@ -24,6 +24,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "gst_private.h"
|
||||
|
||||
|
@ -39,6 +40,11 @@
|
|||
static GModule *main_module = NULL;
|
||||
static GList *_gst_plugin_static = NULL;
|
||||
|
||||
/* static variables for segfault handling of plugin loading */
|
||||
static char *_gst_plugin_fault_handler_filename = NULL;
|
||||
extern gboolean *_gst_disable_segtrap; /* see gst.c */
|
||||
static gboolean *_gst_plugin_fault_handler_is_setup = FALSE;
|
||||
|
||||
/* list of valid licenses.
|
||||
* One of these must be specified or the plugin won't be loaded
|
||||
* Contact gstreamer-devel@lists.sourceforge.net if your license should be
|
||||
|
@ -168,7 +174,7 @@ gst_plugin_register_func (GstPlugin *plugin, GModule *module, GstPluginDesc *des
|
|||
}
|
||||
|
||||
if (!desc->license || !desc->description || !desc->package ||
|
||||
!desc->copyright || !desc->origin) {
|
||||
!desc->origin) {
|
||||
if (GST_CAT_DEFAULT) GST_INFO ("plugin \"%s\" has incorrect GstPluginDesc, not loading",
|
||||
plugin->filename);
|
||||
return FALSE;
|
||||
|
@ -194,6 +200,71 @@ gst_plugin_register_func (GstPlugin *plugin, GModule *module, GstPluginDesc *des
|
|||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* _gst_plugin_fault_handler_restore:
|
||||
* segfault handler restorer
|
||||
*/
|
||||
static void
|
||||
_gst_plugin_fault_handler_restore (void)
|
||||
{
|
||||
struct sigaction action;
|
||||
|
||||
memset (&action, 0, sizeof (action));
|
||||
action.sa_handler = SIG_DFL;
|
||||
|
||||
sigaction (SIGSEGV, &action, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* _gst_plugin_fault_handler_sighandler:
|
||||
* segfault handler implementation
|
||||
*/
|
||||
static void
|
||||
_gst_plugin_fault_handler_sighandler (int signum)
|
||||
{
|
||||
/* We need to restore the fault handler or we'll keep getting it */
|
||||
_gst_plugin_fault_handler_restore ();
|
||||
|
||||
switch (signum)
|
||||
{
|
||||
case SIGSEGV:
|
||||
g_print ("\nERROR: ");
|
||||
g_print ("Caught a segmentation fault while loading plugin file:\n");
|
||||
g_print ("%s\n\n", _gst_plugin_fault_handler_filename);
|
||||
g_print ("Please either:\n");
|
||||
g_print ("- remove it and restart.\n");
|
||||
g_print ("- run with --gst-disable-segtrap and debug.\n");
|
||||
exit (-1);
|
||||
break;
|
||||
default:
|
||||
g_print ("Caught unhandled signal on plugin loading\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _gst_plugin_fault_handler_setup:
|
||||
* sets up the segfault handler
|
||||
*/
|
||||
static void
|
||||
_gst_plugin_fault_handler_setup (void)
|
||||
{
|
||||
struct sigaction action;
|
||||
|
||||
/* if asked to leave segfaults alone, just return */
|
||||
if (_gst_disable_segtrap) return;
|
||||
|
||||
if (_gst_plugin_fault_handler_is_setup) return;
|
||||
|
||||
memset (&action, 0, sizeof (action));
|
||||
action.sa_handler = _gst_plugin_fault_handler_sighandler;
|
||||
|
||||
sigaction (SIGSEGV, &action, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_gst_plugin_fault_handler_setup ();
|
||||
|
||||
/**
|
||||
* gst_plugin_load_file:
|
||||
* @plugin: The plugin to load
|
||||
|
@ -201,7 +272,7 @@ gst_plugin_register_func (GstPlugin *plugin, GModule *module, GstPluginDesc *des
|
|||
*
|
||||
* Load the given plugin.
|
||||
*
|
||||
* Returns: a new GstPlugin or NULL, if an error occured
|
||||
* Returns: a new GstPlugin or NULL, if an error occurred.
|
||||
*/
|
||||
GstPlugin *
|
||||
gst_plugin_load_file (const gchar *filename, GError **error)
|
||||
|
@ -230,7 +301,7 @@ gst_plugin_load_file (const gchar *filename, GError **error)
|
|||
GST_PLUGIN_ERROR_MODULE,
|
||||
"Problem opening file %s\n",
|
||||
filename);
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
module = g_module_open (filename, G_MODULE_BIND_LAZY);
|
||||
|
@ -278,10 +349,19 @@ gst_plugin_load_file (const gchar *filename, GError **error)
|
|||
desc->name);
|
||||
}
|
||||
|
||||
/* this is where we load the actual .so, so let's trap SIGSEGV */
|
||||
_gst_plugin_fault_handler_setup ();
|
||||
_gst_plugin_fault_handler_filename = plugin->filename;
|
||||
|
||||
if (gst_plugin_register_func (plugin, module, desc)) {
|
||||
/* remove signal handler */
|
||||
_gst_plugin_fault_handler_restore ();
|
||||
_gst_plugin_fault_handler_filename = NULL;
|
||||
GST_INFO ("plugin \"%s\" loaded", plugin->filename);
|
||||
return plugin;
|
||||
} else {
|
||||
/* remove signal handler */
|
||||
_gst_plugin_fault_handler_restore ();
|
||||
GST_DEBUG ("gst_plugin_register_func failed for plugin \"%s\"", filename);
|
||||
/* plugin == NULL */
|
||||
g_set_error (error,
|
||||
|
@ -327,8 +407,6 @@ gst_plugin_desc_copy (GstPluginDesc *dest, const GstPluginDesc *src)
|
|||
dest->version = g_strdup (src->version);
|
||||
g_free (dest->license);
|
||||
dest->license = g_strdup (src->license);
|
||||
g_free (dest->copyright);
|
||||
dest->copyright = g_strdup (src->copyright);
|
||||
g_free (dest->package);
|
||||
dest->package = g_strdup (src->package);
|
||||
g_free (dest->origin);
|
||||
|
@ -343,7 +421,6 @@ gst_plugin_desc_free (GstPluginDesc *desc)
|
|||
g_free (desc->description);
|
||||
g_free (desc->version);
|
||||
g_free (desc->license);
|
||||
g_free (desc->copyright);
|
||||
g_free (desc->package);
|
||||
g_free (desc->origin);
|
||||
|
||||
|
@ -439,21 +516,6 @@ gst_plugin_get_license (GstPlugin *plugin)
|
|||
|
||||
return plugin->desc.license;
|
||||
}
|
||||
/**
|
||||
* gst_plugin_get_copyright:
|
||||
* @plugin: plugin to get the copyright of
|
||||
*
|
||||
* get the informal copyright notice of the plugin
|
||||
*
|
||||
* Returns: the copyright of the plugin
|
||||
*/
|
||||
G_CONST_RETURN gchar*
|
||||
gst_plugin_get_copyright (GstPlugin *plugin)
|
||||
{
|
||||
g_return_val_if_fail (plugin != NULL, NULL);
|
||||
|
||||
return plugin->desc.copyright;
|
||||
}
|
||||
/**
|
||||
* gst_plugin_get_package:
|
||||
* @plugin: plugin to get the package of
|
||||
|
|
|
@ -61,11 +61,10 @@ struct _GstPluginDesc {
|
|||
GstPluginExitFunc plugin_exit; /* pointer to exiting function */
|
||||
gchar *version; /* version of the plugin */
|
||||
gchar *license; /* effective license of plugin */
|
||||
gchar *copyright; /* informal copyright notice */
|
||||
gchar *package; /* package plugin belongs to */
|
||||
gchar *origin; /* URL to provider of plugin */
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstPlugin {
|
||||
|
@ -78,10 +77,10 @@ struct _GstPlugin {
|
|||
gpointer manager; /* managing registry */
|
||||
GModule * module; /* contains the module if the plugin is loaded */
|
||||
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,copyright,package,origin) \
|
||||
#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin) \
|
||||
GstPluginDesc gst_plugin_desc = { \
|
||||
major, \
|
||||
minor, \
|
||||
|
@ -91,13 +90,12 @@ GstPluginDesc gst_plugin_desc = { \
|
|||
NULL, \
|
||||
version, \
|
||||
license, \
|
||||
copyright, \
|
||||
package, \
|
||||
origin, \
|
||||
GST_STRUCT_PADDING_INIT \
|
||||
GST_PADDING_INIT \
|
||||
};
|
||||
|
||||
#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,copyright,package,origin) \
|
||||
#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) \
|
||||
{ \
|
||||
|
@ -110,10 +108,9 @@ _gst_plugin_static_init__ ##init (void) \
|
|||
NULL, \
|
||||
version, \
|
||||
license, \
|
||||
copyright, \
|
||||
package, \
|
||||
origin, \
|
||||
GST_STRUCT_PADDING_INIT \
|
||||
GST_PADDING_INIT \
|
||||
}; \
|
||||
_gst_plugin_register_static (&plugin_desc_); \
|
||||
}
|
||||
|
@ -135,7 +132,6 @@ void gst_plugin_set_name (GstPlugin *plugin, const gchar *name);
|
|||
G_CONST_RETURN gchar* gst_plugin_get_longname (GstPlugin *plugin);
|
||||
G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin);
|
||||
G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin);
|
||||
G_CONST_RETURN gchar* gst_plugin_get_copyright (GstPlugin *plugin);
|
||||
G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);
|
||||
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
|
||||
GModule * gst_plugin_get_module (GstPlugin *plugin);
|
||||
|
|
|
@ -50,7 +50,7 @@ struct _GstPluginFeature {
|
|||
|
||||
gpointer manager;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstPluginFeatureClass {
|
||||
|
@ -58,7 +58,7 @@ struct _GstPluginFeatureClass {
|
|||
|
||||
void (*unload_thyself) (GstPluginFeature *feature);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
903
gst/gstqueue.c
903
gst/gstqueue.c
File diff suppressed because it is too large
Load diff
|
@ -56,43 +56,51 @@ struct _GstQueue {
|
|||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
|
||||
/* the queue of buffers we're keeping our grubby hands on */
|
||||
/* the queue of data we're keeping our grubby hands on */
|
||||
GQueue *queue;
|
||||
|
||||
guint level_buffers; /* number of buffers queued here */
|
||||
guint level_bytes; /* number of bytes queued here */
|
||||
guint64 level_time; /* amount of time queued here */
|
||||
struct {
|
||||
guint buffers; /* no. of buffers */
|
||||
guint bytes; /* no. of bytes */
|
||||
guint64 time; /* amount of time */
|
||||
} cur_level, /* currently in the queue */
|
||||
max_size, /* max. amount of data allowed in the queue */
|
||||
min_treshold; /* min. amount of data required to wake reader */
|
||||
|
||||
guint size_buffers; /* size of queue in buffers */
|
||||
guint size_bytes; /* size of queue in bytes */
|
||||
guint64 size_time; /* size of queue in time */
|
||||
/* whether we leak data, and at which end */
|
||||
gint leaky;
|
||||
|
||||
/* number of nanoseconds until a blocked queue 'times out'
|
||||
* to receive data and returns a filler event. -1 = disable */
|
||||
guint64 block_timeout;
|
||||
|
||||
/* it the queue should fail on possible deadlocks */
|
||||
gboolean may_deadlock;
|
||||
|
||||
gint leaky; /* whether the queue is leaky, and if so at which end */
|
||||
gint block_timeout; /* microseconds until a blocked queue times out and returns GST_EVENT_FILLER.
|
||||
* A value of -1 will block forever. */
|
||||
guint min_threshold_bytes; /* the minimum number of bytes required before
|
||||
* waking up the reader thread */
|
||||
gboolean may_deadlock; /* it the queue should fail on possible deadlocks */
|
||||
gboolean interrupt;
|
||||
gboolean flush;
|
||||
|
||||
GMutex *qlock; /* lock for queue (vs object lock) */
|
||||
GCond *not_empty; /* signals buffers now available for reading */
|
||||
GCond *not_full; /* signals space now available for writing */
|
||||
GCond *item_add; /* signals buffers now available for reading */
|
||||
GCond *item_del; /* signals space now available for writing */
|
||||
GCond *event_done; /* upstream event signaller */
|
||||
|
||||
GTimeVal *timeval; /* the timeout for the queue locking */
|
||||
GAsyncQueue *events; /* upstream events get decoupled here */
|
||||
GQueue *events; /* upstream events get decoupled here */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstQueueClass {
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* signal callbacks */
|
||||
void (*full) (GstQueue *queue);
|
||||
/* signals - 'running' is called from both sides
|
||||
* which might make it sort of non-useful... */
|
||||
void (*underrun) (GstQueue *queue);
|
||||
void (*running) (GstQueue *queue);
|
||||
void (*overrun) (GstQueue *queue);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_queue_get_type (void);
|
||||
|
|
|
@ -86,7 +86,7 @@ struct _GstRegistry {
|
|||
|
||||
GList *paths;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstRegistryClass {
|
||||
|
@ -105,7 +105,7 @@ struct _GstRegistryClass {
|
|||
/* signals */
|
||||
void (*plugin_added) (GstRegistry *registry, GstPlugin *plugin);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -799,8 +799,14 @@ gst_scheduler_factory_class_init (GstSchedulerFactoryClass *klass)
|
|||
|
||||
factory_parent_class = g_type_class_ref (GST_TYPE_PLUGIN_FEATURE);
|
||||
|
||||
if (!_default_name)
|
||||
if (!_default_name) {
|
||||
if (g_getenv ("GST_SCHEDULER")) {
|
||||
_default_name = g_strdup (g_getenv ("GST_SCHEDULER"));
|
||||
} else {
|
||||
_default_name = g_strdup (GST_SCHEDULER_DEFAULT_NAME);
|
||||
}
|
||||
}
|
||||
g_assert (_default_name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -72,7 +72,7 @@ struct _GstScheduler {
|
|||
|
||||
GList *schedulers;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstSchedulerClass {
|
||||
|
@ -105,7 +105,7 @@ struct _GstSchedulerClass {
|
|||
void (*object_sync) (GstScheduler *sched, GstClock *clock, GstObject *object,
|
||||
GstClockID id);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_scheduler_get_type (void);
|
||||
|
@ -161,13 +161,13 @@ struct _GstSchedulerFactory {
|
|||
gchar *longdesc; /* long description of the scheduler (well, don't overdo it..) */
|
||||
GType type; /* unique GType of the scheduler */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstSchedulerFactoryClass {
|
||||
GstPluginFeatureClass parent;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_scheduler_factory_get_type (void);
|
||||
|
|
|
@ -45,13 +45,13 @@ struct _GstSystemClock {
|
|||
GMutex * mutex;
|
||||
GCond * cond;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstSystemClockClass {
|
||||
GstClockClass parent_class;
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_system_clock_get_type (void);
|
||||
|
|
|
@ -63,7 +63,7 @@ struct _GstThread {
|
|||
GMutex *lock; /* thread lock/condititon pairs */
|
||||
GCond *cond; /* used to control the thread */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstThreadClass {
|
||||
|
@ -72,7 +72,7 @@ struct _GstThreadClass {
|
|||
/* signals */
|
||||
void (*shutdown) (GstThread *thread);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_thread_get_type (void);
|
||||
|
|
|
@ -67,7 +67,7 @@ struct _GstTypeFind {
|
|||
guint64 (* get_length) (gpointer data);
|
||||
|
||||
/* <private> */
|
||||
GST_STRUCT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstTypeFindFactory {
|
||||
|
@ -80,14 +80,14 @@ struct _GstTypeFindFactory {
|
|||
|
||||
gpointer user_data;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstTypeFindFactoryClass {
|
||||
GstPluginFeatureClass parent;
|
||||
/* <private> */
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* typefind function interface */
|
||||
|
|
|
@ -63,11 +63,8 @@ typedef enum {
|
|||
#define GST_RANK_MARGINAL 64
|
||||
#define GST_RANK_NONE 0
|
||||
|
||||
#define GST_STRUCT_PADDING gpointer _gst_reserved[4];
|
||||
#define GST_CLASS_PADDING gpointer _gst_reserved[4];
|
||||
#define GST_OBJECT_PADDING gpointer _gst_reserved[4];
|
||||
|
||||
#define GST_STRUCT_PADDING_INIT {NULL, NULL, NULL, NULL}
|
||||
#define GST_PADDING 4
|
||||
#define GST_PADDING_INIT { 0 }
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ struct _GstURIHandlerInterface {
|
|||
|
||||
/* we might want to add functions here to query features, someone with gnome-vfs knowledge go ahead */
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* general URI functions */
|
||||
|
|
|
@ -49,7 +49,7 @@ struct _GstXML {
|
|||
|
||||
xmlNsPtr ns;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
typedef struct _GstXMLNs GstXMLNs;
|
||||
|
@ -61,7 +61,7 @@ struct _GstXMLClass {
|
|||
void (*object_loaded) (GstXML *xml, GstObject *object, xmlNodePtr self);
|
||||
void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_xml_get_type (void);
|
||||
|
|
|
@ -39,11 +39,10 @@ GST_PLUGIN_DEFINE (
|
|||
GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"gstindexers",
|
||||
"Gstremaer core indexers",
|
||||
"GStreamer core indexers",
|
||||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -42,9 +42,10 @@ _ref {_identifier}"."{_identifier}?
|
|||
_binref {_identifier}[[:space:]]*"."[[:space:]]*"("
|
||||
|
||||
/* links */
|
||||
_capschar ("\\".)|([^[:space:]\;!\.\,\(\)\]\[])
|
||||
_mimechar ([[:alnum:]-])
|
||||
_mimetype ({_mimechar}+"/"{_mimechar}+)|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
|
||||
_capschar ("\\".)|([^[:space:]\;!\,\(\)\]\[])
|
||||
_capsstring {_capschar}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
|
||||
_mimetype ({_capschar}+"/"{_capschar}+)|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
|
||||
_caps {_mimetype}(","[^!]|{_capsstring})*
|
||||
_link ("!"[[:space:]]*{_caps}([[:space:]]*";"[[:space:]]*{_caps})*[[:space:]]*"!")|("!")
|
||||
|
||||
|
|
|
@ -663,9 +663,6 @@ gst_xml_registry_parse_plugin (GMarkupParseContext *context, const gchar *tag, c
|
|||
else if (!strcmp (tag, "version")) {
|
||||
plugin->desc.version = g_strndup (text, text_len);
|
||||
}
|
||||
else if (!strcmp (tag, "copyright")) {
|
||||
plugin->desc.copyright = g_strndup (text, text_len);
|
||||
}
|
||||
else if (!strcmp (tag, "license")) {
|
||||
plugin->desc.license = g_strndup (text, text_len);
|
||||
}
|
||||
|
@ -1220,7 +1217,6 @@ gst_xml_registry_save_plugin (GstXMLRegistry *xmlregistry, GstPlugin *plugin)
|
|||
PUT_ESCAPED ("filename", plugin->filename);
|
||||
PUT_ESCAPED ("version", plugin->desc.version);
|
||||
PUT_ESCAPED ("license", plugin->desc.license);
|
||||
PUT_ESCAPED ("copyright", plugin->desc.copyright);
|
||||
PUT_ESCAPED ("package", plugin->desc.package);
|
||||
PUT_ESCAPED ("origin", plugin->desc.origin);
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ GST_DEBUG_CATEGORY_STATIC(debug_scheduler);
|
|||
|
||||
typedef struct _GstSchedulerChain GstSchedulerChain;
|
||||
|
||||
#define GST_ELEMENT_THREADSTATE(elem) (cothread*) (GST_ELEMENT_CAST (elem)->sched_private)
|
||||
#define GST_RPAD_BUFPEN(pad) (GstData*) (GST_REAL_PAD_CAST(pad)->sched_private)
|
||||
#define GST_ELEMENT_THREADSTATE(elem) (cothread*) (GST_ELEMENT (elem)->sched_private)
|
||||
#define GST_RPAD_BUFPEN(pad) (GstData*) (GST_REAL_PAD(pad)->sched_private)
|
||||
|
||||
#define GST_ELEMENT_COTHREAD_STOPPING GST_ELEMENT_SCHEDULER_PRIVATE1
|
||||
#define GST_ELEMENT_IS_COTHREAD_STOPPING(element) GST_FLAG_IS_SET((element), GST_ELEMENT_COTHREAD_STOPPING)
|
||||
|
@ -74,8 +74,7 @@ struct _GstSchedulerChain {
|
|||
#define GST_IS_BASIC_SCHEDULER_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASIC_SCHEDULER))
|
||||
|
||||
#define GST_BASIC_SCHEDULER_CAST(sched) ((GstBasicScheduler *)(sched))
|
||||
#define SCHED(element) GST_BASIC_SCHEDULER_CAST (GST_ELEMENT_SCHED (element))
|
||||
#define SCHED(element) GST_BASIC_SCHEDULER (GST_ELEMENT_SCHED (element))
|
||||
|
||||
typedef enum {
|
||||
GST_BASIC_SCHEDULER_STATE_NONE,
|
||||
|
@ -273,7 +272,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
@ -281,7 +279,7 @@ GST_PLUGIN_DEFINE (
|
|||
static int
|
||||
gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv)
|
||||
{
|
||||
GstElement *element = GST_ELEMENT_CAST (argv);
|
||||
GstElement *element = GST_ELEMENT (argv);
|
||||
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
|
||||
|
||||
GST_DEBUG("entering loopfunc wrapper of %s", name);
|
||||
|
@ -315,7 +313,7 @@ static int
|
|||
gst_basic_scheduler_chain_wrapper (int argc, char **argv)
|
||||
{
|
||||
GSList *already_iterated = NULL;
|
||||
GstElement *element = GST_ELEMENT_CAST (argv);
|
||||
GstElement *element = GST_ELEMENT (argv);
|
||||
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
|
||||
|
||||
GST_DEBUG ("entered chain wrapper of element %s", name);
|
||||
|
@ -387,7 +385,7 @@ gst_basic_scheduler_chain_wrapper (int argc, char **argv)
|
|||
static int
|
||||
gst_basic_scheduler_src_wrapper (int argc, char **argv)
|
||||
{
|
||||
GstElement *element = GST_ELEMENT_CAST (argv);
|
||||
GstElement *element = GST_ELEMENT (argv);
|
||||
GList *pads;
|
||||
GstRealPad *realpad;
|
||||
GstData *data = NULL;
|
||||
|
@ -402,17 +400,17 @@ gst_basic_scheduler_src_wrapper (int argc, char **argv)
|
|||
if (!GST_IS_REAL_PAD (pads->data))
|
||||
continue;
|
||||
|
||||
realpad = GST_REAL_PAD_CAST (pads->data);
|
||||
realpad = GST_REAL_PAD (pads->data);
|
||||
|
||||
pads = g_list_next (pads);
|
||||
if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SRC && GST_PAD_IS_USABLE (realpad)) {
|
||||
GST_CAT_DEBUG (debug_dataflow, "calling _getfunc for %s:%s", GST_DEBUG_PAD_NAME (realpad));
|
||||
g_return_val_if_fail (GST_RPAD_GETFUNC (realpad) != NULL, 0);
|
||||
data = GST_RPAD_GETFUNC (realpad) (GST_PAD_CAST (realpad));
|
||||
data = GST_RPAD_GETFUNC (realpad) (GST_PAD (realpad));
|
||||
if (data) {
|
||||
GST_CAT_DEBUG (debug_dataflow, "calling gst_pad_push on pad %s:%s %p",
|
||||
GST_DEBUG_PAD_NAME (realpad), data);
|
||||
gst_pad_push (GST_PAD_CAST (realpad), data);
|
||||
gst_pad_push (GST_PAD (realpad), data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -604,7 +602,7 @@ gst_basic_scheduler_cothreaded_chain (GstBin * bin, GstSchedulerChain * chain)
|
|||
while (elements) {
|
||||
gboolean decoupled;
|
||||
|
||||
element = GST_ELEMENT_CAST (elements->data);
|
||||
element = GST_ELEMENT (elements->data);
|
||||
elements = g_list_next (elements);
|
||||
|
||||
decoupled = GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED);
|
||||
|
@ -650,7 +648,7 @@ gst_basic_scheduler_cothreaded_chain (GstBin * bin, GstSchedulerChain * chain)
|
|||
|
||||
peerpad = GST_PAD_PEER (pad);
|
||||
if (peerpad) {
|
||||
GstElement *peerelement = GST_ELEMENT_CAST (GST_PAD_PARENT (peerpad));
|
||||
GstElement *peerelement = GST_ELEMENT (GST_PAD_PARENT (peerpad));
|
||||
gboolean different_sched = (peerelement->sched != GST_SCHEDULER (chain->sched));
|
||||
gboolean peer_decoupled = GST_FLAG_IS_SET (peerelement, GST_ELEMENT_DECOUPLED);
|
||||
|
||||
|
@ -1043,9 +1041,9 @@ static void
|
|||
gst_basic_scheduler_setup (GstScheduler *sched)
|
||||
{
|
||||
/* first create thread context */
|
||||
if (GST_BASIC_SCHEDULER_CAST (sched)->context == NULL) {
|
||||
if (GST_BASIC_SCHEDULER (sched)->context == NULL) {
|
||||
GST_DEBUG ("initializing cothread context");
|
||||
GST_BASIC_SCHEDULER_CAST (sched)->context = do_cothread_context_init ();
|
||||
GST_BASIC_SCHEDULER (sched)->context = do_cothread_context_init ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1053,7 +1051,7 @@ static void
|
|||
gst_basic_scheduler_reset (GstScheduler *sched)
|
||||
{
|
||||
cothread_context *ctx;
|
||||
GList *elements = GST_BASIC_SCHEDULER_CAST (sched)->elements;
|
||||
GList *elements = GST_BASIC_SCHEDULER (sched)->elements;
|
||||
|
||||
while (elements) {
|
||||
GstElement *element = GST_ELEMENT (elements->data);
|
||||
|
@ -1064,11 +1062,11 @@ gst_basic_scheduler_reset (GstScheduler *sched)
|
|||
elements = g_list_next (elements);
|
||||
}
|
||||
|
||||
ctx = GST_BASIC_SCHEDULER_CAST (sched)->context;
|
||||
ctx = GST_BASIC_SCHEDULER (sched)->context;
|
||||
|
||||
do_cothread_context_destroy (ctx);
|
||||
|
||||
GST_BASIC_SCHEDULER_CAST (sched)->context = NULL;
|
||||
GST_BASIC_SCHEDULER (sched)->context = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1262,8 +1260,8 @@ gst_basic_scheduler_pad_unlink (GstScheduler * sched, GstPad * srcpad, GstPad *
|
|||
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
|
||||
|
||||
/* we need to have the parent elements of each pad */
|
||||
element1 = GST_ELEMENT_CAST (GST_PAD_PARENT (srcpad));
|
||||
element2 = GST_ELEMENT_CAST (GST_PAD_PARENT (sinkpad));
|
||||
element1 = GST_ELEMENT (GST_PAD_PARENT (srcpad));
|
||||
element2 = GST_ELEMENT (GST_PAD_PARENT (sinkpad));
|
||||
|
||||
/* first task is to remove the old chain they belonged to.
|
||||
* this can be accomplished by taking either of the elements,
|
||||
|
@ -1391,7 +1389,7 @@ gst_basic_scheduler_iterate (GstScheduler * sched)
|
|||
GST_DEBUG ("there are %d elements in this chain", chain->num_elements);
|
||||
elements = chain->elements;
|
||||
while (elements) {
|
||||
entry = GST_ELEMENT_CAST (elements->data);
|
||||
entry = GST_ELEMENT (elements->data);
|
||||
elements = g_list_next (elements);
|
||||
if (GST_FLAG_IS_SET (entry, GST_ELEMENT_DECOUPLED)) {
|
||||
GST_DEBUG ("entry \"%s\" is DECOUPLED, skipping",
|
||||
|
|
|
@ -36,9 +36,9 @@ GST_DEBUG_CATEGORY_STATIC(debug_scheduler);
|
|||
# define COTHREADS_NAME ""
|
||||
#endif
|
||||
|
||||
#define GST_ELEMENT_SCHED_CONTEXT(elem) ((GstOptSchedulerCtx*) (GST_ELEMENT_CAST (elem)->sched_private))
|
||||
#define GST_ELEMENT_SCHED_CONTEXT(elem) ((GstOptSchedulerCtx*) (GST_ELEMENT (elem)->sched_private))
|
||||
#define GST_ELEMENT_SCHED_GROUP(elem) (GST_ELEMENT_SCHED_CONTEXT (elem)->group)
|
||||
#define GST_PAD_BUFLIST(pad) ((GList*) (GST_REAL_PAD_CAST(pad)->sched_private))
|
||||
#define GST_PAD_BUFLIST(pad) ((GList*) (GST_REAL_PAD(pad)->sched_private))
|
||||
|
||||
#define GST_ELEMENT_COTHREAD_STOPPING GST_ELEMENT_SCHEDULER_PRIVATE1
|
||||
#define GST_ELEMENT_IS_COTHREAD_STOPPING(element) GST_FLAG_IS_SET((element), GST_ELEMENT_COTHREAD_STOPPING)
|
||||
|
@ -59,8 +59,6 @@ typedef struct _GstOptSchedulerClass GstOptSchedulerClass;
|
|||
#define GST_IS_OPT_SCHEDULER_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPT_SCHEDULER))
|
||||
|
||||
#define GST_OPT_SCHEDULER_CAST(sched) ((GstOptScheduler *)(sched))
|
||||
|
||||
typedef enum {
|
||||
GST_OPT_SCHEDULER_STATE_NONE,
|
||||
GST_OPT_SCHEDULER_STATE_STOPPED,
|
||||
|
@ -378,7 +376,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_VERSION,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
);
|
||||
|
@ -954,7 +951,7 @@ get_group_schedule_function (int argc, char *argv[])
|
|||
|
||||
while (pads) {
|
||||
GstData *data;
|
||||
GstPad *pad = GST_PAD_CAST (pads->data);
|
||||
GstPad *pad = GST_PAD (pads->data);
|
||||
pads = g_list_next (pads);
|
||||
|
||||
/* skip sinks and ghostpads */
|
||||
|
@ -1247,7 +1244,7 @@ setup_group_scheduler (GstOptScheduler *osched, GstOptSchedulerGroup *group)
|
|||
static GstElementStateReturn
|
||||
gst_opt_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint transition)
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
GstOptSchedulerGroup *group;
|
||||
GstElementStateReturn res = GST_STATE_SUCCESS;
|
||||
|
||||
|
@ -1477,7 +1474,7 @@ static void
|
|||
gst_opt_scheduler_setup (GstScheduler *sched)
|
||||
{
|
||||
#ifdef USE_COTHREADS
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
|
||||
/* first create thread context */
|
||||
if (osched->context == NULL) {
|
||||
|
@ -1491,7 +1488,7 @@ static void
|
|||
gst_opt_scheduler_reset (GstScheduler *sched)
|
||||
{
|
||||
#ifdef USE_COTHREADS
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
GSList *chains = osched->chains;
|
||||
|
||||
while (chains) {
|
||||
|
@ -1516,7 +1513,7 @@ gst_opt_scheduler_reset (GstScheduler *sched)
|
|||
static void
|
||||
gst_opt_scheduler_add_element (GstScheduler *sched, GstElement *element)
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
GstOptSchedulerCtx *ctx;
|
||||
const GList *pads;
|
||||
|
||||
|
@ -1584,14 +1581,14 @@ gst_opt_scheduler_remove_element (GstScheduler *sched, GstElement *element)
|
|||
static void
|
||||
gst_opt_scheduler_lock_element (GstScheduler *sched, GstElement *element)
|
||||
{
|
||||
//GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
//GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
g_warning ("lock element, implement me");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_opt_scheduler_unlock_element (GstScheduler *sched, GstElement *element)
|
||||
{
|
||||
//GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
//GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
g_warning ("unlock element, implement me");
|
||||
}
|
||||
|
||||
|
@ -1625,7 +1622,7 @@ gst_opt_scheduler_interrupt (GstScheduler *sched, GstElement *element)
|
|||
return FALSE;
|
||||
#else
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
|
||||
GST_INFO ( "scheduler set interrupted state");
|
||||
osched->state = GST_OPT_SCHEDULER_STATE_INTERRUPTED;
|
||||
|
@ -1637,7 +1634,7 @@ gst_opt_scheduler_interrupt (GstScheduler *sched, GstElement *element)
|
|||
static void
|
||||
gst_opt_scheduler_error (GstScheduler *sched, GstElement *element)
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
GstOptSchedulerGroup *group;
|
||||
get_group (element, &group);
|
||||
if (group)
|
||||
|
@ -1650,7 +1647,7 @@ gst_opt_scheduler_error (GstScheduler *sched, GstElement *element)
|
|||
static void
|
||||
gst_opt_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad)
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
LinkType type = GST_OPT_INVALID;
|
||||
GstElement *element1, *element2;
|
||||
|
||||
|
@ -1828,7 +1825,7 @@ element_has_link_with_group (GstElement *element, GstOptSchedulerGroup *group, G
|
|||
/* see if the element has no more links to the peer group */
|
||||
pads = gst_element_get_pad_list (element);
|
||||
while (pads && !linked) {
|
||||
GstPad *pad = GST_PAD_CAST (pads->data);
|
||||
GstPad *pad = GST_PAD (pads->data);
|
||||
pads = g_list_next (pads);
|
||||
|
||||
/* we only operate on real pads and on the pad that is not broken */
|
||||
|
@ -1916,7 +1913,7 @@ group_can_reach_group (GstOptSchedulerGroup *group, GstOptSchedulerGroup *target
|
|||
static void
|
||||
gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad)
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
GstElement *element1, *element2;
|
||||
GstOptSchedulerGroup *group1, *group2;
|
||||
|
||||
|
@ -2040,7 +2037,7 @@ gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkp
|
|||
static void
|
||||
gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist)
|
||||
{
|
||||
//GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
//GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
|
||||
g_warning ("pad select, implement me");
|
||||
}
|
||||
|
@ -2057,7 +2054,7 @@ static GstSchedulerState
|
|||
gst_opt_scheduler_iterate (GstScheduler *sched)
|
||||
{
|
||||
GstSchedulerState state = GST_SCHEDULER_STATE_STOPPED;
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
gint iterations = osched->iterations;
|
||||
|
||||
osched->state = GST_OPT_SCHEDULER_STATE_RUNNING;
|
||||
|
@ -2121,7 +2118,7 @@ gst_opt_scheduler_iterate (GstScheduler *sched)
|
|||
static void
|
||||
gst_opt_scheduler_show (GstScheduler *sched)
|
||||
{
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
|
||||
GstOptScheduler *osched = GST_OPT_SCHEDULER (sched);
|
||||
GSList *chains;
|
||||
|
||||
g_print ("iterations: %d\n", osched->iterations);
|
||||
|
@ -2164,7 +2161,7 @@ gst_opt_scheduler_get_property (GObject *object, guint prop_id,
|
|||
|
||||
g_return_if_fail (GST_IS_OPT_SCHEDULER (object));
|
||||
|
||||
osched = GST_OPT_SCHEDULER_CAST (object);
|
||||
osched = GST_OPT_SCHEDULER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case ARG_ITERATIONS:
|
||||
|
@ -2187,7 +2184,7 @@ gst_opt_scheduler_set_property (GObject *object, guint prop_id,
|
|||
|
||||
g_return_if_fail (GST_IS_OPT_SCHEDULER (object));
|
||||
|
||||
osched = GST_OPT_SCHEDULER_CAST (object);
|
||||
osched = GST_OPT_SCHEDULER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case ARG_ITERATIONS:
|
||||
|
|
|
@ -31,8 +31,10 @@ Prereq: /sbin/ldconfig
|
|||
### documentation requirements
|
||||
BuildRequires: openjade
|
||||
BuildRequires: python2
|
||||
BuildRequires: docbook-style-dsssl docbook-dtd31-sgml
|
||||
BuildRequires: transfig xfig
|
||||
BuildRequires: docbook-style-dsssl
|
||||
BuildRequires: docbook-utils
|
||||
BuildRequires: transfig
|
||||
BuildRequires: xfig
|
||||
|
||||
%description
|
||||
GStreamer is a streaming-media framework, based on graphs of filters which
|
||||
|
@ -139,15 +141,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
|||
%{_libdir}/libgstcontrol-%{majorminor}.so.*
|
||||
%dir %{_libdir}/gstreamer-%{majorminor}
|
||||
%dir %{_localstatedir}/cache/gstreamer-%{majorminor}
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstautoplugcache*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstautoplugger*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstbasicomega*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstoptscheduler.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstoptomega*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstbasicgthreadscheduler*.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstoptgthreadscheduler*.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstelements*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgststaticautoplug*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstgetbits*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstspider*.so*
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstindexers.so*
|
||||
|
@ -208,6 +207,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
|||
|
||||
|
||||
%changelog
|
||||
* Mon Dec 01 2003 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
- changed documentation buildrequires
|
||||
|
||||
* Sun Nov 09 2003 Christian Schaller <Uraeus@gnome.org>
|
||||
- Fix spec to handle new bytestream library
|
||||
|
||||
|
|
|
@ -252,6 +252,7 @@ gst_bytestream_peek (GstByteStream *bs, GstBuffer **buf, guint32 len)
|
|||
GstBuffer *headbuf, *retbuf = NULL;
|
||||
|
||||
g_return_val_if_fail (bs != NULL, 0);
|
||||
g_return_val_if_fail (buf != NULL, 0);
|
||||
g_return_val_if_fail (len > 0, 0);
|
||||
|
||||
GST_DEBUG ("peek: asking for %d bytes", len);
|
||||
|
@ -323,6 +324,7 @@ gst_bytestream_peek_bytes (GstByteStream *bs, guint8** data, guint32 len)
|
|||
GstBuffer *headbuf;
|
||||
|
||||
g_return_val_if_fail (bs != NULL, 0);
|
||||
g_return_val_if_fail (data != NULL, 0);
|
||||
g_return_val_if_fail (len > 0, 0);
|
||||
|
||||
GST_DEBUG ("peek_bytes: asking for %d bytes", len);
|
||||
|
@ -761,7 +763,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -48,7 +48,7 @@ struct _GstByteStream {
|
|||
/* if we are in the seek state (waiting for DISCONT) */
|
||||
gboolean in_seek;
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GstByteStream* gst_bytestream_new (GstPad *pad);
|
||||
|
|
|
@ -227,7 +227,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -335,7 +335,7 @@ gst_aggregator_loop (GstElement *element)
|
|||
|
||||
debug = "loop_select";
|
||||
|
||||
pad = gst_pad_select (aggregator->sinkpads);
|
||||
pad = gst_pad_selectv (aggregator->sinkpads);
|
||||
buf = GST_BUFFER (gst_pad_pull (pad));
|
||||
|
||||
gst_aggregator_push (aggregator, pad, buf, debug);
|
||||
|
|
|
@ -95,7 +95,6 @@ GST_PLUGIN_DEFINE (
|
|||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -56,43 +56,51 @@ struct _GstQueue {
|
|||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
|
||||
/* the queue of buffers we're keeping our grubby hands on */
|
||||
/* the queue of data we're keeping our grubby hands on */
|
||||
GQueue *queue;
|
||||
|
||||
guint level_buffers; /* number of buffers queued here */
|
||||
guint level_bytes; /* number of bytes queued here */
|
||||
guint64 level_time; /* amount of time queued here */
|
||||
struct {
|
||||
guint buffers; /* no. of buffers */
|
||||
guint bytes; /* no. of bytes */
|
||||
guint64 time; /* amount of time */
|
||||
} cur_level, /* currently in the queue */
|
||||
max_size, /* max. amount of data allowed in the queue */
|
||||
min_treshold; /* min. amount of data required to wake reader */
|
||||
|
||||
guint size_buffers; /* size of queue in buffers */
|
||||
guint size_bytes; /* size of queue in bytes */
|
||||
guint64 size_time; /* size of queue in time */
|
||||
/* whether we leak data, and at which end */
|
||||
gint leaky;
|
||||
|
||||
/* number of nanoseconds until a blocked queue 'times out'
|
||||
* to receive data and returns a filler event. -1 = disable */
|
||||
guint64 block_timeout;
|
||||
|
||||
/* it the queue should fail on possible deadlocks */
|
||||
gboolean may_deadlock;
|
||||
|
||||
gint leaky; /* whether the queue is leaky, and if so at which end */
|
||||
gint block_timeout; /* microseconds until a blocked queue times out and returns GST_EVENT_FILLER.
|
||||
* A value of -1 will block forever. */
|
||||
guint min_threshold_bytes; /* the minimum number of bytes required before
|
||||
* waking up the reader thread */
|
||||
gboolean may_deadlock; /* it the queue should fail on possible deadlocks */
|
||||
gboolean interrupt;
|
||||
gboolean flush;
|
||||
|
||||
GMutex *qlock; /* lock for queue (vs object lock) */
|
||||
GCond *not_empty; /* signals buffers now available for reading */
|
||||
GCond *not_full; /* signals space now available for writing */
|
||||
GCond *item_add; /* signals buffers now available for reading */
|
||||
GCond *item_del; /* signals space now available for writing */
|
||||
GCond *event_done; /* upstream event signaller */
|
||||
|
||||
GTimeVal *timeval; /* the timeout for the queue locking */
|
||||
GAsyncQueue *events; /* upstream events get decoupled here */
|
||||
GQueue *events; /* upstream events get decoupled here */
|
||||
|
||||
GST_OBJECT_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstQueueClass {
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* signal callbacks */
|
||||
void (*full) (GstQueue *queue);
|
||||
/* signals - 'running' is called from both sides
|
||||
* which might make it sort of non-useful... */
|
||||
void (*underrun) (GstQueue *queue);
|
||||
void (*running) (GstQueue *queue);
|
||||
void (*overrun) (GstQueue *queue);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_queue_get_type (void);
|
||||
|
|
|
@ -195,7 +195,7 @@ gst_tee_getcaps (GstPad *pad)
|
|||
pads = gst_element_get_pad_list (GST_ELEMENT (tee));
|
||||
|
||||
while (pads) {
|
||||
GstPad *srcpad = GST_PAD_CAST (pads->data);
|
||||
GstPad *srcpad = GST_PAD (pads->data);
|
||||
GstPad *peer;
|
||||
const GstCaps2 *peercaps;
|
||||
GstCaps2 *newcaps;
|
||||
|
|
|
@ -367,16 +367,17 @@ stop_typefinding (GstTypeFindElement *typefind)
|
|||
if (push_cached_buffers) {
|
||||
GstBuffer *buffer;
|
||||
guint size = gst_buffer_store_get_size (typefind->store, 0);
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (typefind, "seeking back to current position %u", size);
|
||||
if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink),
|
||||
gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, size))) {
|
||||
GST_WARNING_OBJECT (typefind, "could not seek to required position %u, hope for the best", size);
|
||||
}
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
gst_buffer_store_clear (typefind->store);
|
||||
}
|
||||
|
|
|
@ -367,16 +367,17 @@ stop_typefinding (GstTypeFindElement *typefind)
|
|||
if (push_cached_buffers) {
|
||||
GstBuffer *buffer;
|
||||
guint size = gst_buffer_store_get_size (typefind->store, 0);
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (typefind, "seeking back to current position %u", size);
|
||||
if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink),
|
||||
gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, size))) {
|
||||
GST_WARNING_OBJECT (typefind, "could not seek to required position %u, hope for the best", size);
|
||||
}
|
||||
if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
|
||||
gst_pad_push (typefind->src, GST_DATA (buffer));
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
gst_buffer_store_clear (typefind->store);
|
||||
}
|
||||
|
|
|
@ -39,11 +39,10 @@ GST_PLUGIN_DEFINE (
|
|||
GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"gstindexers",
|
||||
"Gstremaer core indexers",
|
||||
"GStreamer core indexers",
|
||||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -108,6 +108,12 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
|
|||
# otherwise packages like GCC can not be built if only parts of the source
|
||||
# have been downloaded.
|
||||
|
||||
# thomasvs, 11/12/03: this option has been added in gettext 0.12
|
||||
# if we really need this, then we should add a check for the version,
|
||||
# but for now it doesn't seem to be worth the hassle, so I'm commenting
|
||||
# this option to the gettext incantation below
|
||||
# --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
|
||||
|
||||
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
|
||||
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
|
||||
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
||||
|
@ -115,7 +121,7 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
|||
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)' \
|
||||
--msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
|
||||
|
||||
test ! -f $(DOMAIN).po || { \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
|
||||
|
|
38
po/de.po
38
po/de.po
|
@ -6,8 +6,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gstreamer-0.7 0.7.0.1\n"
|
||||
"Report-Msgid-Bugs-To: \"http://bugzilla.gnome.org\"\n"
|
||||
"POT-Creation-Date: 2003-11-22 17:49+0100\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2003-12-17 21:27-0800\n"
|
||||
"PO-Revision-Date: 2003-10-08 15:36-0700\n"
|
||||
"Last-Translator: David Schleef <ds@schleef.org>\n"
|
||||
"Language-Team: Gnome Translators <i18n@gnome.org>\n"
|
||||
|
@ -15,69 +15,73 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: gst/gst.c:112
|
||||
#: gst/gst.c:116
|
||||
msgid "Print the GStreamer version"
|
||||
msgstr "druck die GStreamer Version"
|
||||
|
||||
#: gst/gst.c:113
|
||||
#: gst/gst.c:117
|
||||
msgid "Make all warnings fatal"
|
||||
msgstr "macht alle Achtunge toedlich"
|
||||
|
||||
#: gst/gst.c:115
|
||||
#: gst/gst.c:119
|
||||
msgid ""
|
||||
"default debug level from 1 (only error) to 5 (anything) or 0 for no output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:116
|
||||
#: gst/gst.c:120
|
||||
msgid ""
|
||||
"colon-seperated list of category_name=level pairs to set specific levels for "
|
||||
"the individual categories.\n"
|
||||
"Example:GST_AUTOPLUG=5:GST_ELEMENT_*=3"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:117
|
||||
#: gst/gst.c:121
|
||||
msgid "disable color debugging output"
|
||||
msgstr "abschalt Farbe in Fehlersucheausgabe"
|
||||
|
||||
#: gst/gst.c:118
|
||||
#: gst/gst.c:122
|
||||
msgid "disable debugging"
|
||||
msgstr "abschalt die Fehlersuche"
|
||||
|
||||
#: gst/gst.c:119
|
||||
#: gst/gst.c:123
|
||||
msgid "print available debug categories and exit"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:121
|
||||
#: gst/gst.c:125
|
||||
msgid "Disable accelerated CPU instructions"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:122
|
||||
#: gst/gst.c:126
|
||||
msgid "enable verbose plugin loading diagnostics"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'--separated path list for loading plugins"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:124
|
||||
#: gst/gst.c:128
|
||||
msgid ""
|
||||
"comma-separated list of plugins to preload in addition to the list stored in "
|
||||
"env variable GST_PLUGIN_PATH"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:129
|
||||
msgid "disable trapping of segmentation faults during plugin loading"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:130
|
||||
msgid "scheduler to use ('"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:130
|
||||
msgid "' is the default)"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:126
|
||||
#: gst/gst.c:131
|
||||
msgid "registry to use"
|
||||
msgstr ""
|
||||
|
||||
|
|
38
po/es.po
38
po/es.po
|
@ -6,8 +6,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: GStreamer 0.7.0.1\n"
|
||||
"Report-Msgid-Bugs-To: \"http://bugzilla.gnome.org\"\n"
|
||||
"POT-Creation-Date: 2003-11-22 17:49+0100\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2003-12-17 21:27-0800\n"
|
||||
"PO-Revision-Date: 2003-10-09 14:10-0700\n"
|
||||
"Last-Translator: David Schleef <ds@schleef.org>\n"
|
||||
"Language-Team: translators <translation@gnome.org>\n"
|
||||
|
@ -15,68 +15,72 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: gst/gst.c:112
|
||||
#: gst/gst.c:116
|
||||
msgid "Print the GStreamer version"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:113
|
||||
#: gst/gst.c:117
|
||||
msgid "Make all warnings fatal"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:115
|
||||
#: gst/gst.c:119
|
||||
msgid ""
|
||||
"default debug level from 1 (only error) to 5 (anything) or 0 for no output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:116
|
||||
#: gst/gst.c:120
|
||||
msgid ""
|
||||
"colon-seperated list of category_name=level pairs to set specific levels for "
|
||||
"the individual categories.\n"
|
||||
"Example:GST_AUTOPLUG=5:GST_ELEMENT_*=3"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:117
|
||||
#: gst/gst.c:121
|
||||
msgid "disable color debugging output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:118
|
||||
#: gst/gst.c:122
|
||||
msgid "disable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:119
|
||||
#: gst/gst.c:123
|
||||
msgid "print available debug categories and exit"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:121
|
||||
#: gst/gst.c:125
|
||||
msgid "Disable accelerated CPU instructions"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:122
|
||||
#: gst/gst.c:126
|
||||
msgid "enable verbose plugin loading diagnostics"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'--separated path list for loading plugins"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:124
|
||||
#: gst/gst.c:128
|
||||
msgid ""
|
||||
"comma-separated list of plugins to preload in addition to the list stored in "
|
||||
"env variable GST_PLUGIN_PATH"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:129
|
||||
msgid "disable trapping of segmentation faults during plugin loading"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:130
|
||||
msgid "scheduler to use ('"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:130
|
||||
msgid "' is the default)"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:126
|
||||
#: gst/gst.c:131
|
||||
msgid "registry to use"
|
||||
msgstr ""
|
||||
|
|
38
po/nl.po
38
po/nl.po
|
@ -6,8 +6,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: GStreamer 0.7.0.1\n"
|
||||
"Report-Msgid-Bugs-To: \"http://bugzilla.gnome.org\"\n"
|
||||
"POT-Creation-Date: 2003-11-22 17:49+0100\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2003-12-17 21:27-0800\n"
|
||||
"PO-Revision-Date: 2003-10-09 14:10-0700\n"
|
||||
"Last-Translator: David Schleef <ds@schleef.org>\n"
|
||||
"Language-Team: translators <translation@gnome.org>\n"
|
||||
|
@ -15,68 +15,72 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: gst/gst.c:112
|
||||
#: gst/gst.c:116
|
||||
msgid "Print the GStreamer version"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:113
|
||||
#: gst/gst.c:117
|
||||
msgid "Make all warnings fatal"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:115
|
||||
#: gst/gst.c:119
|
||||
msgid ""
|
||||
"default debug level from 1 (only error) to 5 (anything) or 0 for no output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:116
|
||||
#: gst/gst.c:120
|
||||
msgid ""
|
||||
"colon-seperated list of category_name=level pairs to set specific levels for "
|
||||
"the individual categories.\n"
|
||||
"Example:GST_AUTOPLUG=5:GST_ELEMENT_*=3"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:117
|
||||
#: gst/gst.c:121
|
||||
msgid "disable color debugging output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:118
|
||||
#: gst/gst.c:122
|
||||
msgid "disable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:119
|
||||
#: gst/gst.c:123
|
||||
msgid "print available debug categories and exit"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:121
|
||||
#: gst/gst.c:125
|
||||
msgid "Disable accelerated CPU instructions"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:122
|
||||
#: gst/gst.c:126
|
||||
msgid "enable verbose plugin loading diagnostics"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'--separated path list for loading plugins"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:124
|
||||
#: gst/gst.c:128
|
||||
msgid ""
|
||||
"comma-separated list of plugins to preload in addition to the list stored in "
|
||||
"env variable GST_PLUGIN_PATH"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:129
|
||||
msgid "disable trapping of segmentation faults during plugin loading"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:130
|
||||
msgid "scheduler to use ('"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:130
|
||||
msgid "' is the default)"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:126
|
||||
#: gst/gst.c:131
|
||||
msgid "registry to use"
|
||||
msgstr ""
|
||||
|
|
38
po/no.po
38
po/no.po
|
@ -6,8 +6,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: GStreamer 0.7.0.1\n"
|
||||
"Report-Msgid-Bugs-To: \"http://bugzilla.gnome.org\"\n"
|
||||
"POT-Creation-Date: 2003-11-22 17:49+0100\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2003-12-17 21:27-0800\n"
|
||||
"PO-Revision-Date: 2003-10-09 14:10-0700\n"
|
||||
"Last-Translator: David Schleef <ds@schleef.org>\n"
|
||||
"Language-Team: translators <translation@gnome.org>\n"
|
||||
|
@ -15,68 +15,72 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: gst/gst.c:112
|
||||
#: gst/gst.c:116
|
||||
msgid "Print the GStreamer version"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:113
|
||||
#: gst/gst.c:117
|
||||
msgid "Make all warnings fatal"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:115
|
||||
#: gst/gst.c:119
|
||||
msgid ""
|
||||
"default debug level from 1 (only error) to 5 (anything) or 0 for no output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:116
|
||||
#: gst/gst.c:120
|
||||
msgid ""
|
||||
"colon-seperated list of category_name=level pairs to set specific levels for "
|
||||
"the individual categories.\n"
|
||||
"Example:GST_AUTOPLUG=5:GST_ELEMENT_*=3"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:117
|
||||
#: gst/gst.c:121
|
||||
msgid "disable color debugging output"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:118
|
||||
#: gst/gst.c:122
|
||||
msgid "disable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:119
|
||||
#: gst/gst.c:123
|
||||
msgid "print available debug categories and exit"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:121
|
||||
#: gst/gst.c:125
|
||||
msgid "Disable accelerated CPU instructions"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:122
|
||||
#: gst/gst.c:126
|
||||
msgid "enable verbose plugin loading diagnostics"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:123
|
||||
#: gst/gst.c:127
|
||||
msgid "'--separated path list for loading plugins"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:124
|
||||
#: gst/gst.c:128
|
||||
msgid ""
|
||||
"comma-separated list of plugins to preload in addition to the list stored in "
|
||||
"env variable GST_PLUGIN_PATH"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:129
|
||||
msgid "disable trapping of segmentation faults during plugin loading"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:130
|
||||
msgid "scheduler to use ('"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:125
|
||||
#: gst/gst.c:130
|
||||
msgid "' is the default)"
|
||||
msgstr ""
|
||||
|
||||
#: gst/gst.c:126
|
||||
#: gst/gst.c:131
|
||||
msgid "registry to use"
|
||||
msgstr ""
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
|
||||
noinst_PROGRAMS = test1 test2
|
||||
|
||||
test1_SOURCES = test1.c $(top_srcdir)/gst/gstbuffer.c gstmempool.c
|
||||
test1_SOURCES = test1.c gstbuffer.c gstmempool.c
|
||||
|
||||
EXTRA_DIST = gstbuffer.h gstmempool.h
|
||||
BUILT_SOURCES = gstbuffer.c
|
||||
|
||||
gstbuffer.c:
|
||||
cp $(top_srcdir)/gst/gstbuffer.c .
|
||||
|
||||
EXTRA_DIST = gstmempool.h
|
||||
|
||||
LDADD = $(GST_LIBS)
|
||||
AM_CFLAGS = $(GST_CFLAGS)
|
||||
AM_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst
|
||||
|
|
|
@ -1,495 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
||||
* 2000 Wim Taymans <wtay@chello.be>
|
||||
*
|
||||
* gstbuffer.c: Buffer operations
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* this file makes too much noise for most debugging sessions */
|
||||
#define GST_DEBUG_FORCE_DISABLE
|
||||
#include "gst/gst_private.h"
|
||||
|
||||
#include "gstbuffer.h"
|
||||
#include "gstmempool.h"
|
||||
|
||||
GType _gst_buffer_type;
|
||||
|
||||
static GstMemPool *_gst_buffer_pool;
|
||||
|
||||
static void
|
||||
gst_buffer_alloc_func (GstMemPool *pool, gpointer data)
|
||||
{
|
||||
GstBuffer *buffer = GST_BUFFER (data);
|
||||
|
||||
GST_DATA_TYPE(buffer) = _gst_buffer_type;
|
||||
buffer->lock = g_mutex_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
gst_buffer_free_func (GstMemPool *pool, gpointer data)
|
||||
{
|
||||
GstBuffer *buffer = GST_BUFFER (data);
|
||||
|
||||
g_mutex_free (buffer->lock);
|
||||
}
|
||||
|
||||
void
|
||||
_gst_buffer_initialize (void)
|
||||
{
|
||||
int buffersize = sizeof(GstBuffer);
|
||||
static const GTypeInfo buffer_info = {
|
||||
0, /* sizeof(class), */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* sizeof(object), */
|
||||
0,
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* round up to the nearest 32 bytes for cache-line and other efficiencies */
|
||||
buffersize = (((buffersize-1) / 32) + 1) * 32;
|
||||
|
||||
_gst_buffer_pool = gst_mem_pool_new ("GstBuffer", buffersize,
|
||||
buffersize * 32, G_ALLOC_AND_FREE, gst_buffer_alloc_func, gst_buffer_free_func);
|
||||
|
||||
_gst_buffer_type = g_type_register_static (G_TYPE_INT, "GstBuffer", &buffer_info, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_new:
|
||||
*
|
||||
* Create a new buffer.
|
||||
*
|
||||
* Returns: new buffer
|
||||
*/
|
||||
GstBuffer*
|
||||
gst_buffer_new (void)
|
||||
{
|
||||
GstBuffer *buffer;
|
||||
|
||||
buffer = gst_mem_pool_alloc (_gst_buffer_pool);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER,"creating new buffer %p",buffer);
|
||||
|
||||
#ifdef HAVE_ATOMIC_H
|
||||
atomic_set (&buffer->refcount, 1);
|
||||
#else
|
||||
buffer->refcount = 1;
|
||||
#endif
|
||||
buffer->offset = -1;
|
||||
buffer->flags = 0;
|
||||
buffer->data = NULL;
|
||||
buffer->size = 0;
|
||||
buffer->maxsize = 0;
|
||||
buffer->timestamp = 0;
|
||||
buffer->parent = NULL;
|
||||
buffer->pool = NULL;
|
||||
buffer->pool_private = NULL;
|
||||
buffer->free = NULL;
|
||||
buffer->copy = NULL;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_new_from_pool:
|
||||
* @pool: the buffer pool to use
|
||||
*
|
||||
* Create a new buffer using the specified bufferpool.
|
||||
*
|
||||
* Returns: new buffer
|
||||
*/
|
||||
GstBuffer*
|
||||
gst_buffer_new_from_pool (GstBufferPool *pool, guint32 offset, guint32 size)
|
||||
{
|
||||
GstBuffer *buffer;
|
||||
|
||||
g_return_val_if_fail (pool != NULL, NULL);
|
||||
g_return_val_if_fail (pool->buffer_new != NULL, NULL);
|
||||
|
||||
buffer = pool->buffer_new (pool, offset, size, pool->user_data);
|
||||
buffer->pool = pool;
|
||||
buffer->free = pool->buffer_free;
|
||||
buffer->copy = pool->buffer_copy;
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER,"creating new buffer %p from pool %p (size %x, offset %x)",
|
||||
buffer, pool, size, offset);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_create_sub:
|
||||
* @parent: parent buffer
|
||||
* @offset: offset into parent buffer
|
||||
* @size: size of new subbuffer
|
||||
*
|
||||
* Creates a sub-buffer from the parent at a given offset.
|
||||
*
|
||||
* Returns: new buffer
|
||||
*/
|
||||
GstBuffer*
|
||||
gst_buffer_create_sub (GstBuffer *parent,
|
||||
guint32 offset,
|
||||
guint32 size)
|
||||
{
|
||||
GstBuffer *buffer;
|
||||
|
||||
g_return_val_if_fail (parent != NULL, NULL);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(parent) > 0, NULL);
|
||||
g_return_val_if_fail (size > 0, NULL);
|
||||
g_return_val_if_fail ((offset+size) <= parent->size, NULL);
|
||||
|
||||
buffer = gst_mem_pool_alloc (_gst_buffer_pool);
|
||||
GST_DATA_TYPE(buffer) = _gst_buffer_type;
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER,"creating new subbuffer %p from parent %p (size %u, offset %u)",
|
||||
buffer, parent, size, offset);
|
||||
|
||||
#ifdef HAVE_ATOMIC_H
|
||||
atomic_set (&buffer->refcount, 1);
|
||||
#else
|
||||
buffer->refcount = 1;
|
||||
#endif
|
||||
|
||||
/* copy flags and type from parent, for lack of better */
|
||||
buffer->flags = parent->flags;
|
||||
|
||||
/* set the data pointer, size, offset, and maxsize */
|
||||
buffer->data = parent->data + offset;
|
||||
buffer->size = size;
|
||||
buffer->maxsize = parent->size - offset;
|
||||
|
||||
/* deal with bogus/unknown offsets */
|
||||
if (parent->offset != -1)
|
||||
buffer->offset = parent->offset + offset;
|
||||
else
|
||||
buffer->offset = -1;
|
||||
|
||||
/* again, for lack of better, copy parent's timestamp */
|
||||
buffer->timestamp = parent->timestamp;
|
||||
buffer->maxage = parent->maxage;
|
||||
|
||||
/* if the parent buffer is a subbuffer itself, use its parent, a real buffer */
|
||||
if (parent->parent != NULL)
|
||||
parent = parent->parent;
|
||||
|
||||
/* set parentage and reference the parent */
|
||||
buffer->parent = parent;
|
||||
gst_buffer_ref (parent);
|
||||
|
||||
buffer->pool = NULL;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
/* FIXME FIXME: how does this overlap with the newly-added gst_buffer_span() ??? */
|
||||
/**
|
||||
* gst_buffer_append:
|
||||
* @buffer: a buffer
|
||||
* @append: the buffer to append
|
||||
*
|
||||
* Creates a new buffer by appending the data of append to the
|
||||
* existing data of buffer.
|
||||
*
|
||||
* Returns: new buffer
|
||||
*/
|
||||
GstBuffer*
|
||||
gst_buffer_append (GstBuffer *buffer,
|
||||
GstBuffer *append)
|
||||
{
|
||||
guint size;
|
||||
GstBuffer *newbuf;
|
||||
|
||||
g_return_val_if_fail (buffer != NULL, NULL);
|
||||
g_return_val_if_fail (append != NULL, NULL);
|
||||
g_return_val_if_fail (buffer->pool == NULL, NULL);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buffer) > 0, NULL);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(append) > 0, NULL);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER,"appending buffers %p and %p",buffer,append);
|
||||
|
||||
GST_BUFFER_LOCK (buffer);
|
||||
/* the buffer is not used by anyone else */
|
||||
if (GST_BUFFER_REFCOUNT (buffer) == 1 && buffer->parent == NULL
|
||||
&& !GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_DONTFREE)) {
|
||||
/* save the old size */
|
||||
size = buffer->size;
|
||||
buffer->size += append->size;
|
||||
buffer->data = g_realloc (buffer->data, buffer->size);
|
||||
memcpy(buffer->data + size, append->data, append->size);
|
||||
GST_BUFFER_UNLOCK (buffer);
|
||||
}
|
||||
/* the buffer is used, create a new one */
|
||||
else {
|
||||
newbuf = gst_buffer_new ();
|
||||
newbuf->size = buffer->size+append->size;
|
||||
newbuf->data = g_malloc (newbuf->size);
|
||||
memcpy (newbuf->data, buffer->data, buffer->size);
|
||||
memcpy (newbuf->data+buffer->size, append->data, append->size);
|
||||
GST_BUFFER_UNLOCK (buffer);
|
||||
gst_buffer_unref (buffer);
|
||||
buffer = newbuf;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_destroy:
|
||||
* @buffer: the GstBuffer to destroy
|
||||
*
|
||||
* destroy the buffer
|
||||
*/
|
||||
void
|
||||
gst_buffer_destroy (GstBuffer *buffer)
|
||||
{
|
||||
|
||||
g_return_if_fail (buffer != NULL);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER, "freeing %sbuffer %p",
|
||||
(buffer->parent?"sub":""),
|
||||
buffer);
|
||||
|
||||
/* free the data only if there is some, DONTFREE isn't set, and not sub */
|
||||
if (GST_BUFFER_DATA (buffer) &&
|
||||
!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_DONTFREE) &&
|
||||
(buffer->parent == NULL)) {
|
||||
/* if there's a free function, use it */
|
||||
if (buffer->free != NULL) {
|
||||
(buffer->free)(buffer);
|
||||
} else {
|
||||
g_free (GST_BUFFER_DATA (buffer));
|
||||
}
|
||||
}
|
||||
|
||||
/* unreference the parent if there is one */
|
||||
if (buffer->parent != NULL)
|
||||
gst_buffer_unref (buffer->parent);
|
||||
|
||||
/* remove it entirely from memory */
|
||||
gst_mem_pool_free (_gst_buffer_pool,buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_ref:
|
||||
* @buffer: the GstBuffer to reference
|
||||
*
|
||||
* Increment the refcount of this buffer.
|
||||
*/
|
||||
void
|
||||
gst_buffer_ref (GstBuffer *buffer)
|
||||
{
|
||||
g_return_if_fail (buffer != NULL);
|
||||
g_return_if_fail (GST_BUFFER_REFCOUNT(buffer) > 0);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER, "ref buffer %p\n", buffer);
|
||||
|
||||
#ifdef HAVE_ATOMIC_H
|
||||
atomic_inc (&(buffer->refcount));
|
||||
#else
|
||||
GST_BUFFER_LOCK (buffer);
|
||||
buffer->refcount++;
|
||||
GST_BUFFER_UNLOCK (buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_unref:
|
||||
* @buffer: the GstBuffer to unref
|
||||
*
|
||||
* Decrement the refcount of this buffer. If the refcount is
|
||||
* zero, the buffer will be destroyed.
|
||||
*/
|
||||
void
|
||||
gst_buffer_unref (GstBuffer *buffer)
|
||||
{
|
||||
gint zero;
|
||||
|
||||
g_return_if_fail (buffer != NULL);
|
||||
g_return_if_fail (GST_BUFFER_REFCOUNT(buffer) > 0);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_BUFFER, "unref buffer %p\n", buffer);
|
||||
|
||||
#ifdef HAVE_ATOMIC_H
|
||||
zero = atomic_dec_and_test (&(buffer->refcount));
|
||||
#else
|
||||
GST_BUFFER_LOCK (buffer);
|
||||
buffer->refcount--;
|
||||
zero = (buffer->refcount == 0);
|
||||
GST_BUFFER_UNLOCK (buffer);
|
||||
#endif
|
||||
|
||||
/* if we ended up with the refcount at zero, destroy the buffer */
|
||||
if (zero) {
|
||||
gst_buffer_destroy (buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_buffer_copy:
|
||||
* @buffer: the orignal GstBuffer to make a copy of
|
||||
*
|
||||
* Make a full copy of the give buffer, data and all.
|
||||
*
|
||||
* Returns: new buffer
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_copy (GstBuffer *buffer)
|
||||
{
|
||||
GstBuffer *newbuf;
|
||||
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buffer) > 0, NULL);
|
||||
|
||||
/* if a copy function exists, use it, else copy the bytes */
|
||||
if (buffer->copy != NULL) {
|
||||
newbuf = (buffer->copy)(buffer);
|
||||
} else {
|
||||
/* allocate a new buffer */
|
||||
newbuf = gst_buffer_new();
|
||||
|
||||
/* copy the absolute size */
|
||||
newbuf->size = buffer->size;
|
||||
/* allocate space for the copy */
|
||||
newbuf->data = (guchar *)g_malloc (buffer->size);
|
||||
/* copy the data straight across */
|
||||
memcpy(newbuf->data,buffer->data,buffer->size);
|
||||
/* the new maxsize is the same as the size, since we just malloc'd it */
|
||||
newbuf->maxsize = newbuf->size;
|
||||
}
|
||||
newbuf->offset = buffer->offset;
|
||||
newbuf->timestamp = buffer->timestamp;
|
||||
newbuf->maxage = buffer->maxage;
|
||||
|
||||
/* since we just created a new buffer, so we have no ties to old stuff */
|
||||
newbuf->parent = NULL;
|
||||
newbuf->pool = NULL;
|
||||
|
||||
return newbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
* gst_buffer_is_span_fast
|
||||
* @buf1: first source buffer
|
||||
* @buf2: second source buffer
|
||||
*
|
||||
* Determines whether a gst_buffer_span is free, or requires a memcpy.
|
||||
*
|
||||
* Returns: TRUE if the buffers are contiguous, FALSE if a copy would be required.
|
||||
*/
|
||||
gboolean
|
||||
gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2)
|
||||
{
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buf1) > 0, FALSE);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buf2) > 0, FALSE);
|
||||
|
||||
return (buf1->parent && buf2->parent &&
|
||||
(buf1->parent == buf2->parent) &&
|
||||
((buf1->data + buf1->size) == buf2->data));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_buffer_span:
|
||||
* @buf1: first source buffer to merge
|
||||
* @offset: offset in first buffer to start new buffer
|
||||
* @buf2: second source buffer to merge
|
||||
* @len: length of new buffer
|
||||
*
|
||||
* Create a new buffer that consists of part of buf1 and buf2.
|
||||
* Logically, buf1 and buf2 are concatenated into a single larger
|
||||
* buffer, and a new buffer is created at the given offset inside
|
||||
* this space, with a given length.
|
||||
*
|
||||
* If the two source buffers are children of the same larger buffer,
|
||||
* and are contiguous, the new buffer will be a child of the shared
|
||||
* parent, and thus no copying is necessary.
|
||||
*
|
||||
* Returns: new buffer that spans the two source buffers
|
||||
*/
|
||||
/* FIXME need to think about CoW and such... */
|
||||
GstBuffer *
|
||||
gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len)
|
||||
{
|
||||
GstBuffer *newbuf;
|
||||
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buf1) > 0, NULL);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buf2) > 0, NULL);
|
||||
|
||||
/* make sure buf1 has a lower address than buf2 */
|
||||
if (buf1->data > buf2->data) {
|
||||
GstBuffer *tmp = buf1;
|
||||
g_print ("swapping buffers\n");
|
||||
buf1 = buf2;
|
||||
buf2 = tmp;
|
||||
}
|
||||
|
||||
/* if the two buffers have the same parent and are adjacent */
|
||||
if (gst_buffer_is_span_fast(buf1,buf2)) {
|
||||
/* we simply create a subbuffer of the common parent */
|
||||
newbuf = gst_buffer_create_sub (buf1->parent, buf1->data - (buf1->parent->data) + offset, len);
|
||||
}
|
||||
else {
|
||||
g_print ("slow path taken in buffer_span\n");
|
||||
/* otherwise we simply have to brute-force copy the buffers */
|
||||
newbuf = gst_buffer_new ();
|
||||
|
||||
/* put in new size */
|
||||
newbuf->size = len;
|
||||
/* allocate space for the copy */
|
||||
newbuf->data = (guchar *)g_malloc(len);
|
||||
/* copy the first buffer's data across */
|
||||
memcpy(newbuf->data, buf1->data + offset, buf1->size - offset);
|
||||
/* copy the second buffer's data across */
|
||||
memcpy(newbuf->data + (buf1->size - offset), buf2->data, len - (buf1->size - offset));
|
||||
|
||||
if (newbuf->offset != -1)
|
||||
newbuf->offset = buf1->offset + offset;
|
||||
newbuf->timestamp = buf1->timestamp;
|
||||
if (buf2->maxage > buf1->maxage) newbuf->maxage = buf2->maxage;
|
||||
else newbuf->maxage = buf1->maxage;
|
||||
|
||||
}
|
||||
|
||||
return newbuf;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_buffer_merge:
|
||||
* @buf1: first source buffer to merge
|
||||
* @buf2: second source buffer to merge
|
||||
*
|
||||
* Create a new buffer that is the concatenation of the two source
|
||||
* buffers. The original source buffers will not be modified or
|
||||
* unref'd.
|
||||
*
|
||||
* Internally is nothing more than a specialized gst_buffer_span,
|
||||
* so the same optimizations can occur.
|
||||
*
|
||||
* Returns: new buffer that's the concatenation of the source buffers
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2)
|
||||
{
|
||||
/* we're just a specific case of the more general gst_buffer_span() */
|
||||
return gst_buffer_span (buf1, 0, buf2, buf1->size + buf2->size);
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
||||
* 2000 Wim Taymans <wtay@chello.be>
|
||||
*
|
||||
* gstbuffer.h: Header for GstBuffer object
|
||||
*
|
||||
* 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_BUFFER_H__
|
||||
#define __GST_BUFFER_H__
|
||||
|
||||
/* */
|
||||
/* Define this to add file:line info to each GstBuffer showing */
|
||||
/* the location in the source code where the buffer was created. */
|
||||
/* */
|
||||
/* #define GST_BUFFER_WHERE */
|
||||
/* */
|
||||
/* Then in gdb, you can `call gst_buffer_print_live()' to get a list */
|
||||
/* of allocated GstBuffers and also the file:line where they were */
|
||||
/* allocated. */
|
||||
/* */
|
||||
|
||||
#include <gst/gstdata.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ATOMIC_H
|
||||
#include <asm/atomic.h>
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
extern GType _gst_buffer_type;
|
||||
|
||||
#define GST_TYPE_BUFFER (_gst_buffer_type)
|
||||
#define GST_BUFFER(buf) ((GstBuffer *)(buf))
|
||||
#define GST_IS_BUFFER(buf) (GST_DATA_TYPE(buf) == GST_TYPE_BUFFER)
|
||||
|
||||
#define GST_BUFFER_FLAGS(buf) (GST_BUFFER(buf)->flags)
|
||||
#define GST_BUFFER_FLAG_IS_SET(buf,flag) (GST_BUFFER_FLAGS(buf) & (1<<(flag)))
|
||||
#define GST_BUFFER_FLAG_SET(buf,flag) G_STMT_START{ (GST_BUFFER_FLAGS(buf) |= (1<<(flag))); }G_STMT_END
|
||||
#define GST_BUFFER_FLAG_UNSET(buf,flag) G_STMT_START{ (GST_BUFFER_FLAGS(buf) &= ~(1<<(flag))); }G_STMT_END
|
||||
|
||||
|
||||
#define GST_BUFFER_DATA(buf) (GST_BUFFER(buf)->data)
|
||||
#define GST_BUFFER_SIZE(buf) (GST_BUFFER(buf)->size)
|
||||
#define GST_BUFFER_OFFSET(buf) (GST_BUFFER(buf)->offset)
|
||||
#define GST_BUFFER_MAXSIZE(buf) (GST_BUFFER(buf)->maxsize)
|
||||
#define GST_BUFFER_TIMESTAMP(buf) (GST_BUFFER(buf)->timestamp)
|
||||
#define GST_BUFFER_MAXAGE(buf) (GST_BUFFER(buf)->maxage)
|
||||
#define GST_BUFFER_BUFFERPOOL(buf) (GST_BUFFER(buf)->pool)
|
||||
#define GST_BUFFER_PARENT(buf) (GST_BUFFER(buf)->parent)
|
||||
#define GST_BUFFER_POOL_PRIVATE(buf) (GST_BUFFER(buf)->pool_private)
|
||||
#define GST_BUFFER_COPY_FUNC(buf) (GST_BUFFER(buf)->copy)
|
||||
#define GST_BUFFER_FREE_FUNC(buf) (GST_BUFFER(buf)->free)
|
||||
|
||||
|
||||
#define GST_BUFFER_LOCK(buf) (g_mutex_lock(GST_BUFFER(buf)->lock))
|
||||
#define GST_BUFFER_TRYLOCK(buf) (g_mutex_trylock(GST_BUFFER(buf)->lock))
|
||||
#define GST_BUFFER_UNLOCK(buf) (g_mutex_unlock(GST_BUFFER(buf)->lock))
|
||||
|
||||
|
||||
typedef enum {
|
||||
GST_BUFFER_READONLY,
|
||||
GST_BUFFER_ORIGINAL,
|
||||
GST_BUFFER_DONTFREE,
|
||||
|
||||
} GstBufferFlags;
|
||||
|
||||
|
||||
typedef struct _GstBuffer GstBuffer;
|
||||
|
||||
|
||||
typedef void (*GstBufferFreeFunc) (GstBuffer *buf);
|
||||
typedef GstBuffer *(*GstBufferCopyFunc) (GstBuffer *srcbuf);
|
||||
|
||||
|
||||
|
||||
struct _GstBuffer {
|
||||
GstData data_type;
|
||||
|
||||
/* locking */
|
||||
GMutex *lock;
|
||||
|
||||
/* refcounting */
|
||||
#ifdef HAVE_ATOMIC_H
|
||||
atomic_t refcount;
|
||||
#define GST_BUFFER_REFCOUNT(buf) (atomic_read(&(GST_BUFFER((buf))->refcount)))
|
||||
#else
|
||||
int refcount;
|
||||
#define GST_BUFFER_REFCOUNT(buf) (GST_BUFFER(buf)->refcount)
|
||||
#endif
|
||||
|
||||
/* flags */
|
||||
guint16 flags;
|
||||
|
||||
/* pointer to data, its size, and offset in original source if known */
|
||||
guchar *data;
|
||||
guint32 size;
|
||||
guint32 maxsize;
|
||||
guint32 offset;
|
||||
|
||||
/* timestamp */
|
||||
gint64 timestamp;
|
||||
gint64 maxage;
|
||||
|
||||
/* subbuffer support, who's my parent? */
|
||||
GstBuffer *parent;
|
||||
|
||||
/* this is a pointer to the buffer pool (if any) */
|
||||
GstBufferPool *pool;
|
||||
gpointer pool_private;
|
||||
|
||||
/* utility function pointers */
|
||||
GstBufferFreeFunc free; /* free the data associated with the buffer */
|
||||
GstBufferCopyFunc copy; /* copy the data from one buffer to another */
|
||||
};
|
||||
|
||||
/* initialisation */
|
||||
void _gst_buffer_initialize (void);
|
||||
/* creating a new buffer from scratch */
|
||||
GstBuffer* gst_buffer_new (void);
|
||||
GstBuffer* gst_buffer_new_from_pool (GstBufferPool *pool, guint32 offset, guint32 size);
|
||||
|
||||
/* creating a subbuffer */
|
||||
GstBuffer* gst_buffer_create_sub (GstBuffer *parent, guint32 offset, guint32 size);
|
||||
|
||||
/* refcounting */
|
||||
void gst_buffer_ref (GstBuffer *buffer);
|
||||
void gst_buffer_unref (GstBuffer *buffer);
|
||||
|
||||
/* destroying the buffer */
|
||||
void gst_buffer_destroy (GstBuffer *buffer);
|
||||
|
||||
/* copy buffer */
|
||||
GstBuffer* gst_buffer_copy (GstBuffer *buffer);
|
||||
|
||||
/* merge, span, or append two buffers, intelligently */
|
||||
GstBuffer* gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2);
|
||||
GstBuffer* gst_buffer_span (GstBuffer *buf1,guint32 offset,GstBuffer *buf2,guint32 len);
|
||||
GstBuffer* gst_buffer_append (GstBuffer *buf, GstBuffer *buf2);
|
||||
|
||||
gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_BUFFER_H__ */
|
|
@ -118,7 +118,7 @@ gst_mem_pool_destroy (GstMemPool *mem_pool)
|
|||
gpointer
|
||||
gst_mem_pool_alloc (GstMemPool *mem_pool)
|
||||
{
|
||||
GstMemPoolElement *pool = NULL;
|
||||
volatile GstMemPoolElement *pool = NULL;
|
||||
|
||||
g_return_val_if_fail (mem_pool != NULL, NULL);
|
||||
|
||||
|
@ -187,7 +187,7 @@ gst_mem_pool_free (GstMemPool *mem_pool, gpointer mem)
|
|||
:"m" (*mem_pool), "r" (pool), "a" (mem_pool->free));
|
||||
#else
|
||||
g_mutex_lock (mem_pool->chunk_lock);
|
||||
pool->link = mem_pool->free;
|
||||
pool->link = (GstMemPoolElement *) mem_pool->free;
|
||||
mem_pool->free = pool;
|
||||
g_mutex_unlock (mem_pool->chunk_lock);
|
||||
#endif
|
||||
|
|
|
@ -4,7 +4,7 @@ else
|
|||
GST_LOADSAVE_DIRS = xml typefind
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
dirs = \
|
||||
helloworld \
|
||||
queue \
|
||||
queue2 \
|
||||
|
@ -17,22 +17,9 @@ SUBDIRS = \
|
|||
cutter \
|
||||
pingpong \
|
||||
manual \
|
||||
retag \
|
||||
$(GST_LOADSAVE_DIRS)
|
||||
|
||||
DIST_SUBDIRS = helloworld \
|
||||
queue \
|
||||
queue2 \
|
||||
queue3 \
|
||||
queue4 \
|
||||
launch \
|
||||
thread \
|
||||
plugins \
|
||||
mixer \
|
||||
cutter \
|
||||
pingpong \
|
||||
manual \
|
||||
xml \
|
||||
typefind \
|
||||
retag
|
||||
|
||||
SUBDIRS = $(dirs) \
|
||||
$(GST_LOADSAVE_DIRS)
|
||||
|
||||
DIST_SUBDIRS = $(dirs) xml typefind
|
||||
|
|
2
tests/old/examples/autoplug/.gitignore
vendored
2
tests/old/examples/autoplug/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
autoplug
|
||||
xmlTest.gst
|
|
@ -1,4 +0,0 @@
|
|||
noinst_PROGRAMS = autoplug
|
||||
|
||||
autoplug_LDADD = $(GST_LIBS)
|
||||
autoplug_CFLAGS = $(GST_CFLAGS)
|
|
@ -1,152 +0,0 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
static void
|
||||
gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline)
|
||||
{
|
||||
GstElement *osssink, *videosink, *videoelement, *colorspace;
|
||||
GstElement *new_element;
|
||||
GstAutoplug *autoplug;
|
||||
GstElement *autobin;
|
||||
GstElement *filesrc;
|
||||
GstElement *cache;
|
||||
|
||||
GST_DEBUG ("GstPipeline: play have type");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
||||
filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
|
||||
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
|
||||
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
|
||||
|
||||
/* unlink the typefind from the pipeline and remove it */
|
||||
gst_element_unlink_pads (cache, "src", typefind, "sink");
|
||||
gst_bin_remove (GST_BIN (autobin), typefind);
|
||||
|
||||
/* and an audio sink */
|
||||
osssink = gst_element_factory_make ("osssink", "play_audio");
|
||||
g_assert (osssink != NULL);
|
||||
|
||||
videosink = gst_bin_new ("videosink");
|
||||
/* and an video sink */
|
||||
videoelement = gst_element_factory_make ("xvideosink", "play_video");
|
||||
g_assert (videosink != NULL);
|
||||
|
||||
colorspace = gst_element_factory_make ("colorspace", "colorspace");
|
||||
g_assert (colorspace != NULL);
|
||||
|
||||
gst_element_link_pads (colorspace, "src", videoelement, "sink");
|
||||
gst_bin_add (GST_BIN (videosink), colorspace);
|
||||
gst_bin_add (GST_BIN (videosink), videoelement);
|
||||
|
||||
gst_element_add_ghost_pad (videosink,
|
||||
gst_element_get_pad (colorspace, "sink"), "sink");
|
||||
|
||||
autoplug = gst_autoplug_factory_make ("staticrender");
|
||||
g_assert (autoplug != NULL);
|
||||
|
||||
new_element = gst_autoplug_to_renderers (autoplug,
|
||||
caps,
|
||||
videosink,
|
||||
osssink,
|
||||
NULL);
|
||||
|
||||
if (!new_element) {
|
||||
g_print ("could not autoplug, no suitable codecs found...\n");
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
gst_element_set_name (new_element, "new_element");
|
||||
|
||||
gst_bin_add (GST_BIN (autobin), new_element);
|
||||
|
||||
g_object_set (G_OBJECT (cache), "reset", TRUE, NULL);
|
||||
|
||||
gst_element_link_pads (cache, "src", new_element, "sink");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
gst_xml_write_file (GST_ELEMENT (pipeline), fopen ("xmlTest.gst", "w"));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
gst_play_cache_empty (GstElement *element, GstElement *pipeline)
|
||||
{
|
||||
GstElement *autobin;
|
||||
GstElement *filesrc;
|
||||
GstElement *cache;
|
||||
GstElement *new_element;
|
||||
|
||||
fprintf (stderr, "have cache empty\n");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
||||
filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
|
||||
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
|
||||
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
|
||||
new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element");
|
||||
|
||||
gst_element_unlink_many (filesrc, cache, new_element, NULL);
|
||||
gst_bin_remove (GST_BIN (autobin), cache);
|
||||
gst_element_link_pads (filesrc, "src", new_element, "sink");
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
fprintf (stderr, "done with cache_empty\n");
|
||||
}
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
GstElement *filesrc;
|
||||
GstElement *pipeline;
|
||||
GstElement *autobin;
|
||||
GstElement *typefind;
|
||||
GstElement *cache;
|
||||
|
||||
g_thread_init(NULL);
|
||||
gst_init(&argc,&argv);
|
||||
|
||||
if (argc != 2) {
|
||||
g_print("usage: %s <filename>\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* create a new pipeline to hold the elements */
|
||||
pipeline = gst_pipeline_new("pipeline");
|
||||
g_assert(pipeline != NULL);
|
||||
|
||||
/* create a disk reader */
|
||||
filesrc = gst_element_factory_make("filesrc", "disk_source");
|
||||
g_assert(filesrc != NULL);
|
||||
g_object_set(G_OBJECT(filesrc),"location", argv[1],NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), filesrc);
|
||||
|
||||
autobin = gst_bin_new ("autobin");
|
||||
cache = gst_element_factory_make ("autoplugcache", "cache");
|
||||
g_signal_connect (G_OBJECT (cache), "cache_empty", G_CALLBACK (gst_play_cache_empty), pipeline);
|
||||
|
||||
typefind = gst_element_factory_make ("typefind", "typefind");
|
||||
g_signal_connect (G_OBJECT (typefind), "have_type", G_CALLBACK (gst_play_have_type), pipeline);
|
||||
gst_bin_add (GST_BIN (autobin), cache);
|
||||
gst_bin_add (GST_BIN (autobin), typefind);
|
||||
|
||||
gst_element_link_pads (cache, "src", typefind, "sink");
|
||||
gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink");
|
||||
|
||||
gst_bin_add (GST_BIN( pipeline), autobin);
|
||||
gst_element_link_pads (filesrc, "src", autobin, "sink");
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||
|
||||
while (gst_bin_iterate (GST_BIN (pipeline)));
|
||||
|
||||
/* stop the pipeline */
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||
|
||||
gst_object_unref (GST_OBJECT (pipeline));
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -422,11 +422,6 @@ GST_PLUGIN_DEFINE (
|
|||
"0.1", /* The version number of the plugin */
|
||||
"LGPL", /* ieffective license the plugin can be shipped with. Must be
|
||||
* valid for all libraries it links to, too. */
|
||||
"(c) 2003 E. Xamplewriter",
|
||||
/* Copyright holder for this plugin. This does not include
|
||||
* the libraries it links to, contrary to the license. This
|
||||
* field should be considered informational and not legally
|
||||
* binding */
|
||||
"my nifty plugin package",
|
||||
/* package this plugin belongs to. */
|
||||
"http://www.mydomain.com"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue