We can never be sure whether ~AImageReader() has run to completion or
not in AImage::close(). So we move clean up to another AImageReader
method and make sure that's called when in AImageReader_delete. AImage
now contains an sp<> to AImageReader so we can be sure that its members
wouldn't have been destroyed by ~AImageReader and we can check whether
AImageReader_delete has been called on it.
This also prevents us from deadlocking since AImage_delete could also cause
~AImageReader to run with AImageReader::mLock held in AImage::close().
Bug: 137571625
Bug: 137694217
Test: enroll; auth
Test: cts native AImageReader, camera, graphics tests
Change-Id: If5803cb6fcb6f4800032069872daaeac1cd36ed2
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Force close mmap input streams when a capture device is
connected to force disconnect callback to client.
Bug: 137311579
Test: capture with oboetester and connect headset
Change-Id: Iafe939247fa565e2424b40afacdb79a31b8955b7
(cherry picked from commit 7bd2939d6c)
Force close mmap input streams when a capture device is
connected to force disconnect callback to client.
Bug: 137311579
Test: capture with oboetester and connect headset
Change-Id: Iafe939247fa565e2424b40afacdb79a31b8955b7
am: 20b29ddacc -s ours
am skip reason: change_id I8233ec928e7c5700abc1bdd7f32e097892947949 with SHA1 1622326c3c is in history
Change-Id: Id9d3bafbcb1c50cc369c116642423c7cb32912c5
Currently, an input surface to an encoder is created in the codec
process, but the queue operation has to be issued from the application
process. This CL allows an input surface to be created in the
application process, hence reducing the number of IPCs issued per frame.
This option can be chosen by setting "debug.stagefright.c2inputsurface"
to -1. (If the property is not set, it defaults to 0, which picks the
current behavior.)
Test: adb shell setprop debug.stagefright.c2inputsurface -1
Then, record a video.
Bug: 131800183
Bug: 134017277
Change-Id: Idbf2ba87689e1e876a215850aa0260539183a4ee
This is to reduce application confusion when switching between back and
front cameras.
Test: Observe dumpsys on a phone with NIR camera device
Bug: 133141567
Change-Id: I0c11b99fc3a0304d54562548d109df8c56ba1db1
Visualizer gets stuck in mCaptureThread::requestExitAndWait due to a
deadlock between mCaptureThread::mRunning and mCaptureLock.
Temporarily release mCaptureLock upon mCaptureThread::requestExitAndWait.
Test: Clarity -> Response, rapidly toggle visualizer enable, disable
Bug: 135326776
authored-by: Weiyin Jiang <wjiang@codeaurora.org>
Change-Id: If32431c4d7b271b7ea61168cb1a5a42f3a1cd66e
VTS component test currently fails for multiple release and reset APIs
This fail is because of ASSERT on the return type of these APIs.
However these multiple release/reset APIs need not always return C2_OK.
Test: VtsHalMediaC2V1_0TargetComponentTest -I default -C c2.qti.avc.decoder
Bug: 132403160
Change-Id: I6e0f2e227c82c522dd590b9c683add206b41eac0
QTI components were failing VTS under following conditions :
1) unsupported resolutions.
2) fetchGraphicBuffer failed
In all these cases, test should be skipped instead of getting marked as FAILED.
Test: VtsHalMediaC2V1_0TargetVideoEncTest -I default -C c2.qti.avc.encoder -P /sdcard/res/
Bug: 132405032
Change-Id: Icd020135ee735f9f976a3a2cadf8a7ef5e378feb
The deprecated method AudioManager.isBluetoothA2dpOn() calls
getDeviceConnectionState on APM with an empty address, which
caused HwModuleCollection::getDeviceDescriptor to set an empty
address on the DeviceDescriptor for the currently connected
A2DP device. This method is called by MediaRouter.
When the address was reset, the java listener for audio device
connection monitoring was reporting the connection of an A2DP
device with an empty address, which in turn caused AvrcpManager
to behave as if the audio device connection failed.
If MediaRouter called isBluetoothA2dpOn() before AvrcpManager
received its called for device connection, the error would occur.
Bug: 132416679
Test: call isBluetoothA2dpOn() and check for valid address in dumpsys media.audio_policy
Test: atest AudioServiceHostTest#testInjectForRecord ; atest AudioHostTest ; atest AudioPlaybackCaptureTest
Change-Id: I1370edbbca46657506a990855d06a176f07c54d3
Original logic was comparing an overridden format int, switch
to use a const original format.
Test: partner device, Pixel 3 CTS
Bug: 136456900
Change-Id: I03d6e190770ee05e40446c417e323f546fdc2689
The following sequence of events is possible:
t1: FrameListener::onFrameAvailable callback is called, mReader is
promoted from wp<> to sp<>, t1 holds mLock.
t2: AImageReader_delete is called, decStrong is called on AImageReader,
but since its refcount isn't 0, ~AImageReader isn't called
t1: onFrameAvailable completes, ~AImageReader is called with mLock
held, ~AImageReader->
setImageListenerLocked->FrameListener::setImageListener->tries
to lock mLock again, t1 deadlocks.
We move the locking mLock to after the promotion of mReader to sp<> so
that it gets destructed before ~AImageReader is called.
The same is done for BufferRemovedListener.
Bug: 136193631
Test: Auth; unlock
Change-Id: I8bb8c7d59f3711fd9fe434159095938eb5db9153
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>