OSDN Git Service

android-x86/frameworks-av.git
6 years agoAdd check preventing div0 issue
Ryszard Grzesica [Tue, 29 Dec 2015 05:28:44 +0000 (06:28 +0100)]
Add check preventing div0 issue

There might be a scenario while period is zero or after including
precision would be zero, prevent from division in that case and
return false (to use previously used period).

Bug: 73898703
bug: 74067957
Test: run playback as stability test

Change-Id: I3fad1060b095b7b5ea4c1f9cb3f9d42a4c503560
(cherry picked from commit 27e47ce3c3bbc0b4dc629163de7ebbba7e80b149)

6 years agoInit gain config to prevent uninit leak.
jiabin [Fri, 6 Apr 2018 00:16:20 +0000 (17:16 -0700)]
Init gain config to prevent uninit leak.

In AudioPortConfig, we only initialize index for audio_gain_config, but
not other fields. That may cause uninit leak at listAudioPorts and
listAudioPatches.

Bug: 77238250
Bug: 77238762
Test: try repo steps at the bug description.
Change-Id: I57e3bd0598f9aa698a6fa3d3c0218b046de34e2f
(cherry picked from commit ebe0777edcf3b9c6bde9771d65399e2363dc6e40)

6 years agoSanitize effect descriptors for AudioPolicyService binder calls.
Andy Hung [Thu, 12 Apr 2018 18:06:56 +0000 (11:06 -0700)]
Sanitize effect descriptors for AudioPolicyService binder calls.

Zero initialize structs before parcel read, if status is not checked.
Sanitize parcel read audio_port_config.

Test: Audio CTS, See bug for POC
Bug: 73126106
Merged-in: Iece43eb463385927e6babcf93654eea8aaebc29c
Change-Id: Iece43eb463385927e6babcf93654eea8aaebc29c
(cherry picked from commit 498bdcc90bc470a79bf8943cbac64502f7c1c091)

6 years agoAdd check preventing div0 issue
Ryszard Grzesica [Tue, 29 Dec 2015 05:28:44 +0000 (06:28 +0100)]
Add check preventing div0 issue

There might be a scenario while period is zero or after including
precision would be zero, prevent from division in that case and
return false (to use previously used period).

Bug: 73898703
bug: 74067957
Test: run playback as stability test

Change-Id: I3fad1060b095b7b5ea4c1f9cb3f9d42a4c503560
(cherry picked from commit 27e47ce3c3bbc0b4dc629163de7ebbba7e80b149)

6 years agoInit gain config to prevent uninit leak.
jiabin [Fri, 6 Apr 2018 00:16:20 +0000 (17:16 -0700)]
Init gain config to prevent uninit leak.

In AudioPortConfig, we only initialize index for audio_gain_config, but
not other fields. That may cause uninit leak at listAudioPorts and
listAudioPatches.

Bug: 77238250
Bug: 77238762
Test: try repo steps at the bug description.
Change-Id: I57e3bd0598f9aa698a6fa3d3c0218b046de34e2f
(cherry picked from commit ebe0777edcf3b9c6bde9771d65399e2363dc6e40)

