Some more event flags some more padquery types
authorWim Taymans <wim.taymans@gmail.com>
Fri, 2 Aug 2002 11:40:27 +0000 (11:40 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 2 Aug 2002 11:40:27 +0000 (11:40 +0000)
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
gst/gstevent.h
gst/gstpad.c
gst/gstpad.h

index 94388f9..2e13dd2 100644 (file)
@@ -132,7 +132,7 @@ gst_caps_destroy (GstCaps *caps)
 
   if (caps == NULL)
     return;
-  
+
   next = caps->next;
 
   gst_props_unref (caps->properties);
index 0d260ce..05da4a8 100644 (file)
@@ -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);
index bd59ee2..c97efb4 100644 (file)
@@ -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);
index c51289b..b37a5b2 100644 (file)
@@ -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...) \