How o get current epg and video size

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

How o get current epg and video size

Postby dashne » Thu Dec 01, 2011 12:02 pm

Hi every one
I tried to get current channel but it return nothing,also vdeo size is the same thing , my code as below:
for epg:

TEPGInfo ep;
ep.dwSize = sizeof(TEPGInfo);
SendMessage(m_hWndDream,WM_MODULE_MSG,DDMODAPI_GET_EPG_CURRENT,(LPARAM) &ep);
MessageBox(NULL,ep.EventName,ep.EventName,MB_OK);[/color]

and for getting video size:

DWORD tmp[6];
SendMessage(m_hWndDream, WM_MODULE_MSG, DDMODAPI_GET_VIDEO_INFO, (LPARAM)tmp);
if(tmp[1])
{
st.Format(_T("%dx%d MPEG2"),tmp[1]&0xFFFF,tmp[1]>>16);
draw(st,400,15,RGB(0,255,0));
}

can anyone correct the code?

thanks

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

Re: How o get current epg and video size

Postby rel » Thu Dec 01, 2011 12:51 pm

you EPG code seems to be ok.

here is the code to get video resolution
TVideoInfo vi;
vi.dwSize = sizeof(TVideoInfo);
SendMessage(m_hWndDream, WM_MODULE_MSG, DDMODAPI_GET_VIDEO_INFO, (LPARAM)&vi);

vi.Width
vi.Height
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: How o get current epg and video size

Postby dashne » Thu Dec 01, 2011 1:51 pm

thank you
in both case (EPG and video resolution):when I try to text out them into the osd screen ,it prints 0 x 0 for video resolution and - or nothing in some cases when Itry to text out the EPG.EventName and my code is:

void draw(CString str,int x,int y,COLORREF clr)
{

dcSurface.SetTextColor(clr);
dcSurface.TextOutA(x,y,str);
}
void UpdateOSD(TChannelInfo *pch)
{
oldbm = dcSurface.SelectBitmap(bmSurface);

dcSurface.FillSolidRect(rcSurface,RGB(200,0,0));
{

bdc.CreateCompatibleDC(dcSurface);
HBITMAP pOldBmp = bdc.SelectBitmap(HF);
dcSurface.BitBlt(0,0,1004,268,bdc,0,0,SRCCOPY); // Change pos/size as needed...
bdc.SelectBitmap(pOldBmp);
CString st;
st.Format(_T("%s"),pch->ChName);
draw(st,20,15,RGB(0,0,0));
st.Format(_T("%s"),pch->Provider);
draw(st,20,75,RGB(255,0,0));
st.Format(_T("%d"),pch->wVideo);
draw(st,20,135,RGB(0,255,0));
if(pch->ChType==1)
st.Format(_T("Channel Type : %s"),_T("TV"));
else if(pch->ChType==2)
st.Format(_T("Channel Type : %s"),_T("RADIO"));
else if(pch->ChType==3)
st.Format(_T("Channel Type : %s"),_T("DATA"));
else st.Format(_T("Channel Type : %s"),_T("wrong"));
draw(st,20,195,RGB(0,0,255));
TVideoInfo vi;
vi.dwSize = sizeof(TVideoInfo);
SendMessage(m_hWndDream, WM_MODULE_MSG, DDMODAPI_GET_VIDEO_INFO, (LPARAM)&vi);
char buf[64];
wsprintf(buf,"%i x %i MPEG2",vi.Width,vi.Height);
MessageBox(NULL,buf,"ok",MB_OK); //====shows just 0 x 0 MPEG2
dcSurface.TextOutA(400,15,buf); //====shows just 0 x 0 MPEG2
TEPGInfo ep;
ep.dwSize = sizeof(TEPGInfo);
SendMessage(m_hWndDream,WM_MODULE_MSG,DDMODAPI_GET_EPG_CURRENT,(LPARAM) &ep);
MessageBox(NULL,ep.EventName,ep.EventName,MB_OK); //======shows nothing

}
dcSurface.SelectBitmap(oldbm); // Important -> de-select bitmap before calling DD API
//SendMessage(m_hWndDream, WM_MODULE_MSG, DDMODAPI_OSD_REPAINT_SURFACE, surface_id);
SendMessage(m_hWndDream, WM_MODULE_MSG, DDMODAPI_OSD_SHOW_SURFACE, surface_id);
SendMessage(m_hWndDream, WM_MODULE_MSG, DDMODAPI_OSD_REPAINT_SURFACE, surface_id);

}
and Iam putting function UpdateOSD(TChannelInfo *pch) in function AfterChannelChange Section ,every thing goes ok except the epg and video resolution .
can you fix that and sorry for annoying you


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

Re: How o get current epg and video size

Postby dashne » Wed Dec 21, 2011 6:01 am

Where are the DD 's Programmer? Why there in no answer to my question? Is my question so difficult or impossible?
I do not think that, please please someone reply me




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

Re: How o get current epg and video size

Postby rel » Wed Dec 21, 2011 1:56 pm

you should try and figure out most of it yourself.
I can only tell you what API function to use and what are its parameterrs

DD doesnt provide video res for H.264 channels otherwise it should work fine
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: How o get current epg and video size

Postby dashne » Fri Dec 23, 2011 9:42 am

But I tried every thing, every where I wrote the code it returns me nothing, just tell me where should I put the code (for example your code of getting the video resolution) to obtain the information





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

Re: How o get current epg and video size

Postby rel » Sat Dec 24, 2011 3:35 am

check the code sample of DDOSD in the following topic
http://www.dvbdream.org/forum/viewtopic.php?f=7&t=1735

there is source code which can answer your questions
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