Presenting Packets

When it finishes issuing its rendering instructions, the producer application must provide synchronization for their completion. For synchronous elements the producer must perform a CPU wait for rendering to finish on those synchronous elements before inserting the packet in the stream. For asynchronous elements, it instructs the APIs it used to generate fences to trigger when rendering finishes. The application sets the fences for the elements of the packet that is going to be presented by calling NvSciStreamBlockPacketFenceSet().

The application can now insert the packet back into the stream along with the fences by calling NvSciStreamProducerPacketPresent() with the handle of the packet. The stream makes the packet available to consumers, performing any necessary copy or translations steps along the way to make the data and fences accessible. Once a packet is presented, the application must not attempt to modify its contents until it is returned for reuse.

NvSciError
NvSciStreamBlockPacketFenceSet(
    NvSciStreamBlock const block,
    NvSciStreamPacket const handle,
    uint32_t const elemIndex,
    NvSciSyncFence const* const postfence
)

NvSciError
NvSciStreamProducerPacketPresent(
    NvSciStreamBlock const      producer,
    NvSciStreamPacket const     handle
)