mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
Implemented some test cases... they all fail :-(
Original commit message from CVS: Implemented some test cases... they all fail :-( Added a flag to identity to for loop_based behaviour. Added a signal to fakesink when a buffer is consumed.
This commit is contained in:
parent
a914e7b210
commit
9987a75b1b
21 changed files with 1385 additions and 144 deletions
|
@ -34,6 +34,7 @@ GstElementDetails gst_fakesink_details = {
|
|||
/* FakeSink signals and args */
|
||||
enum {
|
||||
/* FILL ME */
|
||||
SIGNAL_HANDOFF,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
@ -49,7 +50,7 @@ static void gst_fakesink_init(GstFakeSink *fakesink);
|
|||
static void gst_fakesink_chain(GstPad *pad,GstBuffer *buf);
|
||||
|
||||
static GstSinkClass *parent_class = NULL;
|
||||
//static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
|
||||
static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
GtkType
|
||||
gst_fakesink_get_type (void)
|
||||
|
@ -75,10 +76,20 @@ gst_fakesink_get_type (void)
|
|||
static void
|
||||
gst_fakesink_class_init (GstFakeSinkClass *klass)
|
||||
{
|
||||
GtkObjectClass *gtkobject_class;
|
||||
GstSinkClass *gstsink_class;
|
||||
|
||||
gtkobject_class = (GtkObjectClass*)klass;
|
||||
gstsink_class = (GstSinkClass*)klass;
|
||||
|
||||
gst_fakesink_signals[SIGNAL_HANDOFF] =
|
||||
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
|
||||
GTK_SIGNAL_OFFSET (GstFakeSinkClass, handoff),
|
||||
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (gtkobject_class, gst_fakesink_signals,
|
||||
LAST_SIGNAL);
|
||||
|
||||
parent_class = gtk_type_class (GST_TYPE_SINK);
|
||||
}
|
||||
|
||||
|
@ -114,4 +125,8 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
|
|||
g_print("(%s:%s)< ",GST_DEBUG_PAD_NAME(pad));
|
||||
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF],
|
||||
fakesink);
|
||||
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ struct _GstFakeSink {
|
|||
|
||||
struct _GstFakeSinkClass {
|
||||
GstSinkClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (*handoff) (GstElement *element,GstPad *pad);
|
||||
};
|
||||
|
||||
GtkType gst_fakesink_get_type(void);
|
||||
|
|
|
@ -39,7 +39,7 @@ enum {
|
|||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_CONTROL
|
||||
ARG_LOOP_BASED,
|
||||
};
|
||||
|
||||
|
||||
|
@ -86,11 +86,11 @@ gst_identity_class_init (GstIdentityClass *klass)
|
|||
|
||||
parent_class = gtk_type_class (GST_TYPE_FILTER);
|
||||
|
||||
//gtk_object_add_arg_type("GstIdentity::control", GTK_TYPE_INT,
|
||||
// GTK_ARG_READWRITE, ARG_CONTROL);
|
||||
gtk_object_add_arg_type ("GstIdentity::loop_based", GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE, ARG_LOOP_BASED);
|
||||
|
||||
//gtkobject_class->set_arg = gst_identity_set_arg;
|
||||
//gtkobject_class->get_arg = gst_identity_get_arg;
|
||||
gtkobject_class->set_arg = gst_identity_set_arg;
|
||||
gtkobject_class->get_arg = gst_identity_get_arg;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -103,7 +103,7 @@ gst_identity_init (GstIdentity *identity)
|
|||
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
||||
|
||||
identity->control = 0;
|
||||
identity->loop_based = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -121,6 +121,22 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
|
|||
gst_pad_push (identity->srcpad, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_identity_loop (GstElement *element)
|
||||
{
|
||||
GstIdentity *identity;
|
||||
GstBuffer *buf;
|
||||
|
||||
g_return_if_fail (element != NULL);
|
||||
g_return_if_fail (GST_IS_IDENTITY (element));
|
||||
|
||||
identity = GST_IDENTITY (element);
|
||||
|
||||
buf = gst_pad_pull (identity->sinkpad);
|
||||
|
||||
gst_pad_push (identity->srcpad, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
|
||||
{
|
||||
|
@ -132,8 +148,16 @@ gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
|
|||
identity = GST_IDENTITY (object);
|
||||
|
||||
switch(id) {
|
||||
case ARG_CONTROL:
|
||||
identity->control = GTK_VALUE_INT (*arg);
|
||||
case ARG_LOOP_BASED:
|
||||
identity->loop_based = GTK_VALUE_BOOL (*arg);
|
||||
if (identity->loop_based) {
|
||||
gst_element_set_loop_function (GST_ELEMENT (identity), gst_identity_loop);
|
||||
gst_pad_set_chain_function (identity->sinkpad, NULL);
|
||||
}
|
||||
else {
|
||||
gst_pad_set_chain_function (identity->sinkpad, gst_identity_chain);
|
||||
gst_element_set_loop_function (GST_ELEMENT (identity), NULL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -149,8 +173,8 @@ static void gst_identity_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
|||
identity = GST_IDENTITY (object);
|
||||
|
||||
switch (id) {
|
||||
case ARG_CONTROL:
|
||||
GTK_VALUE_INT (*arg) = identity->control;
|
||||
case ARG_LOOP_BASED:
|
||||
GTK_VALUE_BOOL (*arg) = identity->loop_based;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
|
|
|
@ -54,7 +54,7 @@ struct _GstIdentity {
|
|||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
|
||||
gint control;
|
||||
gboolean loop_based;
|
||||
};
|
||||
|
||||
struct _GstIdentityClass {
|
||||
|
|
|
@ -20,17 +20,14 @@
|
|||
#include "gstdebug.h"
|
||||
#include "gstautoplug.h"
|
||||
|
||||
#define MAX_COST 999999
|
||||
|
||||
typedef guint (*GstAutoplugCostFunction) (gpointer src, gpointer dest, gpointer data);
|
||||
typedef GList* (*GstAutoplugListFunction) (gpointer data);
|
||||
static void gst_autoplug_class_init (GstAutoplugClass *klass);
|
||||
static void gst_autoplug_init (GstAutoplug *autoplug);
|
||||
|
||||
static GList* gst_autoplug_func (gpointer src, gpointer sink,
|
||||
GstAutoplugListFunction list_function,
|
||||
GstAutoplugCostFunction cost_function,
|
||||
gpointer data);
|
||||
|
||||
|
||||
struct _gst_autoplug_node
|
||||
{
|
||||
gpointer iNode;
|
||||
|
@ -40,69 +37,33 @@ struct _gst_autoplug_node
|
|||
|
||||
typedef struct _gst_autoplug_node gst_autoplug_node;
|
||||
|
||||
static GList*
|
||||
gst_autoplug_enqueue (GList *queue, gpointer iNode, gint iDist, gpointer iPrev)
|
||||
{
|
||||
gst_autoplug_node *node = g_malloc (sizeof (gst_autoplug_node));
|
||||
static GstObjectClass *parent_class = NULL;
|
||||
|
||||
node->iNode = iNode;
|
||||
node->iDist = iDist;
|
||||
node->iPrev = iPrev;
|
||||
GtkType gst_autoplug_get_type(void) {
|
||||
static GtkType autoplug_type = 0;
|
||||
|
||||
queue = g_list_append (queue, node);
|
||||
|
||||
return queue;
|
||||
if (!autoplug_type) {
|
||||
static const GtkTypeInfo autoplug_info = {
|
||||
"GstAutoplug",
|
||||
sizeof(GstElement),
|
||||
sizeof(GstElementClass),
|
||||
(GtkClassInitFunc)gst_autoplug_class_init,
|
||||
(GtkObjectInitFunc)gst_autoplug_init,
|
||||
(GtkArgSetFunc)NULL,
|
||||
(GtkArgGetFunc)NULL,
|
||||
(GtkClassInitFunc)NULL,
|
||||
};
|
||||
autoplug_type = gtk_type_unique(GST_TYPE_AUTOPLUG,&autoplug_info);
|
||||
}
|
||||
return autoplug_type;
|
||||
}
|
||||
|
||||
static GList*
|
||||
gst_autoplug_dequeue (GList *queue, gpointer *iNode, gint *iDist, gpointer *iPrev)
|
||||
{
|
||||
GList *head;
|
||||
gst_autoplug_node *node;
|
||||
|
||||
head = g_list_first (queue);
|
||||
|
||||
if (head) {
|
||||
node = (gst_autoplug_node *)head->data;
|
||||
*iNode = node->iNode;
|
||||
*iPrev = node->iPrev;
|
||||
*iDist = node->iDist;
|
||||
head = g_list_remove (queue, node);
|
||||
}
|
||||
|
||||
return head;
|
||||
static void
|
||||
gst_autoplug_class_init(GstAutoplugClass *klass) {
|
||||
parent_class = gtk_type_class(GST_TYPE_OBJECT);
|
||||
}
|
||||
|
||||
static gint
|
||||
find_factory (gst_autoplug_node *rgnNodes, GstElementFactory *factory)
|
||||
{
|
||||
gint i=0;
|
||||
|
||||
while (rgnNodes[i].iNode) {
|
||||
if (rgnNodes[i].iNode == factory) return i;
|
||||
i++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static GList*
|
||||
construct_path (gst_autoplug_node *rgnNodes, GstElementFactory *factory)
|
||||
{
|
||||
GstElementFactory *current;
|
||||
GList *factories = NULL;
|
||||
|
||||
current = rgnNodes[find_factory(rgnNodes, factory)].iPrev;
|
||||
|
||||
while (current != NULL)
|
||||
{
|
||||
gpointer next;
|
||||
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
|
||||
if (next) factories = g_list_prepend (factories, current);
|
||||
current = next;
|
||||
}
|
||||
|
||||
return factories;
|
||||
static void gst_autoplug_init(GstAutoplug *autoplug) {
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -144,25 +105,6 @@ gst_autoplug_elementfactory_get_list (gpointer data)
|
|||
return gst_elementfactory_get_list ();
|
||||
}
|
||||
|
||||
static guint
|
||||
gst_autoplug_elementfactory_find_cost (gpointer src, gpointer dest, gpointer data)
|
||||
{
|
||||
if (gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest)) {
|
||||
return 1;
|
||||
}
|
||||
return MAX_COST;
|
||||
}
|
||||
|
||||
|
||||
GList*
|
||||
gst_autoplug_factories (GstElementFactory *srcfactory, GstElementFactory *sinkfactory)
|
||||
{
|
||||
return gst_autoplug_func (srcfactory, sinkfactory,
|
||||
gst_autoplug_elementfactory_get_list,
|
||||
gst_autoplug_elementfactory_find_cost,
|
||||
NULL);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GstCaps *src;
|
||||
GstCaps *sink;
|
||||
|
@ -192,8 +134,10 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
|
|||
res = gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest);
|
||||
}
|
||||
|
||||
if (res) return 1;
|
||||
return MAX_COST;
|
||||
if (res)
|
||||
return 1;
|
||||
else
|
||||
return GST_AUTOPLUG_MAX_COST;
|
||||
}
|
||||
|
||||
GList*
|
||||
|
@ -210,34 +154,69 @@ gst_autoplug_caps (GstCaps *srccaps, GstCaps *sinkcaps)
|
|||
&caps);
|
||||
}
|
||||
|
||||
GList*
|
||||
gst_autoplug_elements (GstElement *src, GstElement *sink)
|
||||
static gint
|
||||
find_factory (gst_autoplug_node *rgnNodes, gpointer factory)
|
||||
{
|
||||
return NULL;
|
||||
gint i=0;
|
||||
|
||||
while (rgnNodes[i].iNode) {
|
||||
if (rgnNodes[i].iNode == factory) return i;
|
||||
i++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
GList*
|
||||
gst_autoplug_caps_to_factory (GstCaps *srccaps, GstElementFactory *sinkfactory)
|
||||
static GList*
|
||||
construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
|
||||
{
|
||||
return NULL;
|
||||
GstElementFactory *current;
|
||||
GList *factories = NULL;
|
||||
|
||||
current = rgnNodes[find_factory(rgnNodes, factory)].iPrev;
|
||||
|
||||
while (current != NULL)
|
||||
{
|
||||
gpointer next;
|
||||
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
|
||||
if (next) factories = g_list_prepend (factories, current);
|
||||
current = next;
|
||||
}
|
||||
return factories;
|
||||
}
|
||||
|
||||
GList*
|
||||
gst_autoplug_factory_to_caps (GstElementFactory *srcfactory, GstCaps *sinkcaps)
|
||||
static GList*
|
||||
gst_autoplug_enqueue (GList *queue, gpointer iNode, gint iDist, gpointer iPrev)
|
||||
{
|
||||
return NULL;
|
||||
gst_autoplug_node *node = g_malloc (sizeof (gst_autoplug_node));
|
||||
|
||||
node->iNode = iNode;
|
||||
node->iDist = iDist;
|
||||
node->iPrev = iPrev;
|
||||
|
||||
queue = g_list_append (queue, node);
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
static GList*
|
||||
gst_autoplug_dequeue (GList *queue, gpointer *iNode, gint *iDist, gpointer *iPrev)
|
||||
{
|
||||
GList *head;
|
||||
gst_autoplug_node *node;
|
||||
|
||||
head = g_list_first (queue);
|
||||
|
||||
if (head) {
|
||||
node = (gst_autoplug_node *)head->data;
|
||||
*iNode = node->iNode;
|
||||
*iPrev = node->iPrev;
|
||||
*iDist = node->iDist;
|
||||
head = g_list_remove (queue, node);
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_type_get_sink_to_src:
|
||||
* @sinkid: the id of the sink
|
||||
* @srcid: the id of the source
|
||||
*
|
||||
* return a list of elementfactories that convert the source
|
||||
* type id to the sink type id
|
||||
*
|
||||
* Returns: a list of elementfactories
|
||||
*/
|
||||
static GList*
|
||||
gst_autoplug_func (gpointer src, gpointer sink,
|
||||
GstAutoplugListFunction list_function,
|
||||
|
@ -253,8 +232,6 @@ gst_autoplug_func (gpointer src, gpointer sink,
|
|||
GList *factories;
|
||||
guint num_factories;
|
||||
|
||||
DEBUG ("%p %p\n", src, sink);
|
||||
|
||||
elements = g_list_append (elements, sink);
|
||||
elements = g_list_append (elements, src);
|
||||
|
||||
|
@ -274,7 +251,7 @@ gst_autoplug_func (gpointer src, gpointer sink,
|
|||
rgnNodes[i].iDist = 0;
|
||||
}
|
||||
else {
|
||||
rgnNodes[i].iDist = MAX_COST;
|
||||
rgnNodes[i].iDist = GST_AUTOPLUG_MAX_COST;
|
||||
}
|
||||
|
||||
factories = g_list_next (factories);
|
||||
|
@ -292,8 +269,8 @@ gst_autoplug_func (gpointer src, gpointer sink,
|
|||
gpointer current = factories2->data;
|
||||
|
||||
iCost = cost_function (iNode, current, data);
|
||||
if (iCost != MAX_COST) {
|
||||
if((MAX_COST == rgnNodes[i].iDist) ||
|
||||
if (iCost != GST_AUTOPLUG_MAX_COST) {
|
||||
if((GST_AUTOPLUG_MAX_COST == rgnNodes[i].iDist) ||
|
||||
(rgnNodes[i].iDist > (iCost + iDist))) {
|
||||
rgnNodes[i].iDist = iDist + iCost;
|
||||
rgnNodes[i].iPrev = iNode;
|
||||
|
|
|
@ -27,18 +27,37 @@
|
|||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define GST_TYPE_AUTOPLUG \
|
||||
(gst_object_get_type())
|
||||
#define GST_AUTOPLUG(obj) \
|
||||
(GTK_CHECK_CAST((obj),GST_TYPE_AUTOPLUG,GstAutoplug))
|
||||
#define GST_AUTOPLUG_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUG,GstAutoplugClass))
|
||||
#define GST_IS_AUTOPLUG(obj) \
|
||||
(GTK_CHECK_TYPE((obj),GST_TYPE_AUTOPLUG))
|
||||
#define GST_IS_AUTOPLUG_CLASS(obj) \
|
||||
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUG))
|
||||
|
||||
GList* gst_autoplug_factories (GstElementFactory *srcfactory,
|
||||
GstElementFactory *sinkfactory);
|
||||
GList* gst_autoplug_elements (GstElement *src,
|
||||
GstElement *sink);
|
||||
typedef struct _GstAutoplug GstAutoplug;
|
||||
typedef struct _GstAutoplugClass GstAutoplugClass;
|
||||
|
||||
#define GST_AUTOPLUG_MAX_COST 999999
|
||||
|
||||
typedef guint (*GstAutoplugCostFunction) (gpointer src, gpointer dest, gpointer data);
|
||||
typedef GList* (*GstAutoplugListFunction) (gpointer data);
|
||||
|
||||
struct _GstAutoplug {
|
||||
GtkObject object;
|
||||
};
|
||||
|
||||
struct _GstAutoplugClass {
|
||||
GtkObjectClass parent_class;
|
||||
};
|
||||
|
||||
GtkType gst_autoplug_get_type (void);
|
||||
|
||||
GList* gst_autoplug_caps (GstCaps *srccaps, GstCaps *sinkcaps);
|
||||
|
||||
GList* gst_autoplug_caps_to_factory (GstCaps *srccaps, GstElementFactory *sinkfactory);
|
||||
|
||||
GList* gst_autoplug_factory_to_caps (GstElementFactory *srcfactory, GstCaps *sinkcaps);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -157,7 +157,8 @@ gst_pipeline_typefind (GstPipeline *pipeline, GstElement *element)
|
|||
|
||||
gst_bin_add (GST_BIN (pipeline), typefind);
|
||||
|
||||
gst_bin_create_plan (GST_BIN (pipeline));
|
||||
//gst_bin_create_plan (GST_BIN (pipeline));
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY);
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||
|
||||
// keep pushing buffers... the have_type signal handler will set the found flag
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gstdebug.h"
|
||||
#include "gstxml.h"
|
||||
|
||||
static void gst_xml_class_init (GstXMLClass *klass);
|
||||
|
@ -107,7 +108,6 @@ gst_xml_new (const guchar *fname, const guchar *root)
|
|||
|
||||
xml = GST_XML(gtk_type_new(GST_TYPE_XML));
|
||||
|
||||
xml->elements = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
xml->topelements = NULL;
|
||||
|
||||
field = doc->root->childs;
|
||||
|
@ -116,7 +116,11 @@ gst_xml_new (const guchar *fname, const guchar *root)
|
|||
if (!strcmp(field->name, "element")) {
|
||||
GstElement *element;
|
||||
|
||||
xml->elements = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
|
||||
element = gst_element_load_thyself(field, xml->elements);
|
||||
|
||||
g_hash_table_destroy (xml->elements);
|
||||
|
||||
xml->topelements = g_list_prepend (xml->topelements, element);
|
||||
}
|
||||
|
@ -163,7 +167,7 @@ gst_xml_get_element (GstXML *xml, const guchar *name)
|
|||
g_return_val_if_fail(xml != NULL, NULL);
|
||||
g_return_val_if_fail(name != NULL, NULL);
|
||||
|
||||
g_print("gstxml: getting element \"%s\"\n", name);
|
||||
DEBUG ("gstxml: getting element \"%s\"\n", name);
|
||||
|
||||
element = g_hash_table_lookup(xml->elements, name);
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@ main (int argc, char *argv[])
|
|||
glade_init();
|
||||
glade_gnome_init();
|
||||
|
||||
gst_type_dump ();
|
||||
|
||||
play = gst_media_play_new ();
|
||||
|
||||
if (argc > 1) {
|
||||
|
|
|
@ -34,6 +34,7 @@ GstElementDetails gst_fakesink_details = {
|
|||
/* FakeSink signals and args */
|
||||
enum {
|
||||
/* FILL ME */
|
||||
SIGNAL_HANDOFF,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
@ -49,7 +50,7 @@ static void gst_fakesink_init(GstFakeSink *fakesink);
|
|||
static void gst_fakesink_chain(GstPad *pad,GstBuffer *buf);
|
||||
|
||||
static GstSinkClass *parent_class = NULL;
|
||||
//static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
|
||||
static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
GtkType
|
||||
gst_fakesink_get_type (void)
|
||||
|
@ -75,10 +76,20 @@ gst_fakesink_get_type (void)
|
|||
static void
|
||||
gst_fakesink_class_init (GstFakeSinkClass *klass)
|
||||
{
|
||||
GtkObjectClass *gtkobject_class;
|
||||
GstSinkClass *gstsink_class;
|
||||
|
||||
gtkobject_class = (GtkObjectClass*)klass;
|
||||
gstsink_class = (GstSinkClass*)klass;
|
||||
|
||||
gst_fakesink_signals[SIGNAL_HANDOFF] =
|
||||
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
|
||||
GTK_SIGNAL_OFFSET (GstFakeSinkClass, handoff),
|
||||
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (gtkobject_class, gst_fakesink_signals,
|
||||
LAST_SIGNAL);
|
||||
|
||||
parent_class = gtk_type_class (GST_TYPE_SINK);
|
||||
}
|
||||
|
||||
|
@ -114,4 +125,8 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
|
|||
g_print("(%s:%s)< ",GST_DEBUG_PAD_NAME(pad));
|
||||
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF],
|
||||
fakesink);
|
||||
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ struct _GstFakeSink {
|
|||
|
||||
struct _GstFakeSinkClass {
|
||||
GstSinkClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (*handoff) (GstElement *element,GstPad *pad);
|
||||
};
|
||||
|
||||
GtkType gst_fakesink_get_type(void);
|
||||
|
|
|
@ -39,7 +39,7 @@ enum {
|
|||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_CONTROL
|
||||
ARG_LOOP_BASED,
|
||||
};
|
||||
|
||||
|
||||
|
@ -86,11 +86,11 @@ gst_identity_class_init (GstIdentityClass *klass)
|
|||
|
||||
parent_class = gtk_type_class (GST_TYPE_FILTER);
|
||||
|
||||
//gtk_object_add_arg_type("GstIdentity::control", GTK_TYPE_INT,
|
||||
// GTK_ARG_READWRITE, ARG_CONTROL);
|
||||
gtk_object_add_arg_type ("GstIdentity::loop_based", GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE, ARG_LOOP_BASED);
|
||||
|
||||
//gtkobject_class->set_arg = gst_identity_set_arg;
|
||||
//gtkobject_class->get_arg = gst_identity_get_arg;
|
||||
gtkobject_class->set_arg = gst_identity_set_arg;
|
||||
gtkobject_class->get_arg = gst_identity_get_arg;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -103,7 +103,7 @@ gst_identity_init (GstIdentity *identity)
|
|||
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
||||
|
||||
identity->control = 0;
|
||||
identity->loop_based = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -121,6 +121,22 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
|
|||
gst_pad_push (identity->srcpad, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_identity_loop (GstElement *element)
|
||||
{
|
||||
GstIdentity *identity;
|
||||
GstBuffer *buf;
|
||||
|
||||
g_return_if_fail (element != NULL);
|
||||
g_return_if_fail (GST_IS_IDENTITY (element));
|
||||
|
||||
identity = GST_IDENTITY (element);
|
||||
|
||||
buf = gst_pad_pull (identity->sinkpad);
|
||||
|
||||
gst_pad_push (identity->srcpad, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
|
||||
{
|
||||
|
@ -132,8 +148,16 @@ gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
|
|||
identity = GST_IDENTITY (object);
|
||||
|
||||
switch(id) {
|
||||
case ARG_CONTROL:
|
||||
identity->control = GTK_VALUE_INT (*arg);
|
||||
case ARG_LOOP_BASED:
|
||||
identity->loop_based = GTK_VALUE_BOOL (*arg);
|
||||
if (identity->loop_based) {
|
||||
gst_element_set_loop_function (GST_ELEMENT (identity), gst_identity_loop);
|
||||
gst_pad_set_chain_function (identity->sinkpad, NULL);
|
||||
}
|
||||
else {
|
||||
gst_pad_set_chain_function (identity->sinkpad, gst_identity_chain);
|
||||
gst_element_set_loop_function (GST_ELEMENT (identity), NULL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -149,8 +173,8 @@ static void gst_identity_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
|||
identity = GST_IDENTITY (object);
|
||||
|
||||
switch (id) {
|
||||
case ARG_CONTROL:
|
||||
GTK_VALUE_INT (*arg) = identity->control;
|
||||
case ARG_LOOP_BASED:
|
||||
GTK_VALUE_BOOL (*arg) = identity->loop_based;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
|
|
|
@ -54,7 +54,7 @@ struct _GstIdentity {
|
|||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
|
||||
gint control;
|
||||
gboolean loop_based;
|
||||
};
|
||||
|
||||
struct _GstIdentityClass {
|
||||
|
|
12
tests/sched/Makefile
Normal file
12
tests/sched/Makefile
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
CC = libtool gcc
|
||||
|
||||
all: runxml
|
||||
|
||||
runxml: runxml.c
|
||||
$(CC) -Wall `gstreamer-config --cflags --libs` runxml.c -o runxml
|
||||
|
||||
clean:
|
||||
rm -f *.o runxml
|
||||
|
||||
|
79
tests/sched/cases/(fs-fs).xml
Normal file
79
tests/sched/cases/(fs-fs).xml
Normal file
|
@ -0,0 +1,79 @@
|
|||
<?xml version="1.0"?>
|
||||
<GST-Pipeline>
|
||||
<element>
|
||||
<name>new_element</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin2</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
</GST-Pipeline>
|
235
tests/sched/cases/(fs-i-fs).xml
Normal file
235
tests/sched/cases/(fs-i-fs).xml
Normal file
|
@ -0,0 +1,235 @@
|
|||
<?xml version="1.0"?>
|
||||
<GST-Pipeline>
|
||||
<element>
|
||||
<name>bin1</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin2</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin3</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin4</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
</GST-Pipeline>
|
627
tests/sched/cases/(fs-i-i-fs).xml
Normal file
627
tests/sched/cases/(fs-i-i-fs).xml
Normal file
|
@ -0,0 +1,627 @@
|
|||
<?xml version="1.0"?>
|
||||
<GST-Pipeline>
|
||||
<element>
|
||||
<name>bin1</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin2</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin3</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>bin4</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>thread1</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>thread2</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>thread3</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>false</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>thread4</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstFakeSrc::num_sources</name>
|
||||
<value>1</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstIdentity::loop_based</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
</GST-Pipeline>
|
107
tests/sched/cases/(fs-i-q[i-fs]).xml
Normal file
107
tests/sched/cases/(fs-i-q[i-fs]).xml
Normal file
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0"?>
|
||||
<GST-Pipeline>
|
||||
<element>
|
||||
<name>new_element</name>
|
||||
<type>bin</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>thread</name>
|
||||
<type>thread</type>
|
||||
<version>0.9.2</version>
|
||||
<arg>
|
||||
<name>GstThread::create_thread</name>
|
||||
<value>true</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
<children>
|
||||
<element>
|
||||
<name>identity</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>queue.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>fakesink.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesink</name>
|
||||
<type>fakesink</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity.src</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
<element>
|
||||
<name>queue</name>
|
||||
<type>queue</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>identity1.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GstQueue::level</name>
|
||||
<value>0</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GstQueue::max_level</name>
|
||||
<value>20</value>
|
||||
</arg>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>fakesrc</name>
|
||||
<type>fakesrc</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>identity1.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
<element>
|
||||
<name>identity1</name>
|
||||
<type>identity</type>
|
||||
<version>0.9.2</version>
|
||||
<pad>
|
||||
<name>sink</name>
|
||||
<peer>fakesrc.src</peer>
|
||||
</pad>
|
||||
<pad>
|
||||
<name>src</name>
|
||||
<peer>queue.sink</peer>
|
||||
</pad>
|
||||
<arg>
|
||||
<name>GtkObject::user_data</name>
|
||||
</arg>
|
||||
</element>
|
||||
</children>
|
||||
</element>
|
||||
</GST-Pipeline>
|
15
tests/sched/runtestcases
Executable file
15
tests/sched/runtestcases
Executable file
|
@ -0,0 +1,15 @@
|
|||
#/bin/bash
|
||||
|
||||
echo "log" > log.txt
|
||||
|
||||
for i in cases/*.xml
|
||||
do
|
||||
./runxml $i
|
||||
error=$?
|
||||
if test $error -ne 0;
|
||||
then
|
||||
echo $i " error," $error >>log.txt
|
||||
else
|
||||
echo $i " ok" >>log.txt
|
||||
fi
|
||||
done
|
74
tests/sched/runxml.c
Normal file
74
tests/sched/runxml.c
Normal file
|
@ -0,0 +1,74 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
static void
|
||||
buffer_handoff (GstElement *src, GstElement *bin)
|
||||
{
|
||||
g_print ("\n\n *** buffer arrived in sink ***\n\n");
|
||||
gst_element_set_state(bin, GST_STATE_NULL);
|
||||
}
|
||||
|
||||
/* eos will be called when the src element has an end of stream */
|
||||
void eos(GstSrc *src, gpointer data)
|
||||
{
|
||||
g_print("have eos, quitting\n");
|
||||
}
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
GstXML *xml;
|
||||
GList *toplevelelements;
|
||||
gint i = 1;
|
||||
|
||||
gst_init(&argc,&argv);
|
||||
|
||||
if (argc < 2) {
|
||||
g_print ("usage: %s <xml file>\n", argv[0]);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
g_print ("\n *** using testfile %s\n", argv[1]);
|
||||
|
||||
xml = gst_xml_new(argv[1], NULL);
|
||||
|
||||
toplevelelements = gst_xml_get_topelements (xml);
|
||||
|
||||
while (toplevelelements) {
|
||||
GstElement *bin = (GstElement *)toplevelelements->data;
|
||||
GstElement *src, *sink;
|
||||
|
||||
g_print ("\n ***** testcase %d\n", i++);
|
||||
|
||||
src = gst_bin_get_by_name (GST_BIN (bin), "fakesrc");
|
||||
if (src) {
|
||||
}
|
||||
else {
|
||||
g_print ("could not find src element\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
sink = gst_bin_get_by_name (GST_BIN (bin), "fakesink");
|
||||
if (sink) {
|
||||
gtk_signal_connect (GTK_OBJECT(sink), "handoff",
|
||||
GTK_SIGNAL_FUNC(buffer_handoff), bin);
|
||||
}
|
||||
else {
|
||||
g_print ("could not find sink element\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
gst_element_set_state(bin, GST_STATE_READY);
|
||||
gst_element_set_state(bin, GST_STATE_PLAYING);
|
||||
|
||||
if (GST_IS_THREAD (bin)) {
|
||||
sleep (1);
|
||||
}
|
||||
else {
|
||||
gst_bin_iterate(GST_BIN(bin));
|
||||
}
|
||||
|
||||
toplevelelements = g_list_next (toplevelelements);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -36,6 +36,15 @@
|
|||
|
||||
4)
|
||||
|
||||
[-bin--------------------------------------------------------------]
|
||||
! [--------] [--------] [--------] [--------] !
|
||||
! !faksesrc! !identity! !identity! !fakesink! !
|
||||
! ! src --- sink src -- sink src -- sink ! !
|
||||
! [--------] [--------] [--------] [--------] !
|
||||
[------------------------------------------------------------------]
|
||||
|
||||
4b)
|
||||
|
||||
[-bin--------------------------------------------------------------]
|
||||
! [--------] [--------] [--------] [--------] !
|
||||
! !faksesrc! !identity! !identity! !fakesink! !
|
||||
|
|
Loading…
Reference in a new issue