2000-12-28 22:12:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
*
|
|
|
|
* gstbin.h: Header for GstBin container object
|
2000-01-30 09:03:00 +00:00
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2000-01-30 09:03:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_BIN_H__
|
|
|
|
#define __GST_BIN_H__
|
|
|
|
|
|
|
|
#include <gst/gstelement.h>
|
2005-03-07 18:27:42 +00:00
|
|
|
#include <gst/gstiterator.h>
|
examples/: Update a couple of the examples to work again.
Original commit message from CVS:
* examples/Makefile.am:
* examples/helloworld/helloworld.c: (event_loop), (main):
* examples/queue/queue.c: (event_loop), (main):
* examples/queue2/queue2.c: (main):
Update a couple of the examples to work again.
* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_empty),
(gst_base_sink_preroll_queue_flush), (gst_base_sink_handle_event):
Spelling corrections and extra debug.
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_init), (is_eos),
(gst_bin_add_func), (bin_element_is_sink), (gst_bin_get_state),
(gst_bin_change_state), (gst_bin_dispose), (bin_bus_handler):
* gst/gstbin.h:
* gst/gstpipeline.c: (gst_pipeline_init), (gst_pipeline_dispose),
(gst_pipeline_change_state):
* gst/gstpipeline.h:
Move the bus handler for children to the GstBin, and create a
separate bus for receiving messages from children to the one the
bus sends 'upwards' on.
2005-07-06 16:22:47 +00:00
|
|
|
#include <gst/gstbus.h>
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2005-10-15 16:33:09 +00:00
|
|
|
#define GST_TYPE_BIN (gst_bin_get_type ())
|
2002-12-19 21:31:03 +00:00
|
|
|
#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))
|
2003-12-13 16:58:29 +00:00
|
|
|
#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))
|
2005-03-07 18:27:42 +00:00
|
|
|
#define GST_BIN_CAST(obj) ((GstBin*)(obj))
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-01-24 17:04:08 +00:00
|
|
|
/**
|
|
|
|
* GstBinFlags:
|
2005-06-27 08:16:51 +00:00
|
|
|
* @GST_BIN_FLAG_LAST: the last enum in the series of flags for bins.
|
|
|
|
* Derived classes can use this as first value in a list of flags.
|
docs/pwg/advanced-types.xml: Fix description for buffer-frames=0.
Original commit message from CVS:
* docs/pwg/advanced-types.xml:
Fix description for buffer-frames=0.
* docs/gst/tmpl/gstbin.sgml:
* gst/gstbin.c: (gst_bin_child_state_change_func),
(gst_bin_change_state), (gst_bin_change_state_norecurse):
* gst/gstbin.h:
* testsuite/threads/Makefile.am:
* testsuite/threads/threadi.c: (cb_timeout), (cb_quit), (cb_eos),
(cb_state), (cb_play), (main):
Fix non-recursive state changes to *really* change the state
of the object, and not just call parent_class->state_change.
Fix a lot of lockups caused by this. Fixes #132775. Add test
for the problem. Also enable test to show #142588 (fixed).
* gst/gstthread.c: (gst_thread_change_state),
(gst_thread_child_state_change):
Don't exit the thread if we go to NULL and are inside thread
context. Instead, return control to the main thread context
and exit from there.
* gst/gstelement.c: (gst_element_disable_threadsafe_properties):
Don't unset virtual functions, since those may still be used.
That's not necessarily correct, but suffices for now.
* configure.ac:
* testsuite/Makefile.am:
* testsuite/pad/Makefile.am:
* testsuite/pad/chainnopull.c: (gst_test_sink_class_init),
(gst_test_sink_base_init), (gst_test_sink_chain),
(gst_test_sink_init), (main):
* testsuite/pad/getnopush.c: (gst_test_src_class_init),
(gst_test_src_base_init), (gst_test_src_get), (gst_test_src_init),
(main):
* testsuite/pad/link.c: (gst_test_element_class_init),
(gst_test_element_base_init), (gst_test_src_get),
(gst_test_src_loop), (gst_test_src_init), (gst_test_filter_chain),
(gst_test_filter_loop), (gst_test_filter_init),
(gst_test_sink_chain), (gst_test_sink_loop), (gst_test_sink_init),
(cb_error), (main):
Add tests to show #150546. Pass, but should fail (currently
disabled from the testsuite).
* gst/gstscheduler.c: (gst_scheduler_dispose):
Dereference child schedulers on dispose (#94464).
* testsuite/bytestream/filepadsink.c: (gst_fp_sink_init):
Fix typo.
* testsuite/threads/thread.c: (main):
Add more debug.
2005-01-31 15:51:19 +00:00
|
|
|
*
|
|
|
|
* GstBinFlags are a set of flags specific to bins. Most are set/used
|
2021-02-04 15:15:39 +00:00
|
|
|
* internally. They can be checked using the GST_OBJECT_FLAG_IS_SET() macro,
|
|
|
|
* and (un)set using GST_OBJECT_FLAG_SET() and GST_OBJECT_FLAG_UNSET().
|
2005-01-24 17:04:08 +00:00
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
typedef enum {
|
2021-02-04 15:15:39 +00:00
|
|
|
/**
|
|
|
|
* GST_BIN_FLAG_NO_RESYNC:
|
|
|
|
*
|
|
|
|
* Don't resync a state change when elements are added or linked in the bin
|
|
|
|
*
|
|
|
|
* Since: 1.0.5
|
|
|
|
*/
|
2012-12-21 15:36:37 +00:00
|
|
|
GST_BIN_FLAG_NO_RESYNC = (GST_ELEMENT_FLAG_LAST << 0),
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_BIN_FLAG_STREAMS_AWARE:
|
|
|
|
*
|
|
|
|
* Indicates whether the bin can handle elements that add/remove source pads
|
|
|
|
* at any point in time without first posting a no-more-pads signal.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
2016-10-11 10:12:57 +00:00
|
|
|
GST_BIN_FLAG_STREAMS_AWARE = (GST_ELEMENT_FLAG_LAST << 1),
|
2021-02-04 15:15:39 +00:00
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/* padding */
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_BIN_FLAG_LAST:
|
|
|
|
*
|
|
|
|
* The last enum in the series of flags for bins. Derived classes can use this
|
|
|
|
* as first value in a list of flags.
|
|
|
|
*/
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
* docs/gst/gstreamer-sections.txt:
* gst/base/gstbasesink.c: (gst_base_sink_init):
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_get_range), (gst_base_src_check_get_range),
(gst_base_src_start), (gst_base_src_stop):
* gst/base/gstbasesrc.h:
* gst/elements/gstfakesrc.c: (gst_fake_src_set_property):
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
(bin_element_is_sink), (reset_degree), (gst_bin_element_set_state),
(bin_bus_handler):
* gst/gstbin.h:
* gst/gstbuffer.h:
* gst/gstbus.c: (gst_bus_post), (gst_bus_set_flushing):
* gst/gstbus.h:
* gst/gstelement.c: (gst_element_is_locked_state),
(gst_element_set_locked_state), (gst_element_commit_state),
(gst_element_set_state):
* gst/gstelement.h:
* gst/gstindex.c: (gst_index_init):
* gst/gstindex.h:
* gst/gstminiobject.h:
* gst/gstobject.c: (gst_object_init), (gst_object_sink),
(gst_object_set_parent):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_set_blocked_async), (gst_pad_is_blocked),
(gst_pad_get_caps_unlocked), (gst_pad_set_caps):
* gst/gstpad.h:
* gst/gstpadtemplate.h:
* gst/gstpipeline.c: (gst_pipeline_provide_clock_func),
(gst_pipeline_use_clock), (gst_pipeline_auto_clock):
* gst/gstpipeline.h:
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(gst_file_index_commit):
* testsuite/bytestream/filepadsink.c: (gst_fp_sink_init):
* testsuite/pad/link.c: (gst_test_src_init),
(gst_test_filter_init), (gst_test_sink_init):
* testsuite/states/locked.c: (main):
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:28:39 +00:00
|
|
|
GST_BIN_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 5)
|
2004-03-15 14:43:35 +00:00
|
|
|
} GstBinFlags;
|
2000-12-15 01:57:34 +00:00
|
|
|
|
2012-12-21 15:36:37 +00:00
|
|
|
/**
|
|
|
|
* GST_BIN_IS_NO_RESYNC:
|
|
|
|
* @bin: A #GstBin
|
|
|
|
*
|
|
|
|
* Check if @bin will resync its state change when elements are added and
|
|
|
|
* removed.
|
|
|
|
*
|
2013-11-16 12:24:56 +00:00
|
|
|
* Since: 1.0.5
|
2012-12-21 15:36:37 +00:00
|
|
|
*/
|
|
|
|
#define GST_BIN_IS_NO_RESYNC(bin) (GST_OBJECT_FLAG_IS_SET(bin,GST_BIN_FLAG_NO_RESYNC))
|
|
|
|
|
2005-09-11 12:57:36 +00:00
|
|
|
typedef struct _GstBin GstBin;
|
|
|
|
typedef struct _GstBinClass GstBinClass;
|
2007-05-22 11:09:45 +00:00
|
|
|
typedef struct _GstBinPrivate GstBinPrivate;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-08-23 14:25:55 +00:00
|
|
|
/**
|
|
|
|
* GST_BIN_NUMCHILDREN:
|
2005-10-28 17:35:43 +00:00
|
|
|
* @bin: a #GstBin
|
2005-08-23 14:25:55 +00:00
|
|
|
*
|
2005-10-28 17:35:43 +00:00
|
|
|
* Gets the number of children in a bin.
|
2005-08-23 14:25:55 +00:00
|
|
|
*/
|
2005-08-25 23:17:18 +00:00
|
|
|
#define GST_BIN_NUMCHILDREN(bin) (GST_BIN_CAST(bin)->numchildren)
|
2005-08-23 14:25:55 +00:00
|
|
|
/**
|
|
|
|
* GST_BIN_CHILDREN:
|
2005-10-28 17:35:43 +00:00
|
|
|
* @bin: a #GstBin
|
2005-08-23 14:25:55 +00:00
|
|
|
*
|
2021-02-04 15:15:39 +00:00
|
|
|
* Gets the list of children in a bin.
|
2005-08-23 14:25:55 +00:00
|
|
|
*/
|
2005-08-25 23:17:18 +00:00
|
|
|
#define GST_BIN_CHILDREN(bin) (GST_BIN_CAST(bin)->children)
|
2005-08-23 14:25:55 +00:00
|
|
|
/**
|
|
|
|
* GST_BIN_CHILDREN_COOKIE:
|
2005-10-28 17:35:43 +00:00
|
|
|
* @bin: a #GstBin
|
2005-08-23 14:25:55 +00:00
|
|
|
*
|
|
|
|
* Gets the children cookie that watches the children list.
|
|
|
|
*/
|
2005-08-25 23:17:18 +00:00
|
|
|
#define GST_BIN_CHILDREN_COOKIE(bin) (GST_BIN_CAST(bin)->children_cookie)
|
2005-03-07 18:27:42 +00:00
|
|
|
|
2005-11-09 13:14:27 +00:00
|
|
|
/**
|
|
|
|
* GstBin:
|
|
|
|
* @numchildren: the number of children in this bin
|
2012-06-12 18:42:30 +00:00
|
|
|
* @children: (element-type Gst.Element): the list of children in this bin
|
2005-11-09 13:14:27 +00:00
|
|
|
* @children_cookie: updated whenever @children changes
|
|
|
|
* @child_bus: internal bus for handling child messages
|
2012-06-12 18:42:30 +00:00
|
|
|
* @messages: (element-type Gst.Message): queued and cached messages
|
2005-11-09 13:14:27 +00:00
|
|
|
* @polling: the bin is currently calculating its state
|
gst/gstbin.*: Immediatly commit the toplevel bin state when receiving an async-done message. This enables us to avoid...
Original commit message from CVS:
* gst/gstbin.c: (gst_bin_init), (gst_bin_add_func),
(gst_bin_remove_func), (gst_bin_get_state_func),
(gst_bin_element_set_state), (gst_bin_continue_func),
(bin_push_state_continue), (bin_handle_async_start),
(bin_handle_async_done), (gst_bin_handle_message_func):
* gst/gstbin.h:
Immediatly commit the toplevel bin state when receiving an async-done
message. This enables us to avoid spawning a thread to commit the state
in some common cases and it also avoids some races.
Avoid spawning a state thread when adding/removing async elements to a
toplevel bin. Instead we immediatly update the bin state.
Get rid of iterating all the children when getting the state in the bin
because it is now always up-to-date.
Fix bug where locked elements would always return _SUCCESS even it they
returned NO_PREROLL before being locked.
Fix the order of the state_change, async-start/done messages that was
sometimes incorrect.
Mark the state_dirty field as deprecated, we don't need it anymore as we
are always up-to-date.
* gst/gstelement.c: (gst_element_get_state_func),
(gst_element_continue_state):
Small debug inprovements.
Return the previous element state return when nothing is pending instead
of blindly returning SUCCESS.
* tests/check/generic/sinks.c: (GST_START_TEST), (pad_blocked_cb),
(gst_sinks_suite):
Add a whole bunch of new testcases.
2007-06-18 15:12:28 +00:00
|
|
|
* @state_dirty: the bin needs to recalculate its state (deprecated)
|
2005-11-09 13:14:27 +00:00
|
|
|
* @clock_dirty: the bin needs to select a new clock
|
|
|
|
* @provided_clock: the last clock selected
|
2005-11-19 18:28:40 +00:00
|
|
|
* @clock_provider: the element that provided @provided_clock
|
2005-11-09 13:14:27 +00:00
|
|
|
*
|
|
|
|
* The GstBin base class. Subclasses can access these fields provided
|
|
|
|
* the LOCK is taken.
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstBin {
|
2005-06-19 10:54:12 +00:00
|
|
|
GstElement element;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/*< public >*/ /* with LOCK */
|
|
|
|
/* our children, subclass are supposed to update these
|
|
|
|
* fields to reflect their state with _iterate_*() */
|
2005-06-19 10:54:12 +00:00
|
|
|
gint numchildren;
|
|
|
|
GList *children;
|
2005-03-07 18:27:42 +00:00
|
|
|
guint32 children_cookie;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-11-09 13:14:27 +00:00
|
|
|
GstBus *child_bus;
|
|
|
|
GList *messages;
|
examples/: Update a couple of the examples to work again.
Original commit message from CVS:
* examples/Makefile.am:
* examples/helloworld/helloworld.c: (event_loop), (main):
* examples/queue/queue.c: (event_loop), (main):
* examples/queue2/queue2.c: (main):
Update a couple of the examples to work again.
* gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_empty),
(gst_base_sink_preroll_queue_flush), (gst_base_sink_handle_event):
Spelling corrections and extra debug.
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_init), (is_eos),
(gst_bin_add_func), (bin_element_is_sink), (gst_bin_get_state),
(gst_bin_change_state), (gst_bin_dispose), (bin_bus_handler):
* gst/gstbin.h:
* gst/gstpipeline.c: (gst_pipeline_init), (gst_pipeline_dispose),
(gst_pipeline_change_state):
* gst/gstpipeline.h:
Move the bus handler for children to the GstBin, and create a
separate bus for receiving messages from children to the one the
bus sends 'upwards' on.
2005-07-06 16:22:47 +00:00
|
|
|
|
check/: Check fixes, use API as stated in design docs, remove hacks.
Original commit message from CVS:
* check/Makefile.am:
* check/generic/states.c: (GST_START_TEST):
* check/gst/gstbin.c: (GST_START_TEST):
* check/gst/gstpipeline.c: (GST_START_TEST), (gst_pipeline_suite):
* check/states/sinks.c: (GST_START_TEST):
* check/states/sinks2.c: (GST_START_TEST), (gst_object_suite),
(main):
Check fixes, use API as stated in design docs, remove hacks.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_change_state):
Catch stopping our task while we're shutting down.
* gst/gstbin.c: (gst_bin_init), (gst_bin_add_func),
(gst_bin_remove_func), (gst_bin_get_state_func),
(gst_bin_recalc_state), (gst_bin_change_state_func),
(bin_bus_handler):
* gst/gstbin.h:
* gst/gstelement.c: (gst_element_init),
(gst_element_get_state_func), (gst_element_abort_state),
(gst_element_commit_state), (gst_element_lost_state),
(gst_element_set_state), (gst_element_change_state),
(gst_element_change_state_func):
* gst/gstelement.h:
New state change algorithm (see #318116)
* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_init), (gst_pipeline_set_property),
(gst_pipeline_get_property), (do_pipeline_seek),
(gst_pipeline_change_state), (gst_pipeline_provide_clock_func):
* gst/gstpipeline.h:
Remove crude state change hacks.
* gst/gstutils.h:
Remove crude hacks.
* tools/gst-launch.c: (main):
Fixes for state change. Needs some more work to fully use the
new stuff.
2005-10-10 16:38:26 +00:00
|
|
|
gboolean polling;
|
|
|
|
gboolean state_dirty;
|
docs/design/part-states.txt: Some more docs.
Original commit message from CVS:
* docs/design/part-states.txt:
Some more docs.
* gst/gstbin.c: (gst_bin_set_clock_func), (gst_bin_recalc_state),
(gst_bin_change_state_func), (bin_bus_handler):
Doc updates. Don't distribute the same clock over and over again.
* gst/gstclock.c:
* gst/gstclock.h:
Doc updates.
* gst/gstpad.c: (gst_flow_get_name), (gst_flow_to_quark),
(gst_pad_get_type), (gst_pad_push), (gst_pad_push_event),
(gst_pad_send_event):
* gst/gstpad.h:
Make probe emission threadsafe again.
Register quarks and move _get_name() from utils.
Doc updates.
* gst/gstpipeline.c: (gst_pipeline_class_init),
(gst_pipeline_change_state), (gst_pipeline_provide_clock_func):
Only redistribute the clock of it changed.
* gst/gstsystemclock.h:
Doc updates.
* gst/gstutils.c:
* gst/gstutils.h:
Moved the _flow_get_name() to GstPad.
2005-10-11 11:08:52 +00:00
|
|
|
|
2005-10-11 12:58:44 +00:00
|
|
|
gboolean clock_dirty;
|
|
|
|
GstClock *provided_clock;
|
2005-11-19 18:28:40 +00:00
|
|
|
GstElement *clock_provider;
|
2005-10-11 12:58:44 +00:00
|
|
|
|
2007-09-20 07:42:35 +00:00
|
|
|
/*< private >*/
|
2007-05-22 17:10:04 +00:00
|
|
|
GstBinPrivate *priv;
|
2007-05-22 11:09:45 +00:00
|
|
|
|
2011-02-22 15:04:12 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2000-01-30 09:03:00 +00:00
|
|
|
};
|
|
|
|
|
2005-11-09 13:14:27 +00:00
|
|
|
/**
|
|
|
|
* GstBinClass:
|
2005-11-09 15:10:32 +00:00
|
|
|
* @parent_class: bin parent class
|
2005-11-09 13:14:27 +00:00
|
|
|
*
|
2021-02-04 15:15:39 +00:00
|
|
|
* Subclasses can override #GstBinClass::add_element and #GstBinClass::remove_element
|
|
|
|
* to update the list of children in the bin.
|
2005-11-19 18:28:40 +00:00
|
|
|
*
|
2021-02-04 15:15:39 +00:00
|
|
|
* The #GstBinClass::handle_message method can be overridden to implement custom
|
|
|
|
* message handling. handle_message takes ownership of the message, just like
|
|
|
|
* gst_element_post_message().
|
2016-05-14 09:55:53 +00:00
|
|
|
*
|
2021-02-04 15:15:39 +00:00
|
|
|
* #GstBinClass::deep_element_added will be called when a new element has been
|
2016-05-14 09:55:53 +00:00
|
|
|
* added to any bin inside this bin, so it will also be called if a new child
|
|
|
|
* was added to a sub-bin of this bin. #GstBin implementations that override
|
|
|
|
* this message should chain up to the parent class implementation so the
|
2020-06-25 14:50:44 +00:00
|
|
|
* #GstBin::deep-element-added signal is emitted on all parents.
|
2005-11-09 13:14:27 +00:00
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstBinClass {
|
2000-01-30 09:03:00 +00:00
|
|
|
GstElementClass parent_class;
|
|
|
|
|
2005-06-27 08:16:51 +00:00
|
|
|
/*< private >*/
|
2016-02-28 10:06:40 +00:00
|
|
|
GThreadPool *pool; /* deprecated */
|
2005-10-18 14:29:21 +00:00
|
|
|
|
2000-12-20 09:39:43 +00:00
|
|
|
/* signals */
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstBinClass::element_added:
|
|
|
|
* @bin: the #GstBin
|
|
|
|
* @child: the element that was added
|
|
|
|
*
|
|
|
|
* Method called when an element was added to the bin.
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
void (*element_added) (GstBin *bin, GstElement *child);
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstBinClass::element_removed:
|
|
|
|
* @bin: the #GstBin
|
|
|
|
* @child: the element that was removed
|
|
|
|
*
|
|
|
|
* Method called when an element was removed from the bin.
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
void (*element_removed) (GstBin *bin, GstElement *child);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-06-27 08:16:51 +00:00
|
|
|
/*< public >*/
|
|
|
|
/* virtual methods for subclasses */
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstBinClass::add_element:
|
|
|
|
* @bin: the #GstBin
|
|
|
|
* @element: the element to be added
|
|
|
|
*
|
|
|
|
* Method to add an element to the bin.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the @element was added
|
|
|
|
*/
|
2005-03-07 18:27:42 +00:00
|
|
|
gboolean (*add_element) (GstBin *bin, GstElement *element);
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstBinClass::remove_element:
|
|
|
|
* @bin: the #GstBin
|
|
|
|
* @element: the element to be removed
|
|
|
|
*
|
|
|
|
* Method to remove an element from the bin.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the @element was removed
|
|
|
|
*/
|
2005-03-07 18:27:42 +00:00
|
|
|
gboolean (*remove_element) (GstBin *bin, GstElement *element);
|
|
|
|
|
2021-02-04 15:15:39 +00:00
|
|
|
/**
|
|
|
|
* GstBinClass::handle_message:
|
|
|
|
* @bin: the #GstBin
|
|
|
|
* @message: the message to be handled
|
|
|
|
*
|
|
|
|
* Method to handle a message from the children.
|
|
|
|
*/
|
2005-11-19 18:28:40 +00:00
|
|
|
void (*handle_message) (GstBin *bin, GstMessage *message);
|
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/*< private >*/
|
2012-07-10 09:46:41 +00:00
|
|
|
/* signal */
|
2008-11-19 12:06:41 +00:00
|
|
|
gboolean (*do_latency) (GstBin *bin);
|
|
|
|
|
2016-05-14 09:55:53 +00:00
|
|
|
/*< public >*/
|
|
|
|
/* signal */
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstBinClass::deep_element_added:
|
|
|
|
* @bin: the top level #GstBin
|
|
|
|
* @sub_bin: the #GstBin to which the element was added
|
|
|
|
* @child: the element that was added
|
|
|
|
*
|
|
|
|
* Method called when an element was added somewhere in the bin hierarchy.
|
|
|
|
*/
|
2016-05-14 09:55:53 +00:00
|
|
|
void (*deep_element_added) (GstBin *bin, GstBin *sub_bin, GstElement *child);
|
2021-02-04 15:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstBinClass::deep_element_removed:
|
|
|
|
* @bin: the top level #GstBin
|
|
|
|
* @sub_bin: the #GstBin from which the element was removed
|
|
|
|
* @child: the element that was removed
|
|
|
|
*
|
|
|
|
* Method called when an element was removed somewhere in the bin hierarchy.
|
|
|
|
*/
|
2016-05-14 09:55:53 +00:00
|
|
|
void (*deep_element_removed) (GstBin *bin, GstBin *sub_bin, GstElement *child);
|
|
|
|
|
2008-11-19 12:06:41 +00:00
|
|
|
/*< private >*/
|
2016-05-14 09:55:53 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING-2];
|
2000-01-30 09:03:00 +00:00
|
|
|
};
|
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2004-03-15 14:43:35 +00:00
|
|
|
GType gst_bin_get_type (void);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2004-03-15 14:43:35 +00:00
|
|
|
GstElement* gst_bin_new (const gchar *name);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
/* add and remove elements from the bin */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-03-07 18:27:42 +00:00
|
|
|
gboolean gst_bin_add (GstBin *bin, GstElement *element);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-03-07 18:27:42 +00:00
|
|
|
gboolean gst_bin_remove (GstBin *bin, GstElement *element);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/* retrieve a single child */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-03-07 18:27:42 +00:00
|
|
|
GstElement* gst_bin_get_by_name (GstBin *bin, const gchar *name);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-03-07 18:27:42 +00:00
|
|
|
GstElement* gst_bin_get_by_name_recurse_up (GstBin *bin, const gchar *name);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2007-02-10 18:31:12 +00:00
|
|
|
GstElement* gst_bin_get_by_interface (GstBin *bin, GType iface);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/* retrieve multiple children */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-03-07 18:27:42 +00:00
|
|
|
GstIterator* gst_bin_iterate_elements (GstBin *bin);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
check/gst/gstbin.c: Enable check that works now.
Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
Enable check that works now.
* gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
(update_outdegree), (find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state):
* gst/gstbin.h:
Redid the state change algorithm using a topological sort algo.
Handles all cases correctly.
Exposed iterator for state change order.
* gst/gstelement.h:
Temp storage for state changes. Need to get rid of this soon.
2005-09-27 16:16:39 +00:00
|
|
|
GstIterator* gst_bin_iterate_sorted (GstBin *bin);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-03-07 18:27:42 +00:00
|
|
|
GstIterator* gst_bin_iterate_recurse (GstBin *bin);
|
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2005-06-19 10:54:12 +00:00
|
|
|
GstIterator* gst_bin_iterate_sinks (GstBin *bin);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-01-26 06:57:14 +00:00
|
|
|
GstIterator* gst_bin_iterate_sources (GstBin *bin);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2007-02-10 18:31:12 +00:00
|
|
|
GstIterator* gst_bin_iterate_all_by_interface (GstBin *bin, GType iface);
|
2005-03-07 18:27:42 +00:00
|
|
|
|
2019-11-15 14:49:32 +00:00
|
|
|
GST_API
|
|
|
|
GstIterator* gst_bin_iterate_all_by_element_factory_name (GstBin * bin, const gchar * factory_name);
|
|
|
|
|
2008-11-18 09:58:33 +00:00
|
|
|
/* latency */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2008-11-18 09:58:33 +00:00
|
|
|
gboolean gst_bin_recalculate_latency (GstBin * bin);
|
|
|
|
|
2016-09-02 08:39:17 +00:00
|
|
|
/* set and get suppressed flags */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2016-09-02 08:39:17 +00:00
|
|
|
void gst_bin_set_suppressed_flags (GstBin * bin, GstElementFlags flags);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2016-09-02 08:39:17 +00:00
|
|
|
GstElementFlags gst_bin_get_suppressed_flags (GstBin * bin);
|
2008-11-18 09:58:33 +00:00
|
|
|
|
2015-11-10 17:38:59 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBin, gst_object_unref)
|
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
|
|
|
|
2001-01-20 03:10:44 +00:00
|
|
|
#endif /* __GST_BIN_H__ */
|