Page 1 of 1

OSD

Posted: Sun Nov 20, 2011 12:38 pm
by dashne
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

Re: OSD

Posted: Wed Nov 23, 2011 7:25 am
by rel
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.

Re: OSD

Posted: Thu Nov 24, 2011 8:18 am
by dashne
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

Re: OSD

Posted: Thu Nov 24, 2011 9:13 am
by rel
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

Re: OSD

Posted: Thu Nov 24, 2011 11:46 am
by dashne
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

Re: OSD

Posted: Fri Nov 25, 2011 2:49 am
by rel
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.

Re: OSD

Posted: Fri Nov 25, 2011 4:05 am
by dashne
please can you write down the code section in AfterChannelChange for me

or upload the code



thanks

Re: OSD

Posted: Fri Nov 25, 2011 8:22 am
by rel
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...

Re: OSD

Posted: Fri Nov 25, 2011 8:33 am
by dashne
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

Re: OSD

Posted: Fri Nov 25, 2011 11:09 am
by rel
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.....