1/5 also feels awkward, mostly because of those _ptr variables, although that awkwardness could be solved by just not making [all of] read_transform_output_data() a separate function.
(Also, those GstVideoInfo pointers should be const. I was trying to figure out why they were output...)