How to disable OSD1 and get a transparent color for OSD1. Using DMAI?

来源:互联网 发布:java继承中的构造方法 编辑:程序博客网 时间:2024/05/16 05:36

Hi all,

A little project background.

We are developing an application to display captured video and Qt provides a user interface (Qt writing to OSD0).    We need to have a 'transparent color' defined for OSD0 (and used by Qt) to allow the video to 'show through' the OSD0 user interface.  We don't need to have OSD1 attribute window to control the entire transparency of OSD0 and the video. So, I suppose it should be turned off so allow a transparent color for OSD0.

My boot args have OSD0=1280x720x16,3600K    and OSD1 not defined.

I can run my application to put up a Qt user interface.  I then run the encodedecode demo.  With a few mods to the demo, I'm able to see video along with my Qt interface.  But, of course, what I see is using the transparency OSD1 attribute window settings. 

I've 'googled' around to see if anyone else has solved this issue.. but, no luck for me.

So, here are my questions...

1) Can I disable the OSD1 window using the DMAI functionality?  If so, how?  If not, is there another method?

2) Can the 'transparent color' be set using DMAI?  If so, how?  If not, is there another method?

3) Should my boot args change? If so, to what?

I'm sure I'll have more questions as I learn more..  Any help is greatly appreciated.

Thanks,

Dave.

================================================================

Hi Dave,

Dmai only supports the blending through the use of OSD1 as an attribute window. This was supported even in the already-released DVSDK 3.10. I'd recommend you use this technique given it is better supported, more flexible and you don't need OSD1 as a bitmap window anyway. Just my two cents :)

Best regards,

Vincent

================================================================

Hi Dave,

To clarify, you should use OSD0 to control the contents of the on-screen display, and OSD1 as the 'attribute window' that determines that transparency level. Dmai can accomplish this via the Display module. The application can can open up OSD0 (osd display window) and OSD1 (osd attribute window) separately using the Display module. See the ui.c file in encodedecode demo of the DM365 DVSDK on how to use the Display module to 'create' the 'osd window' and the 'attribute window' using the Display_create() function. After that you can simply use Display_get/put to write to the attribute window and control the transparency. If you zero it out entirely it'd become fully transparent.

If you want, you can also study the Display module in Dmai and extract the code you need to interact with the attribute window.

Another thing is we are working on wrapping up the work on DVSDK 4.0 shortly. In the final version of the DVSDK 4.0 we have created a QT-based user interface for the demos, which transparency can be controlled. It sounds similar to what you are trying to achieve. I expect DVSDK 4.0 to become publicly available within the next two weeks, so you may want to check it out when it does. 

Best regards,

Vincent

=================================================================

Vincent,

Thanks you for the response.  My title to my question was a misleading.   I wish to disable OSD1 completely, so I can program a 'hole' color for OSD0 so the QT will display in OSD0 and video will show through accoring to the 'hole' color chosen for OSD0.

In short, I need to know how to disable OSD1 and setup a transparent color for OSD0 for the video layer.

I'm not sure we will be able to convert to DVSDK4.0 with our tool set due to project limitiations/requirements. 

Hopefully I'll be able to figure it out.  Any pointers?

Thanks again.

Dave.

==================================================================

Hi Dave,

To ensure we are talking about the same thing, let's talk about your end goal for a moment. I think what you are trying to do is to overlay your QT driven-display on top of the video while hiding parts of it or making parts of it semi-transparent - is this right?

What I was trying to say in my previous post is that the "hole" color for OSD0 is set via OSD1. You may want to take a look at SPRUFG9C.pdf sections 4.4.4 and 4.4.4.8 as they describe how OSD 'window 1' can be used to set the transparent color for OSD 'window 0'. So if you open up OSD1 in your QT application you can set the transparency of OSD0 by writing to OSD1. So you don't really need to disable or hide OSD1. This is the mechanism used by the encodedecode demo to overlay the statistics and control information over the video.

Best regards,

Vincent

===================================================================

Vincent,

I think I'm beginning to understand.  I actually have graphic symbols (and Qt) to be drawn in OSD0.  I wish the video to be shown through whenever I have a 'hole' pixel color.  It was my understanding that I could setup OSD0 with a 'hole' color to have video show though and I did not need OSD1 at all.  At least that is what I read from the SPRUGG9C doc.  Did I misread this?  I believe you are saying that the latest version (out soon) of the DMAI will support this functionality?

I believe I can get the effect I want by using OSD1 (as you suggest) and select a 'hole' color for this.  (I was using ioctl commands (SPRUEK9) to experiment with some settings without using the DMAI). 

I need to do a little more digging, but I believe you put me on the right track.   But I may be back :).

Thanks for your help.

Dave.

===================================================================

Hi Dave,

Dmai only supports the blending through the use of OSD1 as an attribute window. This was supported even in the already-released DVSDK 3.10. I'd recommend you use this technique given it is better supported, more flexible and you don't need OSD1 as a bitmap window anyway. Just my two cents :)

Best regards,

Vincent

原创粉丝点击