summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/FFMPEGSoftCodec.cpp
Commit message (Collapse)AuthorAgeFilesLines
* stagefright: Disable thumbnail mode for 8996-class devicesSteve Kondik2016-08-191-1/+7
| | | | | | | * The hardware is freezing when used for certain media types. Disable it until the issue is understood. Change-Id: Iaec2420b4f8d3ceacf2c6f72ab14db424092c96b
* stagefright: Fix cts issue with divx testKeith Mok2016-05-181-1/+2
| | | | | | | | | | | | | | | | 8909 is using soft-ip divx decoder using component name starts with "OMX.ittiam." instead of "OMX.qcom." leading to FFMPEGSoftCodec override with wrong compression format using OMX_VIDEO_CodingDIVX (0x7F000003) defined in OMX_FFMPEG_Extn.h. But qcom omx component actually use QOMX_VIDEO_CodingDivx (0x7FA30C02) which defined in OMX_QCOMExtns.h. Add checking for OMX.ittiam in additional to OMX.qcom solved the problem. FEIJ-700 Change-Id: I4071eb3978974d1072373f0c88ea83653c0c53a9
* FFMPEGSoftCodec: Initialize the OMX param struct before using itRicardo Cerqueira2016-05-111-0/+1
| | | | | | | | Make sure all the items in the port param config are filled out, not just those we expect to use. Ref: CYNGNOS-2797 Change-Id: I9271a83fc6496cfe5ad14e45841cd8a05ffece30
* stagefright: Add more hardware codec support for our extractorSteve Kondik2015-12-281-39/+88
| | | | | | | * Additional cases for timestamp reordering (smooth out AVI playback) * Enable hardware thumbnailer Change-Id: If828181850a5627dc1f91b118974905d22ab24e9
* stagefright: Copy the thumbnail timeSteve Kondik2015-12-261-0/+1
| | | | | | | * In case we do a conversion, we need this to seek the extractor to the right position for extracting a thumbnail. Change-Id: I003a599c15890aeeb6d2494b219f170ba5b278d8
* stagefright: Fix AAC profile selectionSteve Kondik2015-12-201-27/+22
| | | | | | | | * Be consistent about AAC profile selection in both Stagefright an our custom plugin. * Also fix duplication in the override code. Change-Id: I9d2724ea8861bc9d7db6a100a2f633f81d243c6c
* stagefright: Fix some aac file cannot be played backKeith Mok2015-12-171-4/+4
| | | | | | | | | 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: Fix videot thumbnail retrival for wmvKeith Mok2015-12-091-0/+34
| | | | | | | | | | | | | | 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
* 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
* 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
* 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
* stagefright: Support hardware codecs with FFMPEG extractorSteve Kondik2015-11-251-7/+86
| | | | | | | | | | | * Quite often we'll be using our custom extractor to handle container formats which aren't supported by any other means, but the codecs used inside the container are hardware supported. * For QC specifically we need to send a few magical incantations, so add support for this. Software codecs will be used if hardware support is unavailable. Change-Id: I917b674142fdab0b009e066e9511648c2695ec4b
* stagefright: Welcome to my nightmare, act IVSteve Kondik2015-11-231-4/+4
| | | | | | | | * Standardize parameter names, clean up stub calls * Attempting to make QC's blob work. We've entered our last days on earth. All is lost, all is lost. Change-Id: Idef9aad100f414e64a737e0f0a8c9c112ad4cb46
* stagefright: Reduce logspamSteve Kondik2015-11-051-1/+1
| | | | Change-Id: I316d82226ea5b8486e4aefae0d69a361ab115006
* libstagefright: Extended media support via FFMPEGSteve Kondik2015-10-281-0/+1149
* 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