gst/gstpad.c: revert last patch from Andy, it makes gst_pad_can_link_filtered much...
authorBenjamin Otte <otte@gnome.org>
Sun, 22 Feb 2004 15:09:20 +0000 (15:09 +0000)
committerBenjamin Otte <otte@gnome.org>
Sun, 22 Feb 2004 15:09:20 +0000 (15:09 +0000)
Original commit message from CVS:
2004-02-22  Benjamin Otte  <otte@gnome.org>

* gst/gstpad.c:
revert last patch from Andy, it makes gst_pad_can_link_filtered much
too noisy
* gst/gsttag.c: (_gst_tag_initialize):
* gst/gsttag.h:
add GST_TAG_ALBUM_VOLUME_{COUNT,NUMBER}
* libs/gst/control/dparam.c: (gst_dparam_attach):
* libs/gst/control/dparammanager.c: (gst_dpman_attach_dparam):
check that types for attached dparams match

ChangeLog
gst/gstpad.c
gst/gsttag.c
gst/gsttag.h
gst/gsttaglist.c
gst/gsttaglist.h
libs/gst/control/dparam.c
libs/gst/control/dparammanager.c

index cbedc79..244944c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-02-22  Benjamin Otte  <otte@gnome.org>
+
+       * gst/gstpad.c:
+         revert last patch from Andy, it makes gst_pad_can_link_filtered much
+         too noisy
+       * gst/gsttag.c: (_gst_tag_initialize):
+       * gst/gsttag.h:
+         add GST_TAG_ALBUM_VOLUME_{COUNT,NUMBER}
+       * libs/gst/control/dparam.c: (gst_dparam_attach):
+       * libs/gst/control/dparammanager.c: (gst_dpman_attach_dparam):
+         check that types for attached dparams match
+
 2004-02-22  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * gst/elements/gstfilesink.c: (gst_filesink_open_file):
index d7fce21..275d2eb 100644 (file)
@@ -193,6 +193,8 @@ gst_real_pad_class_init (GstRealPadClass *klass)
                  gst_marshal_BOXED__BOXED, GST_TYPE_CAPS, 1,
                   GST_TYPE_CAPS | G_SIGNAL_TYPE_STATIC_SCOPE);
 
+/*  gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN, */
+/*                           GTK_ARG_READWRITE, REAL_ARG_ACTIVE); */
   g_object_class_install_property (G_OBJECT_CLASS (klass), REAL_ARG_ACTIVE,
     g_param_spec_boolean ("active", "Active", "Whether the pad is active.",
                           TRUE, G_PARAM_READWRITE));
@@ -556,7 +558,7 @@ gst_pad_set_event_mask_function (GstPad *pad,
 
   GST_RPAD_EVENTMASKFUNC (pad) = mask_func;
 
-  GST_CAT_LOG (GST_CAT_PADS, "eventmaskfunc for %s:%s  set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "eventmaskfunc for %s:%s  set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (mask_func));
 }
 
@@ -631,7 +633,7 @@ gst_pad_set_convert_function (GstPad *pad,
 
   GST_RPAD_CONVERTFUNC (pad) = convert;
 
-  GST_CAT_LOG (GST_CAT_PADS, "convertfunc for %s:%s  set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "convertfunc for %s:%s  set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (convert));
 }
 
@@ -650,7 +652,7 @@ gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query)
 
   GST_RPAD_QUERYFUNC (pad) = query;
 
-  GST_CAT_LOG (GST_CAT_PADS, "queryfunc for %s:%s  set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "queryfunc for %s:%s  set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (query));
 }
 
@@ -669,7 +671,7 @@ gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func)
 
   GST_RPAD_QUERYTYPEFUNC (pad) = type_func;
 
-  GST_CAT_LOG (GST_CAT_PADS, "querytypefunc for %s:%s  set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "querytypefunc for %s:%s  set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (type_func));
 }
 
