[meta-freescale] Video overlay on sabresd

Nikolay Dimitrov picmaster at mail.bg
Mon May 25 02:27:07 PDT 2015


Hi Marco,

On 05/25/2015 10:47 AM, Marco Trillo wrote:
> Hi,
>
> On 05/22/2015 03:40 AM, Nikolay Dimitrov wrote:
>>>>> Thanks for sharing. This works, but I'm trying to achieve exactly the
>>>>> opposite.
>>>>>
>>>>> I need to have my UI on the FG layer (which imho means X rendering to
>>>>> /dev/fb1), and my video player must render on BG layer (/dev/video16,
>>>>> which imho corresponds to /dev/fb0).
> Actually you should be able to achieve what you want by using either one
> of the MXCFB_SET_GBL_ALPHA, MXCFB_SET_LOC_ALPHA or MXCFB_SET_OVERLAY_POS
> ioctls on /dev/fb0, so that this layer renders atop the /dev/video17 at
> /dev/fb1 (with a global alpha with the first one, or a pixel-based alpha
> with the second one which needs 32bpp).

Exactly. Regarding the MXCFB_SET_OVERLAY_POS - I was thinking this
ioctl is related to X/Y position of the layer and not about the layers'
Z-order (at least this is the impression I have looking at the mxcfb
driver and imx lib code). Please correct me if I'm wrong, but I thing
the Z-order of the BG/FG IPU layers is not programmable.

>> - Chroma keying is buggy: opening the V4L2 device file (/dev/video16)
>> on the BG layer resets the chroma key. Here are steps to reproduce:
>>
>> 1. Start Xorg on /dev/fb1.
>> 2. Start a X11 app, which draws a solid-colored rectangle containing
>> the chroma key (0xFF00FF in my case).
>> 3. Run a console app, which programs the chroma key to 0xFF00FF and
>> global alpha to 0x80.
>> 4. Observe that the chroma-key colored rectangle is now
>> fully transparent, as expected.
>> 5. Start gstreamer with imxv4l2sink, using /dev/video16
>> 6. Observe that chroma-key colored rectangle is opaque. This is an
>> issue.
>>
>> If #3 is executed while the video is playing, the colored rectangle
>> becomes fully transparent, as expected.
>
> I think this is more an issue with the `imxv4l2sink' plug-in, which
> resets the global alpha of the layer, than the /dev/video* node itself.
> Unfortunately, the `imxv4l2sink' plug-in seems to be written so that it
> manages the layers itself, containing incomplete code for setting the
> global alpha, the local alpha, and the color key, but not fully exposing
> these options via gstreamer properties. You may want to try the sink
> based on the IPU lib directly (`mfw_isink' IIRC) and see how it behaves.

Yes, I was also thinking along the same lines that the issue could be
caused by several things (xorg, video sink). I'll look around and
probably I can fix this in the gst plugin. Btw, I'm using the V4L2 sink
because in the past I had performance issues when the screen was
rotated at 180 degrees, and the V4L2 performed much better in both 0
and 180 degrees. But I'll definitely try it out.

Regards,
Nikolay


More information about the meta-freescale mailing list