<div dir="ltr">Just wanted to mention that I keep looking at the GstVideoCropMeta for my cropping needs, and its insufficient. Basically, it assumes that the crop area is entirely contained within the frame. I have cases where I want to 'crop' a 1920x1080 frame with a 1920x1080 rectangle starting at y coordinate -960, so as to have just the top half of the original frame in the output frame. videobox can do this, but videocrop cannot, and I fear the author of the GstVideoCropMeta feature didn't consider that use case, as starting coordinates must always be positive.<br>
<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 2, 2014 at 7:37 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On So, 2014-03-02 at 18:10 +1000, Philip Craig wrote:<br>
> Hi,<br>
><br>
> Some platforms have the ability to do video cropping in hardware. I'm<br>
> wondering what the best way to expose this functionality is.<br>
><br>
> It seems like GstVideoCropMeta was added to deal with this situation.<br>
> The idea here would be for the videocrop element to add a<br>
> GstVideoCropMeta instead of doing the cropping (after checking if<br>
> downstream supports this meta).<br>
<br>
</div>That's exactly how it is supposed to work, yes. See how textoverlay<br>
handles the GstVideoOverlayMeta.<br>
<div class=""><br>
> I had a bit of a look at doing this, but I don't see how to make it<br>
> work. The problem is that if videocrop is defining the crop rectangle<br>
> without actually cropping, then the output caps that it negotiates<br>
> have to be the uncropped caps, otherwise it doesn't get the correct<br>
> size buffers. But doing that will break other things. In particular,<br>
> if the hardware element that actually does the cropping is a transform<br>
> element, then it is impossible for that transform element to negotiate<br>
> the correct output caps, because it doesn't know in advance how much<br>
> will be cropped.<br>
><br>
> Of course I could just not use videocrop and add crop properties to<br>
> the hardware element instead. The downside of that is the caps<br>
> negotiation starts to get complicated, because the hardware element is<br>
> doing conversion, scaling, and rotation too. It would be nice to reuse<br>
> well tested elements like videocrop instead.<br>
<br>
</div>The solution for this would be that you put the cropped caps (i.e. the<br>
lower width/height) into the caps that are configured on the pad, but<br>
put the larger, uncropped caps in the ALLOCATION query and use it for<br>
configuring the buffer pool. See e.g. how mpeg2dec or theoradec does<br>
this.<br>
<br>
By this all elements involved will know the cropped and uncropped size<br>
and configure themselves accordingly.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sebastian Dröge, Centricular Ltd - <a href="http://www.centricular.com" target="_blank">http://www.centricular.com</a><br>
Expertise, Straight from the Source<br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Stirling Westrup<br>Programmer, Entrepreneur.<br><a href="https://www.linkedin.com/e/fpf/77228" target="_blank">https://www.linkedin.com/e/fpf/77228</a><br><a href="http://www.linkedin.com/in/swestrup" target="_blank">http://www.linkedin.com/in/swestrup</a><br>
<a href="http://technaut.livejournal.com" target="_blank">http://technaut.livejournal.com</a><br><a href="http://sourceforge.net/users/stirlingwestrup" target="_blank">http://sourceforge.net/users/stirlingwestrup</a>
</div>