Hi
where I could find sample using pipe/fifo for ts decoding? I would use pipe so the entire stream received, could be processed to retrieve all pid transmitting over a transponder (tuned by dvbtune). Now I am using this code but there a problem on decoding pid: child's get out only pid 0 (scan decode other pids)!
I think the problem is in write-end pipe but I dont know how resolve! Could you help me in anyway? thanks of all. Andrea



//parent write-end fd[1] while((read(fd_dvr,&tmp,10*TS_SIZE))!=0){

write(fd[1],tmp,10*TS_SIZE);

}

//child read-end fd[0]
if((read(fd[0], mbuf, TS_SIZE))<0) perror("\nerror reading pipe\n");

                                for (i = 0; i < TS_SIZE ; i++)
                                {
                                        if ( mbuf[i] == 0x47 ){
                                                printf("\nFound sync byte at %d\n",i);
                                                break;
                                        }
                                }

                                if (i == TS_SIZE)
                                {
                                        perror("\nNot a TS\n");
                                        return -1;
                                }else{
                                        memcpy(buf, mbuf+i, TS_SIZE-i);

while((read(fd[0], mbuf, i))!=0);

                                        memcpy(buf+TS_SIZE-i, mbuf, i);
            //my_get_bits() function ok!
                                        point_bit=11;

i=my_get_bits(buf,13);

printf("\nFirst pid: %04x\n",i);

point_bit=0;

                                        l=0;
                                        while((read(fd[0], buf, TS_SIZE))!=0){
                                                //read(fd[0], buf, TS_SIZE);
                                                point_bit=11;
                                                i=my_get_bits(buf,13);
                                                printf("\nFound pid %d: %04x 
%d\n",l,i,i);
                                                point_bit=0;
                                                l++;
                                        }
                                }

}




_________________________________________________________________





-- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as subject.



Reply via email to