Commit f7e7f726 authored by Rafaël Carré's avatar Rafaël Carré

opensles: no need to store SLEngineItf in context

parent d4d278c7
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
struct aout_sys_t struct aout_sys_t
{ {
SLObjectItf engineObject; SLObjectItf engineObject;
SLEngineItf engineEngine;
SLObjectItf outputMixObject; SLObjectItf outputMixObject;
SLAndroidSimpleBufferQueueItf playerBufferQueue; SLAndroidSimpleBufferQueueItf playerBufferQueue;
SLObjectItf playerObject; SLObjectItf playerObject;
...@@ -133,6 +132,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -133,6 +132,7 @@ static int Open( vlc_object_t *p_this )
{ {
audio_output_t *p_aout = (audio_output_t *)p_this; audio_output_t *p_aout = (audio_output_t *)p_this;
SLresult result; SLresult result;
SLEngineItf engineEngine;
/* Allocate structure */ /* Allocate structure */
p_aout->sys = calloc( 1, sizeof( aout_sys_t ) ); p_aout->sys = calloc( 1, sizeof( aout_sys_t ) );
...@@ -169,13 +169,13 @@ static int Open( vlc_object_t *p_this ) ...@@ -169,13 +169,13 @@ static int Open( vlc_object_t *p_this )
// get the engine interface, needed to create other objects // get the engine interface, needed to create other objects
result = (*p_sys->engineObject)->GetInterface( p_sys->engineObject, result = (*p_sys->engineObject)->GetInterface( p_sys->engineObject,
*p_sys->SL_IID_ENGINE, &p_sys->engineEngine ); *p_sys->SL_IID_ENGINE, &engineEngine );
CHECK_OPENSL_ERROR( result, "Failed to get the engine interface" ); CHECK_OPENSL_ERROR( result, "Failed to get the engine interface" );
// create output mix, with environmental reverb specified as a non-required interface // create output mix, with environmental reverb specified as a non-required interface
const SLInterfaceID ids1[] = { *p_sys->SL_IID_VOLUME }; const SLInterfaceID ids1[] = { *p_sys->SL_IID_VOLUME };
const SLboolean req1[] = { SL_BOOLEAN_FALSE }; const SLboolean req1[] = { SL_BOOLEAN_FALSE };
result = (*p_sys->engineEngine)->CreateOutputMix( p_sys->engineEngine, result = (*engineEngine)->CreateOutputMix( engineEngine,
&p_sys->outputMixObject, 1, ids1, req1 ); &p_sys->outputMixObject, 1, ids1, req1 );
CHECK_OPENSL_ERROR( result, "Failed to create output mix" ); CHECK_OPENSL_ERROR( result, "Failed to create output mix" );
...@@ -212,7 +212,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -212,7 +212,7 @@ static int Open( vlc_object_t *p_this )
//create audio player //create audio player
const SLInterfaceID ids2[] = { *p_sys->SL_IID_ANDROIDSIMPLEBUFFERQUEUE }; const SLInterfaceID ids2[] = { *p_sys->SL_IID_ANDROIDSIMPLEBUFFERQUEUE };
const SLboolean req2[] = { SL_BOOLEAN_TRUE }; const SLboolean req2[] = { SL_BOOLEAN_TRUE };
result = (*p_sys->engineEngine)->CreateAudioPlayer( p_sys->engineEngine, result = (*engineEngine)->CreateAudioPlayer( engineEngine,
&p_sys->playerObject, &audioSrc, &p_sys->playerObject, &audioSrc,
&audioSnk, sizeof( ids2 ) / sizeof( *ids2 ), &audioSnk, sizeof( ids2 ) / sizeof( *ids2 ),
ids2, req2 ); ids2, req2 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment