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
How o get current epg and video size
Moderators:X05, Dreamer, FredB
skystar2
Re: How o get current epg and video size
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
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
Re: How o get current epg and video size
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
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
Re: How o get current epg and video size
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
I do not think that, please please someone reply me
thanks
skystar2
Re: How o get current epg and video size
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
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
Re: How o get current epg and video size
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
thanks
skystar2
Re: How o get current epg and video size
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
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