Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Charles_P_
Beginner
76 Views

Audio Encoder returns MFX_ERR_INVALID_HANDLE

When attempting to initialize the audio path encoder I get MFX_ERR_INVALID_HANDLE error.

Logic used:

mfxVersion SWversion = {0,1}, HWversion = {0,1}, version;

mfxSession Audiosession;

mfxStatus sts;

sts = MFXInit(MFX_IMPL_AUDIO | MFX_IMPL_SOFTWARE, &SWversion, &Audiosession);

if (MFX_ERR_NONE == sts){

MFXQueryVersion(Audiosession,&version);

printf("Audio version:%d.%d API Level: %d.%d\n",

SWversion.Major,SWversion.Minor,

version.Major, version.Minor);

mfxIMPL implTest = 0;

sts = MFXQueryIMPL(Audiosession, &implTest);

printf("audio impl %d %d\n",implTest, sts); }

mfxAudioParam par;

sts = MFXAudioENCODE_Query( Audiosession, 0, &par); //at this point the MFX_ERR_INVALID_HANDLE is returned

printf("get param %d\n",sts); 

0 Kudos
3 Replies
76 Views

Hi,

mfxAudioParam par;

sts = MFXAudioENCODE_Query( Audiosession, 0, &par); //at this point the MFX_ERR_INVALID_HANDLE is returned

MFX_ERR_INVALID_HANDLE is one of the programming related error, which means its a Invalid session or MemID handle. When this error status is returned by SDK function, it generally expects a reset or close function to follow. 

If you refer to mediaSDk audio maual on Page 21, which shows the syntax for MFXAudioENCODE_Query:

mfxStatus MFXAudioENCODE_Query(mfxSession session, mfxAudioParam *in, mfxAudioParam *out);

In above case, I suggest correctly defining the "par" variable as pointer to mfxAudioParam stucture as output . If the in pointer is zero, the function returns the class configurability in the output mfxAudioParam structure. Hope this helps.

Thanks,

Charles_P_
Beginner
76 Views

Thanks for coming back.

When tried changing to par parameter to a pointer, it did not change the results.

I ran with the tracer running and the analzer log indicated it could not find mfxplugin32_sw.dll. Could this be the cause? If so where I get/build it from.

Chuck

76 Views

Hi,

I think you missed attaching the log file, as size points to 0 bytes. Please re-upload the log file.

I understand you are building an Audio decoder where session searches for libmfxaudiosw32.dll (bin/Win32), not sure why it indicates it could not find mfxplugin32_sw.dll. Log file can provide more details. 

I suggest confirming adding mfxaudio header file, and libmfxaudiosw32.dll to the path of the application. Please check if following header files are added.

Include these files:
#include “mfxvideo.h” /* SDK functions in C */
#include “mfxvideo++.h” /* optional for C++ development */
#include “mfxplugin.h” /* plugin development */ -> Please confirm if you have added this to the path.
#include “mfxaudio.h” /* AUDIO functions – needed for audio plugins */
#include “mfxaudio++.h” /* optional for C++ development for audio plugins */
Link these libraries:
libmfx.lib /* The SDK static dispatcher library */
or
libmfx.a /* The SDK static dispatcher library */

Thanks,

Reply