@@ -744,7 +746,7 @@ gst_pad_set_internal_link_function (GstPad *pad,
   g_return_if_fail (GST_IS_REAL_PAD (pad));
 
   GST_RPAD_INTLINKFUNC (pad) = intlink;
-  GST_CAT_LOG (GST_CAT_PADS, "internal link for %s:%s  set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "internal link for %s:%s  set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (intlink));
 }
 
@@ -762,7 +764,7 @@ gst_pad_set_formats_function (GstPad *pad, GstPadFormatsFunction formats)
   g_return_if_fail (GST_IS_REAL_PAD (pad));
 
   GST_RPAD_FORMATSFUNC (pad) = formats;
-  GST_CAT_LOG (GST_CAT_PADS, "formats function for %s:%s  set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "formats function for %s:%s  set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (formats));
 }
 
@@ -801,7 +803,7 @@ gst_pad_set_link_function (GstPad *pad,
   g_return_if_fail (GST_IS_REAL_PAD (pad));
 
   GST_RPAD_LINKFUNC (pad) = link;
-  GST_CAT_LOG (GST_CAT_PADS, "linkfunc for %s:%s set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "linkfunc for %s:%s set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (link));
 }
 
@@ -821,7 +823,7 @@ gst_pad_set_unlink_function (GstPad *pad,
   g_return_if_fail (GST_IS_REAL_PAD (pad));
 
   GST_RPAD_UNLINKFUNC (pad) = unlink;
-  GST_CAT_LOG (GST_CAT_PADS, "unlinkfunc for %s:%s set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "unlinkfunc for %s:%s set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (unlink));
 }
 
@@ -847,7 +849,7 @@ gst_pad_set_fixate_function (GstPad *pad, GstPadFixateFunction fixate)
   g_return_if_fail (GST_IS_REAL_PAD (pad));
 
   GST_RPAD_FIXATEFUNC (pad) = fixate;
-  GST_CAT_LOG (GST_CAT_PADS, "fixatefunc for %s:%s set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "fixatefunc for %s:%s set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (fixate));
 }
 
@@ -884,7 +886,7 @@ gst_pad_set_getcaps_function (GstPad *pad,
   g_return_if_fail (GST_IS_REAL_PAD (pad));
 
   GST_RPAD_GETCAPSFUNC (pad) = getcaps;
-  GST_CAT_LOG (GST_CAT_PADS, "getcapsfunc for %s:%s set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "getcapsfunc for %s:%s set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (getcaps));
 }
 
@@ -905,7 +907,7 @@ gst_pad_set_bufferalloc_function (GstPad *pad,
   g_return_if_fail (GST_PAD_IS_SINK (pad));
 
   GST_RPAD_BUFFERALLOCFUNC (pad) = bufalloc;
-  GST_CAT_LOG (GST_CAT_PADS, "bufferallocfunc for %s:%s set to %s",
+  GST_CAT_DEBUG (GST_CAT_PADS, "bufferallocfunc for %s:%s set to %s",
              GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (bufalloc));
 }
 
@@ -989,8 +991,8 @@ gst_pad_unlink (GstPad *srcpad,
   g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_UNLINKED], 
                  0, realsrc);
 
