converting videocrop to use VideoCropMeta

Philip Craig philipjcraig at gmail.com
Sun Mar 2 00:10:27 PST 2014


Hi,

Some platforms have the ability to do video cropping in hardware. I'm
wondering what the best way to expose this functionality is.

It seems like GstVideoCropMeta was added to deal with this situation.
The idea here would be for the videocrop element to add a
GstVideoCropMeta instead of doing the cropping (after checking if
downstream supports this meta).

I had a bit of a look at doing this, but I don't see how to make it
work. The problem is that if videocrop is defining the crop rectangle
without actually cropping, then the output caps that it negotiates
have to be the uncropped caps, otherwise it doesn't get the correct
size buffers. But doing that will break other things. In particular,
if the hardware element that actually does the cropping is a transform
element, then it is impossible for that transform element to negotiate
the correct output caps, because it doesn't know in advance how much
will be cropped.

Of course I could just not use videocrop and add crop properties to
the hardware element instead. The downside of that is the caps
negotiation starts to get complicated, because the hardware element is
doing conversion, scaling, and rotation too. It would be nice to reuse
well tested elements like videocrop instead.

Any thoughts on how this should be done?


More information about the gstreamer-devel mailing list