oneVPL-intel-gpu icon indicating copy to clipboard operation
oneVPL-intel-gpu copied to clipboard

improve oneVPL's user experience

Open dyang23 opened this issue 2 years ago • 1 comments

System information

  • GPU platform enabling for new feature: NV
  • Host machine if it's discrete card: NV
  • libva/libva-utils/gmmlib/media-driver/VPL runtime version you are using? NV
  • Are you willing to contribute it?(Yes/No) No

Feature Information

Describe the feature and expected behavior

Compared with NVDEC API, MSDK needs to parse bitstream and determine whether it needs to attach SPS, PPS and other data. This is a little cumbersome for developers, and it is difficult to get started.

Customer usage and impact for this feature

int NvDecoder::Decode(const uint8_t *pData, int nSize, int nFlags, int64_t nTimestamp) { m_nDecodedFrame = 0; m_nDecodedFrameReturned = 0; CUVIDSOURCEDATAPACKET packet = { 0 }; packet.payload = pData; packet.payload_size = nSize; packet.flags = nFlags | CUVID_PKT_TIMESTAMP; packet.timestamp = nTimestamp; if (!pData || nSize == 0) { packet.flags |= CUVID_PKT_ENDOFSTREAM; } NVDEC_API_CALL(cuvidParseVideoData(m_hParser, &packet));

return m_nDecodedFrame;

}

The video bitstream pData is fed into parser using NVDECODE API cuvidParseVideoData() directly.

Application must register a function to handle any sequence
change. Parser triggers pfnSequenceCallback callback for initial sequence header or when it encounters a video format change.

Parser triggers pfnDecodePicture callback when bitstream data for one frame is
ready. In case of field pictures, there may be two decode calls per one display call since two fields make up one frame.

Parser triggers pfnDisplayPicture callback when a frame in display order is ready.

bool MFXFrameConstructor::PrepareFrame(const uint8_t* data, uint32_t size, uint64_t pts) { bool ret = true; MFX_ZERO_MEMORY(mBitstream);

switch (mFrameType) { case MFX_FRAME_AVC: ret = PrepareAVCFrame(data, size, pts); break; case MFX_FRAME_HEVC: ret = PrepareHEVCFrame(data, size, pts); break; default: MC_LOG("Unsupported codec!"); ret = false; break; }

return ret; }


Compared with NVDEC API, MSDK needs to parse bitstream and determine whether it needs to attach SPS, PPS and other data.
This is a little cumbersome for developers, and it is difficult to get started.

**Additional context**
Add any other context or screenshots about the feature request here.

dyang23 avatar Mar 02 '23 07:03 dyang23

Auto Created VSMGWL-63154 for further analysis.

intel-mediadev avatar Apr 03 '23 06:04 intel-mediadev