-  GST_CAT_LOG (GST_CAT_ELEMENT_PADS, "unlinked %s:%s and %s:%s",
-               GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+  GST_CAT_INFO (GST_CAT_ELEMENT_PADS, "unlinked %s:%s and %s:%s",
+            GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
 
   gst_object_unref (GST_OBJECT (realsrc));
   gst_object_unref (GST_OBJECT (realsink));
@@ -1527,42 +1529,76 @@ gst_pad_try_set_caps_nonfixed (GstPad *pad, const GstCaps *caps)
   return ret;
 }
 
-/* returning NULL indicates that the arguments are invalid */
-static GstPadLink*
-gst_pad_link_prepare (GstPad *srcpad, GstPad *sinkpad,
-                      const GstCaps *filtercaps)
+/**
+ * gst_pad_can_link_filtered:
+ * @srcpad: the source #GstPad to link.
+ * @sinkpad: the sink #GstPad to link.
+ * @filtercaps: the filter #GstCaps.
+ *
+ * Checks if the source pad and the sink pad can be linked when constrained
+ * by the given filter caps. Both @srcpad and @sinkpad must be unlinked.
+ *
+ * Returns: TRUE if the pads can be linked, FALSE otherwise.
+ */
+gboolean
+gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad,
+                           const GstCaps *filtercaps)
 {
   GstRealPad *realsrc, *realsink;
   GstPadLink *link;
 
-  g_return_val_if_fail (GST_IS_PAD (srcpad), NULL);
-  g_return_val_if_fail (GST_IS_PAD (sinkpad), NULL);
+  /* FIXME This function is gross.  It's almost a direct copy of
+   * gst_pad_link_filtered().  Any decent programmer would attempt
+   * to merge the two functions, which I will do some day. --ds
+   */
 
+  /* generic checks */
+  g_return_val_if_fail (srcpad != NULL, FALSE);
+  g_return_val_if_fail (GST_IS_PAD (srcpad), FALSE);
+  g_return_val_if_fail (sinkpad != NULL, FALSE);
+  g_return_val_if_fail (GST_IS_PAD (sinkpad), FALSE);
+
+  GST_CAT_INFO (GST_CAT_PADS, "trying to link %s:%s and %s:%s",
+            GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+
+  /* now we need to deal with the real/ghost stuff */
   realsrc = GST_PAD_REALIZE (srcpad);
   realsink = GST_PAD_REALIZE (sinkpad);
 
   if ((GST_PAD (realsrc) != srcpad) || (GST_PAD (realsink) != sinkpad)) {
-    GST_CAT_DEBUG (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
-                   GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
+    GST_CAT_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
+              GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
+  }
+  /* FIXME: shouldn't we convert this to g_return_val_if_fail? */
+  if (GST_RPAD_PEER (realsrc) != NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real source pad %s:%s has a peer, failed",
+             GST_DEBUG_PAD_NAME (realsrc));
+    return FALSE;
+  }
+  if (GST_RPAD_PEER (realsink) != NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s has a peer, failed",
+             GST_DEBUG_PAD_NAME (realsink));
+    return FALSE;
+  }
+  if (GST_PAD_PARENT (realsrc) == NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real src pad %s:%s has no parent, failed",
+             GST_DEBUG_PAD_NAME (realsrc));
+    return FALSE;
+  }
+  if (GST_PAD_PARENT (realsink) == NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s has no parent, failed",
+             GST_DEBUG_PAD_NAME (realsrc));
+    return FALSE;
   }
-
-  g_return_val_if_fail (GST_RPAD_PEER (realsrc) == NULL, NULL);
-  g_return_val_if_fail (GST_RPAD_PEER (realsink) == NULL, NULL);
-  g_return_val_if_fail (GST_PAD_PARENT (realsrc) != NULL, NULL);
-  g_return_val_if_fail (GST_PAD_PARENT (realsink) != NULL, NULL);
 
   if (!gst_pad_check_schedulers (realsrc, realsink)) {
     g_warning ("linking pads with different scheds requires "
                "exactly one decoupled element (such as queue)");
-    return NULL;
+    return FALSE;
   }
   
-  if (GST_RPAD_DIRECTION (realsrc) == GST_RPAD_DIRECTION (realsink)) {
-    g_warning ("%s:%s and %s:%s are both %s pads, failed",
-               GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink),
-               GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC ? "src" : "sink");
-    return NULL;
-  }    
+  g_return_val_if_fail (realsrc != NULL, GST_PAD_LINK_REFUSED);
+  g_return_val_if_fail (realsink != NULL, GST_PAD_LINK_REFUSED);
 
   link = gst_pad_link_new ();
 
@@ -1574,48 +1610,29 @@ gst_pad_link_prepare (GstPad *srcpad, GstPad *sinkpad,
     link->sinkpad = GST_PAD (realsrc);
   }
 
