The different tag merging modes are basically replace, overwrite and append,
but they can be seen from two directions. Given two taglists: (A) the tags
already in the element and (B) the ones that are supplied to the element (
e.g. via gst_tag_setter_merge_tags() / gst_tag_setter_add_tags() or a
GST_EVENT_TAG), how are these tags merged?
In the table below this is shown for the cases that a tag exists in the list
(A) or does not exists (!A) and combinations thereof.
Table 1. merge mode
merge mode
A + B
A + !B
!A + B
!A + !B
REPLACE_ALL
B
-
B
-
REPLACE
B
A
B
-
APPEND
A, B
A
B
-
PREPEND
B, A
A
B
-
KEEP
A
A
B
-
KEEP_ALL
A
A
-
-
GST_TAG_MERGE_UNDEFINED
undefined merge mode
GST_TAG_MERGE_REPLACE_ALL
replace all tags (clear list and append)
GST_TAG_MERGE_REPLACE
replace tags
GST_TAG_MERGE_APPEND
append tags
GST_TAG_MERGE_PREPEND
prepend tags
GST_TAG_MERGE_KEEP
keep existing tags
GST_TAG_MERGE_KEEP_ALL
keep all existing tags
GST_TAG_MERGE_COUNT
the number of merge modes
The different tag merging modes are basically replace, overwrite and append, but they can be seen from two directions. Given two taglists: (A) the tags already in the element and (B) the ones that are supplied to the element ( e.g. via gst_tag_setter_merge_tags() / gst_tag_setter_add_tags() or a GST_EVENT_TAG), how are these tags merged? In the table below this is shown for the cases that a tag exists in the list (A) or does not exists (!A) and combinations thereof. Table 1. merge mode merge mode A + B A + !B !A + B !A + !B REPLACE_ALL B - B - REPLACE B A B - APPEND A, B A B - PREPEND B, A A B - KEEP A A B - KEEP_ALL A A - - GST_TAG_MERGE_UNDEFINED undefined merge mode GST_TAG_MERGE_REPLACE_ALL replace all tags (clear list and append) GST_TAG_MERGE_REPLACE replace tags GST_TAG_MERGE_APPEND append tags GST_TAG_MERGE_PREPEND prepend tags GST_TAG_MERGE_KEEP keep existing tags GST_TAG_MERGE_KEEP_ALL keep all existing tags GST_TAG_MERGE_COUNT the number of merge modes