Commit e1aeec6d authored by Wim Taymans's avatar Wim Taymans

Removed plugable schedulers.

Original commit message from CVS:
Removed plugable schedulers.
Removed Scheduler/Manager from elements.
Removed gsttypes.h, rearranged includes.
Removed dependency pad<->element, element<>pipeline, and
various others,  fix includes.
implement gst_pad_get_parent() with gst_object_get_parent()
Make GstTask sefcontained.
Fix _get_state() on GstBin, it did not return ASYNC with a 0
timeout.
Fix endless loop in iterator_fold_with_resync.
parent fba0bf77
2005-07-18 Wim Taymans <wim@fluendo.com>
* check/elements/gstfakesrc.c: (GST_START_TEST):
* configure.ac:
* gst/Makefile.am:
* gst/gst.c: (gst_init_get_popt_table), (init_pre), (init_post),
(init_popt_callback):
* gst/gst.h:
* gst/gst_private.h:
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_add_func),
(gst_bin_remove_func), (gst_bin_get_state), (gst_bin_change_state):
* gst/gstbin.h:
* gst/gstbus.h:
* gst/gstconfig.h.in:
* gst/gstelement.c: (gst_element_class_init),
(gst_element_set_base_time), (gst_element_get_base_time),
(iterator_fold_with_resync), (gst_element_change_state),
(gst_element_dispose), (gst_element_get_bus):
* gst/gstelement.h:
* gst/gstelementfactory.h:
* gst/gsterror.c: (_gst_core_errors_init):
* gst/gsterror.h:
* gst/gstevent.h:
* gst/gstghostpad.c: (gst_ghost_pad_do_activate_push):
* gst/gstindex.c:
* gst/gstinfo.c: (_gst_debug_init):
* gst/gstmessage.c: (_gst_message_copy):
* gst/gstmessage.h:
* gst/gstminiobject.h:
* gst/gstobject.c:
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_start_task), (gst_pad_stop_task):
* gst/gstpad.h:
* gst/gstparse.h:
* gst/gstpipeline.c: (gst_pipeline_init), (gst_pipeline_dispose),
(gst_pipeline_change_state), (gst_pipeline_set_new_stream_time),
(gst_pipeline_get_last_stream_time):
* gst/gstpipeline.h:
* gst/gstpluginfeature.h:
* gst/gstquery.h:
* gst/gstscheduler.c:
* gst/gstscheduler.h:
* gst/gststructure.h:
* gst/gsttask.c: (gst_task_get_type), (gst_task_class_init),
(gst_task_finalize), (gst_task_func), (gst_task_create),
(gst_task_set_lock), (gst_task_get_state), (gst_task_start),
(gst_task_stop), (gst_task_pause):
* gst/gsttask.h:
* gst/gsttypefind.h:
* gst/gsttypes.h:
* gst/registries/gstlibxmlregistry.c: (load_feature),
(gst_xml_registry_load), (gst_xml_registry_save_feature):
* gst/registries/gstxmlregistry.c:
(gst_xml_registry_start_element), (gst_xml_registry_save_feature):
* gst/schedulers/threadscheduler.c:
* libs/gst/control/dparammanager.h:
* tools/gst-inspect.c: (print_element_list),
(print_plugin_features), (print_element_features):
* tools/gst-xmlinspect.c: (print_element_list),
(print_plugin_info), (main):
Removed plugable schedulers.
Removed Scheduler/Manager from elements.
Removed gsttypes.h, rearranged includes.
Removed dependency pad<->element, element<>pipeline, and
various others, fix includes.
implement gst_pad_get_parent() with gst_object_get_parent()
Make GstTask sefcontained.
Fix _get_state() on GstBin, it did not return ASYNC with a 0
timeout.
Fix endless loop in iterator_fold_with_resync.
2005-07-18 Wim Taymans <wim@fluendo.com>
* gst/Makefile.am:
......
......@@ -60,7 +60,6 @@ event_func (GstPad * pad, GstEvent * event)
GST_START_TEST (test_num_buffers)
{
GstElement *src;
GstScheduler *scheduler;
GstPad *srcpad, *sinkpad;
src = gst_element_factory_make ("fakesrc", "src");
......@@ -73,9 +72,6 @@ GST_START_TEST (test_num_buffers)
g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
scheduler = gst_scheduler_factory_make (NULL, src);
gst_element_set_scheduler (src, scheduler);
srcpad = gst_element_get_pad (src, "src");
fail_if (srcpad == NULL, "Could not get source pad from fakesrc");
gst_pad_set_caps (sinkpad, NULL);
......
......@@ -653,7 +653,6 @@ gst/base/Makefile
gst/indexers/Makefile
gst/elements/Makefile
gst/parse/Makefile
gst/schedulers/Makefile
gst/registries/Makefile
libs/Makefile
libs/gst/Makefile
......
......@@ -61,8 +61,8 @@ else
GST_URI_SRC = gsturi.c
endif
SUBDIRS = $(GST_PARSE_DIRS) $(GST_REGISTRY_DIRS) . base elements schedulers $(GST_INDEX_DIRS)
DIST_SUBDIRS = base elements parse registries schedulers indexers
SUBDIRS = $(GST_PARSE_DIRS) $(GST_REGISTRY_DIRS) . base elements $(GST_INDEX_DIRS)
DIST_SUBDIRS = base elements parse registries indexers
# make variables for all generated source and header files to make the
# distinction clear
......@@ -103,7 +103,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gstquery.c \
gstqueryutils.c \
gstqueue.c \
gstscheduler.c \
gststructure.c \
gstsystemclock.c \
gsttag.c \
......@@ -179,7 +178,6 @@ gst_headers = \
gstquery.h \
gstqueryutils.h \
gstqueue.h \
gstscheduler.h \
gststructure.h \
gstsystemclock.h \
gsttag.h \
......@@ -188,7 +186,6 @@ gst_headers = \
gsttrace.h \
gsttrashstack.h \
gsttypefind.h \
gsttypes.h \
gsturi.h \
gsturitype.h \
gstutils.h \
......
......@@ -93,7 +93,6 @@ enum
ARG_PLUGIN_PATH,
ARG_PLUGIN_LOAD,
ARG_SEGTRAP_DISABLE,
ARG_SCHEDULER,
ARG_REGISTRY
};
......@@ -191,8 +190,6 @@ gst_init_get_popt_table (void)
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, NULL, N_("SCHEDULER")},
{"gst-registry", NUL, POPT_ARG_STRING | POPT_ARGFLAG_STRIP, NULL,
ARG_REGISTRY, N_("Registry to use"), N_("REGISTRY")},
POPT_TABLEEND
......@@ -209,10 +206,6 @@ gst_init_get_popt_table (void)
g_strdup_printf (_
("path list for loading plugins (separated by '%s')"),
G_SEARCHPATH_SEPARATOR_S);
} else if (strcmp (gstreamer_options[i].longName, "gst-scheduler") == 0) {
gstreamer_options[i].descrip =
g_strdup_printf (_("Scheduler to use (default is '%s')"),
GST_SCHEDULER_DEFAULT_NAME);
}
}
......@@ -500,8 +493,6 @@ init_pre (void)
gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/elements");
gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/types");
gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/autoplug");
gst_registry_add_path (_global_registry,
PLUGINS_BUILDDIR "/gst/schedulers");
gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/indexers");
#else
/* add the main (installed) library path if GST_PLUGIN_PATH_ONLY not set */
......@@ -585,7 +576,6 @@ init_post (void)
gst_pad_get_type ();
gst_element_factory_get_type ();
gst_element_get_type ();
gst_scheduler_factory_get_type ();
gst_type_find_factory_get_type ();
gst_bin_get_type ();
......@@ -784,9 +774,6 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
case ARG_SEGTRAP_DISABLE:
_gst_disable_segtrap = TRUE;
break;
case ARG_SCHEDULER:
gst_scheduler_factory_set_default_name (arg);
break;
case ARG_REGISTRY:
#ifndef GST_DISABLE_REGISTRY
g_object_set (G_OBJECT (_user_registry), "location", arg, NULL);
......
......@@ -28,7 +28,6 @@
#include <popt.h>
#include <gst/gstenumtypes.h>
#include <gst/gsttypes.h>
#include <gst/gstversion.h>
#include <gst/gstbin.h>
......@@ -52,7 +51,6 @@
#include <gst/gstplugin.h>
#include <gst/gstquery.h>
#include <gst/gstqueryutils.h>
#include <gst/gstscheduler.h>
#include <gst/gststructure.h>
#include <gst/gstsystemclock.h>
#include <gst/gsttag.h>
......
......@@ -46,13 +46,10 @@ gboolean __gst_in_valgrind (void);
#include <gst/gstinfo.h>
extern GstDebugCategory *GST_CAT_GST_INIT;
extern GstDebugCategory *GST_CAT_COTHREADS;
extern GstDebugCategory *GST_CAT_COTHREAD_SWITCH;
extern GstDebugCategory *GST_CAT_AUTOPLUG;
extern GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT;
extern GstDebugCategory *GST_CAT_PARENTAGE;
extern GstDebugCategory *GST_CAT_STATES;
extern GstDebugCategory *GST_CAT_PLANNING;
extern GstDebugCategory *GST_CAT_SCHEDULING;
extern GstDebugCategory *GST_CAT_BUFFER;
extern GstDebugCategory *GST_CAT_CAPS;
......@@ -78,13 +75,10 @@ extern GstDebugCategory *GST_CAT_PROBE;
#else
#define GST_CAT_GST_INIT NULL
#define GST_CAT_COTHREADS NULL
#define GST_CAT_COTHREAD_SWITCH NULL
#define GST_CAT_AUTOPLUG NULL
#define GST_CAT_AUTOPLUG_ATTEMPT NULL
#define GST_CAT_PARENTAGE NULL
#define GST_CAT_STATES NULL
#define GST_CAT_PLANNING NULL
#define GST_CAT_SCHEDULING NULL
#define GST_CAT_DATAFLOW NULL
#define GST_CAT_BUFFER NULL
......
......@@ -32,7 +32,6 @@
#include "gstinfo.h"
#include "gsterror.h"
#include "gstscheduler.h"
#include "gstindex.h"
#include "gstutils.h"
......@@ -67,9 +66,6 @@ static void gst_bin_set_index_func (GstElement * element, GstIndex * index);
static GstClock *gst_bin_get_clock_func (GstElement * element);
static void gst_bin_set_clock_func (GstElement * element, GstClock * clock);
static void gst_bin_set_manager (GstElement * element, GstPipeline * manager);
static void gst_bin_set_scheduler (GstElement * element, GstScheduler * sched);
static gboolean gst_bin_send_event (GstElement * element, GstEvent * event);
static GstBusSyncReply bin_bus_handler (GstBus * bus,
GstMessage * message, GstBin * bin);
......@@ -179,8 +175,6 @@ gst_bin_class_init (GstBinClass * klass)
#endif
gstelement_class->get_clock = GST_DEBUG_FUNCPTR (gst_bin_get_clock_func);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_bin_set_clock_func);
gstelement_class->set_manager = GST_DEBUG_FUNCPTR (gst_bin_set_manager);
gstelement_class->set_scheduler = GST_DEBUG_FUNCPTR (gst_bin_set_scheduler);
gstelement_class->send_event = GST_DEBUG_FUNCPTR (gst_bin_send_event);
gstelement_class->query = GST_DEBUG_FUNCPTR (gst_bin_query);
......@@ -295,50 +289,6 @@ gst_bin_get_clock_func (GstElement * element)
return result;
}
/* set the scheduler on all of the children in this bin
*
* MT safe
*/
static void
gst_bin_set_scheduler (GstElement * element, GstScheduler * sched)
{
GList *children;
GstBin *bin;
bin = GST_BIN (element);
parent_class->set_scheduler (element, sched);
GST_LOCK (bin);
for (children = bin->children; children; children = g_list_next (children)) {
GstElement *child = GST_ELEMENT (children->data);
gst_element_set_scheduler (child, sched);
}
GST_UNLOCK (bin);
}
/* set the manager on all of the children in this bin
*
* MT safe
*/
static void
gst_bin_set_manager (GstElement * element, GstPipeline * manager)
{
GstBin *bin = GST_BIN (element);
GList *kids;
GstElement *kid;
GST_ELEMENT_CLASS (parent_class)->set_manager (element, manager);
GST_LOCK (element);
for (kids = bin->children; kids != NULL; kids = kids->next) {
kid = GST_ELEMENT (kids->data);
gst_element_set_manager (kid, manager);
}
GST_UNLOCK (element);
}
static gboolean
is_eos (GstBin * bin)
{
......@@ -426,9 +376,9 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
bin->numchildren++;
bin->children_cookie++;
gst_element_set_manager (element, GST_ELEMENT (bin)->manager);
gst_element_set_bus (element, bin->child_bus);
gst_element_set_scheduler (element, GST_ELEMENT_SCHEDULER (bin));
gst_element_set_base_time (element, GST_ELEMENT (bin)->base_time);
gst_element_set_clock (element, GST_ELEMENT_CLOCK (bin));
GST_UNLOCK (bin);
......@@ -552,9 +502,7 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
elem_name);
g_free (elem_name);
gst_element_set_manager (element, NULL);
gst_element_set_bus (element, NULL);
gst_element_set_scheduler (element, NULL);
/* unlock any waiters for the state change. It is possible that
* we are waiting for an ASYNC state change on this element. The
......@@ -878,14 +826,10 @@ gst_bin_get_state (GstElement * element, GstElementState * state,
GstElementStateReturn ret = GST_STATE_SUCCESS;
GList *children;
guint32 children_cookie;
gboolean zero_timeout;
gboolean have_no_preroll;
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "getting state");
zero_timeout = timeout != NULL && timeout->tv_sec == 0
&& timeout->tv_usec == 0;
/* lock bin, no element can be added or removed between going into
* the quick scan and the blocking wait. */
GST_LOCK (bin);
......@@ -893,11 +837,11 @@ gst_bin_get_state (GstElement * element, GstElementState * state,
restart:
have_no_preroll = FALSE;
/* if we have a non zero timeout we must make sure not to block
/* first we need to poll with a non zero timeout to make sure we don't block
* on the sinks when we have NO_PREROLL elements. This is why we do
* a quick check if there are still NO_PREROLL elements. We also
* catch the error elements this way. */
if (!zero_timeout) {
{
GTimeVal tv;
gboolean have_async = FALSE;
......@@ -928,7 +872,7 @@ restart:
}
switch (ret) {
/* report FAILURE or NO_PREROLL immediatly */
/* report FAILURE immediatly */
case GST_STATE_FAILURE:
goto done;
case GST_STATE_NO_PREROLL:
......@@ -996,13 +940,8 @@ restart:
case GST_STATE_NO_PREROLL:
/* report FAILURE and NO_PREROLL immediatly */
goto done;
break;
case GST_STATE_ASYNC:
/* since we checked for non prerollable elements before,
* the first ASYNC return is the real return value */
if (!zero_timeout)
goto done;
break;
goto done;
default:
g_assert_not_reached ();
}
......@@ -1244,36 +1183,42 @@ restart:
peer = gst_pad_get_peer (pad);
if (peer) {
GstElement *peer_elem;
GstObject *peer_parent;
peer_elem = gst_pad_get_parent (peer);
/* get parent */
peer_parent = gst_object_get_parent (GST_OBJECT (peer));
if (peer_elem) {
/* if we have an element parent, follow it */
if (peer_parent && GST_IS_ELEMENT (peer_parent)) {
GstObject *parent;
/* see if this element is in the bin we are currently handling */
parent = gst_object_get_parent (GST_OBJECT_CAST (peer_elem));
parent = gst_object_get_parent (peer_parent);
if (parent) {
if (parent == GST_OBJECT_CAST (bin)) {
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"adding element %s to queue", GST_ELEMENT_NAME (peer_elem));
"adding element %s to queue", GST_ELEMENT_NAME (peer_parent));
/* make sure we don't have duplicates */
remove_all_from_queue (semi_queue, peer_elem, TRUE);
remove_all_from_queue (elem_queue, peer_elem, TRUE);
remove_all_from_queue (semi_queue, peer_parent, TRUE);
remove_all_from_queue (elem_queue, peer_parent, TRUE);
/* was reffed before pushing on the queue by the
* gst_object_get_parent() call we used to get the element. */
g_queue_push_tail (elem_queue, peer_elem);
g_queue_push_tail (elem_queue, peer_parent);
/* so that we don't unref it */
peer_parent = NULL;
} else {
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"not adding element %s to queue, it is in another bin",
GST_ELEMENT_NAME (peer_elem));
gst_object_unref (peer_elem);
GST_ELEMENT_NAME (peer_parent));
}
gst_object_unref (parent);
}
}
if (peer_parent)
gst_object_unref (peer_parent);
gst_object_unref (peer);
} else {
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
......
......@@ -54,8 +54,8 @@ typedef enum {
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5
} GstBinFlags;
/*typedef struct _GstBin GstBin; */
/*typedef struct _GstBinClass GstBinClass; */
typedef struct _GstBin GstBin;
typedef struct _GstBinClass GstBinClass;
#define GST_BIN_NUMCHILDREN(bin) (GST_BIN_CAST(bin)->numchildren);
#define GST_BIN_CHILDREN(bin) (GST_BIN_CAST(bin)->children);
......
......@@ -22,7 +22,9 @@
#ifndef __GST_BUS_H__
#define __GST_BUS_H__
#include <gst/gsttypes.h>
typedef struct _GstBus GstBus;
typedef struct _GstBusClass GstBusClass;
#include <gst/gstmessage.h>
#include <gst/gstclock.h>
......
......@@ -20,6 +20,9 @@
#define GST_DISABLE_URI 1
#endif
/***** default padding of structures *****/
#define GST_PADDING 4
#define GST_PADDING_INIT {0}
/***** disabling of subsystems *****/
......
......@@ -29,7 +29,6 @@
#include "gstbus.h"
#include "gstmarshal.h"
#include "gsterror.h"
#include "gstscheduler.h"
#include "gstevent.h"
#include "gstutils.h"
#include "gstinfo.h"
......@@ -67,11 +66,7 @@ static void gst_element_finalize (GObject * object);
static GstElementStateReturn gst_element_change_state (GstElement * element);
static GstElementStateReturn gst_element_get_state_func (GstElement * element,
GstElementState * state, GstElementState * pending, GTimeVal * timeout);
static void gst_element_set_manager_func (GstElement * element,
GstPipeline * manager);
static void gst_element_set_bus_func (GstElement * element, GstBus * bus);
static void gst_element_set_scheduler_func (GstElement * element,
GstScheduler * scheduler);
#ifndef GST_DISABLE_LOADSAVE
static xmlNodePtr gst_element_save_thyself (GstObject * object,
......@@ -174,9 +169,7 @@ gst_element_class_init (GstElementClass * klass)
klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state);
klass->get_state = GST_DEBUG_FUNCPTR (gst_element_get_state_func);
klass->set_manager = GST_DEBUG_FUNCPTR (gst_element_set_manager_func);
klass->set_bus = GST_DEBUG_FUNCPTR (gst_element_set_bus_func);
klass->set_scheduler = GST_DEBUG_FUNCPTR (gst_element_set_scheduler_func);
klass->numpadtemplates = 0;
klass->elementfactory = NULL;
......@@ -1915,6 +1908,7 @@ iterator_fold_with_resync (GstIterator * iter, GstIteratorFoldFunction func,
switch (ires) {
case GST_ITERATOR_RESYNC:
gst_iterator_resync (iter);
break;
case GST_ITERATOR_DONE:
res = TRUE;
......@@ -1999,13 +1993,6 @@ gst_element_change_state (GstElement * element)
}
break;
case GST_STATE_PAUSED_TO_PLAYING:
/* FIXME really needed? */
GST_LOCK (element);
if (GST_ELEMENT_MANAGER (element)) {
element->base_time =
GST_ELEMENT_CAST (GST_ELEMENT_MANAGER (element))->base_time;
}
GST_UNLOCK (element);
break;
case GST_STATE_PLAYING_TO_PAUSED:
break;
......@@ -2072,7 +2059,6 @@ gst_element_dispose (GObject * object)
}
GST_LOCK (element);
gst_object_replace ((GstObject **) & element->manager, NULL);
gst_object_replace ((GstObject **) & element->clock, NULL);
GST_UNLOCK (element);
......@@ -2238,20 +2224,6 @@ gst_element_restore_thyself (GstObject * object, xmlNodePtr self)
}
#endif /* GST_DISABLE_LOADSAVE */
static void
gst_element_set_manager_func (GstElement * element, GstPipeline * manager)
{
g_return_if_fail (GST_IS_ELEMENT (element));
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, element, "setting manager to %p",
manager);
/* setting the manager cannot increase the refcount */
GST_LOCK (element);
GST_ELEMENT_MANAGER (element) = manager;
GST_UNLOCK (element);
}
static void
gst_element_set_bus_func (GstElement * element, GstBus * bus)
{
......@@ -2265,69 +2237,6 @@ gst_element_set_bus_func (GstElement * element, GstBus * bus)
GST_UNLOCK (element);
}
static void
gst_element_set_scheduler_func (GstElement * element, GstScheduler * scheduler)
{
g_return_if_fail (GST_IS_ELEMENT (element));
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, element, "setting scheduler to %p",
scheduler);
GST_LOCK (element);
gst_object_replace ((GstObject **) & GST_ELEMENT_SCHEDULER (element),
GST_OBJECT (scheduler));
GST_UNLOCK (element);
}
/**
* gst_element_set_manager:
* @element: a #GstElement to set the manager of.
* @manager: the #GstManager to set.
*
* Sets the manager of the element. For internal use only, unless you're
* writing a new bin subclass.
*
* MT safe.
*/
void
gst_element_set_manager (GstElement * element, GstPipeline * manager)
{
GstElementClass *oclass;
g_return_if_fail (GST_IS_ELEMENT (element));
oclass = GST_ELEMENT_GET_CLASS (element);
if (oclass->set_manager)
oclass->set_manager (element, manager);
}
/**
* gst_element_get_manager:
* @element: a #GstElement to get the manager of.
*
* Returns the manager of the element.
*
* Returns: the element's #GstPipeline. unref after usage.
*
* MT safe.
*/
GstPipeline *
gst_element_get_manager (GstElement * element)
{
GstPipeline *result = NULL;
g_return_val_if_fail (GST_IS_ELEMENT (element), result);
GST_LOCK (element);
result = GST_ELEMENT_MANAGER (element);
gst_object_ref (result);
GST_UNLOCK (element);
return result;
}
/**
* gst_element_set_bus:
* @element: a #GstElement to set the bus of.
......@@ -2377,50 +2286,3 @@ gst_element_get_bus (GstElement * element)
return result;
}
/**
* gst_element_set_scheduler:
* @element: a #GstElement to set the scheduler of.
* @scheduler: the #GstScheduler to set.
*
* Sets the scheduler of the element. For internal use only, unless you're
* testing elements.
*
* MT safe.
*/
void
gst_element_set_scheduler (GstElement * element, GstScheduler * scheduler)
{
GstElementClass *oclass;
g_return_if_fail (GST_IS_ELEMENT (element));
oclass = GST_ELEMENT_GET_CLASS (element);
if (oclass->set_scheduler)
oclass->set_scheduler (element, scheduler);
}
/**
* gst_element_get_scheduler:
* @element: a #GstElement to get the scheduler of.
*
* Returns the scheduler of the element.
*
* Returns: the element's #GstScheduler.
*
* MT safe.
*/
GstScheduler *
gst_element_get_scheduler (GstElement * element)
{
GstScheduler *result = NULL;
g_return_val_if_fail (GST_IS_ELEMENT (element), result);
GST_LOCK (element);
result = GST_ELEMENT_SCHEDULER (element);
GST_UNLOCK (element);
return result;
}
......@@ -24,10 +24,25 @@
#ifndef __GST_ELEMENT_H__
#define __GST_ELEMENT_H__
/* gstelement.h and gstelementfactory.h include eachother */
typedef struct _GstElement GstElement;
typedef struct _GstElementClass GstElementClass;
/* gstmessage.h needs ElementState */
#define GST_NUM_STATES 4
typedef enum {
GST_STATE_VOID_PENDING = 0,
GST_STATE_NULL = (1 << 0),
GST_STATE_READY = (1 << 1),
GST_STATE_PAUSED = (1 << 2),
GST_STATE_PLAYING = (1 << 3)
} GstElementState;
#include <gst/gstconfig.h>
#include <gst/gsttypes.h>
#include <gst/gstobject.h>
#include <gst/gstpad.h>
#include <gst/gstbus.h>
#include <gst/gstclock.h>
#include <gst/gstelementfactory.h>
#include <gst/gstplugin.h>
......@@ -49,7 +64,13 @@ GST_EXPORT GType _gst_element_type;
#define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
#define GST_ELEMENT_CAST(obj) ((GstElement*)(obj))
#define GST_NUM_STATES 4
typedef enum {
GST_STATE_FAILURE = 0,
GST_STATE_SUCCESS = 1,
GST_STATE_ASYNC = 2,