OSD

Module API help / support section for programmers.

Moderators: Dreamer, FredB, X05

dashne
Just can't stay away
Posts: 20
Joined: Thu Jun 03, 2010 2:25 pm

OSD

Postby dashne » Sun Nov 20, 2011 12:38 pm

Hi everyone
I want to show channel information on a surface of an osd when changing channel in c++ programming like
the simOSD when changing channel in dvbdream,an example code will lead me to that if anyone can?



thanks

skystar2
User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Re: OSD

Postby rel » Wed Nov 23, 2011 7:25 am

I'll give you Delphi structure but you can port to C++ yourself:

You should use following export functions of the module to get informed about channel changes

Code: Select all

function BeforeChannelChange(ChInfo: Pointer): BOOL; stdcall; export;
begin
.....
end;

function AfterChannelChange(_ChInfo: PChannelInfo): BOOL; stdcall; export;
begin
.....
end;
You can also fill up the onDDEvent() function of the module to get informed about volume changes

Code: Select all

function OnDDEvent(EventType: DWORD; EventParams: Pointer): BOOL; stdcall; export;
begin
result := false;
case EventType of
DDEVENT_ON_VOLUME_CHANGE:
begin
Volume := PInteger(EventParams)^;
......
end;
end;
end;

You can ask more if you have questions.
DVB Dream - because I have to dream about having time to code it
dashne
Just can't stay away
Posts: 20
Joined: Thu Jun 03, 2010 2:25 pm

Re: OSD

Postby dashne » Thu Nov 24, 2011 8:18 am

thank you ,I know the functions we need to export and where should be written ,but I need the core code that show the osd screen (say an image) about say 5 seconds ,and I know that this code must be written in function (AfterChannelChange) section,its not problem if the code is delphi language




thanks
skystar2
User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Re: OSD

Postby rel » Thu Nov 24, 2011 9:13 am

check the "simpleOSD" example in ModuleSDK. in Delphi folder
you should get the bitmap object of the OSD surface and then get an HDC to this bitmap, and draw onto this bitmap through GDI functions, then post it to DD OSD surface


I think you can create a DC then, use SelectObject() WinAPI function to attach OSDsurface bitmap to this DC.

http://www.functionx.com/win32/Lesson13.htm
DVB Dream - because I have to dream about having time to code it
dashne
Just can't stay away
Posts: 20
Joined: Thu Jun 03, 2010 2:25 pm

Re: OSD

Postby dashne » Thu Nov 24, 2011 11:46 am

thank you,but there is nothing wat Iam saying,I have not problem with how to loading a bitmap in an osd,I want to show the osd for 5 seconds after this I want to hide it,I used DDMODAPI_OSD_SHOW_SURFACE and DDMODAPI_OSD_HIDE_SURFACE but it still does not show the osd,if I use DDMODAPI_OSD_SHOW_SURFACE only it does not disappear,I know that there must be a Timer using with DDMODAPI_OSD_REPAINT_SURFACE ,I used it,but the video (picture of channel) remain unrenderable (black screen) until the the time is finished ( 5 seconds) ,at that point the osd also disappear and picture of channel returned.
I want it work like simosd whitch come with the dvbdream (just test simosd how it appear and the picture of channel remains)


thanks
skystar2
User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Re: OSD

Postby rel » Fri Nov 25, 2011 2:49 am

if you've done your timing in a loop, that causes CPU usage and problem with video stream.
You should try windows timer api. SetTimer() WinAPI function can help.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

you should also use DDMODAPI_OSD_REPAINT_SURFACE only once , not continiusly in a loop. That causes problems..
use it only when you really need an update on the OSD. Do not try to make animation on OSD surfaces.
DVB Dream - because I have to dream about having time to code it
dashne
Just can't stay away
Posts: 20
Joined: Thu Jun 03, 2010 2:25 pm

Re: OSD

Postby dashne » Fri Nov 25, 2011 4:05 am

please can you write down the code section in AfterChannelChange for me

or upload the code



thanks
skystar2
User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Re: OSD

Postby rel » Fri Nov 25, 2011 8:22 am

sorry, only available example simpleOSD in Delphi , for C++, you should try yourself....
I gave the info above. I think with this given info you should be able to write that yourself...
DVB Dream - because I have to dream about having time to code it
dashne
Just can't stay away
Posts: 20
Joined: Thu Jun 03, 2010 2:25 pm

Re: OSD

Postby dashne » Fri Nov 25, 2011 8:33 am

but the simpleosd remains when changing the channel, just make it disappear after 5 seconds of channel changing,and there is no problem if it in the delphi language


thanks
skystar2
User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Re: OSD

Postby rel » Fri Nov 25, 2011 11:09 am

You should try windows timer api. SetTimer() WinAPI function can help.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
just set a timer to 5 second and hide the osd surface when timer is trigged with the related ModuleAPI command... inside timer function.....
DVB Dream - because I have to dream about having time to code it

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest