codecparsers: h265parser: Verify all possible profiles.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 14 Dec 2021 18:36:56 +0000 (19:36 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 16 Dec 2021 16:08:30 +0000 (17:08 +0100)
commit168ad9f58f6dfbdb588fa3e07158be5c3f13a50e
tree524ad30b45ed1931472de8d2239d4312f7c2298c
parent11791f7ce5c9620913169e7cb44d37661895fdfa
codecparsers: h265parser: Verify all possible profiles.

It's possible a HEVC stream to have multiple profiles given the
compatibility bits. Instead of returning a single profile, internal
gst_h265_profile_tier_level_get_profiles() returns an array with all
it possible profiles.

Profiles are appended into the array only if the generated profile
is not invalid.

gst_h265_profile_tier_level_get_profile() is rewritten in terms of
gst_h265_profile_tier_level_get_profiles(), returning the first
profile found the array.

And  gst_h265_get_profile_from_sps() is also rewritten in terms of
gst_h265_profile_tier_level_get_profiles(), but traversing the array
verifying if the proposed profile is actually valid by Annex A.3.x of
the specification.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1440>
subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c