TagList

List of tags and values used to describe media metadata.

Strings must be in ASCII or UTF-8 encoding. No other encodings are allowed.

Last reviewed on 2009-06-09 (0.10.23)

class TagList {}

Constructors

this
this(GstTagList* gstTagList)

Sets our main struct and passes it to the parent class

this
this()

Creates a new empty GstTagList. Free-function: gst_tag_list_unref

this
this(void* varArgs)

Just like gst_tag_list_new(), only that it takes a va_list argument. Useful mostly for language bindings. Free-function: gst_tag_list_unref

this
this(string str)

Deserializes a tag list.

Members

Functions

addValist
void addValist(GstTagMergeMode mode, string tag, void* varArgs)

Sets the values for the given tags using the specified mode.

addValistValues
void addValistValues(GstTagMergeMode mode, string tag, void* varArgs)

Sets the GValues for the given tags using the specified mode.

addValue
void addValue(GstTagMergeMode mode, string tag, Value value)

Sets the GValue for a given tag using the specified mode.

copy
TagList copy()

Creates a new GstTagList as a copy of the old taglist. The new taglist will have a refcount of 1, owned by the caller, and will be writable as a result. Note that this function is the semantic equivalent of a gst_tag_list_ref() followed by a gst_tag_list_make_writable(). If you only want to hold on to a reference to the data, you should use gst_tag_list_ref(). When you are finished with the taglist, call gst_tag_list_unref() on it.

doref
TagList doref()

Add a reference to a GstTagList mini object. From this point on, until the caller calls gst_tag_list_unref() or gst_tag_list_make_writable(), it is guaranteed that the taglist object will not change. To use a GstTagList object, you must always have a refcount on it -- either the one made implicitly by e.g. gst_tag_list_new(), or via taking one explicitly with this function.

foreac
void foreac(GstTagForeachFunc func, void* userData)

Calls the given function for each tag inside the tag list. Note that if there is no tag, the function won't be called at all.

