Acquring the ECM

Module API help / support section for programmers.

Moderators: FredB, X05, Dreamer

reverb_style
Posts: 2
Joined: Mon Aug 22, 2011 11:06 am

Acquring the ECM

Postby reverb_style » Mon Aug 22, 2011 11:08 am

Hello, I am new to C++ and programming with DVBDream so I apologize if I come off as noobish but I have a question regarding the ECM. I know that I can use "DDMODAPI_GET_CHANNEL_INFO" to get various info such as the SID/PID. The examples provided were very helpful in doing so. However, I am trying to get the ECM itself. I've seen something about the filter type "FT_TSFULL" but when I do something along the lines of SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_START_FILTER, (int)&startFilterParam) where startFilterParam contains what I want the filter to have and then try to view the returned object, I don't seem to find anything. I am sure that I am doing it wrong and any direction towards getting the ECM value itself would be helpful.

I have seen instances of MDAPI_START_FILTER being used but I don't see any of that in the moduleAPI. Is this located elsewhere? Basically, any starting point to getting the actual ECM and viewing the 184/188 bytes associated with it would be greatly appreciated. I'm interested in these sort of things even if it is a bit weird haha.

Thank you.

DVB Dream v1.4
mrwinch
Posts: 1
Joined: Tue Aug 23, 2011 5:13 am

Postby mrwinch » Tue Aug 23, 2011 5:31 am

Hi, to obtain an ECM (or any other table) you have to start a filter in a PID.
You can do this using MDAPI_START_FILTER and a TSTART_FILTER object. For example (suppose ECM pid is 0x112):

Code: Select all

...
TSTART_FILTER Obj;  //Declare it global or with a global scope
...
void MyFilterFunc(int MyFilter, int DataLen, unsigned char *_Data)
{
...
//Put your code for filter here...
}
void StartECMFilter(...)
{
...
memset(&Obj,0x00,sizeof(TSTART_FILTER));
Obj.DLL_ID=your_DLL_ID;
Obj.Filter_ID=0x0;  //for some dvb software better to use value <8
Obj.PID=0x112;    //Your pid...
Obj.Irq_Call_Adresse=(DWORD)&MyFilterFunc;
SendMessage(hwndDD, WM_USER, MDAPI_START_FILTER, (DWORD)&Obj);
...
}
...
void StopECMFilter(...)
{
...
SendMessage(hwndDD, WM_USER, MDAPI_STOP_FILTER, Obj.Running_ID);
...
}


This kind of code works perfectly with DVB Dream and MDAPI: everytime an ECM arrives (about 10 times per second or more), MyFilterFunc is executed.
DVB forever
reverb_style
Posts: 2
Joined: Mon Aug 22, 2011 11:06 am

Postby reverb_style » Mon Aug 29, 2011 11:19 am

Thank you very much for this information as it was a great help. Another question I have though is that I created a few modules using the examples provided in the 'DVB Dream - Freeware' topic. More specifically, I was able create a module that allowed me to enter the frequency and SID and was given back the PID, NID, etc.

This works perfectly but now I cannot seem to combine DDMODAPI and MDAPI function calls. I want to combine the code I created for the transport ID and SID with the code I developed with that allows me to get the ECM. Basically, I want to enter a frequency and SID and from that, get the PID, NID, etc. Then from there, I would take the SID, pass it into the filter and get the ECM. I have created both parts individually, but cannot seem to combine the two. I believe that this has to do with using both DDMODAPI and MDAPI in the same project but I just want confirmation that this is the case.

In the moduleAPI.h, I do not see anything about MDAPI. Where is that located at?
DVB Dream v1.4

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest