summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
Commit message (Collapse)AuthorAgeFilesLines
* Fix overflows in amrwbencMarco Nelissen2015-12-264-3/+34
| | | | | | | | | | | Revert 3cdaed88daeeebfe05e7913837f41c2d92f411cc and 883ff4f4c41ae9bf84d1912ab054fe38f7505dd0, and fix the overflows that should have been clamped instead of allowed to overflow. Bug: 25843966 Bug: 23752600 Change-Id: I9af1726d058eb8eeaa80fa8df74fe0a3759486c1
* stagefright: Fix audio profile retrievedKeith Mok2015-12-211-1/+1
| | | | | | | | | | | | | | | | The aac audio profile retrieved from the AACExtractor is ranged from 0-3. However the corresponding OMX header definition is from 1-4: typedef enum OMX_AUDIO_AACPROFILETYPE{ ... OMX_AUDIO_AACObjectMain = 1, OMX_AUDIO_AACObjectLC, OMX_AUDIO_AACObjectSSR, OMX_AUDIO_AACObjectLTP, ... Change-Id: I1c8932abe19bff918acd5e4d8c2e39eaaac4f6c3
* stagefright: Deal with output format of other AAC decodersSteve Kondik2015-12-211-4/+7
| | | | | | | * Pass the bits-per-sample value when setting up the raw PCM output in case FFMPEG is decoding as it will produce floats. Change-Id: If5a8cc43a1c41e522324e77871823c9084f92169
* stagefright: Fix AAC profile selectionSteve Kondik2015-12-202-28/+23
| | | | | | | | * Be consistent about AAC profile selection in both Stagefright an our custom plugin. * Also fix duplication in the override code. Change-Id: I9d2724ea8861bc9d7db6a100a2f633f81d243c6c
* frameworks/av: fix channelmask and source format for pcm filesAmit Shekhar2015-12-191-1/+1
| | | | | | | | | -Update channel mask from channel count if parser reports channel mask to be 0 -Update source format for each buffer by extending call to setPcmFormat when aggregation is not done Change-Id: I1f4ce07e3e784d85e63be03a69ac1395bfa913e2 CRs-Fixed: 948222
* Move overflow checks into SkipCutBufferMarco Nelissen2015-12-183-15/+32
| | | | | | | | | | | | Previously SkipCutBuffer would check its input parameters to ensure they were sane, however since bogus values might be the result of overflows, and overflow protection was recently turned on for libstagefright, the compiler's overflow checks were performed before SkipCutBuffer's, resulting in abort rather than just ignoring the bogus values. Moving the multiplication by framesize into SkipCutBuffer fixes this. Change-Id: I1ad6744bb045a5212701bbf6ee44eecb5f318210
* Fix potential double close in IMediaMetadataRetriever::setDataSourceTaiju Tsuiki2015-12-181-0/+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
* stagefright: Fix some aac file cannot be played backKeith Mok2015-12-172-4/+5
| | | | | | | | | The AACExtractor does not pass the aacprofile via kKeyAACAOT and google aac decoder does not support LTP profile. Solve by setting the kKeyAACAOT profile and use ffmpeg when it is aac LTP profile. Change-Id: I79762bd23e3bcc34f2ea56e35686162f1630c06b
* stagefright: Update makefile for Exynos variants.Ethan Chen2015-12-151-8/+9
| | | | Change-Id: I1f6a2797156eba00e8f4cc1a5728b8e274ce965f
* stagefright: Additional fixes for extended offload supportSteve Kondik2015-12-144-1/+9
| | | | | | | | | | | * Fix compilation with debug enabled * Allow FLAC offload to be enabled independent of QCOM_HARDWARE, tested with the Nexus 5X and is working! * Disable the FLACExtractor if offload is enabled since it can only output decoded PCM. This will force FFMPEG to be used, which does everything we need for FLAC offload Change-Id: I7d71c153a6a6ea7df8e32bc73f5cbe9f51cdcf64
* stagefright: Finish "Port AOSP fixes"Steve Kondik2015-12-131-1/+1
| | | | | | * Fill in stubs for CAF commit bd019775a921ae9165e924e4d37bc838a7ef5781 Change-Id: Ia97d965d121aa3c3c2fc0ab8b164244416852ca5
* stagefright: Finish support for HEVC muxingSteve Kondik2015-12-131-1/+1
| | | | | | * Forward-port CAF L-MR1 code to fill in stubs. Change-Id: I6c07e803ad4fe3ef5286f61667b5ca11380db984
* stagefright: Add support for FLAC offloadingSteve Kondik2015-12-132-2/+21
| | | | | | | * New Qualcomm DSPs support FLAC decoding, but the offload code is stubbed out in M. Unstub it from what used to be open source. Change-Id: I03c129c42ebc6909a3392e42a7f96791c8fabd28
* stagefright: Fix a few format strings on 64-bitSteve Kondik2015-12-131-1/+2
| | | | Change-Id: I25708df616fe53d709b80c65ddecbdddef303124
* StagefrightRecorder: Add support for WAVE recordingMichael Bestas2015-12-122-0/+324
| | | | | | * Forward port the cm-12.1 code Change-Id: I77373a236108507b8fa76cc8d3016de36aade301
* stagefright: Fix videot thumbnail retrival for wmvKeith Mok2015-12-092-0/+44
| | | | | | | | | | | | | | We override some h/w decoders in video configure since we know some h/w decoder does not support certain types of video. e.g. WMV7/8. But we did not do that when application retrieving video frame for thumbnail causing video frame retrieved is corrupted. Fix it by calling FFMPEGSoftCodec::overrideComponentName when we retrieve a single video frame for thumbnail purpose. Change-Id: I334698c331dfd3d49bb5d8b8e9c1fe381b304179
* stagefright: Override to use ffmpeg for decoding wmv1Keith Mok2015-12-091-1/+1
| | | | | | | | | | Qcom hardware vc1 decoder cannot decode wmv1 (version7) correctly. Currently it only skip wmv2 (version8) and force to use ffmpeg sw decoder. Change to use default decoder only if wmv version is equals to 9 (vc1) Change-Id: Iadb0ecca252ee8a1dfb635ee44d1a88daa9c7a54
* libstagefright: Fix for testExceptionManikanta Kanamarlapudi2015-12-091-9/+13
| | | | | | | | Handled decoder configure call for encoder component and vice-versa in fallback logic CRs-Fixed: 891538 Change-Id: Ibb0d2da829a0e0f907ad8265836bac0466de1b4d
* stagefright: Add OMX.ffmpeg. checkingKeith Mok2015-12-073-2/+4
| | | | | | | Port from L, add "OMX.ffmpeg." checking in additional to "OMX.google." for software codec Change-Id: I3ef70a965573d7c2818236a70d4f99b6b7873468
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-076-251/+158
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 3 Change-Id: I2f2a1fe1b58c828e8341556996211562d6e195ab
| * ALooper::awaitResponse gets reply and returns immediately if the looper is ↵Ronghua Wu2015-11-021-16/+4
| | | | | | | | | | | | | | stopped. Bug: 25088488 Change-Id: Id33d5d75f1173db52d00f4ff71d4c2c4f27f72f5
| * Merge "Allow ALooper::awaitResponse to return immediately if the looper is ↵Ronghua Wu2015-10-222-3/+30
| |\ | | | | | | | | | stopped." into mnc-dr-dev
| | * Allow ALooper::awaitResponse to return immediately if the looper is stopped.Ronghua Wu2015-10-222-3/+30
| | | | | | | | | | | | | | | Bug: 25088488 Change-Id: I63e69886a8e9cffcaad675ca1a5642c0abf3b466
| * | Fix offset adjustment when skipping off-spec meta chunkMarco Nelissen2015-10-221-3/+3
| |/ | | | | | | | | Bug: 25172843 Change-Id: Ibbfe4369176f2a367eab5a39fd742f425b017288
| * Reconcile with master after mass cherrypicksMarco Nelissen2015-10-161-0/+1
| | | | | | | | Change-Id: I74649c9771212aa6309ea16c253723994b8e3622
| * Merge "SoftAVCDec: Exit gracefully when memory allocation fails in the ↵Marco Nelissen2015-10-161-0/+11
| |\ | | | | | | | | | decoder" into mnc-dr-dev
| | * SoftAVCDec: Exit gracefully when memory allocation fails in the decoderHarish Mahendrakar2015-10-161-0/+11
| | | | | | | | | | | | Change-Id: Ib6e16be3f128e4fc97f8f05b794da980341c81cc
| * | Merge "SoftAVCDec: Added a check for unsupported resolutions" into mnc-dr-devMarco Nelissen2015-10-161-0/+11
| |\ \ | | |/
| | * SoftAVCDec: Added a check for unsupported resolutionsHarish Mahendrakar2015-10-161-0/+11
| | | | | | | | | | | | | | | | | | Bug: 24542936 Change-Id: I97203353c7d026e02c8aad0f2c820a641e453c7c
| * | SoftHEVCDec: Reduced memory requirementsHarish Mahendrakar2015-10-162-248/+98
| |/ | | | | | | Change-Id: I8b5205dd8a149a02f78fb55fc3121daf4e69791a
| * SoftMPEG2Dec: Added support for deinterlacerHarish Mahendrakar2015-10-161-1/+2
| | | | | | | | | | | | Bug: 20932810 Change-Id: I16eadda6f26e73ed89c878d52c38bb43d84bfe40
| * Merge "libstagefright: don't reclaim codec when there's buffer owned by ↵Ronghua Wu2015-10-131-1/+41
| |\ | | | | | | | | | client. Notify the client and try to reclaim again in 0.5s." into mnc-dr-dev
| | * libstagefright: don't reclaim codec when there's buffer ownedRonghua Wu2015-10-051-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | by client. Notify the client and try to reclaim again in 0.5s. Bug: 23703241 Bug: 23949540 Change-Id: I1afe50c71635645668bfb73ffa0d801765b5ae3c
* | | Cached reading of stsz atomDavid Williams2015-12-072-35/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The entire stsz atom needs to be checked, entry by entry, to determine the maximum size of a sample so that the proper buffer size can be allocated by the decoder. This change reads a block of entries at a time, cutting down the number of file reads and thus significantly increasing the performance of reading the entries. Change-Id: Ida39c2fe59bccb4440faeab1e71d8cf58682bcc3
* | | stagefright: Clear mNoMoreOutputData flag during seekingJia Meng2015-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | For some 3rd party players, stop won't be called when playing to the end. If seeking happens after that, we need to clear this flag to make it be ready for subsequence data flow. Change-Id: I9b2d18d03225420a45821ba7536cdc91d52b1312 CRs-Fixed: 755988
* | | mediascanner: handle DATE tagJorge Ruesga2015-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Allow passing DATE tag to MediaScanner in order to use it to retrieve the year, if YEAR tag isn't present (see http://review.cyanogenmod.org/#/c/101467) Change-Id: I928177e5473262a45b1041a58f381a00d67e2995 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* | | Fatal error while playing certain mkv files.Mazhar2015-12-072-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addTracks() function, the value of codecPrivateSize is zero for the certain mkv contents, which causes this fatal error. With this fix, error is returned whenever the value of codecPrivateSize is less than 2, to avoid the fatal error. Change-Id: I2f464deb7444d4c129aaa4d77bba35a3835bf7e1 Signed-off-by: gbhakteX <gurudattax.bhakte@intel.com> Signed-off-by: Mazhar <mazharx.sameullah@intel.com>
* | | libstagefright: squash exynos4 supportSimon Shields2015-12-084-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e41cc838b6212f8711c550522e8cefc95f003a67 Author: rINanDO <drjisakh@gmail.com> Date: Mon Aug 10 13:56:56 2015 +0200 stagefright: Exynos4 MPEG4 decoder should set native color format. Change-Id: I41bee77d48fc0b35691b94585de10269579ae789 commit a50263c53a1ecd0f75688f7042dd5e5d9badbc39 Author: Caio Schnepper <caioschnepper@gmail.com> Date: Wed Jun 10 22:26:07 2015 -0300 libstagefright: back off exynos4_enhancements HWC_HWOVERLAY usage The open source hwc doesn't support the GRALLOC_USAGE_HW_FIMC1 | GRALLOC_USAGE_HWC_HWOVERLAY combination. Removing HWC_HWOVERLAY allows FIMC1 to do decode/color conversion. Change-Id: Ibdfa9e5dd170e99e0d994540979e88e519931641 commit 63286a333bde1aa047de4e2fde8da1b59e42a16d Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org> Date: Sun Nov 3 02:45:19 2013 +0000 exynos4: libstragefright: add support for samsung colorformat/omx/mfc Source: http://git.insignal.co.kr/samsung/exynos/android/platform/frameworks/av/commit/?h=exynos-jb&id=1614612f7ca2a00473d202dbedcb135fadc608ad Conflicts: media/libstagefright/ACodec.cpp media/libstagefright/OMXCodec.cpp cherry pick from 906eba9f Change-Id: I1c174f8e9fa9bd3ed16a0399f070b6680f6a331c Change-Id: I47f5b09b37ea5376a45c80c9dd91a7fbd0c3361a
* | | stagefright: Fix Divx version keyKeith Mok2015-12-041-37/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | If mime type is MEDIA_MIMETYPE_VIDEO_DIVX4 or MEDIA_MIMETYPE_VIDEO_DIVX311, the qcom specific portion of code is skipped, since err = BAD_TYPE. Fix it by checking mimetype div4 and div311 before the qcom specific code. Change-Id: Id1a4f43541ef2b0f4d3ab84425965f30be17b7e4
* | | Fixed comparison on 64 bit systemKeith Mok2015-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixed comparison in setSampleToChunkParams which return false since SIZE_MAX in 64 bit system is 18446744073709551615, but off64_t is signed. Change-Id: Idba6b94e2dbdcc34ced98a5f926f1b5e0b6cf5cb
* | | stagefright: Fix build breaksKeith Mok2015-12-021-2/+2
| | | | | | | | | | | | | | | | | | Fix build breaks on non QCOM_HARDWARE device Change-Id: I4671fa21cc7836172d356a83381dc80ee6b18f03
* | | stagefright: More HW codec support w/ FFMPEGExtractorSteve Kondik2015-12-021-0/+51
| | | | | | | | | | | | | | | | | | * Support QC DiVX codec Change-Id: I5591b4544a8f92a7cc309b45a8de009f572217b7
* | | Handle error result from DrmManagerClient correctlyPatrik Lindgren2015-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | readAtDRM() must handle the case when DrmManagerClient::pread() returns an error (-1) correctly. This is a degrade in Android L. Change-Id: Id7ff124d178e26931dddac5ac73697cfe6da501c
* | | Handle malformed audio packets received during RTSP stream switchingSunil Shah2015-12-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During RTSP stream switching (for example channel switching in a Mobile TV application) we occasionally receive packets that don't contain valid data, so we cannot remove LATM framing (as per the MPEG4 Audio Assembler). This fix allows the frame remover to exit gracefully (instead of crashing), when such frames are encountered, and as a consequence, Mobile TV apps can change channels properly. Change-Id: Ie4c3d2766c87b43f31624192de96bc47180ca514
* | | stagefright: Fix fallback mechanism to SW decoderKeith Mok2015-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fallback mediaserver to SW decoder breaks with commit eeb8a90192cee627890a74f75a0c64145fbc34f4 Since the err parameters is overrided in a local loop. And even an alternative decoder is configureCodec sucessfully, the outer loop err parameters is still != OK and return false. Change-Id: Id5a9e570e5f55f28a80d7cd25a2a14d59442f3e2
* | | stagefright: handleSetSurface: Don't dereference null graphic buffersDiogo Ferreira2015-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In metadata mode and when buffers are owned by the native window , it is possible that the graphics buffer is null. This is fine since we don't have to attach it to a surface. However, the logging was trying to dereference this graphic buffer which caused media to crash sporadically. This fixes the flakiness in android.media.cts.MediaPlayerTest#testVideoSurfaceResetting Change-Id: I89f30ca1177d7118da5a7b0ffbbb91370f9b54ab
* | | stagefright: Fix cts testGetMaxSupportedInstancesKeith Mok2015-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix cts testGetMaxSupportedInstances on 64 bits system. In FFMPEGSoftCodec.cpp, it tries to get OMX parameter in function setRawAudioFormat by calling: OMX_PARAM_PORTDEFINITIONTYPE def; ... status_t err = OMXhandle->getParameter( nodeID, OMX_IndexParamPortDefinition, &def, sizeof(def)); However, this code runs in 64 bits, and mediaserver is running in 32 bits. sizeof(OMX_PARAM_PORTDEFINITIONTYPE) is equals to 112 vs 96 in 32 bits mode, since sizeof(OMX_PTR) are different. In SimpleSoftOMXComponent::internalGetParameter which runs in 32 bits mode, it checks defParams->nSize != sizeof(OMX_PARAM_PORTDEFINITIONTYPE) and fails. Declaring OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS in FFMPEGSoftCodec.cpp solves it. Change-Id: Ieb5a548c580e87c964c66f0b0d6ce8bb14dac690
* | | ffmpeg: flac: Assume 16 bits per sample if not setDiogo Ferreira2015-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes android.media.cts.MediaCodecCapabilitiesTest#testGetMaxSupportedInstances Change-Id: I52222fd739c413ddd9c925796dc7adabef1b375a
* | | Fix for getPosition after seekWang Liyong2015-11-301-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When starting playback with a seek pending (calling seek before start) there is a brief period when the audioplayer returns an incorrect position (zero) This is caused by that mSeeking is set to false before the position in the audioplayer actually is updated. Change-Id: Iaec355c8fdfe589d9b826d20c2531034f2b4e6fb
* | | Correct the time returned by AudioPlayer::getMediaTimeBertil Akesson2015-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change 80a68deec52c9a1b47215ed68526206ec88197f8 was added to eliminate returning negative media positions. In the change all negative values of realTimeOffset were discarded. The value realTimeOffset accounts for the latency and the number of samples played since last feeding the AudioTrack and is generally negative. By discarding this value for negative values the time returned does not account for latency or the number of samples played. Change-Id: I470450934228732e34539c227365a225be74ccc8