From cadff5e8137dae5b0138cd1b64062eed8df680e1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 2 Aug 2002 11:40:27 +0000 Subject: [PATCH] Some more event flags some more padquery types Original commit message from CVS: Some more event flags some more padquery types Better debugging in _pad_get_caps ref the caps before adding them to a padtemplate --- gst/gstcaps.c | 2 +- gst/gstevent.h | 16 +++++++++++++--- gst/gstpad.c | 10 +++++----- gst/gstpad.h | 4 +++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 94388f910b..2e13dd29f9 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -132,7 +132,7 @@ gst_caps_destroy (GstCaps *caps) if (caps == NULL) return; - + next = caps->next; gst_props_unref (caps->properties); diff --git a/gst/gstevent.h b/gst/gstevent.h index 0d260cedbf..05da4a804c 100644 --- a/gst/gstevent.h +++ b/gst/gstevent.h @@ -65,7 +65,10 @@ extern GType _gst_event_type; #define GST_SEEK_FLAGS_MASK 0xfff00000 typedef enum { - GST_EVENT_FLAG_NONE = 0 + GST_EVENT_FLAG_NONE = 0, + + /* indicates negative rates are supported */ + GST_RATE_FLAG_NEGATIVE = (1 << 1) } GstEventFlag; typedef struct @@ -87,14 +90,19 @@ functionname (GstPad *pad) \ /* seek events, extends GstEventFlag */ typedef enum { + /* | with some format */ + /* | with one of these */ GST_SEEK_METHOD_CUR = (1 << (GST_SEEK_METHOD_SHIFT + 0)), GST_SEEK_METHOD_SET = (1 << (GST_SEEK_METHOD_SHIFT + 1)), GST_SEEK_METHOD_END = (1 << (GST_SEEK_METHOD_SHIFT + 2)), + /* | with optional seek flags */ + /* seek flags */ GST_SEEK_FLAG_FLUSH = (1 << (GST_SEEK_FLAGS_SHIFT + 0)), GST_SEEK_FLAG_ACCURATE = (1 << (GST_SEEK_FLAGS_SHIFT + 1)), GST_SEEK_FLAG_KEY_UNIT = (1 << (GST_SEEK_FLAGS_SHIFT + 2)), - GST_SEEK_FLAG_SEGMENT_LOOP = (1 << (GST_SEEK_FLAGS_SHIFT + 3)) + GST_SEEK_FLAG_SEGMENT_LOOP = (1 << (GST_SEEK_FLAGS_SHIFT + 3)), + } GstSeekType; typedef enum { @@ -169,7 +177,9 @@ GstEvent* gst_event_new (GstEventType type); /* seek event */ GstEvent* gst_event_new_seek (GstSeekType type, gint64 offset); -GstEvent* gst_event_new_segment_seek (GstSeekType type, gint64 start, gint64 stop); + +GstEvent* gst_event_new_segment_seek (GstSeekType type, gint64 start, gint64 stop); + /* size events */ GstEvent* gst_event_new_size (GstFormat format, gint64 value); diff --git a/gst/gstpad.c b/gst/gstpad.c index bd59ee201c..c97efb4fc8 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1622,7 +1622,7 @@ gst_pad_get_caps (GstPad *pad) GST_DEBUG_PAD_NAME (realpad), realpad); if (GST_PAD_CAPS (realpad)) { - GST_DEBUG (GST_CAT_CAPS, "using pad real caps"); + GST_DEBUG (GST_CAT_CAPS, "using pad real caps %p", GST_PAD_CAPS (realpad)); return GST_PAD_CAPS (realpad); } else if GST_RPAD_GETCAPSFUNC (realpad) { @@ -1630,8 +1630,9 @@ gst_pad_get_caps (GstPad *pad) return GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL); } else if (GST_PAD_PAD_TEMPLATE (realpad)) { - GST_DEBUG (GST_CAT_CAPS, "using pad template"); - return GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (realpad)); + GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad); + GST_DEBUG (GST_CAT_CAPS, "using pad template %p with caps %p", templ, GST_PAD_TEMPLATE_CAPS (templ)); + return GST_PAD_TEMPLATE_CAPS (templ); } GST_DEBUG (GST_CAT_CAPS, "pad has no caps"); @@ -2200,7 +2201,6 @@ gst_pad_template_class_init (GstPadTemplateClass *klass) gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - gstobject_class->path_string_separator = "*"; } @@ -2287,7 +2287,7 @@ gst_pad_template_new (const gchar *name_template, while (caps) { new->fixed &= caps->fixed; - thecaps = gst_caps_append (thecaps, caps); + thecaps = gst_caps_append (thecaps, gst_caps_ref (caps)); caps = va_arg (var_args, GstCaps*); } va_end (var_args); diff --git a/gst/gstpad.h b/gst/gstpad.h index c51289b03d..b37a5b2687 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -122,7 +122,9 @@ typedef enum { GST_PAD_QUERY_POSITION, GST_PAD_QUERY_LATENCY, GST_PAD_QUERY_JITTER, - GST_PAD_QUERY_SEGMENT_END + GST_PAD_QUERY_START, + GST_PAD_QUERY_SEGMENT_END, + GST_PAD_QUERY_RATE } GstPadQueryType; #define GST_PAD_QUERY_TYPE_FUNCTION(functionname, a...) \