+  if (GST_RPAD_DIRECTION (link->srcpad) != GST_PAD_SRC) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real src pad %s:%s is not a source pad, failed",
+             GST_DEBUG_PAD_NAME (link->srcpad));
+    gst_pad_link_free (link);
+    return FALSE;
+  }    
+  if (GST_RPAD_DIRECTION (link->sinkpad) != GST_PAD_SINK) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s is not a sink pad, failed",
+             GST_DEBUG_PAD_NAME (link->sinkpad));
+    gst_pad_link_free (link);
+    return FALSE;
+  }
+
   link->srccaps = gst_pad_get_caps (link->srcpad);
   link->sinkcaps = gst_pad_get_caps (link->sinkpad);
   if (filtercaps) link->filtercaps = gst_caps_copy (filtercaps);
 
-  return link;
-}
-
-/**
- * gst_pad_can_link_filtered:
- * @srcpad: the source #GstPad to link.
- * @sinkpad: the sink #GstPad to link.
- * @filtercaps: the filter #GstCaps.
- *
- * Checks if the source pad and the sink pad can be linked when constrained
- * by the given filter caps. Both @srcpad and @sinkpad must be unlinked.
- *
- * Returns: TRUE if the pads can be linked, FALSE otherwise.
- */
-gboolean
-gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad,
-                           const GstCaps *filtercaps)
-{
-  GstPadLink *link;
-
-  GST_CAT_INFO (GST_CAT_PADS, "checking if %s:%s and %s:%s can link",
-                GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
-
-  link = gst_pad_link_prepare (srcpad, sinkpad, filtercaps);
-  
-  if (!link) return FALSE;
-
   gst_pad_link_intersect (link);
   if (gst_caps_is_empty (link->caps)) {
-    GST_CAT_INFO (GST_CAT_PADS, "%s:%s and %s:%s %sdo not have compatible capabilities, failed",
-                  GST_DEBUG_PAD_NAME (link->sinkpad), GST_DEBUG_PAD_NAME (link->srcpad),
-                  link->filtercaps ? "and the filtercaps " : "");
     gst_pad_link_free (link);
     return FALSE;
   }
 
-  GST_CAT_DEBUG (GST_CAT_PADS, "yes, pads %s:%s and %s:%s can link",
-                 GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
   gst_pad_link_free (link);
   return TRUE;
 }
@@ -1650,22 +1667,87 @@ gboolean
 gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad,
     const GstCaps *filtercaps)
 {
-  GstPadLink *link;
+  GstRealPad *realsrc, *realsink;
   GstScheduler *src_sched, *sink_sched;
+  GstPadLink *link;
+
+  /* generic checks */
+  g_return_val_if_fail (srcpad != NULL, FALSE);
+  g_return_val_if_fail (GST_IS_PAD (srcpad), FALSE);
+  g_return_val_if_fail (sinkpad != NULL, FALSE);
+  g_return_val_if_fail (GST_IS_PAD (sinkpad), FALSE);
 
   GST_CAT_INFO (GST_CAT_PADS, "trying to link %s:%s and %s:%s",
-                GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+            GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+
+  /* now we need to deal with the real/ghost stuff */
+  realsrc = GST_PAD_REALIZE (srcpad);
+  realsink = GST_PAD_REALIZE (sinkpad);
 
-  link = gst_pad_link_prepare (srcpad, sinkpad, filtercaps);
+  if ((GST_PAD (realsrc) != srcpad) || (GST_PAD (realsink) != sinkpad)) {
+    GST_CAT_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
+              GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
+  }
+  /* FIXME: shouldn't we convert this to g_return_val_if_fail? */
+  if (GST_RPAD_PEER (realsrc) != NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real source pad %s:%s has a peer, failed",
+             GST_DEBUG_PAD_NAME (realsrc));
+    return FALSE;
+  }
+  if (GST_RPAD_PEER (realsink) != NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s has a peer, failed",
+             GST_DEBUG_PAD_NAME (realsink));
+    return FALSE;
+  }
+  if (GST_PAD_PARENT (realsrc) == NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real src pad %s:%s has no parent, failed",
+             GST_DEBUG_PAD_NAME (realsrc));
+    return FALSE;
+  }
+  if (GST_PAD_PARENT (realsink) == NULL) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s has no parent, failed",
+             GST_DEBUG_PAD_NAME (realsrc));
+    return FALSE;
+  }
+
+  if (!gst_pad_check_schedulers (realsrc, realsink)) {
+    g_warning ("linking pads with different scheds requires "
+               "exactly one decoupled element (such as queue)");
+    return FALSE;
+  }
   