getBoolean
int getBoolean(string tag, int value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getBooleanIndex
int getBooleanIndex(string tag, uint index, int value)

Gets the value that is at the given index for the given tag in the given list.

getDate
int getDate(string tag, Date value)

Copies the first date for the given tag in the taglist into the variable pointed to by value. Free the date with g_date_free() when it is no longer needed. Free-function: g_date_free

getDateIndex
int getDateIndex(string tag, uint index, Date value)

Gets the date that is at the given index for the given tag in the given list and copies it into the variable pointed to by value. Free the date with g_date_free() when it is no longer needed. Free-function: g_date_free

getDateTime
int getDateTime(string tag, DateTime value)

Copies the first datetime for the given tag in the taglist into the variable pointed to by value. Unref the date with gst_date_time_unref() when it is no longer needed. Free-function: gst_date_time_unref

getDateTimeIndex
int getDateTimeIndex(string tag, uint index, DateTime value)

Gets the datetime that is at the given index for the given tag in the given list and copies it into the variable pointed to by value. Unref the datetime with gst_date_time_unref() when it is no longer needed. Free-function: gst_date_time_unref

getDouble
int getDouble(string tag, double value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getDoubleIndex
int getDoubleIndex(string tag, uint index, double value)

Gets the value that is at the given index for the given tag in the given list.

getFloat
int getFloat(string tag, float value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getFloatIndex
int getFloatIndex(string tag, uint index, float value)

Gets the value that is at the given index for the given tag in the given list.

getInt
int getInt(string tag, int value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getInt64
int getInt64(string tag, long value)
getInt64_Index
int getInt64_Index(string tag, uint index, long value)

Gets the value that is at the given index for the given tag in the given list.

getIntIndex
int getIntIndex(string tag, uint index, int value)

Gets the value that is at the given index for the given tag in the given list.

getPointer
int getPointer(string tag, void* value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getPointerIndex
int getPointerIndex(string tag, uint index, void* value)

Gets the value that is at the given index for the given tag in the given list.

getSample
int getSample(string tag, Sample sample)

Copies the first sample for the given tag in the taglist into the variable pointed to by sample. Free the sample with gst_sample_unref() when it is no longer needed. You can retrieve the buffer from the sample using gst_sample_get_buffer() and the associated caps (if any) with gst_sample_get_caps(). Free-function: gst_sample_unref

getSampleIndex
int getSampleIndex(string tag, uint index, Sample sample)

Gets the sample that is at the given index for the given tag in the given list and copies it into the variable pointed to by smple. Free the sample with gst_sample_unref() when it is no longer needed. You can retrieve the buffer from the sample using gst_sample_get_buffer() and the associated caps (if any) with gst_sample_get_caps(). Free-function: gst_sample_unref

getScope
GstTagScope getScope()

Gets the scope of list.

getString
int getString(string tag, string value)

Copies the contents for the given tag into the value, possibly merging multiple values into one if multiple values are associated with the tag. Use gst_tag_list_get_string_index (list, tag, 0, value) if you want to retrieve the first string associated with this tag unmodified. The resulting string in value will be in UTF-8 encoding and should be freed by the caller using g_free when no longer needed. The returned string is also guaranteed to be non-NULL and non-empty. Free-function: g_free

getStringIndex
int getStringIndex(string tag, uint index, string value)

Gets the value that is at the given index for the given tag in the given list. The resulting string in value will be in UTF-8 encoding and should be freed by the caller using g_free when no longer needed. The returned string is also guaranteed to be non-NULL and non-empty. Free-function: g_free

getStruct
void* getStruct()

the main Gtk struct as a void*

getTagListStruct
GstTagList* getTagListStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getTagSize
uint getTagSize(string tag)

Checks how many value are stored in this tag list for the given tag.

getUint
int getUint(string tag, uint value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getUint64
int getUint64(string tag, ulong value)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.

getUint64_Index
int getUint64_Index(string tag, uint index, ulong value)

Gets the value that is at the given index for the given tag in the given list.

getUintIndex
int getUintIndex(string tag, uint index, uint value)

Gets the value that is at the given index for the given tag in the given list.

getValueIndex
Value getValueIndex(string tag, uint index)

Gets the value that is at the given index for the given tag in the given list.

insert
void insert(TagList from, GstTagMergeMode mode)

Inserts the tags of the from list into the first list using the given mode.

isEmpty
int isEmpty()

Checks if the given taglist is empty.

isEqual
int isEqual(TagList list2)

Checks if the two given taglists are equal.

merge
TagList merge(TagList list2, GstTagMergeMode mode)

Merges the two given lists into a new list. If one of the lists is NULL, a copy of the other is returned. If both lists are NULL, NULL is returned. Free-function: gst_tag_list_unref

nTags
int nTags()

Get the number of tags in list.

nthTagName
string nthTagName(uint index)

Get the name of the tag in list at index.

peekStringIndex
int peekStringIndex(string tag, uint index, string value)

Peeks at the value that is at the given index for the given tag in the given list. The resulting string in value will be in UTF-8 encoding and doesn't need to be freed by the caller. The returned string is also guaranteed to be non-NULL and non-empty.

removeTag
void removeTag(string tag)

Removes the given tag from the taglist.

setScope
void setScope(GstTagScope scop)

Sets the scope of list to scope. By default the scope of a taglist is stream scope.

toString
string toString()

Serializes a tag list to a string.

unref
void unref()

Unref a GstTagList, and and free all its memory when the refcount reaches 0.

Static functions

copyValue
int copyValue(Value dest, TagList list, string tag)

Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag. You must g_value_unset() the value after use.

exists
int exists(string tag)

Checks if the given type is already registered.

getDescription
string getDescription(string tag)

Returns the human-readable description of this tag, You must not change or free this string.

getFlag
GstTagFlag getFlag(string tag)

Gets the flag of tag.

getNick
string getNick(string tag)

Returns the human-readable name of this tag, You must not change or free this string.

getType
GType getType(string tag)

Gets the GType used for this tag.

isFixed
int isFixed(string tag)

Checks if the given tag is fixed. A fixed tag can only contain one value. Unfixed tags can contain lists of values.

mergeStringsWithComma
void mergeStringsWithComma(Value dest, Value src)

This is a convenience function for the func argument of gst_tag_register(). It concatenates all given strings using a comma. The tag must be registered as a G_TYPE_STRING or this function will fail.

mergeUseFirst
void mergeUseFirst(Value dest, Value src)

This is a convenience function for the func argument of gst_tag_register(). It creates a copy of the first value from the list.

register
void register(string name, GstTagFlag flag, GType type, string nick, string blurb, GstTagMergeFunc func)

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. The old registration may have used a different type however. So don't rely on your supplied values. Important: if you do not supply a merge function the implication will be that there can only be one single value for this tag in a tag list and any additional values will silenty be discarded when being added (unless GST_TAG_MERGE_REPLACE, GST_TAG_MERGE_REPLACE_ALL, or GST_TAG_MERGE_PREPEND is used as merge mode, in which case the new value will replace the old one in the list). The merge function will be called from gst_tag_list_copy_value() when it is required that one or more values for a tag be condensed into one single value. This may happen from gst_tag_list_get_string(), gst_tag_list_get_int(), gst_tag_list_get_double() etc. What will happen exactly in that case depends on how the tag was registered and if a merge function was supplied and if so which one. Two default merge functions are provided: gst_tag_merge_use_first() and gst_tag_merge_strings_with_comma().

registerStatic
void registerStatic(string name, GstTagFlag flag, GType type, string nick, string blurb, GstTagMergeFunc func)

Registers a new tag type for the use with GStreamer's type system. Same as gst_tag_register(), but name, nick, and blurb must be static strings or inlined strings, as they will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)

Variables

gstTagList
GstTagList* gstTagList;

the main Gtk struct

Meta