videodecoder: fix tag handling
authorTim-Philipp Müller <tim@centricular.com>
Sun, 16 Aug 2015 16:55:22 +0000 (17:55 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 16 Aug 2015 17:23:07 +0000 (18:23 +0100)
commit30b7cc66708830ad6d3e986ef11b1eb21a9c3132
tree363e03c943503c280e5c4f66535408e92e77227b
parent917ea30aafc407b8219bfb08ce6c0643dd0d9a82
videodecoder: fix tag handling

Before we just merged everything in pretty much random ways
ad-hoc instead of keeping state properly. In 0.10 that was
how it worked, but in 1.x the tag events sent should always
reflect the latest state and replace any previous tags.

So save the upstream (stream) tags, and save the tags set
by the decoder subclass with merge mode, and then update
the merged tags whenever either of those two changes.

This slightly changes the behaviour of gst_video_decoder_merge_tags()
in case it is called multiple times, since now any call replaces
the previously-set tags. However, it leads to much more predictable
outcomes, and also we are not aware of any subclass which sets this
multiple times and expects all the tags set to be merged.

If more complex tag merging scenarios are required, we'll have
to add a new vfunc for that or the subclass has to intercept
the upstream tags itself and send merged tags itself.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
gst-libs/gst/video/gstvideodecoder.c