The previous iteration of the code was inferring the type of the frame by looking at the overall size of the gst-payloaded packet. It is more robust to actually parse the payload and look at the actual data buffers it contains. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2303>