From 5a34cd92ed351898381d01f4ee189dc754846876 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 22 Feb 2004 15:09:20 +0000 Subject: [PATCH] gst/gstpad.c: revert last patch from Andy, it makes gst_pad_can_link_filtered much too noisy Original commit message from CVS: 2004-02-22 Benjamin Otte * 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 | 12 ++ gst/gstpad.c | 267 ++++++++++++++++++++----------- gst/gsttag.c | 10 ++ gst/gsttag.h | 2 + gst/gsttaglist.c | 10 ++ gst/gsttaglist.h | 2 + libs/gst/control/dparam.c | 1 + libs/gst/control/dparammanager.c | 1 + 8 files changed, 213 insertions(+), 92 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbedc798a8..244944c88e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-02-22 Benjamin Otte + + * 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 * gst/elements/gstfilesink.c: (gst_filesink_open_file): diff --git a/gst/gstpad.c b/gst/gstpad.c index d7fce21683..275d2ebe9a 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -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,60 +1529,6 @@ 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) -{ - 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); - - 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)); - } - - 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; - } - - 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; - } - - 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); - } - - 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. @@ -1596,26 +1544,95 @@ gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps) { + GstRealPad *realsrc, *realsink; 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)); + /* 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 + */ - link = gst_pad_link_prepare (srcpad, sinkpad, filtercaps); + /* 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_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); - 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 " : ""); + 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_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); + + gst_pad_link_intersect (link); + if (gst_caps_is_empty (link->caps)) { 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,21 +1667,86 @@ 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)); - link = gst_pad_link_prepare (srcpad, sinkpad, filtercaps); - - if (!link) return FALSE; + /* now we need to deal with the real/ghost stuff */ + realsrc = GST_PAD_REALIZE (srcpad); + realsink = GST_PAD_REALIZE (sinkpad); - 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_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; + } + + 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_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 */ @@ -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; } diff --git a/gst/gsttag.c b/gst/gsttag.c index f03932430a..bb866f5674 100644 --- a/gst/gsttag.c +++ b/gst/gsttag.c @@ -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"), diff --git a/gst/gsttag.h b/gst/gsttag.h index 8ff070210f..4f11fc50fd 100644 --- a/gst/gsttag.h +++ b/gst/gsttag.h @@ -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" diff --git a/gst/gsttaglist.c b/gst/gsttaglist.c index f03932430a..bb866f5674 100644 --- a/gst/gsttaglist.c +++ b/gst/gsttaglist.c @@ -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"), diff --git a/gst/gsttaglist.h b/gst/gsttaglist.h index 8ff070210f..4f11fc50fd 100644 --- a/gst/gsttaglist.h +++ b/gst/gsttaglist.h @@ -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" diff --git a/libs/gst/control/dparam.c b/libs/gst/control/dparam.c index dcccb849aa..d94b94183e 100644 --- a/libs/gst/control/dparam.c +++ b/libs/gst/control/dparam.c @@ -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; diff --git a/libs/gst/control/dparammanager.c b/libs/gst/control/dparammanager.c index 3a5412cfaf..cb0a66b8f3 100644 --- a/libs/gst/control/dparammanager.c +++ b/libs/gst/control/dparammanager.c @@ -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);