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>
|
|
|
|
*
|
|
|
|
* gstscheduler.h: Header for default scheduler code
|
2000-12-26 23:51:04 +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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_SCHEDULER_H__
|
|
|
|
#define __GST_SCHEDULER_H__
|
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
#include <gst/gstelement.h>
|
2000-12-26 23:51:04 +00:00
|
|
|
#include <gst/gstbin.h>
|
|
|
|
|
2000-12-28 22:12:02 +00:00
|
|
|
|
2000-12-26 23:51:04 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
#define GST_TYPE_SCHEDULE \
|
|
|
|
(gst_schedule_get_type())
|
|
|
|
#define GST_SCHEDULE(obj) \
|
2001-06-25 01:20:11 +00:00
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SCHEDULE,GstSchedule))
|
2001-05-25 21:00:07 +00:00
|
|
|
#define GST_SCHEDULE_CLASS(klass) \
|
2001-06-25 01:20:11 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SCHEDULE,GstScheduleClass))
|
2001-05-25 21:00:07 +00:00
|
|
|
#define GST_IS_SCHEDULE(obj) \
|
2001-06-25 01:20:11 +00:00
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SCHEDULE))
|
2001-05-25 21:00:07 +00:00
|
|
|
#define GST_IS_SCHEDULE_CLASS(klass) \
|
2001-06-25 01:20:11 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SCHEDULE))
|
2001-05-25 21:00:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define GST_SCHED_PARENT(sched) ((sched)->parent)
|
|
|
|
|
|
|
|
//typedef struct _GstSchedule GstSchedule;
|
|
|
|
//typedef struct _GstScheduleClass GstScheduleClass;
|
|
|
|
typedef struct _GstScheduleChain GstScheduleChain;
|
|
|
|
|
|
|
|
struct _GstSchedule {
|
|
|
|
GstObject object;
|
|
|
|
|
|
|
|
GstElement *parent;
|
|
|
|
|
|
|
|
GList *elements;
|
|
|
|
gint num_elements;
|
|
|
|
|
|
|
|
GList *chains;
|
|
|
|
gint num_chains;
|
|
|
|
|
|
|
|
void (*add_element) (GstSchedule *sched, GstElement *element);
|
|
|
|
void (*remove_element) (GstSchedule *sched, GstElement *element);
|
|
|
|
void (*enable_element) (GstSchedule *sched, GstElement *element);
|
|
|
|
void (*disable_element) (GstSchedule *sched, GstElement *element);
|
|
|
|
void (*lock_element) (GstSchedule *sched, GstElement *element);
|
|
|
|
void (*unlock_element) (GstSchedule *sched, GstElement *element);
|
|
|
|
void (*pad_connect) (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
|
|
|
|
void (*pad_disconnect) (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
|
|
|
|
gboolean (*iterate) (GstSchedule *sched);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstScheduleClass {
|
|
|
|
GstObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
2001-05-27 00:04:00 +00:00
|
|
|
#define GST_SCHEDULE_SAFETY(sched) if (sched)
|
|
|
|
//#define GST_SCHEDULE_SAFETY(sched)
|
|
|
|
|
|
|
|
#define GST_SCHEDULE_ADD_ELEMENT(sched,element) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { ((sched)->add_element((sched),(element))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_REMOVE_ELEMENT(sched,element) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { ((sched)->remove_element((sched),(element))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_ENABLE_ELEMENT(sched,element) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { ((sched)->enable_element((sched),(element))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_DISABLE_ELEMENT(sched,element) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { ((sched)->disable_element((sched),(element))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_LOCK_ELEMENT(sched,element) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { if ((sched)->lock_element != NULL) \
|
|
|
|
((sched)->lock_element((sched),(element))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_UNLOCK_ELEMENT(sched,element) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { if ((sched)->unlock_element != NULL) \
|
|
|
|
((sched)->unlock_element((sched),(element))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_PAD_CONNECT(sched,srcpad,sinkpad) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { ((sched)->pad_connect((sched),(srcpad),(sinkpad))); } \
|
|
|
|
}G_STMT_END
|
|
|
|
#define GST_SCHEDULE_PAD_DISCONNECT(sched,srcpad,sinkpad) G_STMT_START{ \
|
|
|
|
GST_SCHEDULE_SAFETY(sched) { ((sched)->pad_disconnect((sched),(srcpad),(sinkpad))); } \
|
|
|
|
}G_STMT_END
|
2001-05-25 21:00:07 +00:00
|
|
|
#define GST_SCHEDULE_ITERATE(sched) \
|
|
|
|
((sched)->iterate((sched)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct _GstScheduleChain {
|
|
|
|
GstSchedule *sched;
|
|
|
|
|
|
|
|
GList *disabled;
|
|
|
|
|
|
|
|
GList *elements;
|
|
|
|
gint num_elements;
|
|
|
|
|
|
|
|
GstElement *entry;
|
|
|
|
|
|
|
|
gint cothreaded_elements;
|
|
|
|
gboolean schedule;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-06-25 01:20:11 +00:00
|
|
|
GType gst_schedule_get_type (void);
|
2001-05-27 14:37:29 +00:00
|
|
|
GstSchedule* gst_schedule_new (GstElement *parent);
|
|
|
|
|
|
|
|
void gst_schedule_add_element (GstSchedule *sched, GstElement *element);
|
|
|
|
void gst_schedule_remove_element (GstSchedule *sched, GstElement *element);
|
|
|
|
void gst_schedule_enable_element (GstSchedule *sched, GstElement *element);
|
|
|
|
void gst_schedule_disable_element (GstSchedule *sched, GstElement *element);
|
|
|
|
void gst_schedule_pad_connect (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
|
|
|
|
void gst_schedule_pad_disconnect (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
|
|
|
|
gboolean gst_schedule_iterate (GstSchedule *sched);
|
|
|
|
|
|
|
|
void gst_schedule_show (GstSchedule *sched);
|
2001-05-25 21:00:07 +00:00
|
|
|
|
2000-12-26 23:51:04 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* __GST_SCHEDULER_H__ */
|