summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
Commit message (Collapse)AuthorAgeFilesLines
* DO NOT MERGE - audioflinger: fix recursive mutex lock in EffectHandle.Eric Laurent2017-03-221-7/+25
| | | | | | | | | | | | | | | Bug: 33661708 Bug: 32707507 Bug: 32095713 Test: run CTS AudioEffectTest#test5_0Command, Custom binder test CVE-2017-0479 CVE-2017-0480 Change-Id: I03f674f126c191143bd8bdfe236f793e975826a5 (cherry picked from commit 31a4598a1908b3ccac7ddb33c511ce66840aa911) (cherry picked from commit 8415635765380be496da9b4578d8f134a527d86b)
* DO NOT MERGE - improve audio effect framwework thread safetyEric Laurent2017-03-226-122/+221
| | | | | | | | | | | | | | | | | | | | | | - Reorganize handle effect creation code to make sure the effect engine is created with both thread and effect chain mutex held. - Reorganize handle disconnect code to make sure the effect engine is released with both thread and effect chain mutex held. - Protect IEffect interface methods in EffectHande with a Mutex. - Only pin effect if the session was acquired first. - Do not use strong pointer to EffectModule in EffectHandles: only the EffectChain has a single strong reference to the EffectModule. Bug: 32707507 CVE-2017-0479 CVE-2017-0480 CVE-2017-0499 Change-Id: Ia1098cba2cd32cc2d1c9dfdff4adc2388dfed80e (cherry picked from commit b378b73dd7480b584340b8028802c9ca2d625123) (cherry picked from commit 22e26d8ee73488c58ba3e7928e5da155151abfd0 with backport by <sultanxda@gmail.com>)
* Fix security vulnerability: potential OOB write in audioserverrago2017-03-131-0/+16
| | | | | | | | | Bug: 32705438 Bug: 32703959 Test: cts security test Change-Id: I8900c92fa55b56c4c2c9d721efdbabe6bfc8a4a4 (cherry picked from commit e275907e576601a3579747c3a842790bacf111e2) (cherry picked from commit b0bcddb44d992e74140a3f5eedc7177977ea8e34)
* Effect: Use local cached data for Effect commitAndy Hung2017-03-131-19/+38
| | | | | | | | | Test: POC, Cts Effect, BassBoost, EnvReverb, Equalizer, Test: LoudnessEnhancer, PresetReverb, Virtualizer, Visualizer Bug: 32220769 Change-Id: Iea96ba0daf71691ee8954cca4ba1c10fe827626e (cherry picked from commit dd79ccda92c1e9b982b2d0f8877d98e5258fbb73) (cherry picked from commit a155de4d70e0b9ac8fc02b2bdcbb2e8e6cca46ff)
* Effects: Check get parameter command sizeAndy Hung2017-02-031-0/+7
| | | | | | | | | | Test: Custom test. Bug: 32438594 Bug: 32624850 Bug: 32635664 Change-Id: I9b1315e2c02f11bea395bfdcf5c1ccddccbad8a6 (cherry picked from commit 3d34cc76e315dfa8c3b1edf78835b0dab4980505) (cherry picked from commit 26965db50a617f69bdefca0d7533796c80374f2c)
* Merge tag 'android-6.0.1_r72' into HEADJessica Wagantall2016-10-061-0/+23
|\ | | | | | | | | | | Android 6.0.1 Release 72 (M4B30X) Change-Id: I617426a3fbf7a8d013c5be838ad4c80a00b61a5f
| * Add EFFECT_CMD_SET_PARAM parameter checkingAndy Hung2016-08-261-0/+29
| | | | | | | | | | | | Fix merge conflict to mnc-mr3-release Bug: 30204301 Change-Id: Ib9c3ee1c2f23c96f8f7092dd9e146bc453d7a290
* | audioflinger: Always process volume commands from a latest trackHaynes Mathew George2016-08-191-9/+3
| | | | | | | | | | | | | | | | | | Process them irrespective of whether the track is invalid. Ignoring to do so may lead to glitches/loud bursts in audio when a new track reuses the same output. CRs-Fixed: 1002448 Change-Id: I9afbdd221db3a7311eb0ec8bb75852cf5409084e
* | audioflinger: set flush pending on invalidating offload trackHaynes Mathew George2016-08-192-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On invalidating an offload track, the IAudioTrack instance is destroyed and the offload output is released. If it so happens that APM::getOutputForAttr for the new IAudioTrack is called before OffloadThread::prepareTracks_l checks and removes an invalid track, the same output can get reused. The side effect of this is data present in HAL and below from before the invalidate will be rendered before data from the new seek position is rendered. This is unexpected. To fix this, set hint to issue flush when an offload track is invalidated. Bug: 28566885 CRs-Fixed: 1002438 Change-Id: Ib6c38a3abb600598b87591bac90d03b7150d5216
* | Don't place large objects on the stackGlenn Kasten2016-08-191-5/+13
| | | | | | | | | | Bug: 25020816 Change-Id: Ife4da9fc3000e645f654f2eb28b37ad3a89d61f9
* | Merge tag 'android-6.0.1_r61' into HEADJessica Wagantall2016-08-021-0/+6
|\ \ | | | | | | | | | | | | | | | Android 6.0.1 Release 61 (MOB30Z) Change-Id: Ic86e42d5fb8f81fe5c4f58d2e76852829c609760
| * | Check effect command reply size in AudioFlingerAndy Hung2016-06-231-0/+6
| |/ | | | | | | | | Bug: 29251553 Change-Id: I1bcc1281f1f0542bb645f6358ce31631f2a8ffbf
* | Enforce permission for accessing fm tunerScott Mertz2016-07-082-0/+9
| | | | | | | | Change-Id: I13f3ba8fc9caaeee21597a2405a8c3629e985502
* | frameworks/av: Fix LOG_NDEBUG compilation issuesLeena Winterrowd2016-04-132-1/+2
| | | | | | | | | | | | Fix compilation issues that appear when enabling LOG_NDEBUG. Change-Id: I87e9e5ac66157759dd6f521fab0dd346089a011a
* | audio: QTI resampler supports for 32 bit input formatZhou Song2016-04-133-10/+16
| | | | | | | | | | | | | | | | | | | | | | Configure QTI resampler as 32 bit input format to avoid losing precision. audioflinger: add channel count check to use QTI resampler Change-Id: I8f76dd82b72a0dd8b77343e77e0d0545e1be2114 CRs-Fixed: 940287 Change-Id: I7e1b8582cd6bb106ab0bd25f9bc1bd9e4092318b
* | audioflinger: Compile 192k resampler for 32 bit environmentRamjee Singh2016-04-131-2/+9
| | | | | | | | | | | | | | | | Current makefile compiles the resampler only for 64 bit environment. Allow compilation for 32 bit environment as well. CRs-Fixed: 735776 Change-Id: I626725551af73fc5ea98a7dbf87cacea9dbbc0ef
* | audio: use offload standby delay for direct pcmWeiyin Jiang2016-04-031-0/+2
| | | | | | | | | | | | | | | | | | Default standby delay for legacy direct is too aggressive for track offloaded use case. Using offload standby delay instead, which allows sufficient time for track transition before standby the output. CRs-Fixed: 982822 Change-Id: Ifd0e39c5b3fe4a4af9f444dbbad21ef1e1a5edfa
* | audio: allow standby for direct trackWeiyin Jiang2016-04-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | Delay standby for offload track use case is not suitable for direct track in PCM format, because player torn down doesn't necessarily happen. To avoid AP looping infinitely, allow standby right after direct track in PCM format is paused. CRs-Fixed: 986784 Change-Id: Id0026ac9891a12acc4affa446b2bc841559fcc28
* | audioflinger: clear mMixerBuffer if frame is not readyMohan Kumar2016-03-221-3/+15
| | | | | | | | | | | | | | | | Clear the mMixerBuffer if frame is not ready before the FastMixer starts processing. Otherwise it might result in large glitches on output device due to junk data present in the mixbuffer. Change-Id: I9f025234d4ac100f85d2ec67c06a8df4195bea98
* | Merge tag 'android-6.0.1_r22' of ↵Steve Kondik2016-03-101-3/+20
|\ \ | | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 22
| * | audioflinger: fix standby delay on A2DP outputEric Laurent2016-01-121-3/+20
| |/ | | | | | | | | | | | | | | | | | | | | Make sure that standby delay is never less than the audio flinger default on A2DP output. Due to variable latency and amount of buffering in A2DP sinks, an agressive standby delay could lead to truncated audio. Bug: 25830539. Change-Id: I38be37ad346f5f4bf8303d3db4e3e911bf637968 (cherry picked from commit 42537be61479e59c4718e1304364551c1454f63c)
* | Revert "AudioMixer: delete reformatBuffer provider in proper order"Ashish Jain2016-02-011-2/+2
| | | | | | | | | | | | This reverts commit 415bcac8afac7aef3e9853cfe4a0f2a0eb2f04ad. Change-Id: Ibbc35f16ef8cd17ead72498178c3e7bca1dff3cc
* | AudioMixer: Clear bufferProviders in correct orderAshish Jain2016-02-011-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: While switching between clips with different track properties, when earlier track is cleared, postDownMixerBufferProvider tries to release a buffer to serverProxy instead of the original owner i.e. downMixBufferProvider. This illegal releaseBuffer call to serverProxy results in an assert in AudioTrackShared. -In issue scenario, data flow path in AudioMixer is, ServerProxy-->-->DownMixer-->PostDownMixer-->Resampler, - Clear for downMixerBufferProvider ensures that all serverproxy buffers are returned back. -This also causes the postDownMixer to get connected with serverProxy. -Hence on delete of postDownMixer illegal releaseBuffer for serverProxy gets executed. Fix: Clear PostDownMixerBufferProvider before clearing DownMixerBufferProvider to ensure that buffers are release to right owners. Change-Id: I982366660d0a1e04be8cca6dabe758221dedf9b1
* | audioflinger: Enable TEE_SINK compilationLeena Winterrowd2016-02-011-1/+1
| | | | | | | | | | | | | | Change CHECK to ALOG_ASSERT to allow compilation of the TEE_SINK dump feature. Change-Id: I1114a9d185cfd24cdbdda51c526f48be7fd009f9
* | Combine 'DTS Sound (TruMedia) Postpro support in frameworks/av for Android ↵jinamdar2016-02-014-3/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | 6.0' as a single patch. Signed-off-by: jinamdar <jaydeep.inamdar@dts.com> (cherry picked from commit d3668da66643d4cc39058fb65c8db0742748f70f) Conflicts: services/audioflinger/AudioFlinger.cpp services/audioflinger/Threads.cpp Change-Id: I67e3ba100ff40058919ba827b806aea7bdbaf4bb
* | Revert "Audio Effects are not processing first buffer"Gabriele M2016-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | This causes a short and loud noise when turning off effects while an audio track is playing or when an audio track is started with audio effects enabled. The noise appears to be non-existent if the volume level is set to its maximum. This reverts commit d15a8bd157cb531716bd3e15561f557e74588801. Change-Id: I2b8dd3447d673b4b98018710bc10c1eeb282598e
* | AudioMixer: delete reformatBuffer provider in proper orderSharad Sangle2016-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | If mixer is creating reformatBufferProvider and downMixerBufferProvider while adding a track it first creates downMixerProvider then reformatBufferProvider. While deleting track it first deletes downMixerBufferProvider and then reformatBufferProvider, which should be in reverse order, the object created last should be deleted first. Change-Id: I844e7862280fe37c3167b31e92bbb27aa9463315
* | audioflinger: update multiplier logic to calculate frameCountSatya Krishna Pindiproli2015-12-191-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the value of the multiplier used in calculating mNormalFrameCount is odd, it is rounded off to a higher even value. This results in an increase of mNormalFrameCount and thereby the latency which is not expected. Do not prefer an even multiplier and let the value remain as is even if it is odd. CRs-Fixed: 931454 Change-Id: Ia60d87d01caef6f45998bffeafc3d6a24f7c7fb4
* | libaudioflinger: avoid s/w effect processing in case of Direct PCMvivek mehta2015-12-192-5/+10
| | | | | | | | | | | | | | - Check Direct PCM usecase with Offload - do not process s/w effect when direct PCM is enabled Change-Id: I2eb843b17558e60cf36daff0c5fbdf50dccf99ca
* | audioflinger: Don't do float conversion in upmix/downmix for legacy ALSAArne Coucheron2015-12-072-0/+64
| | | | | | | | | | | | | | | | | | Legacy ALSA really hates floating point, and it's breaking mic input when doing things like audio recording. Use the old conversion routine for legacy ALSA. Change-Id: I616f4cd42fa0e4d7595dd61ed2d36c4fa7052c53
* | Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-075-5/+22
|\ \ | |/ | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 3 Change-Id: I2f2a1fe1b58c828e8341556996211562d6e195ab
| * Merge "audioflinger: increase shared memory heap size" into mnc-dr-devEric Laurent2015-10-142-4/+14
| |\
| | * audioflinger: increase shared memory heap sizeEric Laurent2015-10-142-4/+14
| | | | | | | | | | | | | | | | | | Bug: 21093153. Change-Id: I389af11451b01ce49fdb8957e2f322ba1925a62e (cherry picked from commit da73b6c7474aaa5616f0214e238776f12717f32b)
| * | For static obtainBuffer(), do not set mUnreleased if acknowledging flush.Andy Hung2015-10-131-0/+1
| |/ | | | | | | | | | | | | static audio tracks use obtainBuffer() to update position in start(). Bug: 22938515 Change-Id: I8ae32f6cce4d122386d2cf8982e158049b04ba9a
| * am 4c6e77ff: AudioFlinger: Clear record buffers when starting RecordThreadAndy Hung2015-10-132-2/+7
| |\ | | | | | | | | | | | | * commit '4c6e77ff8e18a1551320a6b42f6a45e19dcce748': AudioFlinger: Clear record buffers when starting RecordThread
| | * AudioFlinger: Clear record buffers when starting RecordThreadAndy Hung2015-10-132-2/+7
| | | | | | | | | | | | | | | | | | Bug: 24211743 Bug: 24267152 Change-Id: I58c55e56b85067b71e4e300f947b4dfc159637ba
* | | audioflinger: Fix effect can't be added for mono channel input.Manish Kumar2015-12-071-1/+1
| | | | | | | | | | | | | | | | | | Don't forbid effects being added for mono channel. Change-Id: Ib080c6c9ac263239668b639a788c29154726210d
* | | AudioFlinger: Fix re-use of fast-trackSumit Bhattacharya2015-12-071-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a fast-track using shared buffer is restarted, we need to call obtainbuffer if frameReady has already become zero, even if track is still active. This is required to reset mFramesReadySafe. Otherwise mFramesReadySafe remain at 0 and fastmixer can't consume data from the track when it is re-used. Change-Id: I5d6f364f8f31baad3341bd4f51bf8a8b147cd7d7
* | | Audio Effects are not processing first bufferLucas Gomez Jimenez2015-11-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation in AudioFlinger set the effects to state IDLE when they are created. Later on when the effect is enabled by the client, the state changes to STARTING. Then when the audio playback starts, the AudioFlinger thread loop calls EffectChain::process_l() to perform the effects processing. However this method will first call process() and then updateState(), so the firstprocess won't do anything because the effect is in STARTING state. After the call to updateState, the state is moved to ACTIVE and then next calls to process_l() will work as expected. Change-Id: I9dfd3d5a0e53403034eb42f9366e1b3cdc5249c0
* | | audioflinger: Adjust throttle interval when effects in useSteve Kondik2015-11-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Loud clicks/pops are heard when playing to a USB device with AudioFX enabled. Particularly frequent when the USB device is capable of high-resolution output. * Adjust the throttling period when effects are enabled to prevent this. Change-Id: I3db220d13c37f4ff5b835c14831fbe6f5a5b062c
* | | audioflinger: Fix compilation with debug enabledSteve Kondik2015-11-231-1/+1
| | | | | | | | | | | | Change-Id: I8c459fd5a6530d7fc253f96400208dc6911b68ec
* | | audio: Set OutputFormat of AudioMixer to PCM16Ramjee Singh2015-11-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | - MixerThread sets OutputFormat to PCM_FLOAT by default We are having issue with SRS Effects due to this format - Fix is to select always PCM16 format as Audio HAL supports only PCM16 Change-Id: I26d23836180fe95b4c32b071593827b6fe4d674e
* | | Merge tag 'android-6.0.0_r26' into cm-13.0Ricardo Cerqueira2015-11-057-233/+13
|\ \ \ | |/ / | | | | | | | | | | | | Android 6.0.0 release 26 Change-Id: I8a57007bf6efcd8b95c3cebf5e0444345bdd4cda
| * | CameraService: Use SCHED_FIFO for request queue thread in HFREino-Ville Talvala2015-09-266-232/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move SchedulingPolicyService from audioservice to mediautils - When starting up a high speed stream config, set request queue thread to SCHED_FIFO using SchedulingPolicyService Bug: 24227252 Change-Id: I224b59142bd111caf563779f55cddd62385b9bac
| * | Merge "Workaround static fast track start-after-stop issue" into mnc-dr-devAndy Hung2015-09-121-1/+4
| |\ \
| | * | Workaround static fast track start-after-stop issueAndy Hung2015-09-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 23291988 Bug: 23614327 Bug: 23924081 Change-Id: Id1a519ed4bb2a6f4cb197da8450f7069b55c0d48
| * | | audio flinger: force audio path start from normal mixerEric Laurent2015-09-101-0/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The audio HAL wakes up and configures the audio path when receiving the first write() in standby state. This causes a certain amount of process to take place in the mixer threads which is problematic for fast mixer running at FIFO priority. We now force a fake write() of 0 bytes from normal mixer to trigger the audio path configuration before starting the fast mixer. Bug: 23791972. Change-Id: I54311b337fda956444846f5d2f53a3263d54e04b
| * | Revert "Do not acknowledge flush() on start() for static tracks"Eric Laurent2015-09-091-6/+3
| | | | | | | | | | | | | | | | | | | | | This reverts commit cafe86a9cb6625bb1ec6383e16e28e4c9e455f87. Bug: 23924093. Change-Id: I186d1013b06a286eca93c30bb9b3545dc36695ff
| * | Do not acknowledge flush() on start() for static tracksAndy Hung2015-08-241-3/+6
| |/ | | | | | | | | Bug: 22938515 Change-Id: I1de653de169a3fbbaa693da6057897ea57772447
* | libstagefright: Extended media support via FFMPEGSteve Kondik2015-10-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Original work by Michael Chen - https://github.com/omxcodec * Kitkat port by Chih-Wei Huang / Android X86 project * Additional fixes by Arcee and Cyanogen * High resolution support by Cyanogen * Lollipop port and refactoring by Cyanogen * Marshmallow port and refactoring by Cyanogen ------ libstagefright: add null checking to addPlugin libstagefright: fix error handling of dlsym() According 'man dlsym', a NULL return from dlsym() doesn't indicate an error. The correct way to test for an error is to call dlerror() to clear any old error conditions, then call dlsym(), and then call dlerror() again to check whether its return value is not NULL. libstagefright: add more media mimetypes This is the first step to add the ffmpeg plugins. libstagefright: add ExtractorPlugin The patch allows to load an ExtractorPlugin to extend the functions of DataSource::sniff and MediaExtractor. A plugin has to implement a C function getExtractorPlugin to fill the MediaExtractor::Plugin struct. The filename of the plugin could be specified by the media.stagefright.extractor-plugin property. Change-Id: I995a37a4f1ab4bba6ca3c24c7001a27a1e3ccb90 FLACExtractor: Add more sample rates support In FLACExtractor.cpp, it has function to check file's sample rate. If the input sample rate is not in its list, it will return "unsupported sample rate" issue. Modify code to make other sample rates (100,1k,42k,46k) pass the check Issue: AXIA-1441 Change-Id: I48f91119275560ec6d00feb0dedc70d10aa55262 Signed-off-by: Xiaobing Feng <xiaobing.feng@windriver.com> Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com> libstagefright: add ffmpeg components libstagefright: add more decoders Add support for wma, wmv, ra, ape, dts decoders. Change-Id: Iaf48a806aa0cef7d9bcb848383fc3d778c8bd248 libstagefright: allow to use the extended extractor in priority If the meta contains the string "extended-extractor-use", use the extended extractor first. add support for rv20, rv30 add ffmpeg heuristic decoder Change-Id: I5eed11b563ca7f15d44bacfb795d6f3da08ab883 add HEVC(H.265) decoder and cleanup Squashed the following commits of branch cm_maguro-10.1 from https://github.com/omxcodec/android_frameworks_av.git by Michael Chen <omxcodec@gmail.com> defb904 remove MEDIA_MIMETYPE_AUDIO_MP2 8036958 add fetchUriFromFd func to get file name 91bc7d5 fix videoCompressionFormatString and audioCodingTypeString funcs f03069f reset FRAME_DROP_FREQ to 0 718b99a add HEVC(H.265) decoder 84f8bf6 cleanup f026c93 cleanup 440614a add debug info Change-Id: Ie75db0778f633357e2280aef6d47a0fa3beb823e AwesomePlayer: use AwesomeLocalRenderer for OMX.ffmpeg.* components stagefright: Remove duplicate types from QC media defs Change-Id: I50ecafe79a2985d0868a1ac82464d6ca448aa2c5 Conflicts: media/libstagefright/ExtendedMediaDefs.cpp media/libstagefright/OMXCodec.cpp libstagefright: Re-introduce a QCOM_HARDWARE ifdef after the FFMPEG commit Fixes a build error on non QCOM hardware. Change-Id: I4a4268b351d0d8bf748dd03ccea0fbab20ed4314 DataSource: Split off ffmpeg sniffer to a second pass, and only if necessary ffmpeg's sniffer is intended as a grab-all-that-doesn't-work-elsewhere extractor. Unfortunately, this causes two issues: - As written, it requires ffmpeg to whitelist any extractors supported by stagefright, or else it will blindly override them. This has codebase sync issues, as shown by the VP9 and WAV accidental overrides - It imposes an in-depth analysis of _all_ media, even that which we want to be processed quickly by shipping stagefright plugins (hardware or not). This is mostly noticeable in network streams and thumbnail generation. This patch moves FFmpegExtractor to an independent sniffer queue, and it only invokes it when the regular MediaExtractor hits 1 of 3 conditions: 1 - The confidence in the identified container type is low 2 - No container is identified at all 3 - A video container was found by other extractors, but only 1 stream (audio or video) was identified. Change-Id: Ib96ff4f6bc06223fe0e819a57560d3c872a79ddd stagefright: OMX.ffmpeg.* are software decoders, ensure they're treated as such Wherever the component name for OMX.google soft decoders is used to identify a software-based component, do the same for ffmpeg. Things like memory management and window buffers care about this. Change-Id: Ib83561936c7383e8726edb073cea9d78f7d1312f libstagefright: Don't invoke FFMPEG for MP3 Change-Id: Ia30d25d1a994328827f14a286661cd2e1eaa1181 stagefright: Fix audio codec fallthru * We shouldn't return an error from setAudioFormat unless it's really an error since fallthru is necessary. * We don't even need to do this, since the component name is checked before calling into mm-parser or FFMPEG. * Fixes Vorbis decoding after FFMPEG patch. Change-Id: I4871c62044c6693e5698119dee3a10c20c26e2c7 stagefright: Fix codec lookup bugs on NuPlayer * Fix use of WMA/WMV software codecs * Fix mpeg2 software codec name * Don't override the component name in ACodec. This actually breaks stuff because the format isn't available in the kInit message. Change-Id: I93c292e039de5f24c2ccbd6ae2242b06d28fe518 stagefright: Cleanup and improve format parsing * Move FFMPEG-specific exceptions to FFMPEGSoftCodec * Add handling for AAC MAIN profile * Use the new OMX_AUDIO_CodingAndroidAC3 to handle AC3 Change-Id: Ibb806cd2b9dd23dc1e1b2c862fcde40605023a49 stagefright: Keep track of the bit width in the RAW codec * We need this to push 24-bit PCM around Stagefright and OMX Change-Id: Ic94ec972162a01545d5dd0ad0bf3eb6c6731f42e stagefright: Adjust confidence threshold for extended sniffers * Some sniffers return 0.2 for cases where they only find an audio track in some containers. * Change the comparison to also examine files right on this threshold. * This allows us to score ONE FUCKING HUNDRED PERCENT on the Antutu Video Test \o/ Change-Id: I78b6ab8a634771e0e290f669801f5b08d6a32a51 stagefright: Fix FFMPEG catchall decoders * Get this metadata properly flowing * Allows us to play tracks such as Apple Lossless :) Change-Id: I2990b30eef5b672da339d24444424c61a43b85c2 stagefright: Fix metadata/message conversion issues * Remove duplication of code between ExtendedCodec and FFMPEGSoftCodec, just call into ExtendedCodec and properly ifdef QCOM-only parts. * Fix CSD not being converted when AV_ENHANCEMENTS wasn't set- this was breaking the software video codecs on Hammerhead. Change-Id: I9cd4316ce19b15baabf12b78b992498ce48e2697 Fix compile error after I9cd4316ce19b15baabf12b78b992498ce48e2697 frameworks/av/media/libstagefright/ExtendedCodec.cpp:1187:1: error: expected '}' at end of input Change-Id: I7d75e69160f794b177f4235f4a6bb5a188dc0d08 stagefright: Fix AC3 playback * Skip setupAC3Codec in ACodec for non-Google components. Change-Id: I5090485ba020f7ad1c0962fc977e38675b4c8314 stagefright: Guard against crash with mismatched codecs * Return unsupported error if WMV file can't be scanned. Change-Id: Ia4a1ac7a299990f8b9c05a93736cb2fa9d0ee965 stagefright: Correct ifdeffage of some QC codecs Change-Id: Ie8cc7287967b84e09941283559ca542efd928d91 stagefright: Create native window for FFMPEG software codecs Change-Id: I178f334f1fa1ea9edc6898fb61e72902c2cb2651 stagefright: Don't ever try to use extended sniffers on DRM * This can cause long retry intervals during key exchange. Don't do it! Change-Id: Id9a87dcbe43cd0cc9919fe07f0a963e087baccad stagefright: Be more tolerant of missing metadata for FFMPEG codecs * If these codecs are instantiated programatically and required metadata isn't sent, just set some defaults instead of crashing on an assert. * This fixes testAllNonTunneledVideoCodecsSupportFlexibleYUV in MR1 CTS Change-Id: I69bf6105a1be529298de574bd5d3b6813e7a4e8f stagefright: Fix issues with software decoders * Fix MKV thumbnails * Fix VC1 thumbnails * Fix FFMPEG thumbnails * Fix trial decoder * Fix edge cases with WMV3/VC1 playback * Fix a state issue which caused some codecs to get wrong configuration Change-Id: I09599166aa24bcff53f91e43de096c4fad8ca7ad stagefright: ffmpeg: Slightly raise the threshold for the ffmpeg scanner 0.2 is the success value for the OMX.google soft audio sniffers, which was making ffmpeg own the unpacking of those streams needlessly. Fixes CYNGNOS-282 Change-Id: I75f50ed838cb8af9acdf99aa284b80a070555284 stagefright: Add support for loading a custom OMXPlugin * To facilitate moving the stagefright-plugins glue out of the framework, support is added to OMXMaster to load multiple external plugins besides internal/vendor versions. * This is currently limited to one plugin, defined by the "mm.sf.omx-plugin" system property. The code will allow any number of libraries to be loaded, though. * Should also be useful for nonstandard vendor implementations too. Change-Id: I27d7e16ad56baa17754d8ea47a8c608a0d73d6f1 stagefright: Move a bunch of FFMPEG stuff out of here * Get rid of some of the glue code for stagefright-plugins and use the new extension header and plugin. * Still a bunch of TODOs on this, but it works. Change-Id: If07d3213952b624d48035e5f58ad883b2a4049b0 stagefright: Remove deprecated FFMPEG config Change-Id: I1fcdb4eeba72e2420493b89ddd6fc718d170ced7 stagefright: Support for 24-bit audio in StageFright * Plumb bit depth thru ACodec and OMX * Add support for 24-bit PCM offload in NuPlayer on QC devices * Use new AudioFlinger features for mixing multi formats without offload * Clean up a bunch of code Change-Id: I018d3a995b63450a38c6c43eaa37c86be30fd893 nuplayer: Fix PCM offload turning on all the time * Remove the extra condition, since this will be set even if PCM offload was denied. Change-Id: I8f33ef68562d8e057e7a86c5ae6187d0049bf3aa stagefright: Cleanup of PCM offload checks * Put the checks in a single place. Change-Id: I2d0d5b542593896e78bf989296de1a1d1e3a4963 stagefright: Add bit-depth plumbing for new formats Change-Id: I13cfd75e4b4819543b64babf20cc9af57ea2978f nuplayer: Fix bitrate propagation * We use "bitrate" rather than "bit-rate". Change-Id: I4699194e3e3f7ef55b4eb554f5de7a6b5f6b80ce libstagefright: Implement fallback mechanism to SW decoder Implement fallback mechanism to software decoder when hardware decoder configuration fails in ACodec Change-Id: Idf4c445942b03e28b264c91a20e69d52224727bd