gst/gstpad.c: Rearrange/rewrite much of the pad negotiation code, since it resembled pasta. This actually changes th...

Original commit message from CVS:
* gst/gstpad.c:
Rearrange/rewrite much of the pad negotiation code, since it
resembled pasta.  This actually changes the way some
negotiation works, since the previous code was inconsistent
depending on how it was invoked.  Add (internal) structure
GstPadLink, which is used to hold some information (more in
the future) about the link between two pads.  Fixes a number
of bugs, including random lossage of filter caps when the
initial negotiation is delayed.  A few functions are still
unimplemented.
* gst/gstpad.h:
Add GST_PAD_LINK_{SUCESSFUL|FAILED}() macros.  Please use
these when testing GstPadLinkReturn values instead of comparing
directly.
This commit is contained in:
David Schleef 2003-12-23 21:39:35 +00:00
parent b121bf3571
commit 91954ff66b
3 changed files with 393 additions and 572 deletions

View file

@ -1,3 +1,20 @@
2003-12-23 David Schleef <ds@schleef.org>
* gst/gstpad.c:
Rearrange/rewrite much of the pad negotiation code, since it
resembled pasta. This actually changes the way some
negotiation works, since the previous code was inconsistent
depending on how it was invoked. Add (internal) structure
GstPadLink, which is used to hold some information (more in
the future) about the link between two pads. Fixes a number
of bugs, including random lossage of filter caps when the
initial negotiation is delayed. A few functions are still
unimplemented.
* gst/gstpad.h:
Add GST_PAD_LINK_{SUCESSFUL|FAILED}() macros. Please use
these when testing GstPadLinkReturn values instead of comparing
directly.
2003-12-23 David Schleef <ds@schleef.org> 2003-12-23 David Schleef <ds@schleef.org>
* gst/gstvalue.c: * gst/gstvalue.c:

File diff suppressed because it is too large Load diff

View file

@ -81,7 +81,7 @@ typedef struct _GstGhostPadClass GstGhostPadClass;
/*typedef struct _GstPadTemplate GstPadTemplate;*/ /*typedef struct _GstPadTemplate GstPadTemplate;*/
/*typedef struct _GstPadTemplateClass GstPadTemplateClass;*/ /*typedef struct _GstPadTemplateClass GstPadTemplateClass;*/
typedef struct _GstStaticPadTemplate GstStaticPadTemplate; typedef struct _GstStaticPadTemplate GstStaticPadTemplate;
typedef struct _GstPadLink GstPadLink;
typedef enum { typedef enum {
GST_PAD_LINK_REFUSED = -1, GST_PAD_LINK_REFUSED = -1,
@ -90,6 +90,9 @@ typedef enum {
GST_PAD_LINK_DONE = 2 GST_PAD_LINK_DONE = 2
} GstPadLinkReturn; } GstPadLinkReturn;
#define GST_PAD_LINK_FAILED(ret) (ret < GST_PAD_LINK_OK)
#define GST_PAD_LINK_SUCCESSFUL(ret) (ret >= GST_PAD_LINK_OK)
/* convenience functions */ /* convenience functions */
#ifdef G_HAVE_ISO_VARARGS #ifdef G_HAVE_ISO_VARARGS
#define GST_PAD_QUERY_TYPE_FUNCTION(functionname, ...) GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, __VA_ARGS__); #define GST_PAD_QUERY_TYPE_FUNCTION(functionname, ...) GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, __VA_ARGS__);
@ -195,7 +198,9 @@ struct _GstRealPad {
GstProbeDispatcher probedisp; GstProbeDispatcher probedisp;
gpointer _gst_reserved[GST_PADDING]; GstPadLink *link;
gpointer _gst_reserved[GST_PADDING - 1];
}; };
struct _GstRealPadClass { struct _GstRealPadClass {
@ -255,6 +260,7 @@ struct _GstGhostPadClass {
#define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc) #define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc)
#define GST_RPAD_FIXATEFUNC(pad) (((GstRealPad *)(pad))->fixatefunc) #define GST_RPAD_FIXATEFUNC(pad) (((GstRealPad *)(pad))->fixatefunc)
#define GST_RPAD_BUFFERALLOCFUNC(pad) (((GstRealPad *)(pad))->bufferallocfunc) #define GST_RPAD_BUFFERALLOCFUNC(pad) (((GstRealPad *)(pad))->bufferallocfunc)
#define GST_RPAD_LINK(pad) (((GstRealPad *)(pad))->link)
/* GstGhostPad */ /* GstGhostPad */
#define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad) #define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad)