Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Help on use of DMX_OUT_TAP



Hi there. I'm writing a program to tune in my DVB-T card and write the 
received data stream out to a file. But I am wanting to write the output 
to several files, each for a different PID.

So I have some code like this:

  int fd = open("/dev/dvb/adapter0/demux0", O_RDWR);
  if (fd == 0) return EIO;

  struct dmx_pes_filter_params pesFilterParams;
  pesFilterParams.pid      = (uint16_t)pid;
  pesFilterParams.input    = DMX_IN_FRONTEND;
  pesFilterParams.output   = DMX_OUT_TAP;
  pesFilterParams.pes_type = DMX_PES_OTHER;
  pesFilterParams.flags    = DMX_IMMEDIATE_START;

  int status;
  if ((status = ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams)) < 0) {
    close(fd);
    perror("Error:");
    return EIO;
  }

I call the code above once for each separate file/pid. Then I read from
each 'fd'. But I don't get the data stream I was expecting. I was
expecting to be deluged with data, but instead I seem to receive data at a
slow rate. Occasionally, read() even returns with an error corresponding
to "buffer overflow", which also seems strange.

So I tried using exactly the same code but changing DMX_OUT_TAP to 
DMX_OUT_TS_TAP. And I read the '../dvr0' device instead. In this case I 
get the data I was expecting, and I even successfully played the MPEG 
stream I received. The relevant documentation says:

"DMX_OUT_TAP delivers the stream output to the demux device on which the 
ioctl is called. DMX_OUT_TS_TAP routes output to the logical DVR device 
/dev/dvb/adapter0/dvr0, which delivers a TS multiplexed from all filters 
for which DMX_OUT_TS_TAP was specified."

Have I misunderstood something, or is it a bug? I haven't tried the very 
latest code from CVS, I'll do that this weekend. I just wanted to check my 
code was sensible first.

Many thanks for your help,

James.



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index