Re: generating ts_packets with libdvbpsi
Thomas Lagemann <[email protected]>
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <45E428B3.8060401__42690.1857289069$1172580601$gmane$org@idmt.fraunhofer.de> |
Gonzalo Berdeal wrote: > Hello, > I need your help. > Could anybody explain me how to make the transport stream packets once I have the PSI info in dvbpsi_psi_section_s * structure (after calling the dvbpsi_GenPATSections function) ? > There is a field called *p_data. Is this the pointer where the data is? Is the length always 188 bytes? Should I copy all the sections until *p_next == NULL? > Gonzalo Berdeal. > Thank you very much. > p_data is is the pointer to the section data that can take up to 1024 bytes for a PSI section and up to 4096 bytes for a private Section. You need to wrap this data in the payload of the TS-packets, each 188 bytes long. The payload of the TS-packet is 188 minus the four bytes of the header and (if present) the length of the adaptation field. Take a look at the function writePSI in the example in gen_pmt.c . This takes a section, wraps it in a TS and writes it to stdout Make sure to fill out the first four bytes of the packet you pass to the function with the following values according to ISO/IEC 13818-1 Table 2-3 sync_byte transport_error_indicator payload_unit_start_indicator transport_priority PID transport_scrambling_control adaptation_field_control continuity_counter regards Thomas Lagemann -- This is the libdvbpsi-devel mailing-list, see http://developers.videolan.org/ To unsubscribe, go to: http://developers.videolan.org/lists.html