Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Do I need to free pfxBitstream->Data when done with it?

Matthew_C_
New Contributor I
136 Views

I currently have mfxBitstream *pMfxBitstream that comes out of EncodeFrameAsync

At that point pfxBitstream->data contains data, however after writing that data to a file or copying it somewhere else, I no longer need it

Is setting pMfxBitstream->DataLength = 0; enough as shown by the example?  Or should I also free pMfxBitstream->Data if I intent to use it repeatedly and avoid memory leaks?  Or would freeing it potentially cause problems?

Thank you.

0 Kudos
1 Reply
Petter_L_Intel
Employee
136 Views

Hi Matthew,

You do not have to free any mfxBitStream buffers during execution. The samples provided with the Media SDK showcase the correct usage. In essence just allocate sufficient buffer before starting processing then free it after all frames have been completely processed.

Regards,
Petter

Reply