Major cleanup of the latest ghostpad changes. Fixed everything that broke, correctly. Someone will want to go updat...

Original commit message from CVS:
Major cleanup of the latest ghostpad changes.  Fixed everything that
broke, correctly.  Someone will want to go update the API doc templates.
This commit is contained in:
Erik Walthinsen 2001-01-19 09:37:32 +00:00
parent 5ed8c467bf
commit 74f8050844
14 changed files with 226 additions and 249 deletions

View file

@ -746,11 +746,12 @@ gst_editor_element_add_pad_func (GstEditorElement *element,
editorpad = gst_editor_pad_new (element, pad, NULL);
if (pad->direction == GST_PAD_SINK) {
// FIXME does this need to check for ghost/real?
if (GST_PAD_DIRECTION(pad) == GST_PAD_SINK) {
element->sinkpads = g_list_prepend(element->sinkpads,editorpad);
element->sinks++;
// g_print("added 'new' pad to sink list\n");
} else if (pad->direction == GST_PAD_SRC) {
} else if (GST_PAD_DIRECTION(pad) == GST_PAD_SRC) {
element->srcpads = g_list_prepend(element->srcpads,editorpad);
element->srcs++;
// g_print("added 'new' pad to src list\n");

View file

@ -45,12 +45,11 @@ struct _image_entry {
GtkType (*gtktype) (void);
};
#define TYPES_SIZE 4
#define TYPES_SIZE 3
struct _image_entry _image_types[TYPES_SIZE] = {
{GST_EDITOR_IMAGE_BIN, gst_bin_get_type },
{GST_EDITOR_IMAGE_THREAD, gst_thread_get_type },
{GST_EDITOR_IMAGE_PIPELINE, gst_pipeline_get_type },
{GST_EDITOR_IMAGE_TEE, gst_tee_get_type },
};
GstEditorImage*

View file

@ -138,7 +138,8 @@ gst_editor_pad_new(GstEditorElement *parent,GstPad *pad,
GstPad *peerpad;
GstEditorPad *peereditorpad;
peerpad = pad->peer;
// FIXME does this need to check for ghost/real?
peerpad = GST_PAD_PEER(pad);
peereditorpad = GST_EDITOR_GET_OBJECT (peerpad);
@ -270,7 +271,8 @@ gst_editor_pad_realize (GstEditorPad *pad)
GST_EDITOR_SET_OBJECT(pad->border,pad);
/* create the pad box on the correct side */
pad->issrc = (pad->pad->direction == GST_PAD_SRC);
// FIXME does this need to check for ghost/real?
pad->issrc = (GST_PAD_DIRECTION(pad->pad) == GST_PAD_SRC);
if (pad->issrc)
pad->padbox = gnome_canvas_item_new(pad->group,
gnome_canvas_rect_get_type(),

View file

@ -41,12 +41,11 @@ struct _palette_entry {
gchar *factoryname;
};
#define CORE_ELEMENT_SIZE 4
#define CORE_ELEMENT_SIZE 3
struct _palette_entry _palette_contents_core[CORE_ELEMENT_SIZE] = {
{"Bin", gst_bin_get_type, "bin" },
{"Thread", gst_thread_get_type, "thread" },
{"Pipeline", gst_pipeline_get_type, "pipeline" },
{"Tee", gst_tee_get_type, "tee" },
};
enum {

View file

@ -20,30 +20,27 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef GST_HGUARD_GSTALPHA_H
#define GST_HGUARD_GSTALPHA_H
#ifndef __GST_GSTALPHA_H__
#define __GST_GSTALPHA_H__
#warning in gstalpha.h
#define GET_SP(target) \
__asm__("stq $30,%0" : "=m"(target) : : "30");
#define SET_SP(stackpointer) \
#define GST_ARCH_SET_SP(stackpointer) \
__asm__("bis $31,%0,$30" : : "r"(stackpointer));
#define CALL(target) \
#define GST_ARCH_CALL(target) \
__asm__( "bis $31,%0,$27\n\t" \
"jsr $26,($27),0" : : "r"(target) );
struct minimal_ppc_stackframe {
// Need to get more information about the stackframe format
// and get the fields more correct. Check GDB sources maybe?
struct minimal_stackframe {
unsigned long back_chain;
unsigned long LR_save;
unsigned long unused1;
unsigned long unused2;
};
#define SETUP_STACK(sp) \
#define GST_ARCH_SETUP_STACK(sp) \
sp = ((unsigned long *)(sp)) - 4; \
((struct minimal_ppc_stackframe *)sp)->back_chain = 0;
((struct minimal_stackframe *)sp)->back_chain = 0;
#endif /* GST_HGUARD_GSTALPHA_H */
#endif /* __GST_GSTALPHA_H__ */

View file

@ -754,7 +754,7 @@ gst_bin_iterate_func (GstBin *bin)
pads = entry->pads;
while (pads) {
pad = GST_PAD (pads->data);
if (GST_REAL_PAD(pad)->direction == GST_PAD_SRC) {
if (GST_RPAD_DIRECTION(pad) == GST_PAD_SRC) {
GST_DEBUG (0,"calling getfunc of %s:%s\n",GST_DEBUG_PAD_NAME(pad));
if (GST_REAL_PAD(pad)->getfunc == NULL)
fprintf(stderr, "error, no getfunc in \"%s\"\n", gst_element_get_name (entry));

View file

@ -20,18 +20,16 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef GST_HGUARD_GSTI386_H
#define GST_HGUARD_GSTI386_H
#ifndef __GST_GSTI386_H__
#define __GST_GSTI386_H__
#define GET_SP(target) \
__asm__( "movl %%esp, %0" : "=r"(target) : : "esp", "ebp" );
#define GST_ARCH_SET_SP(stackpointer) \
__asm__( "movl %0, %%esp\n" : : "r"(stackpointer) );
#define SET_SP(source) \
__asm__( "movl %0, %%esp\n" : : "r"(source) );
#define CALL(target) \
#define GST_ARCH_CALL(target) \
__asm__("call *%0" : : "r"(target) );
#define SETUP_STACK(sp) do ; while(0)
// assuming the stackframe is 16 bytes
#define GST_ARCH_SETUP_STACK(sp) sp -= 4
#endif /* GST_HGUARD_GSTI386_H */
#endif /* __GST_GSTI386_H__ */

View file

@ -110,7 +110,9 @@ G_GNUC_UNUSED static gchar *_debug_string = NULL;
/********** some convenience macros for debugging **********/
#define GST_DEBUG_PAD_NAME(pad) \
((pad)->parent != NULL) ? gst_element_get_name(GST_ELEMENT((pad)->parent)) : "''", gst_pad_get_name(pad)
(((GstPad*)(pad))->parent != NULL) ? \
gst_element_get_name(GST_ELEMENT(((GstPad*)(pad))->parent)) : \
"''", gst_pad_get_name((GstPad*)pad)

View file

@ -28,21 +28,6 @@
#include "gsttype.h"
/* Pad signals and args */
enum {
SET_ACTIVE,
CAPS_CHANGED,
/* FILL ME */
LAST_SIGNAL
};
enum {
ARG_0,
ARG_ACTIVE,
/* FILL ME */
};
/***** Start with the base GstPad class *****/
static void gst_pad_class_init (GstPadClass *klass);
static void gst_pad_init (GstPad *pad);
@ -88,6 +73,20 @@ gst_pad_init (GstPad *pad)
/***** Then do the Real Pad *****/
/* Pad signals and args */
enum {
REAL_SET_ACTIVE,
REAL_CAPS_CHANGED,
/* FILL ME */
REAL_LAST_SIGNAL
};
enum {
REAL_ARG_0,
REAL_ARG_ACTIVE,
/* FILL ME */
};
static void gst_real_pad_class_init (GstRealPadClass *klass);
static void gst_real_pad_init (GstRealPad *pad);
@ -99,7 +98,7 @@ static void gst_real_pad_destroy (GtkObject *object);
static void gst_pad_push_func (GstPad *pad, GstBuffer *buf);
static GstPad *real_pad_parent_class = NULL;
static guint gst_real_pad_signals[LAST_SIGNAL] = { 0 };
static guint gst_real_pad_signals[REAL_LAST_SIGNAL] = { 0 };
GtkType
gst_real_pad_get_type(void) {
@ -130,20 +129,20 @@ gst_real_pad_class_init (GstRealPadClass *klass)
real_pad_parent_class = gtk_type_class(GST_TYPE_PAD);
gst_real_pad_signals[SET_ACTIVE] =
gst_real_pad_signals[REAL_SET_ACTIVE] =
gtk_signal_new ("set_active", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, set_active),
gtk_marshal_NONE__BOOL, GTK_TYPE_NONE, 1,
GTK_TYPE_BOOL);
gst_real_pad_signals[CAPS_CHANGED] =
gst_real_pad_signals[REAL_CAPS_CHANGED] =
gtk_signal_new ("caps_changed", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, caps_changed),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_real_pad_signals, LAST_SIGNAL);
gtk_object_class_add_signals (gtkobject_class, gst_real_pad_signals, REAL_LAST_SIGNAL);
gtk_object_add_arg_type ("GstRealPad::active", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_ACTIVE);
GTK_ARG_READWRITE, REAL_ARG_ACTIVE);
gtkobject_class->destroy = gst_real_pad_destroy;
gtkobject_class->set_arg = gst_real_pad_set_arg;
@ -176,7 +175,7 @@ gst_real_pad_set_arg (GtkObject *object, GtkArg *arg, guint id)
g_return_if_fail(GST_IS_PAD(object));
switch (id) {
case ARG_ACTIVE:
case REAL_ARG_ACTIVE:
if (GTK_VALUE_BOOL(*arg)) {
gst_info("gstpad: activating pad\n");
GST_FLAG_UNSET(object,GST_PAD_DISABLED);
@ -184,7 +183,7 @@ gst_real_pad_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_info("gstpad: de-activating pad\n");
GST_FLAG_SET(object,GST_PAD_DISABLED);
}
gtk_signal_emit(GTK_OBJECT(object), gst_real_pad_signals[SET_ACTIVE],
gtk_signal_emit(GTK_OBJECT(object), gst_real_pad_signals[REAL_SET_ACTIVE],
! GST_FLAG_IS_SET(object,GST_PAD_DISABLED));
break;
default:
@ -199,7 +198,7 @@ gst_real_pad_get_arg (GtkObject *object, GtkArg *arg, guint id)
g_return_if_fail (GST_IS_PAD (object));
switch (id) {
case ARG_ACTIVE:
case REAL_ARG_ACTIVE:
GTK_VALUE_BOOL (*arg) = ! GST_FLAG_IS_SET (object, GST_PAD_DISABLED);
break;
default:
@ -221,18 +220,16 @@ GstPad*
gst_pad_new (gchar *name,
GstPadDirection direction)
{
GstPad *pad;
GstRealPad *realpad;
GstRealPad *pad;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (direction != GST_PAD_UNKNOWN, NULL);
realpad = gtk_type_new (gst_real_pad_get_type ());
pad = GST_PAD(realpad);
pad->name = g_strdup (name);
realpad->direction = direction;
pad = gtk_type_new (gst_real_pad_get_type ());
GST_PAD_NAME(pad) = g_strdup (name);
GST_RPAD_DIRECTION(pad) = direction;
return pad;
return GST_PAD(pad);
}
/**
@ -249,15 +246,13 @@ gst_pad_new_from_template (GstPadTemplate *templ,
gchar *name)
{
GstPad *pad;
GstRealPad *realpad;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (templ != NULL, NULL);
pad = gst_pad_new (name, templ->direction);
realpad = GST_REAL_PAD (pad);
realpad->caps = templ->caps;
pad->padtemplate = templ;
GST_PAD_CAPS(pad) = templ->caps;
GST_PAD_PADTEMPLATE(pad) = templ;
return pad;
}
@ -274,9 +269,9 @@ GstPadDirection
gst_pad_get_direction (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, GST_PAD_UNKNOWN);
g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_UNKNOWN);
g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_UNKNOWN);
return GST_REAL_PAD(pad)->direction;
return GST_PAD_DIRECTION(pad);
}
/**
@ -329,7 +324,9 @@ void gst_pad_set_chain_function (GstPad *pad,
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_REAL_PAD(pad)->chainfunc = chain;
GST_RPAD_CHAINFUNC(pad) = chain;
GST_DEBUG (0,"chainfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_CHAINFUNC(pad),chain);
}
/**
@ -346,12 +343,9 @@ gst_pad_set_get_function (GstPad *pad,
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
// the if and such should optimize out when DEBUG is off
GST_DEBUG (0,"setting get function for %s:%s\n",GST_DEBUG_PAD_NAME(pad));
GST_REAL_PAD(pad)->getfunc = get;
GST_RPAD_GETFUNC(pad) = get;
GST_DEBUG (0,"getfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_REAL_PAD(pad)->getfunc,get);
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_GETFUNC(pad),get);
}
/**
@ -368,9 +362,9 @@ gst_pad_set_getregion_function (GstPad *pad,
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_DEBUG (0,"gstpad: pad setting getregion function\n");
GST_REAL_PAD(pad)->getregionfunc = getregion;
GST_RPAD_GETREGIONFUNC(pad) = getregion;
GST_DEBUG (0,"getregionfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_GETREGIONFUNC(pad),getregion);
}
/**
@ -387,7 +381,9 @@ gst_pad_set_qos_function (GstPad *pad,
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_REAL_PAD(pad)->qosfunc = qos;
GST_RPAD_QOSFUNC(pad) = qos;
GST_DEBUG (0,"qosfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_QOSFUNC(pad),qos);
}
/**
@ -404,7 +400,9 @@ gst_pad_set_eos_function (GstPad *pad,
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_REAL_PAD(pad)->eosfunc = eos;
GST_RPAD_EOSFUNC(pad) = eos;
GST_DEBUG (0,"eosfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_EOSFUNC(pad),eos);
}
@ -412,10 +410,9 @@ gst_pad_set_eos_function (GstPad *pad,
static void
gst_pad_push_func(GstPad *pad, GstBuffer *buf)
{
GstRealPad *realpad = GST_REAL_PAD(pad);
if (realpad->peer->chainfunc != NULL) {
if (GST_RPAD_CHAINFUNC(GST_RPAD_PEER(pad)) != NULL) {
GST_DEBUG (0,"calling chain function\n");
(realpad->peer->chainfunc)(pad,buf);
(GST_RPAD_CHAINFUNC(GST_RPAD_PEER(pad)))(pad,buf);
} else {
GST_DEBUG (0,"got a problem here: default pad_push handler in place, no chain function\n");
}
@ -433,23 +430,22 @@ void
gst_pad_handle_qos(GstPad *pad,
glong qos_message)
{
GstRealPad *realpad = GST_REAL_PAD (pad);
GstElement *element;
GList *pads;
GstPad *target_pad;
GST_DEBUG (0,"gst_pad_handle_qos(\"%s\",%08ld)\n", GST_ELEMENT(pad->parent)->name,qos_message);
if (realpad->qosfunc) {
(realpad->qosfunc) (pad,qos_message);
if (GST_RPAD_QOSFUNC(pad)) {
(GST_RPAD_QOSFUNC(pad)) (pad,qos_message);
} else {
element = GST_ELEMENT (GST_PAD(realpad->peer)->parent);
element = GST_ELEMENT (GST_PAD_PARENT(GST_RPAD_PEER(pad)));
pads = element->pads;
GST_DEBUG (0,"gst_pad_handle_qos recurse(\"%s\",%08ld)\n", element->name, qos_message);
while (pads) {
target_pad = GST_PAD (pads->data);
if (GST_REAL_PAD(target_pad)->direction == GST_PAD_SINK) {
if (GST_RPAD_DIRECTION(target_pad) == GST_PAD_SINK) {
gst_pad_handle_qos (target_pad, qos_message);
}
pads = g_list_next (pads);
@ -479,20 +475,18 @@ gst_pad_disconnect (GstPad *srcpad,
g_return_if_fail (GST_IS_PAD (sinkpad));
// now we need to deal with the real/ghost stuff
if (GST_IS_GHOST_PAD(srcpad)) realsrc = GST_GHOST_PAD(srcpad)->realpad;
else realsrc = GST_REAL_PAD(srcpad);
if (GST_IS_GHOST_PAD(sinkpad)) realsink = GST_GHOST_PAD(sinkpad)->realpad;
else realsink = GST_REAL_PAD(sinkpad);
realsrc = GST_PAD_REALIZE(srcpad);
realsink = GST_PAD_REALIZE(sinkpad);
g_return_if_fail (realsrc->peer != NULL);
g_return_if_fail (realsink->peer != NULL);
g_return_if_fail (GST_RPAD_PEER(realsrc) != NULL);
g_return_if_fail (GST_RPAD_PEER(realsink) != NULL);
g_return_if_fail ((realsrc->direction == GST_PAD_SRC) &&
(realsink->direction == GST_PAD_SINK));
g_return_if_fail ((GST_RPAD_DIRECTION(realsrc) == GST_PAD_SRC) &&
(GST_RPAD_DIRECTION(realsink) == GST_PAD_SINK));
/* first clear peers */
realsrc->peer = NULL;
realsink->peer = NULL;
GST_RPAD_PEER(realsrc) = NULL;
GST_RPAD_PEER(realsink) = NULL;
GST_INFO (GST_CAT_ELEMENT_PADS, "disconnected %s:%s and %s:%s",
GST_DEBUG_PAD_NAME(srcpad), GST_DEBUG_PAD_NAME(sinkpad));
@ -517,26 +511,23 @@ gst_pad_connect (GstPad *srcpad,
g_return_if_fail(GST_IS_PAD(srcpad));
g_return_if_fail(sinkpad != NULL);
g_return_if_fail(GST_IS_PAD(sinkpad));
// g_return_if_fail(sinkpad->chain != NULL);
// now we need to deal with the real/ghost stuff
if (GST_IS_GHOST_PAD(srcpad)) realsrc = GST_GHOST_PAD(srcpad)->realpad;
else realsrc = GST_REAL_PAD(srcpad);
if (GST_IS_GHOST_PAD(sinkpad)) realsink = GST_GHOST_PAD(sinkpad)->realpad;
else realsink = GST_REAL_PAD(sinkpad);
realsrc = GST_PAD_REALIZE(srcpad);
realsink = GST_PAD_REALIZE(sinkpad);
g_return_if_fail(realsrc->peer == NULL);
g_return_if_fail(realsink->peer == NULL);
g_return_if_fail(GST_RPAD_PEER(realsrc) == NULL);
g_return_if_fail(GST_RPAD_PEER(realsink) == NULL);
/* check for reversed directions and swap if necessary */
if ((realsrc->direction == GST_PAD_SINK) &&
(realsink->direction == GST_PAD_SRC)) {
if ((GST_RPAD_DIRECTION(realsrc) == GST_PAD_SINK) &&
(GST_RPAD_DIRECTION(realsink) == GST_PAD_SRC)) {
temppad = realsrc;
realsrc = realsink;
realsink = temppad;
}
g_return_if_fail((realsrc->direction == GST_PAD_SRC) &&
(realsink->direction == GST_PAD_SINK));
g_return_if_fail((GST_RPAD_DIRECTION(realsrc) == GST_PAD_SRC) &&
(GST_RPAD_DIRECTION(realsink) == GST_PAD_SINK));
if (!gst_pad_check_compatibility (srcpad, sinkpad)) {
g_warning ("gstpad: connecting incompatible pads (%s:%s) and (%s:%s)\n",
@ -548,14 +539,8 @@ gst_pad_connect (GstPad *srcpad,
}
/* first set peers */
realsrc->peer = realsink;
realsink->peer = realsrc;
// FIXME this is irrelevant now
/* now copy the chain pointer from sink to src */
//srcpad->chainfunc = sinkpad->chainfunc;
/* and the pull function */
//srcpad->pullfunc = sinkpad->pullfunc;
GST_RPAD_PEER(realsrc) = realsink;
GST_RPAD_PEER(realsink) = realsrc;
/* set the connected flag */
/* FIXME: set connected flag */
@ -584,7 +569,7 @@ gst_pad_set_parent (GstPad *pad,
//g_print("set parent %s\n", gst_element_get_name(parent));
pad->parent = parent;
GST_PAD_PARENT(pad) = parent;
}
/**
@ -605,13 +590,7 @@ gst_pad_add_ghost_parent (GstPad *pad,
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
realpad = GST_REAL_PAD (pad);
/* FIXME is this going to be needed?
// now we need to deal with the real/ghost stuff
if (GST_IS_GHOST_PAD(srcpad)) realsrc = GST_GHOST_PAD(srcpad)->realpad;
else realsrc = GST_REAL_PAD(srcpad);
*/
realpad = GST_PAD_REALIZE(pad);
realpad->ghostparents = g_list_prepend (realpad->ghostparents, parent);
}
@ -635,7 +614,7 @@ gst_pad_remove_ghost_parent (GstPad *pad,
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
realpad = GST_REAL_PAD (pad);
realpad = GST_PAD_REALIZE (pad);
realpad->ghostparents = g_list_remove (realpad->ghostparents, parent);
}
@ -654,7 +633,7 @@ gst_pad_get_parent (GstPad *pad)
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
return pad->parent;
return GST_PAD_PARENT(pad);
}
/**
@ -671,13 +650,13 @@ gst_pad_get_ghost_parents (GstPad *pad)
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_REAL_PAD (pad), NULL); // NOTE this restriction
return GST_REAL_PAD(pad)->ghostparents;
return GST_PAD_REALIZE(pad)->ghostparents;
}
/**
* gst_pad_set_caps_list:
* @pad: the pad to set the caps to
* @caps: the capslist to attach to this pad
* @caps: a GList of the capabilities to attach to this pad
*
* Set the capabilities of this pad.
*/
@ -688,7 +667,7 @@ gst_pad_set_caps_list (GstPad *pad,
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad)); // NOTE this restriction
GST_REAL_PAD(pad)->caps = caps;
GST_PAD_CAPS(pad) = caps;
}
/**
@ -697,21 +676,15 @@ gst_pad_set_caps_list (GstPad *pad,
*
* Get the capabilities of this pad.
*
* Returns: a list of capabilities of this pad
* Returns: a list of the capabilities of this pad
*/
GList *
gst_pad_get_caps_list (GstPad *pad)
{
GstRealPad *realpad;
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
// find the real pad
if (GST_IS_GHOST_PAD (pad)) realpad = GST_GHOST_PAD(pad)->realpad;
else realpad = GST_REAL_PAD(pad);
return realpad->caps;
return GST_PAD_CAPS(pad);
}
/**
@ -726,17 +699,12 @@ gst_pad_get_caps_list (GstPad *pad)
GstCaps *
gst_pad_get_caps_by_name (GstPad *pad, gchar *name)
{
GstRealPad *realpad;
GList *caps;
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
// find the real pad
if (GST_IS_GHOST_PAD (pad)) realpad = GST_GHOST_PAD(pad)->realpad;
else realpad = GST_REAL_PAD(pad);
caps = realpad->caps;
caps = GST_PAD_CAPS(pad);
while (caps) {
GstCaps *cap = (GstCaps *)caps->data;
@ -770,14 +738,11 @@ gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad)
g_return_val_if_fail (sinkpad != NULL, FALSE);
g_return_val_if_fail (GST_IS_PAD (sinkpad), FALSE);
// find the real pad
if (GST_IS_GHOST_PAD (srcpad)) realsrc = GST_GHOST_PAD(srcpad)->realpad;
else realsrc = GST_REAL_PAD(srcpad);
if (GST_IS_GHOST_PAD (sinkpad)) realsink = GST_GHOST_PAD(sinkpad)->realpad;
else realsink = GST_REAL_PAD(sinkpad);
realsrc = GST_PAD_REALIZE(srcpad);
realsink = GST_PAD_REALIZE(sinkpad);
if (realsrc->caps && realsink->caps) {
if (!gst_caps_list_check_compatibility (realsrc->caps, realsink->caps)) {
if (GST_RPAD_CAPS(realsrc) && GST_RPAD_CAPS(realsink)) {
if (!gst_caps_list_check_compatibility (GST_RPAD_CAPS(realsrc), GST_RPAD_CAPS(realsink))) {
return FALSE;
}
else {
@ -802,15 +767,10 @@ gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad)
GstPad*
gst_pad_get_peer (GstPad *pad)
{
GstRealPad *realpad;
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
// find the real pad
if (GST_IS_GHOST_PAD (pad)) realpad = GST_GHOST_PAD(pad)->realpad;
else realpad = GST_REAL_PAD(pad);
return GST_PAD(realpad->peer);
return GST_PAD(GST_PAD_PEER(pad));
}
// FIXME this needs to be rethought soon
@ -896,14 +856,13 @@ gst_pad_save_thyself (GstPad *pad,
GstRealPad *realpad;
GstPad *peer;
// FIXME ?
if (GST_IS_GHOST_PAD(pad)) return NULL;
g_return_val_if_fail (GST_IS_REAL_PAD (pad), NULL);
realpad = GST_REAL_PAD(pad);
xmlNewChild(parent,NULL,"name",pad->name);
if (realpad->peer != NULL) {
peer = GST_PAD(realpad->peer);
if (GST_RPAD_PEER(realpad) != NULL) {
peer = GST_PAD(GST_RPAD_PEER(realpad));
// first check to see if the peer's parent's parent is the same
//if (pad->parent->parent == peer->parent->parent)
// we just save it off
@ -932,21 +891,25 @@ gst_pad_ghost_save_thyself (GstPad *pad,
{
xmlNodePtr self;
g_return_val_if_fail (GST_IS_GHOST_PAD (pad), NULL);
self = xmlNewChild(parent,NULL,"ghostpad",NULL);
xmlNewChild(self,NULL,"name",pad->name);
xmlNewChild(self,NULL,"parent",GST_ELEMENT(pad->parent)->name);
// FIXME FIXME FIXME!
return self;
}
#ifndef gst_pad_push
void gst_pad_push(GstPad *pad,GstBuffer *buf) {
GstRealPad *realpad = GST_REAL_PAD(pad);
GstRealPad *peer = GST_RPAD_PEER(pad);
GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad));
if (realpad->peer->pushfunc) {
if (peer->pushfunc) {
GST_DEBUG (0,"calling pushfunc &%s of peer pad %s:%s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->peer->pushfunc),GST_DEBUG_PAD_NAME(GST_PAD(realpad->peer)));
(realpad->peer->pushfunc)(GST_PAD(realpad->peer),buf);
GST_DEBUG_FUNCPTR_NAME(peer->pushfunc),GST_DEBUG_PAD_NAME(((GstPad*)peer)));
(peer->pushfunc)(((GstPad*)peer),buf);
} else
GST_DEBUG (0,"no pushfunc\n");
}
@ -954,15 +917,14 @@ void gst_pad_push(GstPad *pad,GstBuffer *buf) {
#ifndef gst_pad_pull
GstBuffer *gst_pad_pull(GstPad *pad) {
GstRealPad *realpad = GST_REAL_PAD(pad);
GstRealPad *peer = realpad->peer;
GstRealPad *peer = GST_RPAD_PEER(pad);
GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad));
if (peer->pullfunc) {
GST_DEBUG (0,"calling pullfunc &%s (@%p) of peer pad %s:%s\n",
GST_DEBUG_FUNCPTR_NAME(peer->pullfunc),&peer->pullfunc,GST_DEBUG_PAD_NAME(GST_PAD(peer)));
return (peer->pullfunc)(GST_PAD(peer));
GST_DEBUG_FUNCPTR_NAME(peer->pullfunc),&peer->pullfunc,GST_DEBUG_PAD_NAME(((GstPad*)peer)));
return (peer->pullfunc)(((GstPad*)peer));
} else {
GST_DEBUG (0,"no pullfunc for peer pad %s:%s at %p\n",GST_DEBUG_PAD_NAME(GST_PAD(peer)),&peer->pullfunc);
GST_DEBUG (0,"no pullfunc for peer pad %s:%s at %p\n",GST_DEBUG_PAD_NAME(((GstPad*)peer)),&peer->pullfunc);
return NULL;
}
}
@ -970,12 +932,12 @@ GstBuffer *gst_pad_pull(GstPad *pad) {
#ifndef gst_pad_pullregion
GstBuffer *gst_pad_pullregion(GstPad *pad,gulong offset,gulong size) {
GstRealPad *realpad = GST_REAL_PAD(pad);
GstRealPad *peer = GST_RPAD_PEER(pad);
GST_DEBUG_ENTER("(%s:%s,%ld,%ld)",GST_DEBUG_PAD_NAME(pad),offset,size);
if (realpad->peer->pullregionfunc) {
if (peer->pullregionfunc) {
GST_DEBUG (0,"calling pullregionfunc &%s of peer pad %s:%s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->peer->pullregionfunc),GST_DEBUG_PAD_NAME(GST_PAD(realpad->peer)));
return (realpad->peer->pullregionfunc)(GST_PAD(realpad->peer),offset,size);
GST_DEBUG_FUNCPTR_NAME(peer->pullregionfunc),GST_DEBUG_PAD_NAME(((GstPad*)peer)));
return (peer->pullregionfunc)(((GstPad*)peer),offset,size);
} else {
GST_DEBUG (0,"no pullregionfunc\n");
return NULL;

View file

@ -107,11 +107,6 @@ struct _GstPadClass {
GstObjectClass parent_class;
};
/* quick access macros */
#define GST_PAD_NAME(pad) (GST_PAD(pad)->name)
#define GST_PAD_DIRECTION(pad) (GST_PAD(pad)->direction)
#define GST_PAD_PARENT(pad) (GST_PAD(pad)->parent)
struct _GstRealPad {
GstPad pad;
@ -137,10 +132,6 @@ struct _GstRealPad {
GList *ghostparents;
};
/* quick test to see if the pad is connected */
#define GST_PAD_CONNECTED(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->peer != NULL)
#define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->pullfunc != NULL)
struct _GstRealPadClass {
GstPadClass parent_class;
@ -160,7 +151,43 @@ struct _GstGhostPadClass {
GstPadClass parent_class;
};
/* template */
/***** helper macros *****/
/* GstPad */
#define GST_PAD_NAME(pad) (((GstPad *)(pad))->name)
#define GST_PAD_ELEMENT_PRIVATE(pad) (((GstPad *)(pad))->element_private)
#define GST_PAD_PARENT(pad) (((GstPad *)(pad))->parent)
#define GST_PAD_PADTEMPLATE(pad) (((GstPad *)(pad))->padtemplate)
/* GstRealPad */
#define GST_RPAD_DIRECTION(pad) (((GstRealPad *)(pad))->direction)
#define GST_RPAD_CAPS(pad) (((GstRealPad *)(pad))->caps)
#define GST_RPAD_PEER(pad) (((GstRealPad *)(pad))->peer)
#define GST_RPAD_BUFPEN(pad) (((GstRealPad *)(pad))->bufpen)
#define GST_RPAD_CHAINFUNC(pad) (((GstRealPad *)(pad))->chainfunc)
#define GST_RPAD_GETFUNC(pad) (((GstRealPad *)(pad))->getfunc)
#define GST_RPAD_GETREGIONFUNC(pad) (((GstRealPad *)(pad))->getregionfunc)
#define GST_RPAD_PUSHFUNC(pad) (((GstRealPad *)(pad))->pushfunc)
#define GST_RPAD_PULLFUNC(pad) (((GstRealPad *)(pad))->pullfunc)
#define GST_RPAD_PULLREGIONFUNC(pad) (((GstRealPad *)(pad))->pullregionfunc)
#define GST_RPAD_QOSFUNC(pad) (((GstRealPad *)(pad))->qosfunc)
#define GST_RPAD_EOSFUNC(pad) (((GstRealPad *)(pad))->eosfunc)
/* GstGhostPad */
#define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad)
/* Generic */
#define GST_PAD_REALIZE(pad) (GST_IS_REAL_PAD(pad) ? ((GstRealPad *)(pad)) : GST_GPAD_REALPAD(pad))
#define GST_PAD_DIRECTION(pad) GST_RPAD_DIRECTION(GST_PAD_REALIZE(pad))
#define GST_PAD_CAPS(pad) GST_RPAD_CAPS(GST_PAD_REALIZE(pad))
#define GST_PAD_PEER(pad) GST_RPAD_PEER(GST_PAD_REALIZE(pad))
/* Some check functions (unused?) */
#define GST_PAD_CONNECTED(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->peer != NULL)
#define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->pullfunc != NULL)
/***** PadTemplate *****/
#define GST_TYPE_PADTEMPLATE (gst_padtemplate_get_type ())
#define GST_PADTEMPLATE(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PADTEMPLATE,GstPad))
#define GST_PADTEMPLATE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PADTEMPLATE,GstPadClass))
@ -261,7 +288,7 @@ GstBuffer* gst_pad_pull_region (GstPad *pad, gulong offset, gulong size);
GstPad * gst_pad_select (GstPad *nextpad, ...);
#define gst_pad_eos(pad) ((pad)->peer->eosfunc((pad)->peer))
#define gst_pad_eos(pad) (GST_RPAD_EOSFUNC(GST_RPAD_PEER(pad))(GST_PAD(GST_RPAD_PEER(pad))))
gboolean gst_pad_set_eos (GstPad *pad);
gboolean gst_pad_eos_func (GstPad *pad);

View file

@ -20,18 +20,17 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef GST_HGUARD_GSTPPC_H
#define GST_HGUARD_GSTPPC_H
#ifndef __GST_GSTPPC_H__
#define __GST_GSTPPC_H__
/* FIXME: Hmm - does this work?
*/
#define GET_SP(target) \
__asm__("stw 1,%0" : "=m"(target) : : "r1");
#define SET_SP(source) \
__asm__("lwz 1,%0" : "=m"(source))
// should bring this in line with others and use an "r"
#define GST_ARCH_SET_SP(stackpointer) \
__asm__("lwz 1,%0" : : "m"(stackpointer))
#define CALL(target) \
#define GST_ARCH_CALL(target) \
__asm__( "mr 0,%0\n\t" \
"mtlr 0\n\t" \
"blrl" : : "r"(target) );
@ -43,8 +42,8 @@ struct minimal_ppc_stackframe {
unsigned long unused2;
};
#define SETUP_STACK(sp) \
#define GST_ARCH_SETUP_STACK(sp) \
sp = ((unsigned long *)(sp)) - 4; \
((struct minimal_ppc_stackframe *)sp)->back_chain = 0;
#endif /* GST_HGUARD_GSTPPC_H */
#endif /* __GST_GSTPPC_H__ */

View file

@ -65,11 +65,11 @@ gst_bin_chain_wrapper (int argc,char *argv[])
pads = g_list_next (pads);
if (!GST_IS_REAL_PAD(pad)) continue;
realpad = GST_REAL_PAD(pad);
if (realpad->direction == GST_PAD_SINK) {
if (GST_RPAD_DIRECTION(realpad) == GST_PAD_SINK) {
GST_DEBUG (0,"pulling a buffer from %s:%s\n", name, gst_pad_get_name (pad));
buf = gst_pad_pull (pad);
GST_DEBUG (0,"calling chain function of %s:%s\n", name, gst_pad_get_name (pad));
(realpad->chainfunc) (pad,buf);
GST_RPAD_CHAINFUNC(realpad) (pad,buf);
GST_DEBUG (0,"calling chain function of %s:%s done\n", name, gst_pad_get_name (pad));
}
}
@ -85,7 +85,6 @@ gst_bin_src_wrapper (int argc,char *argv[])
{
GstElement *element = GST_ELEMENT (argv);
GList *pads;
GstPad *pad;
GstRealPad *realpad;
GstBuffer *buf;
G_GNUC_UNUSED const gchar *name = gst_element_get_name (element);
@ -95,26 +94,25 @@ gst_bin_src_wrapper (int argc,char *argv[])
do {
pads = element->pads;
while (pads) {
pad = GST_PAD (pads->data);
if (!GST_IS_REAL_PAD(pads->data)) continue;
realpad = (GstRealPad*)(pads->data);
pads = g_list_next(pads);
if (!GST_IS_REAL_PAD(pad)) continue;
realpad = GST_REAL_PAD(pad);
if (realpad->direction == GST_PAD_SRC) {
if (GST_RPAD_DIRECTION(realpad) == GST_PAD_SRC) {
// region_struct *region = cothread_get_data (element->threadstate, "region");
GST_DEBUG (0,"calling _getfunc for %s:%s\n",GST_DEBUG_PAD_NAME(pad));
GST_DEBUG (0,"calling _getfunc for %s:%s\n",GST_DEBUG_PAD_NAME(realpad));
// if (region) {
//gst_src_push_region (GST_SRC (element), region->offset, region->size);
// if (eralpad->getregionfunc == NULL)
// gst_src_push_region (GST_SRC (element), region->offset, region->size);
// if (GST_RPAD_GETREGIONFUNC(realpad) == NULL)
// fprintf(stderr,"error, no getregionfunc in \"%s\"\n", name);
// buf = (realpad->getregionfunc)(pad, region->offset, region->size);
// buf = (GST_RPAD_GETREGIONFUNC(realpad))((GstPad*)realpad, region->offset, region->size);
// } else {
if (realpad->getfunc == NULL)
if (GST_RPAD_GETFUNC(realpad) == NULL)
fprintf(stderr,"error, no getfunc in \"%s\"\n", name);
buf = (realpad->getfunc)(pad);
buf = GST_RPAD_GETFUNC(realpad) ((GstPad*)realpad);
// }
GST_DEBUG (0,"calling gst_pad_push on pad %s:%s\n",GST_DEBUG_PAD_NAME(pad));
gst_pad_push (pad, buf);
GST_DEBUG (0,"calling gst_pad_push on pad %s:%s\n",GST_DEBUG_PAD_NAME(realpad));
gst_pad_push ((GstPad*)realpad, buf);
}
}
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
@ -130,8 +128,8 @@ gst_bin_pushfunc_proxy (GstPad *pad, GstBuffer *buf)
cothread_state *threadstate = GST_ELEMENT(pad->parent)->threadstate;
GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad));
GST_DEBUG (0,"putting buffer %p in peer's pen\n",buf);
GST_REAL_PAD(pad)->peer->bufpen = buf;
GST_DEBUG (0,"switching to %p (@%p)\n",threadstate,&(GST_ELEMENT(pad->parent)->threadstate));
GST_RPAD_BUFPEN(GST_RPAD_PEER(pad)) = buf;
GST_DEBUG (0,"switching to %p (@%p)\n",threadstate,&(GST_ELEMENT(GST_PAD_PARENT(pad))->threadstate));
cothread_switch (threadstate);
GST_DEBUG (0,"done switching\n");
}
@ -139,18 +137,18 @@ gst_bin_pushfunc_proxy (GstPad *pad, GstBuffer *buf)
static GstBuffer*
gst_bin_pullfunc_proxy (GstPad *pad)
{
GstRealPad *realpad = GST_REAL_PAD(pad);
GstBuffer *buf;
cothread_state *threadstate = GST_ELEMENT(pad->parent)->threadstate;
cothread_state *threadstate = GST_ELEMENT(GST_PAD_PARENT(pad))->threadstate;
GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad));
if (realpad->bufpen == NULL) {
GST_DEBUG (0,"switching to %p (@%p)\n",threadstate,&(GST_ELEMENT(pad->parent)->threadstate));
// FIXME this should be a while
if (GST_RPAD_BUFPEN(pad) == NULL) {
GST_DEBUG (0,"switching to %p (@%p)\n",threadstate,&(GST_ELEMENT(GST_PAD_PARENT(pad))->threadstate));
cothread_switch (threadstate);
}
GST_DEBUG (0,"done switching\n");
buf = realpad->bufpen;
realpad->bufpen = NULL;
buf = GST_RPAD_BUFPEN(pad);
GST_RPAD_BUFPEN(pad) = NULL;
return buf;
}
@ -190,7 +188,6 @@ gst_schedule_cothreaded_chain (GstBin *bin, _GstBinChain *chain) {
cothread_func wrapper_function;
GList *pads;
GstPad *pad;
GstRealPad *realpad;
GST_DEBUG (0,"chain is using cothreads\n");
@ -234,29 +231,28 @@ gst_schedule_cothreaded_chain (GstBin *bin, _GstBinChain *chain) {
pad = GST_PAD (pads->data);
pads = g_list_next (pads);
if (!GST_IS_REAL_PAD(pad)) continue;
realpad = GST_REAL_PAD(pad);
// if the element is DECOUPLED or outside the manager, we have to chain
if ((wrapper_function == NULL) ||
(GST_ELEMENT(GST_PAD(realpad->peer)->parent)->manager != GST_ELEMENT(bin))) {
(GST_ELEMENT(GST_PAD(GST_RPAD_PEER(pad))->parent)->manager != GST_ELEMENT(bin))) {
// set the chain proxies
if (gst_pad_get_direction (pad) == GST_PAD_SINK) {
if (GST_RPAD_DIRECTION(pad) == GST_PAD_SINK) {
GST_DEBUG (0,"copying chain function into push proxy for %s:%s\n",GST_DEBUG_PAD_NAME(pad));
realpad->pushfunc = realpad->chainfunc;
GST_RPAD_PUSHFUNC(pad) = GST_RPAD_CHAINFUNC(pad);
} else {
GST_DEBUG (0,"copying get function into pull proxy for %s:%s\n",GST_DEBUG_PAD_NAME(pad));
realpad->pullfunc = realpad->getfunc;
realpad->pullregionfunc = realpad->getregionfunc;
GST_RPAD_PULLFUNC(pad) = GST_RPAD_GETFUNC(pad);
GST_RPAD_PULLREGIONFUNC(pad) = GST_RPAD_GETREGIONFUNC(pad);
}
// otherwise we really are a cothread
} else {
if (gst_pad_get_direction (pad) == GST_PAD_SINK) {
GST_DEBUG (0,"setting cothreaded push proxy for sinkpad %s:%s\n",GST_DEBUG_PAD_NAME(pad));
realpad->pushfunc = GST_DEBUG_FUNCPTR(gst_bin_pushfunc_proxy);
GST_RPAD_PUSHFUNC(pad) = GST_DEBUG_FUNCPTR(gst_bin_pushfunc_proxy);
} else {
GST_DEBUG (0,"setting cothreaded pull proxy for srcpad %s:%s\n",GST_DEBUG_PAD_NAME(pad));
realpad->pullfunc = GST_DEBUG_FUNCPTR(gst_bin_pullfunc_proxy);
GST_RPAD_PULLFUNC(pad) = GST_DEBUG_FUNCPTR(gst_bin_pullfunc_proxy);
}
}
}
@ -280,7 +276,6 @@ gst_schedule_chained_chain (GstBin *bin, _GstBinChain *chain) {
GstElement *element;
GList *pads;
GstPad *pad;
GstRealPad *realpad;
GST_DEBUG (0,"chain entered\n");
// walk through all the elements
@ -295,15 +290,14 @@ gst_schedule_chained_chain (GstBin *bin, _GstBinChain *chain) {
pad = GST_PAD (pads->data);
pads = g_list_next (pads);
if (!GST_IS_REAL_PAD(pad)) continue;
realpad = GST_REAL_PAD(pad);
if (gst_pad_get_direction (pad) == GST_PAD_SINK) {
if (GST_RPAD_DIRECTION(pad) == GST_PAD_SINK) {
GST_DEBUG (0,"copying chain function into push proxy for %s:%s\n",GST_DEBUG_PAD_NAME(pad));
realpad->pushfunc = realpad->chainfunc;
GST_RPAD_PUSHFUNC(pad) = GST_RPAD_CHAINFUNC(pad);
} else {
GST_DEBUG (0,"copying get function into pull proxy for %s:%s\n",GST_DEBUG_PAD_NAME(pad));
realpad->pullfunc = realpad->getfunc;
realpad->pullregionfunc = realpad->getregionfunc;
GST_RPAD_PULLFUNC(pad) = GST_RPAD_GETFUNC(pad);
GST_RPAD_PULLREGIONFUNC(pad) = GST_RPAD_GETREGIONFUNC(pad);
}
}
}
@ -334,7 +328,6 @@ void gst_bin_schedule_func(GstBin *bin) {
GSList *pending = NULL;
GList *pads;
GstPad *pad;
GstRealPad *realpad;
GstElement *peerparent;
GList *chains;
_GstBinChain *chain;
@ -405,16 +398,15 @@ void gst_bin_schedule_func(GstBin *bin) {
pad = GST_PAD (pads->data);
pads = g_list_next (pads);
if (!GST_IS_REAL_PAD(pad)) continue;
realpad = GST_REAL_PAD(pad);
GST_DEBUG (0,"have pad %s:%s\n",GST_DEBUG_PAD_NAME(pad));
if (realpad->peer == NULL) GST_ERROR(pad,"peer is null!");
g_assert(realpad->peer != NULL);
g_assert(GST_PAD(realpad->peer)->parent != NULL);
if (GST_RPAD_PEER(pad) == NULL) GST_ERROR(pad,"peer is null!");
g_assert(GST_RPAD_PEER(pad) != NULL);
g_assert(GST_PAD(GST_RPAD_PEER(pad))->parent != NULL);
peerparent = GST_ELEMENT(GST_PAD(realpad->peer)->parent);
peerparent = GST_ELEMENT(GST_PAD(GST_RPAD_PEER(pad))->parent);
GST_DEBUG (0,"peer pad %p\n", realpad->peer);
GST_DEBUG (0,"peer pad %p\n", GST_RPAD_PEER(pad));
// only bother with if the pad's peer's parent is this bin or it's DECOUPLED
// only add it if it's in the list of un-visited elements still
if ((g_list_find (elements, peerparent) != NULL) ||
@ -425,7 +417,7 @@ if (realpad->peer == NULL) GST_ERROR(pad,"peer is null!");
pending = g_slist_prepend (pending, peerparent);
// if this is a sink pad, then the element on the other side is an entry
if ((gst_pad_get_direction (pad) == GST_PAD_SINK) &&
if ((GST_RPAD_DIRECTION(pad) == GST_PAD_SINK) &&
(GST_FLAG_IS_SET (peerparent, GST_ELEMENT_DECOUPLED))) {
chain->entries = g_list_prepend (chain->entries, peerparent);
GST_DEBUG (0,"added '%s' as DECOUPLED entry into the chain\n",gst_element_get_name(peerparent));
@ -560,18 +552,18 @@ if (realpad->peer == NULL) GST_ERROR(pad,"peer is null!");
// copy the peer's chain function, easy enough
GST_DEBUG (0,"copying peer's chainfunc to %s:%s's pushfunc\n",GST_DEBUG_PAD_NAME(pad));
pad->pushfunc = GST_DEBUG_FUNCPTR(pad->peer->chainfunc);
GST_RPAD_PUSHFUNC(pad) = GST_DEBUG_FUNCPTR(GST_RPAD_CHAINFUNC(GST_RPAD_PEER(pad)));
// need to walk through and check for outside connections
//FIXME need to do this for all pads
// get the pad's peer
peer = gst_pad_get_peer (pad);
peer = GST_RPAD_PEER(pad);
if (!peer) {
GST_DEBUG (0,"found SINK pad %s has no peer\n", gst_pad_get_name (pad));
break;
}
// get the parent of the peer of the pad
outside = GST_ELEMENT (gst_pad_get_parent (peer));
outside = GST_ELEMENT (GST_RPAD_PARENT(peer));
if (!outside) break;
// if it's a connection and it's not ours...
if (GST_IS_CONNECTION (outside) &&

View file

@ -1,6 +1,5 @@
#include <glib.h>
#include <gst/gst.h>
#include <gst/elements/gstqueue.h>
extern gboolean _gst_plugin_spew;

View file

@ -1,4 +1,4 @@
noinst_PROGRAMS = case1 case2 case3
noinst_PROGRAMS = case1 #case2 case3
# jsut apps here, this is safe
LIBS += $(GST_LIBS)