summaryrefslogtreecommitdiffstats
path: root/media/libmedia
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r74' into HEADJessica Wagantall2016-11-092-30/+38
|\ | | | | | | | | | | | | | | CYNGNOS-3303 Android 6.0.1 release 74 Change-Id: I0a14578751f4ecb8d13def26b9ffe5dcba4afd72
| * Check mprotect resultMarco Nelissen2016-09-271-24/+28
| | | | | | | | | | | | | | | | | | mprotect can theoretically fail, which could then let one exploit a vulnerable codec if one exists on the device. Bug: 31350239 Change-Id: I7b99c190619f0fb2eb93119596e6da0d2deb8ba5 (cherry picked from commit 866c800c0624bb13eee44973cc8a2ecd0012de6e)
| * Fix stack content leak vulnerability in mediaserverJeff Tinker2016-09-271-1/+1
| | | | | | | | | | | | bug: 30875060 Change-Id: I03f4d08b7b31ac5b507cfc9e65e5607c73972d95 (cherry picked from commit 9a6861cbd3bb0e1b8fe4c105795256ee032f9664)
| * IOMX: work against metadata buffer spoofingLajos Molnar2016-09-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Prohibit direct set/getParam/Settings for extensions meant for OMXNodeInstance alone. This disallows enabling metadata mode without the knowledge of OMXNodeInstance. - Do not share metadata mode buffers cross process. - Disallow setting up metadata mode/tunneling/input surface after first sendCommand. - Disallow store-meta for input cross process. - Disallow emptyBuffer for surface input (via IOMX). - Fix checking for input surface. Bug: 29422020 Change-Id: I801c77b80e703903f62e42d76fd2e76a34e4bc8e (cherry picked from commit f8a4cb410115045278f534e54b41ac78d6bf6c07)
* | Merge tag 'android-6.0.1_r61' into HEADJessica Wagantall2016-08-023-5/+5
|\ \ | |/ | | | | | | | | Android 6.0.1 Release 61 (MOB30Z) Change-Id: Ic86e42d5fb8f81fe5c4f58d2e76852829c609760
| * Don't use sp<>&Marco Nelissen2016-06-233-5/+5
| | | | | | | | | | | | | | because they may end up pointing to NULL after a NULL check was performed. Bug: 28166152 Change-Id: Iab2ea30395b620628cc6f3d067dd4f6fcda824fe
* | Merge remote-tracking branch 'remotes/android-6.0.1_r52' into HEADJessica Wagantall2016-07-073-0/+110
|\ \ | |/ | | | | | | | | Ticket: CYNGNOS-3020 Change-Id: I7e8d69c5f7041b66893ea643c4bc19c3b7bcdda5
| * limit mediaserver memoryMarco Nelissen2016-05-273-0/+110
| | | | | | | | | | | | | | | | | | | | Limit mediaserver using rlimit, to prevent it from bringing down the system via the low memory killer. Default max is 65% of total RAM, but can be customized via system property. Bug: 28471206 Bug: 28615448 Change-Id: Ic84137435d1ef0a6883e9789a4b4f399e4283f05
* | Merge tag 'android-6.0.1_r46' into HEADJessica Wagantall2016-06-071-30/+71
|\ \ | |/ | | | | | | | | Android 6.0.1 release 46 Change-Id: I4fcabf5775aebd2cb8dc0e352d1b1460d3214573
| * Fix OMX_IndexParamConsumerUsageBits size checkMarco Nelissen2016-04-211-3/+4
| | | | | | | | | | Bug: 27207275 Change-Id: I9a7c9fb22a0e84a490ff09c151bd2f88141fdbc0
| * Fix size check for OMX_IndexParamConsumerUsageBitsMarco Nelissen2016-04-211-2/+6
| | | | | | | | | | | | | | | | since it doesn't follow the OMX convention. And remove support for the kClientNeedsFrameBuffer flag. Bug: 27207275 Change-Id: Ia2c119e2456ebf9e2f4e1de5104ef9032a212255
| * DO NOT MERGE Verify OMX buffer sizes prior to accessMarco Nelissen2016-04-211-30/+66
| | | | | | | | | | Bug: 27207275 Change-Id: I4412825d1ee233d993af0a67708bea54304ff62d
| * Get service by value instead of referenceMarco Nelissen2016-02-261-2/+2
| | | | | | | | | | | | | | to prevent a cleared service binder from being used. Bug: 26040840 Change-Id: Ifb5483c55b172d3553deb80dbe27f2204b86ecdb
| * Clear allocation to avoid info leakMarco Nelissen2016-02-261-27/+32
| | | | | | | | | | Bug: 26914474 Change-Id: Ie1a86e86d78058d041149fe599a4996e7f8185cf
| * Fixing safteynet logging bug introduced in ag/862848mspector@google.com2016-02-261-4/+0
| | | | | | | | | | | | We moved the safteynet logging into storeMetaDataInBuffers_l Bug: 26324358 Change-Id: I2171742b53192ebb71d546bcb8970bb3c68f366f
| * 3 uninitialized variables in IOMX.cppmspector@google.com2016-02-261-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | Uninitialized MetadataBufferType pointer in case: SET_INPUT_SURFACE STORE_META_DATA_IN_BUFFERS CREATE_INPUT_SURFACE Fix: initialize them to kMetadataBufferTypeInvalid Bug: 26324358 Change-Id: Ib3bcac9bedc98bc65efa39f67cdbffbd90b374c9
| * Fix info leak vulnerability of IDrmJeff Tinker2016-02-261-1/+1
| | | | | | | | | | bug: 26323455 Change-Id: I25bb30d3666ab38d5150496375ed2f55ecb23ba8
| * IOMX.cpp uninitialized pointer in BnOMX::onTransactmspector@google.com2016-02-261-3/+5
| | | | | | | | | | | | | | | | | | This can lead to local code execution in media server. Fix initializes the pointer and checks the error conditions before returning Bug: 26403627 Change-Id: I7fa90682060148448dba01d6acbe3471d1ddb500
* | audiopolicy: Add AudioSessionInfo APISteve Kondik2016-04-273-2/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * This patch introduces a new API which allows applications to query the state of the audio effects system, and receive callbacks with the necessary information to attach effects to any stream. * In the future, this may come as part of the AudioPort system, but since that's an active area of development by Google, we will dodge it for now. * The policy now simply keeps a refcounted list of objects which hold various bits of stream metadata. Callbacks are sent on stream open/close to applications which might be listening for them. Change-Id: I2d554d36e1378f4eb7b276010a3bfe8345c22ecd
* | audiopolicy: Revert all session callback patches.Steve Kondik2016-04-223-83/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * This has been rearchitected in a better way, as this feature turns out to be more difficult than it seems. * Reverting all of this stuff and rolling it into a single commit. This reverts commit c27a16c33c78a36482336a16199b1b8be794cea4. This reverts commit 32ef0556ae58ff6b7c6fe6fb0a17d3ff7f01de31. This reverts commit 489c9fb62f02e1d23d6d6c89b22f7d19c596e65e. This reverts commit a4123803d0a0e9e0c69faa4207d357cc74a65d58. This reverts commit e13b58b988ab642d4ae5ca6d0a89013510714956. This reverts commit 47f8c7303c9e2054f1492b02b6c7472385c52dc9. This reverts commit 0479d7c79a7fd6f112e8dc7e45c009cf6602dbaa. Change-Id: Iaed9f198d806aa414c95960713e8187c98db248b
* | libmedia: Initialize mState/mActive value to avoid possible crashZhou Song2016-04-132-4/+6
| | | | | | | | | | | | | | | | | | | | | | If track creation fails on server side, mState/mActive is left unitialized. After this a crash can happen when track stop() is called because of a reference to a NULL object. Initialize mState/mActive to specific value in initialized list of track constructor. Change-Id: If8c3611e3229c0c1b14b81285e07b9357fec7658 CRs-Fixed: 992608
* | Update Instrumentation codeWilliam Clark2016-04-131-2/+1
| | | | | | | | | | | | Add support for enhancements in QSSP instrumentation code. Change-Id: I00aa0b2bee5044d91eeeddaa43d3d28518a5ba93
* | audiopolicy: Be a little smarter with auto-attachSteve Kondik2016-04-072-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * The edge cases, ZOMG! * Instead of relying on effects to be automatically attached, let's just always notify userspace and send a bit more information. This lets the application decide if effects should be attached rather than relying on a hard-coded configuration file. * Perform the setup in getOutputForAttr, but do it on the command thread so we don't block the client. OPO-593 Change-Id: I3900b349f2e895d51fa3a3dcc2de0c4bdf6dbc08
* | Merge tag 'android-6.0.1_r24' into HEADJessica Wagantall2016-04-053-36/+52
|\ \ | | | | | | | | | | | | Ticket: CYNGNOS-2213 Android 6.0.1 release 24
| * | Get service by value instead of referenceMarco Nelissen2016-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | | to prevent a cleared service binder from being used. Bug: 26040840 Change-Id: Ifb5483c55b172d3553deb80dbe27f2204b86ecdb
| * | Clear allocation to avoid info leakMarco Nelissen2016-03-011-27/+32
| | | | | | | | | | | | | | | Bug: 26914474 Change-Id: Ie1a86e86d78058d041149fe599a4996e7f8185cf
| * | Fixing safteynet logging bug introduced in ag/862848mspector@google.com2016-03-011-4/+0
| | | | | | | | | | | | | | | | | | We moved the safteynet logging into storeMetaDataInBuffers_l Bug: 26324358 Change-Id: I2171742b53192ebb71d546bcb8970bb3c68f366f
| * | 3 uninitialized variables in IOMX.cppmspector@google.com2016-03-011-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uninitialized MetadataBufferType pointer in case: SET_INPUT_SURFACE STORE_META_DATA_IN_BUFFERS CREATE_INPUT_SURFACE Fix: initialize them to kMetadataBufferTypeInvalid Bug: 26324358 Change-Id: Ib3bcac9bedc98bc65efa39f67cdbffbd90b374c9
| * | Fix info leak vulnerability of IDrmJeff Tinker2016-03-011-1/+1
| | | | | | | | | | | | | | | bug: 26323455 Change-Id: I25bb30d3666ab38d5150496375ed2f55ecb23ba8
| * | IOMX.cpp uninitialized pointer in BnOMX::onTransactmspector@google.com2016-03-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This can lead to local code execution in media server. Fix initializes the pointer and checks the error conditions before returning Bug: 26403627 Change-Id: I7fa90682060148448dba01d6acbe3471d1ddb500
| * | Merge "Fix security vulnerability in ICrypto DO NOT MERGE" into mnc-devJeff Tinker2015-12-091-1/+3
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | am: 89bec04cf8 * commit '89bec04cf83598b1868f3f969c220c3200028e03': Fix security vulnerability in ICrypto DO NOT MERGE
| | * | Fix security vulnerability in ICrypto DO NOT MERGEJeff Tinker2015-12-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | b/25800375 Change-Id: I03c9395f7c7de4ac5813a1207452aac57aa39484
* | | | audiopolicy: Add notification when default effects are updatedSteve Kondik2016-03-083-2/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * In M, we now have the ability to define a default set of audio effect on a per-stream basis. This allows us to get around the problem of apps not sending the control intents so we can implement smart global effects for specific media types. * We still need a session id in order to get a handle and configure them from an app like AudioFX, so we'll need to add some plumbing in order to send an event to interested applications. * This patch implements the native side of this. The Java layer will call down thru AudioSystem and register a callback which will be invoked by the audio policy when default effects are updated on a stream. This callback will receive both the stream type as well as the session id. * Attaching this listener requires that the caller hold the MODIFY_AUDIO_ROUTING permission. Change-Id: I142b15f2585ffca6a953c3e828e2a7c07b24f56c
* | | | Merge tag 'android-6.0.1_r13' into HEADJessica Wagantall2016-02-011-1/+3
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | Android 6.0.1 release 13 Ticket: CYNGNOS-1522 Change-Id: Ie9d7be6df3e63138bafb892a3181446e3c7d844e
| * | | Fix security vulnerability in ICrypto DO NOT MERGEJeff Tinker2015-12-101-1/+3
| |/ / | | | | | | | | | | | | | | | b/25800375 Change-Id: I03c9395f7c7de4ac5813a1207452aac57aa39484
* | | libmedia: Add support for LHR tonesKarthik Reddy Katta2016-01-231-1/+5
| | | | | | | | | | | | | | | | | | | | | Add tones to the ToneGenerator that are to be used for Local Hold Recall. Change-Id: I92cc1d63a3f6d38fc224774909b5b27d58be969c
* | | libmedia: correct latency computing for TRANSFER_SYNCMingming Yin2015-12-311-1/+2
| | | | | | | | | | | | | | | | | | | | | - Compute the track latency by frame count returned from audio hal when in TRANSFER_SYNC mode Change-Id: If7bbf780abc8e141eb35eea44c01c583b1290d3c
* | | libmedia: Preserve futex return status in client obtainBufferLeena Winterrowd2015-12-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clock_gettime() can change errno if something goes wrong (most commonly setting EBADF). This failure should not cause a failure in ClientProxy::obtainBuffer() if the futex returned successfully or with a known status. Preserve errno before calling clock_gettime to prevent propagation of an invalid, unexpected error. Propagated from Ib69201031a81395ece47dd8ad7c4dcddd2b00153 Change-Id: I48320fc287b6a0ef2a1b9e71f9d0e979bd6343a5
* | | AudioTrack: Set DIRECT track flag for direct pcm outputLeena Winterrowd2015-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While direct output should ideally be abstracted from the AudioTrack, the use of an offload path can leave data stuck in the shared buffer (especially if the clip is short such that the buffer is never entirely filled). To ensure that all data is played out on track stop(), AudioTrack must be aware of the direct output or offload session. Set the DIRECT track flag for track offload use cases to avoid losing data in the shared buffer. CRs-Fixed: 944878 Change-Id: I13f840b5d67be56e03ec65d3bc7d44f1090b48c5
* | | libmedia: correct latency computing of AudioRecordMingming Yin2015-12-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Originally, audio record latency is calculated by frame buffers allocated for this track, while the actual latency is determined by audio hal. - Compute the track latency by frame count returned from audio hal when in TRANSFER_CALLBACK mode Change-Id: I26e5e47e8cc3720895b962f7aab8a595a54b7c83
* | | Fix potential double close in IMediaMetadataRetriever::setDataSourceTaiju Tsuiki2015-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMediaMetadataRetriever::setDataSource(fd, offset, length) takes the ownership of |fd| on the direct invocation, and doesn't take the ownership on invocation from Binder. This is inconsintent to other similar methods like IMediaPlayer::setDataSource, and causes potential double close of |fd|. This CL changes the caller and implementations to leave the ownership to make them consistent. Also, fixes a double close in IMediaPlayerService::setDataSource in an error case. Change-Id: Id551a1e725c4392b0fe6b7293871212eb101c0a5
* | | Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-072-3/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 3 Change-Id: I2f2a1fe1b58c828e8341556996211562d6e195ab
| * | Workaround for busy wait bugGlenn Kasten2015-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | | Underlying bug 25195759 is not yet fixed. Bug: 24263351 Change-Id: I04b644246640054d38c8de79e0eb80fcbfef0e48
| * | Merge "For static obtainBuffer(), do not set mUnreleased if acknowledging ↵Glenn Kasten2015-10-141-2/+4
| |\ \ | | | | | | | | | | | | flush." into mnc-dr-dev
| | * | For static obtainBuffer(), do not set mUnreleased if acknowledging flush.Andy Hung2015-10-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | static audio tracks use obtainBuffer() to update position in start(). Bug: 22938515 Change-Id: I8ae32f6cce4d122386d2cf8982e158049b04ba9a
| * | | AudioTrack: Skip callback EVENT_STREAM_END on DEAD_OBJECT.Andy Hung2015-10-131-1/+5
| |/ / | | | | | | | | | | | | | | | | | | Send only EVENT_NEW_IAUDIOTRACK to initiate teardown. Bug: 23750452 Change-Id: Ib5dcd578b5b6a6a1d91a03e58ef8da0acd994243
* | | Fix benign overflow in ToneGenerator.cppChad Brubaker2015-12-071-2/+4
| | | | | | | | | | | | | | | | | | | | | while (count--) causes an unsigned overflow when count = 0, refactor the condition to avoid this. Change-Id: I91a8c93e6be715d80070a4c94c1de712cb659265
* | | Fix benign unsigned overflow in AudioTrackChad Brubaker2015-12-071-3/+3
| | | | | | | | | | | | | | | | | | | | | An unsigned overflow could occur in timestamp computation when mTimestamp < mServer. Change-Id: I9e01897478a6d481dd6fb7303d325617466497cf
* | | Fix benign overflow in AudioTrackChad Brubaker2015-12-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | two uint32_t's were being used in a computation that could be negative, cast to int32_t before the subtraction to prevent incorrect overflow detection. Change-Id: I33c5ef79a0ebbba055daa0ea041b42229d0c3152
* | | libmedia: add NULL check before accessing source and destination buffers.Shivaprasad Hongal2015-12-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | IMemory can return a NULL pointer or the destination buffer for readAt can be NULL. Check for NULL and report error. Change-Id: I9608de8ee3817a681c5c51ec7fdbd1bf207d9463 CRs-Fixed: 931744