<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
in gstreamer-imx I have a "imxvpuvideotransform" element. This
element uses the i.MX6 IPU for rotations, colorspace conversions,
scaling, and deinterlacing. All of these operations can be done in
one step.<br>
<br>
As an optimization, I check if a frame really needs to be
transformed, or if it can be passed through. Cases where pass
through is possible:<br>
- input and output width/height/pixel format are the same<br>
- video cropping is enabled, but the crop rectangle contains the
entire frame (thus not actually cropping anything)<br>
- input frame is not interlaced<br>
- input frame is interlaced, but no deinterlacing will be performed<br>
- rotation is disabled<br>
<br>
Since rotation can be set at any time (it is a property), video crop
rectangles can in theory change during playback, and deinterlacing
might be required only for some frames in mixed mode, I need to
evaluate this per-frame. I perform the evaluation in the
prepare_output_buffer() function.<br>
<br>
Initially I called
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
gst_base_transform_set_passthrough() in prepare_output_buffer().
However, this lead to problems in certain situations, such as when
playbin tries to play next media. For this reason, I now call
gst_base_transform_set_passthrough() once, during initialization,
and set GstBaseTransform's passthrough flag to FALSE. I handle
passthrough manually by setting the output buffer to the input
buffer in prepare_output_buffer() if passthrough is required.
transform() is still called, but does nothing then.<br>
<br>
<br>
Here is the relevant part in the code:
<a class="moz-txt-link-freetext" href="https://github.com/Freescale/gstreamer-imx/blob/master/src/ipu/videotransform/videotransform.c#L1295">https://github.com/Freescale/gstreamer-imx/blob/master/src/ipu/videotransform/videotransform.c#L1295</a><br>
<br>
<br>
My question now is: is this an acceptable solution? The
documentation neither confirms nor denies this. It states: "Elements
that only do analysis can return a subbuffer or even just return a
reference to the input buffer (if in passthrough mode)." What if I
do *outbuf = input; if I set GstBaseTransform's passthrough to
FALSE?<br>
<br>
It works right now. I want to make sure this isn't just a fluke, and
in some future GStreamer version, somebody puts an assert that fires
in this case.<br>
<br>
cheers<br>
</body>
</html>