2a25d97e40dbd5dd9195195a3a269095a4932097 |
|
05-Oct-2010 |
Glenn Kasten <gkasten@google.com> |
Object an interface initialization/destroy cleanup Prior to this, object and interface fields were being initialized and deinitialized in random places. This resulted in some real and potential leaks, especially in the case of partial object construction. There were even some places where fields were not being initialized at all. Details: Move destructor for AndroidEffectCapabilities from CEngine::Destroy to IAndroidEffectCapabilities deinit hook. Move destructor for equalizer preset names from CEngine::Destroy to IEngine deinit hook. In Object::Destroy, call deinitializer for each initialized interface, regardless whether it was ever exposed. Remove double initialization of mStepSize in IPlaybackRate constructor. Remove obsolete logs. Add expose hooks that are called when interface is requested in Engine::Create... or by DynamicInterface::AddInterface. Always initialize all interfaces, even if not exposed Fix typos in same-line comments on INTERFACE_ constants. Add new interface state INITIALIZED: uninitialized -> initialized -> exposed. DynamicInterface::Remove sets interface state to initialized (but not exposed), instead of uninitialized. Add explicit constructor calls to initialize fields in C structs (e.g. smart pointers), using placement new. See also build warning which was turned off with -Wno-invalid-offsetof. Add comments about per-instance fields not associated with an interface. Add default initializations for all per-instance fields that are not associated with an interface, in case the object is only partially constructed and then needs to be destroyed due to an error. Add placement new comments. Update comments on private per-instance fields not associated with an interface. Move effect clears from the containing object destructor (CAudioPlayer_Destroy and COutputMix_Destroy) to the interface destructor. In this process this caught a bug that environmental reverb and preset reverb were not being destroyed properly for an audio player. Add comments on interface hooks. Add entries for interface destructors. Add placement new (explicit constructor) and explicit destructor calls for C++ fields in C struct. Fix template instantiation error. Move explicit calls to IBufferQueue_Destroy (now renamed to IBufferQueue_deinit) from CAudioPlayer_Destroy and CAudioRecorder_Destroy to be implicit via the BufferQueue interface deinit hook. ThreadSync interface destructor now logs a warning if ThreadSync::EnterCriticalSection was active at Engine::Destroy Add some comments. Clean up gMonitorFp close code. Fix typo in log message. Fix DynamicInterface to handle distinction between UNINITIALIZED and INITIALIZED states for an interface, and to call the optional expose hook. Do not use memset per interface, because the size of the last interface is unknown. Set the v-table pointer while lock is held. Add curlies to if statements. Log errors if interfaces active during Object::Destroy, instead of asserting. Log a warning if interface requests an interface but it is not available, and is optional. Add log with the class name and address of each new object. Mark only interfaces with init hooks as INITIALIZED; others are UNINITIALIZED. Change-Id: Ibb9c1b5f21e6195af6b20b2f7a5c7157905b735b
/system/media/opensles/libopensles/IMetadataExtraction.c
|
f51f5c6ec99ebc8f2c833a68f232bc1c874a7f2f |
|
09-Jul-2010 |
Glenn Kasten <gkasten@google.com> |
Bug fix and general code cleanup. Trace debug now uses Android logging by LOGV/LOGE. Added SL Utility Toolkit for OpenSL ES, similar to OpenAL UT. Add a -DUSE_TRACE instead of -DNDEBUG and add it commented out to Android.mk. LOGE for error returns, LOGV for all entry and exit. Rename debug.c to trace.c. slutPrintIID prints the symbolic name if known. Fix bug in slQueryNumSupportedEngineInterfaces and slQuerySupportedEngineInterfaces which were not skipping over unavailable interfaces. Use USE_CONFORMANCE to return SL_RESULT_FEATURE_UNSUPPORTED when not supported and make some interfaces unavailable depending on USE_CONFORMANCE. Move most FIXME to separate bug/to-do list. Fix possible intermediate overflow in duration computation for sndfile. Line length 100. Address code review comments, disable LOG.
/system/media/opensles/libopensles/IMetadataExtraction.c
|
f156301680273e71e56e898f98798f5b5b2431f6 |
|
03-Jul-2010 |
Glenn Kasten <gkasten@google.com> |
Trace debug support. Add Enter/Leave interface macros for trace debugging. 3D interface methods do not block for now. Line length 100. Add blank lines between interface methods for clarity. Change-Id: I412936e8574f95308731e41f8b854fe342cb04b6
/system/media/opensles/libopensles/IMetadataExtraction.c
|
aee4409e59584f8e8d0ddaf7e44dc80ec5b80444 |
|
12-Jun-2010 |
Glenn Kasten <gkasten@google.com> |
Improve platform portability. Change-Id: Ieb7290591730f1be7d201ec4690a805c959f76e0
/system/media/opensles/libopensles/IMetadataExtraction.c
|
437f9ab9914ea61112aa496a047162a0d22194cd |
|
07-Jun-2010 |
Glenn Kasten <gkasten@google.com> |
Add note about bug in IMuteSolo channel count. Change-Id: Iccb78019bbbffaa98eaa8877258d88a77c979e48 Remove spurious NDEBUG, init in same order as .h. Change-Id: Ia30b30ce4dbc8f074632c275583b7ef6069141dc Implement asynchronous Object.Realize Added ThreadPool mechanism for asynchronous operations. Fixed off-by-one bug in BufferQueue that didn't use the last buffer. Added engine hooks for Realize and Destroy. Realize hook and callback are now called with mutex unlocked. Added new Object states realizing 1 and realizing 2, mapped to unrealized. Asynchronous realize on an engine is forced to be synchronous. Engine initialization now done at Realize, not during CreateEngine. Change-Id: I9c11461dbeab97aec04f8266f268cfd16086b5a7 Port to Android. Change-Id: I0fff9f32e4d374230ab940e00fe6b8429b143ed3 Shutdown the sync thread when engine is destroyed. Change-Id: I197267e5eaa4a49cacb34bc6e6f9c6fa92b381b5 Mutex unlocked during the initialization phase of DynamicInterfaceManagement.AddInterface. Change-Id: I16000a2c4f1f9e93075f08ac2eaad6a8f12ba9da Dynamic interface removal is done with mutex unlocked. Change-Id: I5317d859dee680ca1c96e803388f2475f7795099 Normalize SLboolean input parameters. Store non-zero boolean value as SL_BOOLEAN_TRUE rather than original value. Line length 100. Change-Id: I867ae8dd328b1427be98dfd148e32fcba38ce409 More input parameter checks. Line length 100. Fix a few build warnings. Change-Id: I78fb1415fed649e05a370cf60e015a7fe13ffe8c Address code review comments. Change-Id: Ic7f2c70ded42f3d0e5e92f173cf80e084e54fc89
/system/media/opensles/libopensles/IMetadataExtraction.c
|
050feed71109208b772e5be2e1a637b82f9d05fc |
|
26-May-2010 |
Jean-Michel Trivi <jmtrivi@google.com> |
Move OpenSL ES library implementation to the libopensles folder. Add an Android makefile for libopensles. Change-Id: I1480bf46c7165cd35bb55aef1f11fb0a04fff88e
/system/media/opensles/libopensles/IMetadataExtraction.c
|