save PTS and userdata early so that it is valid in get_buffer()
only alloc output frames with custom alloc function
remember for each image which memory allocator is responsible
fix: also swap image allocation functions when swapping image memory
Merge branch 'img-userdata'