jhenderson Site Admin
Joined: 07 Mar 2006 Posts: 2254 Location: So. Cal. USA
|
Posted: Tue Mar 20, 2012 1:19 pm Post subject: Vita packet parsing |
|
|
| Quote: | I am using Direct Data mode within my X6=250M application. I will want to be able to quickly (and hopefully efficiently) grab Vita header/trailer info out of the PIP while I am streaming to determine if I need to process the packet for visualization.
In direct data mode I receive a regular Buffer filled with data in the Pip event handler. Looking at the Buffer data, the Pip sends me the data contents of the Velo packet, i.e. a bunch of Vita packets without a Velo header. Is there (or will there be) a Vita datagram that will allow for easy traversal of the Vita packets in a generic buffer? And/or is there an easy way to extract out individual Vita packets and stick them into a VitaBuffer?
|
The PIP tracks Velo packets within slabs of data in the stream. Within each Velo packet are some number of Vita packets that you can process using the Innovative::VeloMergeParser object.
Within the PIP callback, process the Velo block contents with
| Code: | // merge parse processing
VMP.Append(Packet);
VMP.Parse();
|
The VMP will parse all of the Vita packets, lifting the contents of each into separate buffers and notifying you as a fullness level is reached.
Alternately, you could use the VitaPacketParser instead of the VMP, The VPP is lower-level, providing more control. It does not copy the contents of the Vita packets to a buffer; Rather, it passes a reference to an image of each Vita packet as it is parsed within the Velo packet. You can use a method of the parser to copy the image into a VitaBuffer if you determine that the image is worth preserving. Note that in all cases, you will need to selectively screen the Vita packets, since the host will not have enough bandwidth to process them all. |
|