6 years agoMerge cherrypicks of [3912569, 3913632, 3913633, 3913557, 3913471, 3913509, 3913558...
android-build-team Robot [Tue, 17 Apr 2018 18:03:25 +0000 (18:03 +0000)]
Merge cherrypicks of [39125693913632391363339135573913471391350939135583913541391354239134723913473391373539137363913737391373839137393913510391351139135123913513391351439135593913560391375539137953912643391354339125703913057] into sparse-4669640-L32000000164199687

Change-Id: I23280d374f808693e94b5767767e80668621f4ac

6 years agofix crash due to no output format available -- DO NOT MERGE
Chong Zhang [Tue, 20 Mar 2018 20:37:22 +0000 (13:37 -0700)]
fix crash due to no output format available -- DO NOT MERGE

Output format should arrive before we get first frame, but if
it doesn't, better fail it than crash.

bug: 69924594
bug: 75978033
Change-Id: I057ba49c8f83b9a301d409510717039ad894c391
(cherry picked from commit 6cb243cd2bb4d2fb41d12394fe5731ba098fc2ef)

6 years agoHandle overflow in android::HeifDataSource::readAt
Sungtak Lee [Mon, 5 Mar 2018 23:21:33 +0000 (15:21 -0800)]
Handle overflow in android::HeifDataSource::readAt

Bug: 73782357
Change-Id: I03a5b4c5ddaf2664f342973da7f1a79f29cd7be5
(cherry picked from commit 237f9034c6cbe5cbafb0cd4c862d9dddfbdf7389)

6 years agobetter mpeg2 TS elementary stream Access Unit parsing
Ray Essick [Tue, 6 Mar 2018 23:55:29 +0000 (15:55 -0800)]
better mpeg2 TS elementary stream Access Unit parsing

mpeg2 es stream access units have a 3 byte prefix and a 1 byte start
code. Searching for the next access unit started after the prefix
instead of after the start byte.

Bug: 74114680
Test: ran POC before/after
(cherry picked from commit 371066d073c5db289b0f38b9d2bfd3e326c78c66)

Change-Id: If5487c1bff5275ce019dfcae0a4b00bacfed1f6d

6 years agoHandle bad bitrate index in mp3dec.
Dongwon Kang [Fri, 23 Feb 2018 16:59:27 +0000 (08:59 -0800)]
Handle bad bitrate index in mp3dec.

Reference:
  https://www.mp3-tech.org/programmer/frame_header.html

Test: run poc with and without this patch.
Bug: 71868329
Change-Id: Ibf6196eba0b99459e84989ac8c13db57c816c572
(cherry picked from commit 8b638123760bd93958f6cc2f5c7c4f5dbd0a754a)

6 years agoheif: use width and height for decoder -- DO NOT MERGE
Chong Zhang [Tue, 27 Feb 2018 20:43:06 +0000 (12:43 -0800)]
heif: use width and height for decoder -- DO NOT MERGE

The display dimensions from MPEG4Extractor is applied on top
of width and height for scaling, it's not for cropping. For
bitmap uses we have to use width and height, the frame from
media server is not scaled.

This required porting over some fixes from master to fix the
display size vs. image size reporting, otherwise images with
grids may show a black border at the bottom or right.

bug: 73172046
Test: test app in bug; open folders with heif files in Photos
and Downloads; CTS MediaMetadataRetrieverTest.
Change-Id: I3d7f1492d08d48876836ccc05b6eb4de0d0c0f9a
(cherry picked from commit 49d4aa0a7407ea6632c4a3441c7a4d922d003ea5)

6 years agolibstagefright: Extended media support via FFMPEG
Steve Kondik [Thu, 25 Jul 2013 09:33:47 +0000 (17:33 +0800)]
libstagefright: Extended media support via FFMPEG

 * Original work by Michael Chen - https://github.com/omxcodec
 * Original Kitkat port by Chih-Wei Huang / Android X86 project
 * Additional work up to Nougat by:
   - Steve Kondik
   - Ricardo Cerqueira
   - Keith Mok
   - Scott Mertz
   - Ethan Chen
   - Diogo Ferreira
 * Additional work up to Oreo by:
   - Michael Goffioul

Change-Id: Ie871b56f6f6d895a87de8c8920e9e8692382b420

6 years agoMerge cherrypicks of [3898937, 3898958, 3899077, 3897885, 3898496, 3898245, 3898959...
android-build-team Robot [Fri, 13 Apr 2018 22:47:27 +0000 (22:47 +0000)]
Merge cherrypicks of [3898937389895838990773897885389849638982453898959389896038977903898312389831338983143899155389915638991573898289389829038990613898291389829238969513899158389896138989383898246] into sparse-4657601-L30800000163316240

Change-Id: I7fb38efbc6add86c8877cb20e040e7adf87dacf6

6 years agofix crash due to no output format available -- DO NOT MERGE
Chong Zhang [Tue, 20 Mar 2018 20:37:22 +0000 (13:37 -0700)]
fix crash due to no output format available -- DO NOT MERGE

Output format should arrive before we get first frame, but if
it doesn't, better fail it than crash.

bug: 69924594
bug: 75978033
Change-Id: I057ba49c8f83b9a301d409510717039ad894c391
(cherry picked from commit 6cb243cd2bb4d2fb41d12394fe5731ba098fc2ef)

6 years agoHandle overflow in android::HeifDataSource::readAt
Sungtak Lee [Mon, 5 Mar 2018 23:21:33 +0000 (15:21 -0800)]
Handle overflow in android::HeifDataSource::readAt

Bug: 73782357
Change-Id: I03a5b4c5ddaf2664f342973da7f1a79f29cd7be5
(cherry picked from commit 237f9034c6cbe5cbafb0cd4c862d9dddfbdf7389)

6 years agobetter mpeg2 TS elementary stream Access Unit parsing
Ray Essick [Tue, 6 Mar 2018 23:55:29 +0000 (15:55 -0800)]
better mpeg2 TS elementary stream Access Unit parsing

mpeg2 es stream access units have a 3 byte prefix and a 1 byte start
code. Searching for the next access unit started after the prefix
instead of after the start byte.

Bug: 74114680
Test: ran POC before/after
(cherry picked from commit 371066d073c5db289b0f38b9d2bfd3e326c78c66)

Change-Id: I813d2ecd3bc972fb92809f1068f596970591cf3c

6 years agoHandle bad bitrate index in mp3dec.
Dongwon Kang [Fri, 23 Feb 2018 16:59:27 +0000 (08:59 -0800)]
Handle bad bitrate index in mp3dec.

Reference:
  https://www.mp3-tech.org/programmer/frame_header.html

Test: run poc with and without this patch.
Bug: 71868329
Change-Id: Ibf6196eba0b99459e84989ac8c13db57c816c572
(cherry picked from commit 8b638123760bd93958f6cc2f5c7c4f5dbd0a754a)

6 years agoheif: use width and height for decoder -- DO NOT MERGE
Chong Zhang [Tue, 27 Feb 2018 20:43:06 +0000 (12:43 -0800)]
heif: use width and height for decoder -- DO NOT MERGE

The display dimensions from MPEG4Extractor is applied on top
of width and height for scaling, it's not for cropping. For
bitmap uses we have to use width and height, the frame from
media server is not scaled.

This required porting over some fixes from master to fix the
display size vs. image size reporting, otherwise images with
grids may show a black border at the bottom or right.

bug: 73172046
Test: test app in bug; open folders with heif files in Photos
and Downloads; CTS MediaMetadataRetrieverTest.
Change-Id: I3d7f1492d08d48876836ccc05b6eb4de0d0c0f9a
(cherry picked from commit 49d4aa0a7407ea6632c4a3441c7a4d922d003ea5)

6 years agostagefright: allow multiple custom OMXPlugins
Jesse Chan [Fri, 3 Mar 2017 12:42:40 +0000 (20:42 +0800)]
stagefright: allow multiple custom OMXPlugins

* Separated by comma(,)
* Example: media.sf.omx-plugin=libffmpeg_omx.so,libsomxcore.so

Change-Id: I15556a48df282b01f54ca864317eafff5468e739
Signed-off-by: Jesse Chan <jc@lineageos.org>
6 years agostagefright: Add support for loading a custom OMXPlugin
Steve Kondik [Wed, 8 Jul 2015 16:56:01 +0000 (09:56 -0700)]
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

6 years agoMerge tag 'android-8.1.0_r22' into oreo-x86
Chih-Wei Huang [Tue, 10 Apr 2018 07:10:15 +0000 (15:10 +0800)]
Merge tag 'android-8.1.0_r22' into oreo-x86

Android 8.1.0 release 22

6 years agoMerge cherrypicks of [3782287, 3782954, 3783025, 3783026, 3783027, 3783028, 3783029...
android-build-team Robot [Thu, 22 Mar 2018 20:42:47 +0000 (20:42 +0000)]
Merge cherrypicks of [3782287378295437830253783026378302737830283783029378303037831643783165378316737831683783170378317137831723782288378303137821963782955] into oc-m4-release

Change-Id: I6f635dc6b30831b46d040ca15149692f851fbb47

6 years agofix crash due to no output format available -- DO NOT MERGE
Chong Zhang [Tue, 20 Mar 2018 20:37:22 +0000 (13:37 -0700)]
fix crash due to no output format available -- DO NOT MERGE

Output format should arrive before we get first frame, but if
it doesn't, better fail it than crash.

bug: 69924594
bug: 75978033
Change-Id: I057ba49c8f83b9a301d409510717039ad894c391
(cherry picked from commit 6cb243cd2bb4d2fb41d12394fe5731ba098fc2ef)

6 years agoHandle overflow in android::HeifDataSource::readAt
Sungtak Lee [Mon, 5 Mar 2018 23:21:33 +0000 (15:21 -0800)]
Handle overflow in android::HeifDataSource::readAt

Bug: 73782357
Change-Id: I03a5b4c5ddaf2664f342973da7f1a79f29cd7be5
(cherry picked from commit 237f9034c6cbe5cbafb0cd4c862d9dddfbdf7389)

6 years agobetter mpeg2 TS elementary stream Access Unit parsing
Ray Essick [Tue, 6 Mar 2018 23:55:29 +0000 (15:55 -0800)]
better mpeg2 TS elementary stream Access Unit parsing

mpeg2 es stream access units have a 3 byte prefix and a 1 byte start
code. Searching for the next access unit started after the prefix
instead of after the start byte.

Bug: 74114680
Test: ran POC before/after
(cherry picked from commit 371066d073c5db289b0f38b9d2bfd3e326c78c66)

Change-Id: I1d3190550db6d921cb5ea4907300125bb9dfba12

6 years agoHandle bad bitrate index in mp3dec.
Dongwon Kang [Fri, 23 Feb 2018 16:59:27 +0000 (08:59 -0800)]
Handle bad bitrate index in mp3dec.

Reference:
  https://www.mp3-tech.org/programmer/frame_header.html

Test: run poc with and without this patch.
Bug: 71868329
Change-Id: Ibf6196eba0b99459e84989ac8c13db57c816c572
(cherry picked from commit 8b638123760bd93958f6cc2f5c7c4f5dbd0a754a)

6 years agoheif: use width and height for decoder -- DO NOT MERGE
Chong Zhang [Tue, 27 Feb 2018 20:43:06 +0000 (12:43 -0800)]
heif: use width and height for decoder -- DO NOT MERGE

The display dimensions from MPEG4Extractor is applied on top
of width and height for scaling, it's not for cropping. For
bitmap uses we have to use width and height, the frame from
media server is not scaled.

This required porting over some fixes from master to fix the
display size vs. image size reporting, otherwise images with
grids may show a black border at the bottom or right.

bug: 73172046
Test: test app in bug; open folders with heif files in Photos
and Downloads; CTS MediaMetadataRetrieverTest.
Change-Id: I3d7f1492d08d48876836ccc05b6eb4de0d0c0f9a
(cherry picked from commit 49d4aa0a7407ea6632c4a3441c7a4d922d003ea5)

6 years agoSnap for 4657601 from 18cd9b58775e53b2ec1ffe571d165ad8fddfeff4 to oc-m4-release
android-build-team Robot [Wed, 21 Mar 2018 21:27:10 +0000 (21:27 +0000)]
Snap for 4657601 from 18cd9b58775e53b2ec1ffe571d165ad8fddfeff4 to oc-m4-release

Change-Id: I0c31b784dd0d395de8f9b6c0327b4b44b87f8ce3

6 years agoHandle overflow in android::HeifDataSource::readAt
Sungtak Lee [Mon, 5 Mar 2018 23:21:33 +0000 (15:21 -0800)]
Handle overflow in android::HeifDataSource::readAt

Bug: 73782357
Change-Id: I03a5b4c5ddaf2664f342973da7f1a79f29cd7be5
(cherry picked from commit 237f9034c6cbe5cbafb0cd4c862d9dddfbdf7389)

6 years agobetter mpeg2 TS elementary stream Access Unit parsing
Ray Essick [Tue, 6 Mar 2018 23:55:29 +0000 (15:55 -0800)]
better mpeg2 TS elementary stream Access Unit parsing

mpeg2 es stream access units have a 3 byte prefix and a 1 byte start
code. Searching for the next access unit started after the prefix
instead of after the start byte.

Bug: 74114680
Test: ran POC before/after
(cherry picked from commit 371066d073c5db289b0f38b9d2bfd3e326c78c66)

6 years agoheif: use width and height for decoder -- DO NOT MERGE
Chong Zhang [Tue, 27 Feb 2018 20:43:06 +0000 (12:43 -0800)]
heif: use width and height for decoder -- DO NOT MERGE

The display dimensions from MPEG4Extractor is applied on top
of width and height for scaling, it's not for cropping. For
bitmap uses we have to use width and height, the frame from
media server is not scaled.

This required porting over some fixes from master to fix the
display size vs. image size reporting, otherwise images with
grids may show a black border at the bottom or right.

bug: 73172046
Test: test app in bug; open folders with heif files in Photos
and Downloads; CTS MediaMetadataRetrieverTest.
Change-Id: I3d7f1492d08d48876836ccc05b6eb4de0d0c0f9a

(cherry picked from commit 49d4aa0a7407ea6632c4a3441c7a4d922d003ea5)

6 years agoHandle bad bitrate index in mp3dec.
Dongwon Kang [Fri, 23 Feb 2018 16:59:27 +0000 (08:59 -0800)]
Handle bad bitrate index in mp3dec.

Reference:
  https://www.mp3-tech.org/programmer/frame_header.html

Test: run poc with and without this patch.
Bug: 71868329
Change-Id: Ibf6196eba0b99459e84989ac8c13db57c816c572
(cherry picked from commit 8b638123760bd93958f6cc2f5c7c4f5dbd0a754a)

6 years agoSnap for 4603989 from 87d12ea5e997a12c9edd5139082aec0feacacb27 to oc-m2-release
android-build-team Robot [Thu, 15 Mar 2018 16:59:37 +0000 (16:59 +0000)]
Snap for 4603989 from 87d12ea5e997a12c9edd5139082aec0feacacb27 to oc-m2-release

Change-Id: I3b178a779a03034cb0b2863d64134524bfc2b412

6 years agoMerge tag 'android-8.1.0_r18' into oreo-x86
Chih-Wei Huang [Wed, 7 Mar 2018 08:39:55 +0000 (16:39 +0800)]
Merge tag 'android-8.1.0_r18' into oreo-x86

Android 8.1.0 Release 18 (OPM5.171019.017)

6 years agoM3UParser: detect variant streams without EXT-X-STREAM-INF
Robert Shih [Fri, 9 Feb 2018 20:19:35 +0000 (12:19 -0800)]
M3UParser: detect variant streams without EXT-X-STREAM-INF

Bug: 68399439
Change-Id: I95207b40f23a5f927da7154f9a952046118b5cad
(cherry picked from commit f3e0afb82f104d6e9986779ba2cf548c6aab1092)

6 years agoCheck NAL size before looking inside
Ray Essick [Tue, 6 Feb 2018 19:25:31 +0000 (11:25 -0800)]
Check NAL size before looking inside

Add a check to ensure we have a non-zero size for a NAL while
parsing before we crack said NAL open to see what type it is.

Bug: 72117051
Test: compilation
Change-Id: Iaa3ebb2daae5d9225060a11e9adbb6757a168656
Merged-In: I607c67a320b33b991476db30d78223cf4386c0e8
(cherry picked from commit e0c020969d88891b0b71bb938778e9ca762e8035)

6 years agoMerge cherrypicks of [3661626, 3661980, 3662429, 3661545, 3661546, 3661579, 3661580...
android-build-team Robot [Mon, 26 Feb 2018 23:53:13 +0000 (23:53 +0000)]
Merge cherrypicks of [36616263661980366242936615453661546366157936615803662430366154736615483661549366155036625783662579366258036625813662582366258336615973661598366155136615523661553366155436615553662596366259736625983662599366258436625853662586366261636626173662618] into oc-m4-release

Change-Id: Ica7cfbd0adc314077bf1eb2d6c405cc0857a3f7e

6 years agoM3UParser: detect variant streams without EXT-X-STREAM-INF
Robert Shih [Fri, 9 Feb 2018 20:19:35 +0000 (12:19 -0800)]
M3UParser: detect variant streams without EXT-X-STREAM-INF

Bug: 68399439
Change-Id: I95207b40f23a5f927da7154f9a952046118b5cad
(cherry picked from commit f3e0afb82f104d6e9986779ba2cf548c6aab1092)

6 years agoRefactor MediaPlayerBase's notify
Pawin Vongmasa [Sun, 17 Dec 2017 10:31:18 +0000 (02:31 -0800)]
Refactor MediaPlayerBase's notify

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Change-Id: Ia3a8eb99c2faf6935c63800ba08f65970cede48e
(cherry picked from commit 082e4f75a383f957a6ed9186ca0692b694e1ce45)

6 years agoCheck NAL size before looking inside
Ray Essick [Tue, 6 Feb 2018 19:25:31 +0000 (11:25 -0800)]
Check NAL size before looking inside

Add a check to ensure we have a non-zero size for a NAL while
parsing before we crack said NAL open to see what type it is.

Bug: 72117051
Test: compilation
Change-Id: Iaa3ebb2daae5d9225060a11e9adbb6757a168656
Merged-In: I607c67a320b33b991476db30d78223cf4386c0e8
(cherry picked from commit e0c020969d88891b0b71bb938778e9ca762e8035)

6 years agoPrevent MediaPlayerService::Client's use-after-free
Pawin Vongmasa [Tue, 12 Dec 2017 09:56:40 +0000 (01:56 -0800)]
Prevent MediaPlayerService::Client's use-after-free

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Merged-In: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
Change-Id: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
(cherry picked from commit d27ad6bae3215db0ed174f5f036339c9515fbba7)
(cherry picked from commit 028cf0973f928503e89124c3f6493a5226826ed9)

6 years agoSnap for 4565141 from 72f790b906d5e45215df0c00fd897ac084841b00 to oc-m4-release
android-build-team Robot [Mon, 26 Feb 2018 18:05:53 +0000 (18:05 +0000)]
Snap for 4565141 from 72f790b906d5e45215df0c00fd897ac084841b00 to oc-m4-release

Change-Id: Ib1d6b1b1232c98be9316d170a93b033fd173be8f

6 years agoMerge cherrypicks of [3654171] into oc-m5-release
android-build-team Robot [Fri, 23 Feb 2018 21:15:57 +0000 (21:15 +0000)]
Merge cherrypicks of [3654171] into oc-m5-release

Change-Id: I175b50cba5eb73028ec205f4ca9abacef63fcd80

6 years agoRevert "libmedia: Fix null pointer crash in secure buffer allocation."
Adam Seaton [Fri, 23 Feb 2018 18:38:59 +0000 (18:38 +0000)]
Revert "libmedia: Fix null pointer crash in secure buffer allocation."

This reverts commit ddd508e96da76a3e2de3d8dfef16e4d0d07fbf9b.

Change-Id: I68ed440fe9ea775fe30683b85e618dff68e4766d
(cherry picked from commit 4b84f2fc1e7643d8bc223f0eba0db8f06be2e6b2)

6 years agoMerge cherrypicks of [3628718, 3628929, 3628848, 3628813, 3628719, 3628980, 3628930...
android-build-team Robot [Fri, 16 Feb 2018 22:52:08 +0000 (22:52 +0000)]
Merge cherrypicks of [362871836289293628848362881336287193628980362893036289313628903362875936290003629001362900236290033629040362904136290423629043362904436290453628974362902236289813628849362893236289333628934362893536289363628937362893836289393629060362898236289833628984] into oc-m5-release

Change-Id: Ifefabec023c77c6df44f0a54180d55572a0faa5c

6 years agoM3UParser: detect variant streams without EXT-X-STREAM-INF
Robert Shih [Fri, 9 Feb 2018 20:19:35 +0000 (12:19 -0800)]
M3UParser: detect variant streams without EXT-X-STREAM-INF

Bug: 68399439
Change-Id: I95207b40f23a5f927da7154f9a952046118b5cad
(cherry picked from commit f3e0afb82f104d6e9986779ba2cf548c6aab1092)

6 years agoRefactor MediaPlayerBase's notify
Pawin Vongmasa [Sun, 17 Dec 2017 10:31:18 +0000 (02:31 -0800)]
Refactor MediaPlayerBase's notify

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Change-Id: Ia3a8eb99c2faf6935c63800ba08f65970cede48e
(cherry picked from commit 082e4f75a383f957a6ed9186ca0692b694e1ce45)

6 years agolibmedia: Fix null pointer crash in secure buffer allocation.
Santhosh Behara [Mon, 16 Oct 2017 11:53:54 +0000 (17:23 +0530)]
libmedia: Fix null pointer crash in secure buffer allocation.

Add null pointer check for native_handle as it is null if
secure memory allocation fails.

Author: Vasantha Balla<vballa@codeaurora.org>

Test: fix the bug
Bug: 71053053
Merged-In: I204ca69b9808448788c83a1ae5a642618eca8973
Change-Id: I204ca69b9808448788c83a1ae5a642618eca8973
(cherry picked from commit fad26c14c7e68c3fe40bda8fd5692b8dbfac1000)
(cherry picked from commit ddd508e96da76a3e2de3d8dfef16e4d0d07fbf9b)

6 years agoCheck NAL size before looking inside
Ray Essick [Tue, 6 Feb 2018 19:25:31 +0000 (11:25 -0800)]
Check NAL size before looking inside

Add a check to ensure we have a non-zero size for a NAL while
parsing before we crack said NAL open to see what type it is.

Bug: 72117051
Test: compilation
Change-Id: Iaa3ebb2daae5d9225060a11e9adbb6757a168656
Merged-In: I607c67a320b33b991476db30d78223cf4386c0e8
(cherry picked from commit e0c020969d88891b0b71bb938778e9ca762e8035)

6 years agoPrevent MediaPlayerService::Client's use-after-free
Pawin Vongmasa [Tue, 12 Dec 2017 09:56:40 +0000 (01:56 -0800)]
Prevent MediaPlayerService::Client's use-after-free

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Merged-In: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
Change-Id: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
(cherry picked from commit d27ad6bae3215db0ed174f5f036339c9515fbba7)
(cherry picked from commit 028cf0973f928503e89124c3f6493a5226826ed9)

6 years agoMerge cherrypicks of [3614756, 3614757, 3614861, 3614758, 3614759, 3615200, 3615201...
android-build-team Robot [Wed, 14 Feb 2018 17:18:19 +0000 (17:18 +0000)]
Merge cherrypicks of [36147563614757361486136147583614759361520036152013615202361520336152043614670361467136151083615109] into oc-mr1-release

Change-Id: I6a648f5e33bb4046978e2724cbc2da045247774f

6 years agoM3UParser: detect variant streams without EXT-X-STREAM-INF
Robert Shih [Fri, 9 Feb 2018 20:19:35 +0000 (12:19 -0800)]
M3UParser: detect variant streams without EXT-X-STREAM-INF

Bug: 68399439
Change-Id: I95207b40f23a5f927da7154f9a952046118b5cad
(cherry picked from commit f3e0afb82f104d6e9986779ba2cf548c6aab1092)

6 years agoPrevent MediaPlayerService::Client's use-after-free
Pawin Vongmasa [Tue, 12 Dec 2017 09:56:40 +0000 (01:56 -0800)]
Prevent MediaPlayerService::Client's use-after-free

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Merged-In: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
Change-Id: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
(cherry picked from commit d27ad6bae3215db0ed174f5f036339c9515fbba7)
(cherry picked from commit 028cf0973f928503e89124c3f6493a5226826ed9)

6 years agoRefactor MediaPlayerBase's notify
Pawin Vongmasa [Sun, 17 Dec 2017 10:31:18 +0000 (02:31 -0800)]
Refactor MediaPlayerBase's notify

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Change-Id: Ia3a8eb99c2faf6935c63800ba08f65970cede48e
(cherry picked from commit 082e4f75a383f957a6ed9186ca0692b694e1ce45)

6 years agoPrevent MediaPlayerService::Client's use-after-free
Pawin Vongmasa [Tue, 12 Dec 2017 09:56:40 +0000 (01:56 -0800)]
Prevent MediaPlayerService::Client's use-after-free

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 70546581
Merged-In: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
Change-Id: Ia142a7735c6685eb67b2c00917c0ed5ea7e0da9e
(cherry picked from commit d27ad6bae3215db0ed174f5f036339c9515fbba7)
(cherry picked from commit 028cf0973f928503e89124c3f6493a5226826ed9)

6 years agoMerge cherrypicks of [3581037, 3581038, 3580473, 3580624, 3580656, 3580657, 3580658...
android-build-team Robot [Thu, 8 Feb 2018 04:16:49 +0000 (04:16 +0000)]
Merge cherrypicks of [358103735810383580473358062435806563580657358065835803823580474358047535810393581040358047635802063581527358095535809563580957358095835809593580960358096135809623580963358096435809653580966358156735815683581569358157035815713580625358062635815873581513358151435815153580477358158835806593580660358038335803843580478358071935804793580480358138535815283581041358104235810433581044358104535810463581607358038535804813580482358048335806613580662358066335806643580665358048435804853581608358160935816103581611358161235815893581613358048635815193581627358162835815293581530358153135816293581630] into oc-mr1-release

Change-Id: I04f3b4a89e01913b77321b06b7605be6eb35532b

6 years agoCheck NAL size before looking inside
Ray Essick [Tue, 6 Feb 2018 19:25:31 +0000 (11:25 -0800)]
Check NAL size before looking inside

Add a check to ensure we have a non-zero size for a NAL while
parsing before we crack said NAL open to see what type it is.

Bug: 72117051
Test: compilation
Change-Id: Iaa3ebb2daae5d9225060a11e9adbb6757a168656
Merged-In: I607c67a320b33b991476db30d78223cf4386c0e8
(cherry picked from commit e0c020969d88891b0b71bb938778e9ca762e8035)

6 years agolibmedia: Fix null pointer crash in secure buffer allocation.
Santhosh Behara [Mon, 16 Oct 2017 11:53:54 +0000 (17:23 +0530)]
libmedia: Fix null pointer crash in secure buffer allocation.

Add null pointer check for native_handle as it is null if
secure memory allocation fails.

Author: Vasantha Balla<vballa@codeaurora.org>

Test: fix the bug
Bug: 71053053
Merged-In: I204ca69b9808448788c83a1ae5a642618eca8973
Change-Id: I204ca69b9808448788c83a1ae5a642618eca8973
(cherry picked from commit fad26c14c7e68c3fe40bda8fd5692b8dbfac1000)
(cherry picked from commit ddd508e96da76a3e2de3d8dfef16e4d0d07fbf9b)

6 years agoMerge cherrypicks of [3478238, 3478653, 3478239, 3478580, 3478612, 3478240, 3478654...
android-build-team Robot [Thu, 18 Jan 2018 22:44:57 +0000 (22:44 +0000)]
Merge cherrypicks of [347823834786533478239347858034786123478240347865434786553478656347949434794953478933347893434794963479497347949834781603478161347816234788763478877347887834782413478163347816434781653478166347816734781683478169347999034799913479992348001034800113480012] into oc-m2-release

Change-Id: I227f784a6fe35ba1a507ef003a13560a5cf13700

6 years agoFix use of uninitialized value in libmediadrm
Jeff Tinker [Fri, 12 Jan 2018 01:46:16 +0000 (17:46 -0800)]
Fix use of uninitialized value in libmediadrm

bug:70526702
test:gts media tests

Change-Id: I29a67dad01ca8c8f649ba12cf08cc86b7eb56523
(cherry picked from commit 2442047f5c6d368f69fa81917f5aabc9b3c342a0)

6 years agoAACExtractor: check bounds during seek
Robert Shih [Thu, 11 Jan 2018 22:38:23 +0000 (14:38 -0800)]
AACExtractor: check bounds during seek

Bug: 70239507
Test: stagefright -a poc.aac
Change-Id: I61225a04c76fe8855bd2591fb14b734099fa3be6
(cherry picked from commit 0790581021d89ae1d7242e5eb1197bfd12725c85)

6 years agoFix potential buffer overflow in mediadrmserver
Jeff Tinker [Thu, 11 Jan 2018 08:14:53 +0000 (00:14 -0800)]
Fix potential buffer overflow in mediadrmserver

bug:71389378
test: gts media tests

Change-Id: Ic7d4b456bc874b92fbe202e3dafb7ceac747ebc7
(cherry picked from commit 5231cc164fe040a3ab5fcb28baae4e0a4f9fdf4c)

6 years agoMerge cherrypicks of [3478016, 3477857, 3477909, 3478630, 3478631, 3478556, 3478557...
android-build-team Robot [Thu, 18 Jan 2018 19:43:11 +0000 (19:43 +0000)]
Merge cherrypicks of [34780163477857347790934786303478631347855634785573477761347776234777633478043347804434780453478441347844234784433478018347855834785593478560347856134785623478563347856434785653478566347856734785683478569] into oc-m5-release

Change-Id: Ie624e043e5440f75084a51e32fb59ce186ee689a

6 years agoFix use of uninitialized value in libmediadrm
Jeff Tinker [Fri, 12 Jan 2018 01:46:16 +0000 (17:46 -0800)]
Fix use of uninitialized value in libmediadrm

bug:70526702
test:gts media tests

Change-Id: I29a67dad01ca8c8f649ba12cf08cc86b7eb56523
(cherry picked from commit 2442047f5c6d368f69fa81917f5aabc9b3c342a0)

6 years agoAACExtractor: check bounds during seek
Robert Shih [Thu, 11 Jan 2018 22:38:23 +0000 (14:38 -0800)]
AACExtractor: check bounds during seek

Bug: 70239507
Test: stagefright -a poc.aac
Change-Id: I61225a04c76fe8855bd2591fb14b734099fa3be6
(cherry picked from commit 0790581021d89ae1d7242e5eb1197bfd12725c85)

6 years agoFix potential buffer overflow in mediadrmserver
Jeff Tinker [Thu, 11 Jan 2018 08:14:53 +0000 (00:14 -0800)]
Fix potential buffer overflow in mediadrmserver

bug:71389378
test: gts media tests

Change-Id: Ic7d4b456bc874b92fbe202e3dafb7ceac747ebc7
(cherry picked from commit 5231cc164fe040a3ab5fcb28baae4e0a4f9fdf4c)

6 years agoMerge cherrypicks of [3478311, 3478390, 3478133, 3478175, 3478391, 3478392, 3478393...
android-build-team Robot [Thu, 18 Jan 2018 19:09:13 +0000 (19:09 +0000)]
Merge cherrypicks of [3478311347839034781333478175347839134783923478393347813434781353478213347821434782153478233347823434782353478251347825234782533478254347839434783953478396347839734783983478399347840034784013478402347840334782923478293347831234781363477911] into oc-mr1-release

Change-Id: Id70027005744d19b11e7dfe10b6c92b92368e450

6 years agoFix use of uninitialized value in libmediadrm
Jeff Tinker [Fri, 12 Jan 2018 01:46:16 +0000 (17:46 -0800)]
Fix use of uninitialized value in libmediadrm

bug:70526702
test:gts media tests

Change-Id: I29a67dad01ca8c8f649ba12cf08cc86b7eb56523
(cherry picked from commit 2442047f5c6d368f69fa81917f5aabc9b3c342a0)

6 years agoAACExtractor: check bounds during seek
Robert Shih [Thu, 11 Jan 2018 22:38:23 +0000 (14:38 -0800)]
AACExtractor: check bounds during seek

Bug: 70239507
Test: stagefright -a poc.aac
Change-Id: I61225a04c76fe8855bd2591fb14b734099fa3be6
(cherry picked from commit 0790581021d89ae1d7242e5eb1197bfd12725c85)

6 years agoFix potential buffer overflow in mediadrmserver
Jeff Tinker [Thu, 11 Jan 2018 08:14:53 +0000 (00:14 -0800)]
Fix potential buffer overflow in mediadrmserver

bug:71389378
test: gts media tests

Change-Id: Ic7d4b456bc874b92fbe202e3dafb7ceac747ebc7
(cherry picked from commit 5231cc164fe040a3ab5fcb28baae4e0a4f9fdf4c)

6 years agoFix use of uninitialized value in libmediadrm
Jeff Tinker [Fri, 12 Jan 2018 01:46:16 +0000 (17:46 -0800)]
Fix use of uninitialized value in libmediadrm

bug:70526702
test:gts media tests

Change-Id: I29a67dad01ca8c8f649ba12cf08cc86b7eb56523
(cherry picked from commit 2442047f5c6d368f69fa81917f5aabc9b3c342a0)

6 years agoFix potential buffer overflow in mediadrmserver
Jeff Tinker [Thu, 11 Jan 2018 08:14:53 +0000 (00:14 -0800)]
Fix potential buffer overflow in mediadrmserver

bug:71389378
test: gts media tests

Change-Id: Ic7d4b456bc874b92fbe202e3dafb7ceac747ebc7
(cherry picked from commit 5231cc164fe040a3ab5fcb28baae4e0a4f9fdf4c)

6 years agoAACExtractor: check bounds during seek
Robert Shih [Thu, 11 Jan 2018 22:38:23 +0000 (14:38 -0800)]
AACExtractor: check bounds during seek

Bug: 70239507
Test: stagefright -a poc.aac
Change-Id: I61225a04c76fe8855bd2591fb14b734099fa3be6
(cherry picked from commit 0790581021d89ae1d7242e5eb1197bfd12725c85)

6 years agoSnap for 4527419 from 41c800b90de31114108a985e5d11ba94a45fcd78 to oc-m2-release
android-build-team Robot [Fri, 5 Jan 2018 18:59:19 +0000 (18:59 +0000)]
Snap for 4527419 from 41c800b90de31114108a985e5d11ba94a45fcd78 to oc-m2-release

Change-Id: Id75f7f95aa8dcd8870d3a4923ebae4bff874822d

6 years agoMerge cherrypicks of [3416661, 3417182, 3417738, 3417739, 3417758, 3417360, 3417361...
android-build-team Robot [Thu, 4 Jan 2018 19:32:17 +0000 (19:32 +0000)]
Merge cherrypicks of [3416661341718234177383417739341775834173603417361341736234173633416401341640234164033417778341779834166623416663341779934178003417364] into oc-m5-release

Change-Id: Ic4d0c2c480b7d12bf017357a6cceb5eada202a35

6 years agoApply input buffer validation also to AVC and MPEG4 encoders
Dongwon Kang [Tue, 21 Nov 2017 01:55:24 +0000 (17:55 -0800)]
Apply input buffer validation also to AVC and MPEG4 encoders

Input buffer validation is existing only on VPX encoders. This patch
applies the checking also to the other sw video encoders.

Bug: 69065651 Bug: 27569635
Test: run poc with and without the patch.
Test: pass post submit media CTS tests after disabling hw encoders.

Merged-In: I1358df64352577fd6d41cd4bfec18be37c98fe6f
Change-Id: I1358df64352577fd6d41cd4bfec18be37c98fe6f
(cherry picked from commit fed57366c58aa69ad8f1df5191d6bf48e58d86a8)

6 years agohttplive: check for malformed EXT-X-STREAM-INF
Robert Shih [Sat, 2 Dec 2017 00:12:08 +0000 (16:12 -0800)]
httplive: check for malformed EXT-X-STREAM-INF

Bug: 68342866
Test: adb shell am start -a android.intent.action.VIEW -d http://localhost:1137/index.html
Change-Id: I479f9e0b7ca828d048ef88b23b4948e3c1472b3c
(cherry picked from commit e3bd8dd81e51b4d02484e7eec0d725ba9c254c68)

6 years agoIAudioPolicyService: Add attribute tags sanitization
Kevin Rocard [Mon, 13 Nov 2017 19:15:27 +0000 (11:15 -0800)]
IAudioPolicyService: Add attribute tags sanitization

When audio_attributes_t was read from the binder parcel,
the string tags field was copied without checking that
it contained a '\0'.

This could lead to read past the end when tags were used.

This patch always adds a '\0' at the end of the buffer when
deserializing.

Bug: 68953950
Test: manual playback/record
Test: send binder payload without \0 in tags attribute, check that only
      AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 char are printed.
Change-Id: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Merged-In: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 39fdbd097a147b5c719dac9ad2759e6c44eb3a4e)

6 years agoSnap for 4485699 from 7bb7dfb72a0011f63063879df90ef67dece5c0c9 to oc-m2-release
android-build-team Robot [Wed, 3 Jan 2018 22:35:46 +0000 (22:35 +0000)]
Snap for 4485699 from 7bb7dfb72a0011f63063879df90ef67dece5c0c9 to oc-m2-release

Change-Id: I27928751484e794b4584ab4ad87068646923ad87

6 years agohttplive: check for malformed EXT-X-STREAM-INF
Robert Shih [Sat, 2 Dec 2017 00:12:08 +0000 (16:12 -0800)]
httplive: check for malformed EXT-X-STREAM-INF

Bug: 68342866
Test: adb shell am start -a android.intent.action.VIEW -d http://localhost:1137/index.html
Change-Id: I479f9e0b7ca828d048ef88b23b4948e3c1472b3c
(cherry picked from commit e3bd8dd81e51b4d02484e7eec0d725ba9c254c68)

6 years agoIAudioPolicyService: Add attribute tags sanitization
Kevin Rocard [Mon, 13 Nov 2017 19:15:27 +0000 (11:15 -0800)]
IAudioPolicyService: Add attribute tags sanitization

When audio_attributes_t was read from the binder parcel,
the string tags field was copied without checking that
it contained a '\0'.

This could lead to read past the end when tags were used.

This patch always adds a '\0' at the end of the buffer when
deserializing.

Bug: 68953950
Test: manual playback/record
Test: send binder payload without \0 in tags attribute, check that only
      AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 char are printed.
Change-Id: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Merged-In: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 39fdbd097a147b5c719dac9ad2759e6c44eb3a4e)

6 years agoApply input buffer validation also to AVC and MPEG4 encoders
Dongwon Kang [Tue, 21 Nov 2017 01:55:24 +0000 (17:55 -0800)]
Apply input buffer validation also to AVC and MPEG4 encoders

Input buffer validation is existing only on VPX encoders. This patch
applies the checking also to the other sw video encoders.

Bug: 69065651 Bug: 27569635
Test: run poc with and without the patch.
Test: pass post submit media CTS tests after disabling hw encoders.

Merged-In: I1358df64352577fd6d41cd4bfec18be37c98fe6f
Change-Id: I1358df64352577fd6d41cd4bfec18be37c98fe6f
(cherry picked from commit fed57366c58aa69ad8f1df5191d6bf48e58d86a8)

6 years agoMerge cherrypicks of [3365569, 3365570, 3366860, 3366878, 3365571, 3365572, 3366918...
android-build-team Robot [Thu, 14 Dec 2017 21:23:21 +0000 (21:23 +0000)]
Merge cherrypicks of [336556933655703366860336687833655713365572336691833655733365589336559033669383366902336557433655753365576336557733669583365824336559133669593366960336696133669623366963336696433669653366919336696633669673366968336696933669703367018336701933655923365593336698533658253366988336698933669903366991336699233669933366994336700433670053367006336700733670083367009336701033670113367012336701333670143367015336701633670173367038336703933670403367041336704233670443367045336704633670493367050336705233670533367054336705533670563366920336692133669223367079] into oc-mr1-release

Change-Id: I7466a52ccba8f87d545545ac8ede0214ae05f50e

6 years agoDO NOT MERGE : Always set sys.usb.ffs.mtp.ready during configure
Jerry Zhang [Mon, 23 Oct 2017 19:03:40 +0000 (12:03 -0700)]
DO NOT MERGE : Always set sys.usb.ffs.mtp.ready during configure

Sometimes, due to a race, the configure
will fail even though descriptors are actually
written because MtpServer did not die properly.
MtpServer lifetime is fixed properly in master
with multiplexed io, but to work around the
issue here, we set the property at all times.

Also reduce the timeout to leave room for
UsbDeviceManager.

Bug: 67844294
Test: Plug/replug device on sled with usb debugging off x50
Test: Verify that the race is hit, but projection still starts
Test: Verify that all other usb configurations still work
Change-Id: I39dd4d3db95e087f065d58ba80ca980559920c99
(cherry picked from commit 9dc10038b05cc59457ba0a10d90a3b3faddd34c3)

6 years agoApply input buffer validation also to AVC and MPEG4 encoders
Dongwon Kang [Tue, 21 Nov 2017 01:55:24 +0000 (17:55 -0800)]
Apply input buffer validation also to AVC and MPEG4 encoders

Input buffer validation is existing only on VPX encoders. This patch
applies the checking also to the other sw video encoders.

Bug: 69065651 Bug: 27569635
Test: run poc with and without the patch.
Test: pass post submit media CTS tests after disabling hw encoders.

Merged-In: I1358df64352577fd6d41cd4bfec18be37c98fe6f
Change-Id: I1358df64352577fd6d41cd4bfec18be37c98fe6f
(cherry picked from commit fed57366c58aa69ad8f1df5191d6bf48e58d86a8)

6 years agohttplive: check for malformed EXT-X-STREAM-INF
Robert Shih [Sat, 2 Dec 2017 00:12:08 +0000 (16:12 -0800)]
httplive: check for malformed EXT-X-STREAM-INF

Bug: 68342866
Test: adb shell am start -a android.intent.action.VIEW -d http://localhost:1137/index.html
Change-Id: I479f9e0b7ca828d048ef88b23b4948e3c1472b3c
(cherry picked from commit e3bd8dd81e51b4d02484e7eec0d725ba9c254c68)

6 years agocamera: Drop pending preview for enableZsl shots
Chien-Yu Chen [Mon, 23 Oct 2017 22:59:49 +0000 (15:59 -0700)]
camera: Drop pending preview for enableZsl shots

If the device support ZSL, drop pending preview buffers to reduce
the chance the rendering preview frames newer than the still frame
during takePicture().

Test: CTS
Bug: 67497723
Change-Id: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
Merged-In: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
(cherry picked from commit 63068520622543b57c8607612a4f44fbbef6a021)

6 years agoIAudioPolicyService: Add attribute tags sanitization
Kevin Rocard [Mon, 13 Nov 2017 19:15:27 +0000 (11:15 -0800)]
IAudioPolicyService: Add attribute tags sanitization

When audio_attributes_t was read from the binder parcel,
the string tags field was copied without checking that
it contained a '\0'.

This could lead to read past the end when tags were used.

This patch always adds a '\0' at the end of the buffer when
deserializing.

Bug: 68953950
Test: manual playback/record
Test: send binder payload without \0 in tags attribute, check that only
      AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 char are printed.
Change-Id: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Merged-In: I285258cbf7cfaf26b191d1f31b3b1e2d724c4934
Signed-off-by: Kevin Rocard <krocard@google.com>
(cherry picked from commit 39fdbd097a147b5c719dac9ad2759e6c44eb3a4e)

6 years agonuplayer: skip bad SAR values
Chih-Wei Huang [Tue, 15 Aug 2017 04:45:48 +0000 (12:45 +0800)]
nuplayer: skip bad SAR values

Historically there are two definitions of SAR:

1. Storage Aspect Ratio
2. Sample Aspect Ratio

The first one is used in MPEG2 terminology, while the second is used
in MPEG4-AVC terminology.

The MPEG2 terminology actually means the real frame dimension (w:h),
while the MPEG4-AVC terminology means the shape of individual pixels.
It's called PAR (Pixel Aspect Ratio) in MPEG2 terminology.

Android apparently uses the second definition as comments in the code.
However, some video files include SAR tags in MPEG2 terminology sense.
For example,

08-14 18:13:45.212  2841  4769 I NuPlayer:   int32_t width = 856
08-14 18:13:45.212  2841  4769 I NuPlayer:   int32_t height = 480
08-14 18:13:45.212  2841  4769 I NuPlayer:   int32_t sar-width = 852
08-14 18:13:45.212  2841  4769 I NuPlayer:   int32_t sar-height = 480

That makes Android calculate the DAR (Display Aspect Ratio)
incorrectly, where DAR = FAR (Frame Aspect Ratio) x SAR.
As a result the video is stretched strangely.

To workaround it, skip the SAR tags if they look like the
Storage Aspect Ratio.

6 years agomedia: enable dithering for RGB565 conversion
Chih-Wei Huang [Thu, 1 Jun 2017 04:00:10 +0000 (12:00 +0800)]
media: enable dithering for RGB565 conversion

This seems to improve video playback quality.

Inspired by a patch from WuZhen.

6 years agoAllow screenrecord usage on Android-x86
Paulo Sergio Travaglia [Sun, 17 Jan 2016 17:23:06 +0000 (15:23 -0200)]
Allow screenrecord usage on Android-x86

Selects a supported color format for screenrecord (
OMX_COLOR_FormatYUV420Planar instead of OMX_COLOR_FormatAndroidOpaque)
and removes a check on SoftVideoEncoderOMXComponent.cpp
in order to make screenrecord work on Android-x86.

6 years agoDon't use YV12 color format for video decoding
Chih-Wei Huang [Sun, 22 Nov 2015 16:46:22 +0000 (00:46 +0800)]
Don't use YV12 color format for video decoding

YV12 is not supported by Mesa yet. This has to be reverted
when we can enable h/w decoder.

6 years agoCameraSource: set up right frame rate
Hua Wang [Fri, 18 Jan 2013 10:51:13 +0000 (18:51 +0800)]
CameraSource: set up right frame rate

If camera recorder uses HW codec, the capabilities of the codec
are from media_profile.xml; If using SW codec, it is invisible
to the applications, In other words, the applications won't be
able to use the codec or query the capabilities of the codec
at all, it only gives some ranges. StagefrightRecorder will
use default parameters to configure camera, as for framerate,
it should be from camera HAL feedback.

Issue:AXIA-1446
Change-Id: I77bf41239a19d26e2da1c28258288fdaa1c98297
Signed-off-by: Hua Wang <Hua.Wang@windriver.com>
6 years agoFLACExtractor: Add more sample rates support
Billy [Thu, 20 Dec 2012 03:02:55 +0000 (11:02 +0800)]
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>
6 years agoChange max width and height supported by H.263 decoder.
Daniel Charles [Wed, 9 May 2012 18:28:37 +0000 (11:28 -0700)]
Change max width and height supported by H.263 decoder.

Currently this is set to CIF PAL resolution (352x288) which
won't calculate the actual output buffer size for higher resolutions

The h.263 decoder needs the max width and height supported to be able
to decode

H.263 decoders supports: QCIF, CIF, D1 and 16CIF; all PAL.

Change-Id: If5e44c522cb3cb56bb6235ec2992e2544b1737e9
Original-Change-Id: I7f8d2ae4263925ac4cf9250404ef92fc819ca33a
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
6 years agoSW encode: Fix output buffer size
Robert Crabtree [Thu, 26 Jul 2012 00:53:12 +0000 (17:53 -0700)]
SW encode: Fix output buffer size

The output buffer size needs to be updated if the resolution is updated.
The output buffer was configured for QCIF resolution when the actual
resolution was VGA. Buffer overflow was resulting.

Change-Id: Ieca3943d8d67bfcfcf49fed95d17be712f4b14b5
Signed-off-by: Robert Crabtree <robertx.l.crabtree@intel.com>
6 years agoMerge cherrypicks of [3310659, 3311062, 3310913, 3310647, 3310648, 3310649, 3310650...
android-build-team Robot [Tue, 5 Dec 2017 01:14:46 +0000 (01:14 +0000)]
Merge cherrypicks of [331065933110623310913331064733106483310649331065033106513311172331060133111093311193331121333112143311215331121633112173311218331121933112203311221331122233112233311063331122533112523311253331125433112553311256331125833112593311261331126233112633311264331126533112673311268331126933112703311271331131233113133311315331131733113203311322] into oc-m4-release

Change-Id: I9889bdd57684e647f5e7df18d384084c0940edf1

6 years agocamera: Drop pending preview for enableZsl shots
Chien-Yu Chen [Mon, 23 Oct 2017 22:59:49 +0000 (15:59 -0700)]
camera: Drop pending preview for enableZsl shots

If the device support ZSL, drop pending preview buffers to reduce
the chance the rendering preview frames newer than the still frame
during takePicture().

Test: CTS
Bug: 67497723
Change-Id: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
Merged-In: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
(cherry picked from commit 63068520622543b57c8607612a4f44fbbef6a021)

6 years agoMerge cherrypicks of [3287457, 3287458, 3286978, 3286979, 3287477, 3287478, 3287479...
android-build-team Robot [Wed, 29 Nov 2017 18:11:39 +0000 (18:11 +0000)]
Merge cherrypicks of [328745732874583286978328697932874773287478328747932874803287517328751832875373287538328753932875403287481328748232874833287484328748532874863287487328748832873593287459328736032873613287362328736332873643287365328736632873673287489328749032874913287557328757732875583287492328749332875973287617328698032874603287494] into oc-m3-release

Change-Id: I79cfb316beb0cd222ae0c59068568e26328cb31a

6 years agoavoid 32-bit integer overflow
Ray Essick [Thu, 12 Oct 2017 17:15:31 +0000 (10:15 -0700)]
avoid 32-bit integer overflow

change calculation to scale encoder delay and padding when sample rate
changes to use 64-bit math and avoid possible 32-bit overflow.

Bug: 67737022
Test: re-ran affected use case
Change-Id: I6e37341256f3f0e3274ffdd3bad284eaacac25ab
(cherry picked from commit 73e95a9bd43724058651cb11c58dbe3fae651d56)
(cherry picked from commit e0d1b3816e73629029f552da5df31ef31bde2c19)