summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2002-12-31 14:51:54 +0000
committerWim Taymans <wim.taymans@gmail.com>2002-12-31 14:51:54 +0000
commitd315eee4905759731f5987932bb266bc02d1bc19 (patch)
tree7c07bf49385450cc6e842bc941007d34cd305472
parent457ae12e9fac0619a52136e1d272ef820d7155c1 (diff)
downloadgstreamer-d315eee4905759731f5987932bb266bc02d1bc19.tar.gz
- Fix PAD_IS_USABLE on ghostpads
Original commit message from CVS: - Fix PAD_IS_USABLE on ghostpads - fix typos in gstindex.h flags - conditional lock in trashstack asm
-rw-r--r--gst/gstelement.c15
-rw-r--r--gst/gstindex.h6
-rw-r--r--gst/gstpad.h2
-rw-r--r--gst/gsttrashstack.h12
4 files changed, 18 insertions, 17 deletions
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 0af88581da..0e3461d819 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -145,8 +145,6 @@ gst_element_class_init (GstElementClass *klass)
klass->elementfactory = NULL;
klass->padtemplates = NULL;
klass->numpadtemplates = 0;
- klass->send_event = NULL;
- klass->query = NULL;
}
static void
@@ -1770,22 +1768,19 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir)
GST_DEBUG_PAD_NAME (pad));
if (GST_PAD_DIRECTION (pad) == dir) {
- /*
- * FIXME: for some reason a ghosted pad doesn't get it's flag
- * set, which makes this check fail for them.
if (GST_PAD_IS_USABLE (pad)) {
- */
return pad;
- /*
}
- else
+ else {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is not usable",
GST_DEBUG_PAD_NAME (pad));
- */
+ }
}
- else
+ else {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is in wrong direction",
GST_DEBUG_PAD_NAME (pad));
+ }
+
pads = g_list_next (pads);
}
return NULL;
diff --git a/gst/gstindex.h b/gst/gstindex.h
index be7d669dbd..bdf342b2ec 100644
--- a/gst/gstindex.h
+++ b/gst/gstindex.h
@@ -74,11 +74,11 @@ struct _GstIndexAssociation {
};
typedef enum {
- GST_ACCOCIATION_FLAG_NONE = 0,
- GST_ACCOCIATION_FLAG_KEY_UNIT = (1 << 0),
+ GST_ASSOCIATION_FLAG_NONE = 0,
+ GST_ASSOCIATION_FLAG_KEY_UNIT = (1 << 0),
/* new flags should start here */
- GST_ACCOCIATION_FLAG_LAST = (1 << 8),
+ GST_ASSOCIATION_FLAG_LAST = (1 << 8),
} GstAssocFlags;
#define GST_INDEX_FORMAT_FORMAT(entry) ((entry)->data.format.format)
diff --git a/gst/gstpad.h b/gst/gstpad.h
index 05975869c0..54e6e458a1 100644
--- a/gst/gstpad.h
+++ b/gst/gstpad.h
@@ -277,7 +277,7 @@ struct _GstGhostPadClass {
/* Some check functions (unused?) */
#define GST_PAD_IS_CONNECTED(pad) (GST_PAD_PEER(pad) != NULL)
-#define GST_PAD_IS_ACTIVE(pad) (!GST_FLAG_IS_SET(pad, GST_PAD_DISABLED))
+#define GST_PAD_IS_ACTIVE(pad) (!GST_FLAG_IS_SET(GST_PAD_REALIZE(pad), GST_PAD_DISABLED))
#define GST_PAD_IS_USABLE(pad) (GST_PAD_IS_CONNECTED (pad) && \
GST_PAD_IS_ACTIVE(pad) && GST_PAD_IS_ACTIVE(GST_PAD_PEER (pad)))
#define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->gethandler != NULL)
diff --git a/gst/gsttrashstack.h b/gst/gsttrashstack.h
index 3c1ba33c44..b814dfcca2 100644
--- a/gst/gsttrashstack.h
+++ b/gst/gsttrashstack.h
@@ -50,6 +50,12 @@ GST_INLINE_FUNC gpointer gst_trash_stack_pop (GstTrashStack *stack);
#if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2
+#ifdef GST_CONFIG_NO_SMP
+#define SMP_LOCK ""
+#else
+#define SMP_LOCK "lock ; "
+#endif
+
/*
* intel ia32 optimized lockfree implementations
*/
@@ -71,7 +77,7 @@ gst_trash_stack_push (GstTrashStack *stack, gpointer mem)
__asm__ __volatile__ (
"1: \n\t"
" movl %2, (%1); \n\t" /* mem->next == stack->head */
- " lock; cmpxchg %1, %0; \n\t" /* if head unchanged, move mem into it */
+ SMP_LOCK "cmpxchg %1, %0; \n\t" /* if head unchanged, move mem into it */
" jnz 1b; \n" /* head changed, retry */
:
: "m" (*stack),
@@ -98,7 +104,7 @@ gst_trash_stack_pop (GstTrashStack *stack)
" movl (%%eax), %%ebx; \n\t" /* take value pointed to by head (head->next) */
" movl %%edx, %%ecx; \n\t" /* take counter */
" incl %%ecx; \n\t" /* and increment */
- " lock; cmpxchg8b %1; \n\t" /* if eax:edx == *stack, move ebx:ecx to *stack,
+ SMP_LOCK "cmpxchg8b %1; \n\t" /* if eax:edx == *stack, move ebx:ecx to *stack,
* else *stack is moved into eax:edx again... */
" jnz 10b; \n\t" /* ... and we retry */
"20: \n"
@@ -178,7 +184,7 @@ gst_trash_stack_free (GstTrashStack *stack)
g_free (stack);
}
-#endif /* defined (G_CAN_INLINE) || defined (__GST_TRASH_STACK_C__)*/
+#endif /* defined (GST_CAN_INLINE) || defined (__GST_TRASH_STACK_C__)*/
G_END_DECLS