2.6.8 IBMDStreamingH264NALPacket Interface

The IBMDStreamingH264NALPacket interface represents an MPEG-4 AVC/H.264 Network Adaptation Layer (NAL) packet.

Objects with an IBMDStreamingH264NALPacket interface are passed to the IBMDStreamingH264InputCallback::H264NALPacketArrived() callback.

The MPEG-4 AVC/H.264 NAL packet contains the compressed H.264 video bitstream which can be passed to a suitable H.264 video decoder for decoding and display. For some applications it may be more convenient to process NAL video packets instead of processing video carried in transport stream packets.

Related Interfaces

Interface

Interface ID

Description

IBMDStreamingH264InputCallback

IID_IBMDStreamingH264InputCallback

An IBMDStreamingH264NALPacket object interface is passed to IBMDStreamingH264InputCallback::H264NALPacketArrived()

2.6.8.1 IBMDStreamingH264NALPacket::GetPayloadSize method

long IBMDStreamingH264NALPacket::GetPayloadSize();

The GetPayloadSize method gets the number of bytes in the NAL packet.

Returns:

NAL packet size in bytes

2.6.8.2 IBMDStreamingH264NALPacket::GetBytes method

HRESULT IBMDStreamingH264NALPacket::GetBytes(void **buffer);

The GetBytes method returns a pointer to the data buffer of the NAL packet.

Parameters:

buffer – Pointer to NAL packet data buffer - only valid while object remains valid.

Return values:
  • E_POINTER – The buffer parameter is invalid

  • S_OK – Success

2.6.8.3 IBMDStreamingH264NALPacket::GetBytesWithSizePrefix method

HRESULT IBMDStreamingH264NALPacket::GetBytesWithSizePrefix(void **buffer);

The GetBytesWithSizePrefix method returns a pointer to a data buffer starting with a 32bit unsigned integer containing the size of the NAL packet followed by the data buffer of the NAL packet. This arrangement may be required by some video decoders.

Note

The size of the data buffer returned by GetBytesWithSizePrefix is 4 bytes larger than the size of the data buffer returned by GetBytes.

Parameters:

buffer – Pointer to NAL packet data buffer prefixed by size value - only valid while object remains

Return values:
  • E_POINTER – The buffer parameter is invalid

  • S_OK – Success

2.6.8.4 IBMDStreamingH264NALPacket::GetDisplayTime method

HRESULT IBMDStreamingH264NALPacket::GetDisplayTime(uint64_t requestedTimeScale, uint64_t *displayTime);

The GetDisplayTime method returns the time at which to display the video contained in the NAL packet. The display time is in units of the requested time scale.

Parameters:
  • requestedTimeScale – Time scale for the displayTime

  • displayTime – Time at which to display the video

Return values:
  • E_POINTER – The displayTime parameter is invalid

  • S_OK – Success