-  if (!link) return FALSE;
+  g_return_val_if_fail (realsrc != NULL, GST_PAD_LINK_REFUSED);
+  g_return_val_if_fail (realsink != NULL, GST_PAD_LINK_REFUSED);
+
+  link = gst_pad_link_new ();
+
+  if (GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC) {
+    link->srcpad = GST_PAD (realsrc);
+    link->sinkpad = GST_PAD (realsink);
+  } else {
+    link->srcpad = GST_PAD (realsink);
+    link->sinkpad = GST_PAD (realsrc);
+  }
 
-  if (gst_pad_link_try (link) == GST_PAD_LINK_REFUSED) {
-    GST_CAT_INFO (GST_CAT_PADS, "could not link %s:%s to %s:%s",
-                  GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+  if (GST_RPAD_DIRECTION (link->srcpad) != GST_PAD_SRC) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real src pad %s:%s is not a source pad, failed",
+             GST_DEBUG_PAD_NAME (link->srcpad));
+    gst_pad_link_free (link);
+    return FALSE;
+  }    
+  if (GST_RPAD_DIRECTION (link->sinkpad) != GST_PAD_SINK) {
+    GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s is not a sink pad, failed",
+             GST_DEBUG_PAD_NAME (link->sinkpad));
+    gst_pad_link_free (link);
     return FALSE;
   }
 
+  link->srccaps = gst_pad_get_caps (link->srcpad);
+  link->sinkcaps = gst_pad_get_caps (link->sinkpad);
+  if (filtercaps) link->filtercaps = gst_caps_copy (filtercaps);
+  if (gst_pad_link_try (link) == GST_PAD_LINK_REFUSED)
+    return FALSE;
+
   /* fire off a signal to each of the pads telling them 
    * that they've been linked */
   g_signal_emit (G_OBJECT (link->srcpad), gst_real_pad_signals[REAL_LINKED], 
@@ -1682,14 +1764,15 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad,
                            GST_PAD (link->srcpad), GST_PAD (link->sinkpad));
   }
   else {
-    GST_CAT_LOG (GST_CAT_PADS, "not telling link to scheduler %s:%s and %s:%s, %p %p",
-                 GST_DEBUG_PAD_NAME (link->srcpad), GST_DEBUG_PAD_NAME (link->sinkpad),
-                 src_sched, sink_sched);
+    GST_CAT_INFO (GST_CAT_PADS, "not telling link to scheduler %s:%s and %s:%s, %p %p",
+            GST_DEBUG_PAD_NAME (link->srcpad),
+            GST_DEBUG_PAD_NAME (link->sinkpad),
+           src_sched, sink_sched);
   }
 
-  GST_CAT_INFO (GST_CAT_PADS, "sucessfully linked %s:%s and %s:%s",
-                GST_DEBUG_PAD_NAME (link->srcpad),
-                GST_DEBUG_PAD_NAME (link->sinkpad));
+  GST_CAT_INFO (GST_CAT_PADS, "linked %s:%s and %s:%s, successful",
+            GST_DEBUG_PAD_NAME (link->srcpad),
+            GST_DEBUG_PAD_NAME (link->sinkpad));
 
   return TRUE;
 }
index f039324..bb866f5 100644 (file)
@@ -116,6 +116,16 @@ _gst_tag_initialize (void)
                    _("track count"),
                    _("count of tracks inside collection this track belongs to"), 
                    gst_tag_merge_use_first);
