X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgsttaglist.c;h=56e6a46b6e407bc734e5f5010ea5c33cc370006f;hb=53bf06c08814ff9ac3968d47daf11a395cf26a01;hp=3f5d47e9dcd7abc692c308fbe449c2cc87ad4020;hpb=44423e8af3adf99122de2ac53e8d840a46a7d329;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gsttaglist.c b/gst/gsttaglist.c index 3f5d47e..56e6a46 100644 --- a/gst/gsttaglist.c +++ b/gst/gsttaglist.c @@ -21,6 +21,7 @@ /** * SECTION:gsttaglist + * @title: GstTagList * @short_description: List of tags and values used to describe media metadata * * List of tags and values used to describe media metadata. @@ -470,13 +471,13 @@ gst_tag_lookup (const gchar * tag_name) } /** - * gst_tag_register: + * gst_tag_register: (skip) * @name: the name or identifier string * @flag: a flag describing the type of tag info * @type: the type this data is in * @nick: human-readable name * @blurb: a human-readable description about this tag - * @func: (allow-none) (scope call): function for merging multiple values of this tag, or %NULL + * @func: (allow-none): function for merging multiple values of this tag, or %NULL * * Registers a new tag type for the use with GStreamer's type system. If a type * with that name is already registered, that one is used. @@ -509,18 +510,18 @@ gst_tag_register (const gchar * name, GstTagFlag flag, GType type, g_return_if_fail (blurb != NULL); g_return_if_fail (type != 0 && type != GST_TYPE_LIST); - return gst_tag_register_static (g_intern_string (name), flag, type, + gst_tag_register_static (g_intern_string (name), flag, type, g_intern_string (nick), g_intern_string (blurb), func); } /** - * gst_tag_register_static: + * gst_tag_register_static: (skip) * @name: the name or identifier string (string constant) * @flag: a flag describing the type of tag info * @type: the type this data is in * @nick: human-readable name or short description (string constant) * @blurb: a human-readable description for this tag (string constant) - * @func: (allow-none) (scope call): function for merging multiple values of this tag, or %NULL + * @func: (allow-none): function for merging multiple values of this tag, or %NULL * * Registers a new tag type for the use with GStreamer's type system. * @@ -603,7 +604,7 @@ gst_tag_get_type (const gchar * tag) * Returns the human-readable name of this tag, You must not change or free * this string. * - * Returns: the human-readable name of this tag + * Returns: (nullable): the human-readable name of this tag */ const gchar * gst_tag_get_nick (const gchar * tag) @@ -612,7 +613,11 @@ gst_tag_get_nick (const gchar * tag) g_return_val_if_fail (tag != NULL, NULL); info = gst_tag_lookup (tag); - g_return_val_if_fail (info != NULL, NULL); + if (!info) { + GST_WARNING ("Unknown tag: %s", tag); + + return tag; + } return info->nick; } @@ -624,7 +629,7 @@ gst_tag_get_nick (const gchar * tag) * Returns the human-readable description of this tag, You must not change or * free this string. * - * Returns: the human-readable description of this tag + * Returns: (nullable): the human-readable description of this tag */ const gchar * gst_tag_get_description (const gchar * tag) @@ -714,6 +719,10 @@ __gst_tag_list_free (GstTagList * list) gst_structure_free (GST_TAG_LIST_STRUCTURE (list)); +#ifdef USE_POISONING + memset (list, 0xff, sizeof (GstTagListImpl)); +#endif + g_slice_free1 (sizeof (GstTagListImpl), list); } @@ -1294,7 +1303,7 @@ gst_tag_list_add_valist (GstTagList * list, GstTagMergeMode mode, g_warning ("%s: %s", G_STRLOC, error); g_free (error); /* we purposely leak the value here, it might not be - * in a sane state if an error condition occoured + * in a sane state if an error condition occurred */ return; } @@ -1378,6 +1387,7 @@ void gst_tag_list_remove_tag (GstTagList * list, const gchar * tag) { g_return_if_fail (GST_IS_TAG_LIST (list)); + g_return_if_fail (gst_tag_list_is_writable (list)); g_return_if_fail (tag != NULL); gst_structure_remove_field (GST_TAG_LIST_STRUCTURE (list), tag); @@ -1634,6 +1644,18 @@ TAG_MERGE_FUNCS (int, gint, TRUE); */ TAG_MERGE_FUNCS (uint, guint, TRUE); /** + * gst_tag_list_get_int64: + * @list: a #GstTagList to get the tag from + * @tag: tag to read out + * @value: (out): location for the result + * + * Copies the contents for the given tag into the value, merging multiple values + * into one if multiple values are associated with the tag. + * + * Returns: %TRUE, if a value was copied, %FALSE if the tag didn't exist in the + * given list. + */ +/** * gst_tag_list_get_int64_index: * @list: a #GstTagList to get the tag from * @tag: tag to read out