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.

MFXClose fails to deallocate memory

David_C_15
Beginner
784 Views

 Hi all, 

 I'm working on a project which uses multiple threads,

and each thread dynamically creates MFXVideoSession for decoding's purpose.

The problem is that whenever i try to Close() after a DisjoinSession() ,

Close() returns MFX_ERR_INVALID_HANDLE.

Eventually, memory leaks when the whole system is shutting down.

Does anyone have solution to this problem? or can give a reason why it happens?

I'll thank whomever gives it, in advance.

The version of meida sdk used is 2013 R2 by the way,

and here's my dev platform info.

OS: Win 7 (64bit)
CPU: i7-3770
Main Board : Asrock B75M
Mem :8 GB

Regards, David

0 Kudos
3 Replies
andy4us
Beginner
784 Views

Don't call DisjoinSession() before calling close. As you found out that invalidates the handle. If you have multiple sessions, create a master session, have your sessions join to that, then on close, have the joined sessions call disjoinsession, and the master session, call close().

0 Kudos
Petter_L_Intel
Employee
784 Views

Hi,

Also make sure you do not close the parent session until all child sessions are disjoined or closed.

Regards,
Petter 

0 Kudos
David_C_15
Beginner
784 Views

Thank you all,  andy4us and Petter Larsson!

The advice really helped me out.

To add a bit, I think intel should provide a little more specific documentation on media sdk.

Regards, David

0 Kudos
Reply