Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

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

Matthew_C_
New Contributor I
290 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
290 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

0 Kudos
Reply