Improve volume management by keeping track of volume for each type
of device independently.
Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained
per device.
The main changes are:
- AudioService now keeps tracks of stream volumes per device:
volume indexes are kept in a HashMap < device , index>.
active device is queried from policy manager when a volume change request
is received
initalization, mute and unmute happen on all device simultaneously
- Settings: suffixes is added to volume keys to store each device
volume independently.
- AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument
to setStreamVolumeIndex() and getStreamVolumeIndex() to address each
device independently.
- AudioPolicyManagerBase: keep track of stream volumes for each device
and apply volume according to current device selection.
Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
except in the control block, where we don't have room.
In AudioFlinger::ThreadBase::TrackBase::getBuffer,
read the frame size from control block only once.
Change-Id: Id6c4bccd4ed3e07d91df6bbea43bae45524f9f4e
At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t. Java is still int. Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.
Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
This avoid lengthy/duplicate sniffing for drm plugins when a decrypt session is opened
o The change is backward compatibile in that no update is required
for existing drm plug-ins if they do not plan to provide separate
sniffer/extractor
related-to-bug: 5725548
Change-Id: I7fc4caf82d77472da4e2bc7b5d31060fb54fd84c
A long pathname would corrupt the heap due to incorrect use of strncpy.
Also was using hard-coded constant 256 instead of PATH_MAX.
Change-Id: Iba382bbb38624fbc41fec91449f9814f77d4ac0d
Was int, uint32_t, uint16_t, and uint8_t with 2-bit bitfield.
Also replace 0 by AUDIO_FORMAT_DEFAULT and replace 1 by
AUDIO_FORMAT_PCM_16_BIT.
Change-Id: Ia8804f53f1725669e368857d5bb2044917e17975
mActive is protected by mLock; volatile is meaningless on SMP.
Fixed a couple of places where mActive was accessed without a lock:
- stopped()
- processAudioBuffer()
Added stopped_l() for cases where we already hold the lock.
Made mActive a bool not int.
Moved down a lock in setPosition that was being acquired too early.
Change-Id: I73ff368e991c0db9f9472df0b3f96fd33fcc7311
we need to transition to executing state anyway to be able to properly flush/shutdown
in the future.
Change-Id: Ie48bc09ea31942009ae3a5a45aabc9ffad9fb91f
related-to-bug: 5655016
On AudioTrack and AudioRecord stop or failed start, restore the priority
and cgroup of the caller to their previous values, rather than forcing
to NORMAL. Dependent on new thread APIs.
Also fixes bug where priority was set to AUDIO but cgroup not set.
Change-Id: Ib83893918fb4fdf57c6b87884b51038997a631d8
-add videoeditor maximum prefetch YUV frames in media_profiles.xml to limit the total memory usage.
Change-Id: I41ffbc192fcce4c7635e5b0a1f2835852e5ee509
This change moves the ANativeWindow connect and disconnect logic from
MediaPlayer to MediaPlayerService::Client.
Bug: 5502654
Change-Id: Ifc43b98b01ad8f35d62d7ece43110724ec7fda3d
This change makes OMXCodec push RGB 565 buffers filled with black to an
ANativeWindow when tearing down after decoding to protected gralloc
buffers. This allows the OMX tear down to zero out any protected
buffers that were used without the possibility that the buffer is still
being used by SurfaceFlinger or HWComposer.
Bug: 5483222
Change-Id: I8acedd81a7bb67dfdc2fd15733e3375b6ce8d560
This change fixes an issue in Stagefright where the state of an OMXCodec
object can get out of sync with the state of the OMX component. In
particular, if one of the ANativeWindow functions failed and put the
OMXCodec into the ERROR state, this would cause Stagefright to skip
doing the Executing -> Idle transition. Without this transition the
freeBuffersOnPort call would never be made, and the MediaBuffers would
end up being leaked (which would also leak the Gralloc buffers they
reference).
Bug: 5333695
Change-Id: I85ea0cf92d18e7ef6d35c7d1e2a7b4e2c9745d34
The native_window_set_crop() is called when port reconfig event callback comes from decoder's and
crop parameters are changed from default getconfig() OMX_IndexConfigCommonOutputCrop values.
Since the default crop params are same as port reconfig crop params, the native_window_set_crop()
is not called, hence resulting in displaying the whole frame(paddedWidth x paddedHeight).
By calling native_window_set_crop() during initilaization of output port of decoder ensures
in setting up ANative window to crop region.
Change-Id: I68926464a1f5c7e6053804615c8b9bd32ea85688
Signed-off-by: Lakshman Gowda <lakshman79@ti.com>
Return BAD_VALUE error upon detection of wrongly formatted files.
The client should abort the initialization upon error detection.
The current CHECK() interrupts the configurecodec() preventing a graceful
exit.
Change-Id: Ic79313fa76a63284897df5d91635de87d06f3100
Signed-off-by: Gilles-Arnaud Bleu-Laine <gilles@ti.com>