Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Problems with getting and demuxing TS
I took the test_dvr.c source from DVB CVS and tried to simplify it to be
able to get TS from our DVB-S card. But now ts_demux is not working
anymore. ts2pes works if used with a file, but with live input (got from
tsget.c below) it doesn't output all the stream, only something.
With previous DVB 0.8.2 and /dev/video we were able to get TS and also were
able to ts_demux it straight. The newly compiled (0.9) ts_demux can demux
our old TS files but not the new ones. Is there something wrong with this
quick-and-dirty code and its output? I only want to get some transport
stream and be able to ts_demux it (and maybe something else). I would
appreciate a simple solution...
/* tsget.c */
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ost/dmx.h>
#include <ost/video.h>
main()
{
int len;
struct dmxPesFilterParams pesFilterParams;
uint8_t buf[4096];
int fd_dvr;
int fd_demux;
int fd_demux2;
fd_dvr=open("/dev/ost/dvr", O_RDONLY);
fd_demux=open("/dev/ost/demux", O_RDWR|O_NONBLOCK);
fd_demux2=open("/dev/ost/demux", O_RDWR|O_NONBLOCK);
pesFilterParams.pid = 0xa2;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_TS_TAP;
pesFilterParams.pesType = DMX_PES_VIDEO;
pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(fd_demux, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
perror("crap");
return(1);
}
pesFilterParams.pid = 0x60;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_TS_TAP;
pesFilterParams.pesType = DMX_PES_AUDIO;
pesFilterParams.flags = DMX_IMMEDIATE_START;
if (ioctl(fd_demux2, DMX_SET_PES_FILTER, &pesFilterParams) <
0) return(1);
while (1) {
len=read(fd_dvr, buf, 4096);
if (len>0) write (1, buf, len); /* writes to STDOUT */
}
}
--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index