+  gst_tag_register (GST_TAG_ALBUM_VOLUME_NUMBER, GST_TAG_FLAG_META,
+                   G_TYPE_UINT,
+                   _("disc number"),
+                   _("disc number inside a collection"),
+                   gst_tag_merge_use_first);
+  gst_tag_register (GST_TAG_ALBUM_VOLUME_COUNT, GST_TAG_FLAG_META,
+                   G_TYPE_UINT,
+                   _("disc count"),
+                   _("count of discs inside collection this disc belongs to"), 
+                   gst_tag_merge_use_first);
   gst_tag_register (GST_TAG_LOCATION, GST_TAG_FLAG_META,
                    G_TYPE_STRING,
                    _("location"),
index 8ff0702..4f11fc5 100644 (file)
@@ -233,6 +233,8 @@ GstTagList *        gst_event_tag_get_list          (GstEvent *             tag_event);
 #define GST_TAG_COMMENT                        "comment"
 #define GST_TAG_TRACK_NUMBER           "track-number"
 #define GST_TAG_TRACK_COUNT            "track-count"
+#define GST_TAG_ALBUM_VOLUME_NUMBER    "album-disc-number"
+#define GST_TAG_ALBUM_VOLUME_COUNT     "album-disc-count"
 #define GST_TAG_LOCATION               "location"
 #define GST_TAG_DESCRIPTION            "description"
 #define GST_TAG_VERSION                        "version"
index f039324..bb866f5 100644 (file)
@@ -116,6 +116,16 @@ _gst_tag_initialize (void)
                    _("track count"),
                    _("count of tracks inside collection this track belongs to"), 
                    gst_tag_merge_use_first);
+  gst_tag_register (GST_TAG_ALBUM_VOLUME_NUMBER, GST_TAG_FLAG_META,
+                   G_TYPE_UINT,
+                   _("disc number"),
+                   _("disc number inside a collection"),
+                   gst_tag_merge_use_first);
+  gst_tag_register (GST_TAG_ALBUM_VOLUME_COUNT, GST_TAG_FLAG_META,
+                   G_TYPE_UINT,
+                   _("disc count"),
+                   _("count of discs inside collection this disc belongs to"), 
+                   gst_tag_merge_use_first);
   gst_tag_register (GST_TAG_LOCATION, GST_TAG_FLAG_META,
                    G_TYPE_STRING,
                    _("location"),
index 8ff0702..4f11fc5 100644 (file)
@@ -233,6 +233,8 @@ GstTagList *        gst_event_tag_get_list          (GstEvent *             tag_event);
 #define GST_TAG_COMMENT                        "comment"
 #define GST_TAG_TRACK_NUMBER           "track-number"
 #define GST_TAG_TRACK_COUNT            "track-count"
+#define GST_TAG_ALBUM_VOLUME_NUMBER    "album-disc-number"
+#define GST_TAG_ALBUM_VOLUME_COUNT     "album-disc-count"
 #define GST_TAG_LOCATION               "location"
 #define GST_TAG_DESCRIPTION            "description"
 #define GST_TAG_VERSION                        "version"
index dcccb84..d94b941 100644 (file)
@@ -293,6 +293,7 @@ gst_dparam_attach (GstDParam *dparam, GstDParamManager *manager, GParamSpec *par
        g_return_if_fail (param_spec != NULL);
        g_return_if_fail (unit_name != NULL);
        g_return_if_fail (G_IS_PARAM_SPEC (param_spec));
+       g_return_if_fail (G_PARAM_SPEC_VALUE_TYPE (param_spec) == dparam->type); 
 
        GST_DPARAM_NAME(dparam) = g_param_spec_get_name(param_spec);
        GST_DPARAM_PARAM_SPEC(dparam) = param_spec;
index 3a5412c..cb0a66b 100644 (file)
@@ -316,6 +316,7 @@ gst_dpman_attach_dparam (GstDParamManager *dpman, gchar *dparam_name, GstDParam
 
        g_return_val_if_fail(dpwrap != NULL, FALSE);
        g_return_val_if_fail(dpwrap->value != NULL, FALSE);
+       g_return_val_if_fail (G_PARAM_SPEC_VALUE_TYPE (dpwrap->param_spec) == dparam->type, FALSE); 
 
        dpwrap->dparam = dparam;
        gst_dparam_attach(dparam, dpman, dpwrap->param_spec, dpwrap->unit_name);