I'm trying to write EPG grabber. I use libucsi
library under linux. I can read one TS from EIT
table and decode EPG data. But it's incomplete and I don't know how to read all necessary TS.
I tried to google it, and I read some documentation but without success. Can someone help me understanding, and tell me how to read all TS for complete EPG? Has EIT some continuity id or something like that?
Thank you for your help.
[EDIT] function for reading data:
void readD(char * dedev, __u8 * data, int size_data ,int pid)
{
int defd;
if ((defd = open(dedev, O_RDWR | O_LARGEFILE )) < 0)
{
perror("opening demux failed");
return 0;
}
#define TS_BUF_SIZE (256 * 1024)
long dmx_buffer_size = TS_BUF_SIZE;
if( ioctl(defd,DMX_SET_BUFFER_SIZE,dmx_buffer_size) < 0)
{
perror("set demux filter failed");
return 0;
}
struct dmx_sct_filter_params sctFilterParams;
memset(&sctFilterParams, 0, sizeof(struct dmx_sct_filter_params));
sctFilterParams.pid=pid;
sctFilterParams.timeout=10000; //10s
sctFilterParams.flags=DMX_IMMEDIATE_START|DMX_CHECK_CRC;
if( ioctl(defd,DMX_SET_FILTER,&sctFilterParams) < 0)
{
perror("set demux filter failed");
return 0;
}
read(defd,data,size_data);
close(defd);
}
and I call it:
#define TS_PACKET_SIZE 188
__u8 pat_data[TS_PACKET_SIZE*10];
readD(dedev, pat_data, sizeof(pat_data) ,PID_EIT);