OSDN Git Service
Keith Mok [Mon, 22 Feb 2016 18:02:38 +0000 (10:02 -0800)]
stagefright-plugins: Skip 2nd parsing for ogg
Currently only drm extractor from stagefright
provides confidence > 0.8f.
This makes almosts all media files to be parsed a 2nd time
in ffmpeg.
Skip parsing file that is determined by stagefright as ogg
file. The stagefright ogg extractor handles it well enough.
Change-Id: Ic6ab86c8cef38dbbac337f1bf5f4ec2a8bbcd862
Keith Mok [Wed, 17 Feb 2016 00:58:42 +0000 (16:58 -0800)]
stagefright-plugins: enlarge audio/video queue
Some video file have large offset between video and
audio data, we need to enlarge the buffer size
in order to be able to play back those files.
CYNGNOS-2061
Change-Id: Ia44f27e64733186750c058a5cb67985e812ee6c7
Keith Mok [Wed, 17 Feb 2016 00:50:34 +0000 (16:50 -0800)]
stagefright-plugins: prevent deadlock
If video/audio data offset too large,
it will create a deadlock, since there is only one
thread in consuming the video/audio data.
The video can be full, but with all audio data
consumed, causing read function to wait foreve for
new audio data.
CYNGNOS-2061
Change-Id: I0d366311463d5ae25c1d18a584d51d1deae7dfea
Keith Mok [Fri, 29 Jan 2016 19:14:11 +0000 (11:14 -0800)]
stagefright-plugins: workaround negative timestamp
libstagefright does not like negative timestamp,
and is causing crash if extractor reports that.
Add a checking for that, and return media malformed
if negative timestamp is encountered.
Change-Id: I8478b49d280735600b0f6290deb3dee7ed6521f5
Keith Mok [Sat, 23 Jan 2016 00:36:07 +0000 (16:36 -0800)]
stagefright-plugins: Fix mov file streaming
mov file is consider as MEDIA_MIMETYPE_CONTAINER_MPEG4.
But if we are streaming, the following code will force
to use aosp extractor instead:
if (!strcasecmp(container, MEDIA_MIMETYPE_CONTAINER_MPEG4)
&& (source->flags() & DataSource::kIsCachingDataSource)) {
ALOGI("support container: %s, but it is caching data source, "
"Don't use ffmpegextractor", container);
(*meta)->clear();
*meta = NULL;
return false;
}
However aosp does not support mov file container, which results
playback fails.
This patch fixes it.
Change-Id: Ie2ae8a177c7df92987b6a955e6450cb69ee9f93e
Keith Mok [Fri, 22 Jan 2016 00:40:55 +0000 (16:40 -0800)]
stagefright-plugins: Fix video orientation
* Some videos are encoded rotated, but it also records the rotation in a
rotation matrix. During playback, the player should apply the
rotation matrix for display purpose.
Right now, ffmpeg does decode the rotation matrix stored on the video file.
But stagefright-plugins does not parse that meta data to stagefright.
Added code to pass kKeyRotation to stagefright.
* Fixes CYNGNOS-1692
Change-Id: I718fd80c4695407fb214bab359d5cc255044725e
Keith Mok [Wed, 20 Jan 2016 00:22:10 +0000 (16:22 -0800)]
stagefright-plugins: Update pixfmt
PIX_FMT_YUV420P is going to be deprecated.
Use AV_PIX_FMT_YUV420P instead.
Change-Id: Ia6d119367bc2763da8206b1e6c61f3183830fe2b
Keith Mok [Mon, 18 Jan 2016 23:39:01 +0000 (15:39 -0800)]
stagefright-plugins: Skip stream with jpeg tag
* MJPEG is used internally by FFMPEG to represent embedded art as
stream of images. Normally, AV_DISPOSITION_ATTACHED_PIC will be set
on these streams to denote it should be handled as such. We are
seeing certain streams in the wild for which this isn't happening
which causes a hang during decode.
* Fixes NIGHTLIES-2346
Change-Id: Ie86d3ffb5b7b676a77dc0ae5e7d10a828c8532cf
Keith Mok [Wed, 6 Jan 2016 19:57:38 +0000 (11:57 -0800)]
stagefright-plugins: Fix certain HEVC file cannot playback
Add checking for HEVC streaming is in hvcC format or not,
before we decided to do convertion to annex-b format.
Change-Id: If268bbf2631ef51694298d04a3ec89e5e68f37a9
Steve Kondik [Mon, 4 Jan 2016 09:56:36 +0000 (01:56 -0800)]
stagefright-plugins: Parse file metadata tags
* Convert from AVFormat tags into the corresponding Android
tags when file metadata is requested.
* Also extract embedded album art.
Change-Id: I49aec64dc30c9afd6510a25f8c2261029d8bdadf
Steve Kondik [Sat, 2 Jan 2016 16:40:06 +0000 (08:40 -0800)]
stagefright-plugins: Protect against crash
* If the queue has been aborted, don't derefernce NULL pointers.
Change-Id: I1a04216da11cf71cbe78a315d7aef3224bb11162
Steve Kondik [Sat, 2 Jan 2016 09:32:52 +0000 (01:32 -0800)]
stagefright-plugins: Increase max video buffer size + count
* Fixes testOtherMpeg4SurfArbitraryW and testOtherMpeg4FlexArbitraryW
Change-Id: I1af56a5b5d950b61778c59c7d097755c9a4b902e
Steve Kondik [Wed, 30 Dec 2015 23:20:26 +0000 (15:20 -0800)]
stagefright-plugins: Refactor packet queue locking
* Use Mutex/Condition like a sane Android developer
* Introduce a timeout in the blocking get call to avoid deadlocks
* This ensure that error cases get handled gracefully and that
android.media.cts.MediaScannerNotificationTest passes too.
Change-Id: Icd106699dd65af07f7afbbdd02e927ff0122eace
Steve Kondik [Wed, 30 Dec 2015 05:02:20 +0000 (21:02 -0800)]
stagefright-plugins: Fix shutdown deadlock
* No need to hold the lock to shut down the extractor. We can also
deadlock here during heavy mediascanner activity (seen during CTS).
Change-Id: I7fdd540891651c489b524cb4634f933e5bb4746d
Steve Kondik [Wed, 30 Dec 2015 02:28:26 +0000 (18:28 -0800)]
stagefright-plugins: Fix crash during testDecodeWithEOSOnLastBuffer
* Don't blindly dequeue a buffer, it could be garbage in which case
we just crash and fail CTS :(
Change-Id: I6541b75890da8d9e55d5bf0b2126cea2688febba
Steve Kondik [Wed, 30 Dec 2015 02:08:01 +0000 (18:08 -0800)]
stagefright-plugins: Wait for reader shutdown on EOS
* Source will flag EOS but we need to stick around during gapless
playback, otherwise the extractor aborts early and can confuse
apps.
* Fixes gapless transitions during FLAC playback with Tidal.
Change-Id: Icbdaa180d39d626b163089f5686b7a1e4afcfbc2
Steve Kondik [Mon, 28 Dec 2015 21:13:48 +0000 (13:13 -0800)]
stagefright-plugins: Only do as much sniffing as necessary
* Stagefright will now pass on the current knowledge of the stream
instead of zeros/nulls, let's take advantage of it.
* Don't bother sniffing if the confidence is already high.
* Check how much info avformat_open_input found before we continue.
For formats with headers, this is all we need and our latency is
reduced to 10s of milliseconds vs. potentially seconds.
* Add timing metrics in the debug prints.
Change-Id: I476fc6723c070e03a77c6aaa0f8198064a15af2c
Keith Mok [Mon, 21 Dec 2015 23:44:43 +0000 (15:44 -0800)]
stagefright-plugins: Increase confidence on HEVC mp2p files
AOSP does not handle HEVC video codec in mp2p file.
Add more confidence in FFmpegExtractor to use ffmpeg
to decode this type of file.
Change-Id: I34f19e8d1e05c02e92a42386cb8d039f3e2a680d
Keith Mok [Wed, 23 Dec 2015 20:54:37 +0000 (12:54 -0800)]
stagefright-plugins: Fix audio trimmed when reaching eos
When received eos, SoftFFmpegAudio will drop that buffer
without decoding it. This makes the following cts test case failed:
android.media.cts.DecoderTest/testDecodeWithEOSOnLastBuffer
Change-Id: I51e670ac4348dc5bfb8bae267a1801209e509fd7
Keith Mok [Wed, 23 Dec 2015 19:24:18 +0000 (11:24 -0800)]
stagefright-plugins: Fix crash
When openmax reset the audio codec, it does not
clean up the mCodecAlreadyOpened flag which
leaving mCtx->codec equals to null and causing
crash.
Change-Id: Ib5c0240a308d8b85d8ce51e9309ead06addc903f
Steve Kondik [Sun, 27 Dec 2015 06:50:39 +0000 (22:50 -0800)]
stagefright-plugins: Fix thumbnail issues
* Grab the thumbnail time from the overall duration.
* Don't seek for negative values, this unbalances the code
used by FFMPEG for seeking within a range and biases towards
the first frame in short clips, usually resulting in a black
thumbnail.
Change-Id: I7021f19560808dc58dce9892dadcbaf5927e1c14
Steve Kondik [Sun, 27 Dec 2015 06:10:07 +0000 (22:10 -0800)]
stagefright-plugins: Pass the container format in the metadata
* This is needed by Stagefright to enable certain features of
the hardware decoders.
Change-Id: I694429c88501dfc5de6128d0eff28ef9b08c472f
Steve Kondik [Sun, 27 Dec 2015 00:49:51 +0000 (16:49 -0800)]
stagefright-plugins: Remove voodoo from sniff logic
* We always run last, so if our confidence is high then add the
necessary metadata.
* Remove magic numbers.
Change-Id: I34ccffff7836495055610346dc8b99e36d855d5b
Steve Kondik [Sun, 27 Dec 2015 00:48:03 +0000 (16:48 -0800)]
stagefright-plugins: Add special case for DivX containers
* MPEG4Extractor cannot handle this and we need to do it. Boost
confidence level accordingly.
Change-Id: I8ade1c576c0cc81bded1b00c4a0df33ef998a897
Steve Kondik [Sun, 27 Dec 2015 00:46:15 +0000 (16:46 -0800)]
stagefright-plugins: Fix HEVC extradata handling
* Check the correct positions in the extradata for conversion.
Change-Id: I1c909c2f9f8b8dce30c180bca08496b15df928d6
Steve Kondik [Sun, 27 Dec 2015 00:42:29 +0000 (16:42 -0800)]
stagefright-plugins: Always use FFMPEG for FLAC audio
* The decoder in AOSP is not very good and due to the use of libFLAC
it cannot work in the case where the DSP can offload compressed
FLAC (AOSP's codec can only output decoded PCM). Prefer ours instead.
Change-Id: Id5665e4bcff0206c9ce2bd5e3d2ab7bfb81a1663
Steve Kondik [Sun, 27 Dec 2015 00:40:26 +0000 (16:40 -0800)]
stagefright-plugins: Correctly check if audio codec is open
* Same as we're doing for video.
Change-Id: I424cdd197cae73d0647738fc9c97e87c2692181b
Scott Mertz [Wed, 23 Dec 2015 00:19:59 +0000 (16:19 -0800)]
stagefright-plugins: remove global dictionaries
The global dictionaries are only accessed from the ffmpeg extractor.
There is no use for them to be declared in one shared library and
accessed in another.
This has the benefit of fixing an issue where format_opts is not
initialized to NULL in some cases.
Change-Id: I57b39c82e29aa48fc852a9fbe8a2434885d407e6
Steve Kondik [Mon, 21 Dec 2015 11:44:06 +0000 (06:44 -0500)]
stagefright-plugins: Seek to beginning of file on seek error
* Prevent a deadlock on seek error
Change-Id: Ic7dfe1849298f6166154c319e618048720d1ea61
Steve Kondik [Mon, 21 Dec 2015 04:21:54 +0000 (23:21 -0500)]
stagefright-plugins: Fix AAC profile selection
* Just re-use the information FFMPEG has already gathered for us
to avoid inconsistency.
* Also set the right type for HVCC
Change-Id: I341e008cb0b51fffa83122db8103afed3212ec8b
Steve Kondik [Thu, 17 Dec 2015 22:08:06 +0000 (17:08 -0500)]
stagefright-plugins: Return supported profiles for MPEG4
* All codecs understood by MediaCodec must return supported
profiles/levels and additional metadata.
Change-Id: If07a268a0791729b8db00d549f27d581760fa972
Steve Kondik [Mon, 14 Dec 2015 09:03:13 +0000 (01:03 -0800)]
stagefright-plugins: Parse additional FLAC metadata
* Parse the min/max frame and block sizes from the streaminfo and
report it in the metadata
* This is needed for FLAC offload support on new Qualcomm DSPs.
Change-Id: Ib37891a5766066306adf18a6c23af9c9ac7dcdb1
Steve Kondik [Mon, 14 Dec 2015 04:20:08 +0000 (20:20 -0800)]
stagefright-plugins: Really ignore album art "streams"
* We need an extra check for the attached pic disposition if we want
to use the source to extract raw data without a decoder. This
is necessary for audio offload.
Change-Id: Ibb60987462a95a4d80d614870077ecf39c18fd52
Steve Kondik [Sun, 13 Dec 2015 05:23:59 +0000 (21:23 -0800)]
stagefright-plugins: Init port with larger audio buffer size
* Allocate enough to handle 32 bits of data.
Change-Id: Ieac10aa1c1ac78b679c57a1957c3d6699612a262
Keith Mok [Wed, 9 Dec 2015 22:32:20 +0000 (14:32 -0800)]
stagefright-plugins: Fix video of resolution 320x240
Video of resoltuion 320x240 cannot be played correctly.
Since the width and height of mCtx are not set and eqauls to zero.
The width and height of mCts are supposed to be set by
OMX_IndexParamPortDefinition, but the default size is
320x240. So in function internalSetParameter,
case OMX_IndexParamPortDefinition,
(newWidth != oldWidth || newHeight != oldHeight)
is always false and skipped setting mCts->width and height.
This results avcodec_open2 fails and an error is printed out
"Picture size 0x0 is invalid".
Setting mCtx->width and height to mWidth and mHeight solves
the problem.
Change-Id: I5dec4e4af66afded27dc4e6d2835249262f90528
Keith Mok [Wed, 9 Dec 2015 19:26:20 +0000 (11:26 -0800)]
ffmpeg-extractor: Fix sample aspect ratioa issue
Some movies are diplayed incorrectly due to wrong aspect
ratio. The ffmpeg-extractor does not pass the sample aspect ratio
to the upper layer. This fixes it.
Change-Id: I6da6ffe355e1bc3802b2fbd7da0aa2946b88b1a6
Keith Mok [Wed, 7 Oct 2015 23:13:00 +0000 (16:13 -0700)]
ffmpeg: Fix crash when avio_check is called
url_check does not guarantee url_open will be called before
(and actually it is not designed to do so)
If url_open is not called before url_check called, ffs
will be null causing the crash.
Change-Id: I0176c619eeb931ede0061003e396ee7e1407b860
(cherry picked from commit
832d93744cccf1f056f7ecdad6041e91148e9260)
Diogo Ferreira [Fri, 27 Nov 2015 10:37:47 +0000 (10:37 +0000)]
ffmpeg: video: Check if the codec is still open before flushing
This might be called whilst the codec has already finished decoding
and is not available for flushing.
Fixes the adaptative HEVC CTS tests.
Change-Id: I80ad95b23a4ba230256ffb7c6df6af4d99ef65a6
Steve Kondik [Thu, 26 Nov 2015 00:58:55 +0000 (16:58 -0800)]
stagefright-plugins: Relax component role check
* Our extractor might be used to handle both thumbnails
(in software) as well as playback (with hardware codec support).
In at least one case, the vendor OMX roles don't match anything
sane, so relax the check to support this case.
Change-Id: I8925229156cc0e33ff83d4b9ce933087b75b12ef
Ricardo Cerqueira [Wed, 28 Oct 2015 14:56:41 +0000 (14:56 +0000)]
codecs: Disable AC3/EAC3
Because of reasons. And licenses. But mostly reasons. Maybe licenses.
Change-Id: Idd33afae0c55e428fd76961f54ae95f3cb9c6cc0
Steve Kondik [Wed, 4 Nov 2015 12:07:16 +0000 (04:07 -0800)]
stagefright-plugins: Fix the rest of the build with Clang
* Workaround an issue with including the ARM-specific intreadwrite
header from FFMPEG from C++. The usage in this library is not
performance critical.
* Also clean up some misc warnings.
Change-Id: Id17c6464bcab484fea9c58acfaf6751cecca19c5
Steve Kondik [Sun, 1 Nov 2015 12:04:27 +0000 (04:04 -0800)]
stagefright-plugins: Fix compilation issues with Clang
* We still build the utils library with GCC until FFMPEG is sorted.
Change-Id: I8a5d47a53a03b8b96cb6106b9b65b4b978cbdc2a
Steve Kondik [Tue, 27 Oct 2015 23:35:52 +0000 (16:35 -0700)]
stagefright-plugins: Use native sample format
* Audioflinger supports floating point directly now, no need to
downsample these formats.
Change-Id: I79c40310799d4ae871bf5b518f542cd1109d1469
Steve Kondik [Tue, 27 Oct 2015 23:34:53 +0000 (16:34 -0700)]
stagefright-plugins: Remove duplicate codec
Change-Id: I146db06dc882e8e29ef5b60e2cf5f7ecd4109c30
Steve Kondik [Tue, 27 Oct 2015 23:34:23 +0000 (16:34 -0700)]
stagefright-plugins: Populate AAC profile version
Change-Id: I25abad8567bd751b45836fb965cfa0312463e728
Steve Kondik [Tue, 27 Oct 2015 23:33:33 +0000 (16:33 -0700)]
stagefright-plugins: Install binaries to /vendor
Change-Id: I03edc4fea900016e5af06f83511e5f827af30ba4
Steve Kondik [Tue, 27 Oct 2015 23:24:22 +0000 (16:24 -0700)]
Revert "stagefright-plugins: Add flag to disable inclusion"
This reverts commit
19967536a699a97f7c4f66f9403057cd46868207.
Change-Id: I2fcfd918d234f80d0e8aec03e311aa00217291fe
Steve Kondik [Tue, 13 Oct 2015 00:54:50 +0000 (14:54 -1000)]
stagefright-plugins: Add flag to disable inclusion
Change-Id: I9dce3f4b39835582af4b8c29ff34476501802800
Steve Kondik [Tue, 20 Oct 2015 10:32:47 +0000 (03:32 -0700)]
stagefright-plugins: Correct mime type
Change-Id: I31028abb26dadc3a04bb23071077fce1d76e77d8
Christopher R. Palmer [Mon, 31 Aug 2015 12:07:19 +0000 (08:07 -0400)]
ffmpeg-extractor: Fix deadlock when stopping the reader thread
You cannot hold the lock used by the reader thread when trying
to join to the reader thread!
For example, if we start and then stop the reader thread
before it gets a chance to execute, one thread will be in
stopReaderThread calling pthread_thread_join (and holding mLock).
Then the reader thread will execute and immediately block on
mLock (it gets the lock immediately on startup).
Instead, release the lock while we wait for the thread to exit
and then reacquire the lock.
Change-Id: I9247ae48586c18f4eb7a4f74e188b9d4f88824e2
Steve Kondik [Wed, 8 Jul 2015 07:00:09 +0000 (00:00 -0700)]
stagefright-plugins: Restructure the code
* Add an OMXPlugin implementation which will be dynamically loaded by
Stagefright. This plugin will return the appropriate decoder
implementation depending on the component type.
* Rename a few libraries for consistency.
* Reorganize the code under a more lightweight hierarchy.
* Move the custom OMX extensions here.
* Break out the mapping/conversion table for reuse.
* These changes allow us to get rid of large amounts of code from
frameworks/av. This is part of a larger effort to move as much custom
code as possible out of the frameworks and into subprojects.
Change-Id: I3100d83e457bf20fe25a06a808b9d65098291313
Ethan Chen [Thu, 2 Jul 2015 22:17:33 +0000 (15:17 -0700)]
stagefright-plugins: Remove Vorbis/MP3/H263/H264/HEVC
* Google already provides software codecs for
Vorbis/MP3/H263/H264/HEVC.
* Don't provide duplicates of Google provided software codecs.
Change-Id: I39f16d97fc808c9535e91b4c5637222ca1572eaa
Steve Kondik [Tue, 7 Jul 2015 20:48:57 +0000 (13:48 -0700)]
stagefright-plugins: Fix adaptive buffer and crop handling
* Call outputBufferWidth/outputBufferHeight to return the correct value
depending if adaptive mode is enabled.
* We don't need to destroy the decoder in onReset since we can just
change parameters on the fly. Remove this to fix the crash.
* Handle crop settings correctly to fix the zoom effect during
adaptive playback.
Change-Id: Iba658226a09483e68c44875143f61acd75577078
Steve Kondik [Mon, 6 Jul 2015 17:46:40 +0000 (10:46 -0700)]
stagefright-plugins: Add special handling of DivX files
* Stagefright can't handle these files (MPEG4 w/packed b-frames), so we need
to return a special mimetype which avoids the Google decoders.
* We also return the version in the metadata for compatibility with
QC's hardware codecs.
Change-Id: Ibbc5133a0e06d83f6d0ef8f2e44d5fe53cc2d71a
Steve Kondik [Sat, 4 Jul 2015 11:56:13 +0000 (04:56 -0700)]
stagefright-plugins: Improve seeking further
* Use av_rescale_q and handle all timestamps in the format timebase
* Add support for seeking to exact frame (SEEK_CLOSEST)
Change-Id: Ie2b6ac01f897eff8e1e36b1696bd53e6a828d796
Steve Kondik [Fri, 3 Jul 2015 09:13:14 +0000 (02:13 -0700)]
stagefright-plugins: Disable lowres
* Some codecs support the lowres flag, which results in faster decoding
while outputting at a lower resolution. This is unexpected by
Stagefright, and causes CTS failures.
* Performance is extremely good with these codecs now, so just disable
it entirely.
Change-Id: Ib84ceaef8d941d8f89f0a8e38facda40451cdccb
Steve Kondik [Tue, 23 Jun 2015 19:51:11 +0000 (12:51 -0700)]
stagefright-plugins: Update codec list with capabilities
* Needed for CTS.
Change-Id: I73a92f4a8c77c2c51990d2599f13de91a3b84daf
Steve Kondik [Tue, 23 Jun 2015 21:17:18 +0000 (14:17 -0700)]
stagefright-plugins: Set sensible defaults for audio decoders
* Since the refactoring, we don't depend on a call into OMX to tell us
what format to use. Set up some sensible defaults so that client-side
OMX players such as GStreamer can use these codecs too.
Change-Id: Id20b8eade7bbbc11f98c0d83114929cbce9cc29a
Steve Kondik [Tue, 23 Jun 2015 19:47:53 +0000 (12:47 -0700)]
ffmpeg: Remove a couple of codecs we don't need
* Fixes issue with GStreamer
* Temporary fix until autoconfig is implemented.
Change-Id: I5d116c739b36b24077180b489aab67ba135370c4
Steve Kondik [Tue, 16 Jun 2015 19:53:44 +0000 (12:53 -0700)]
stagefright-plugins: Minor fix for FFMPEG 2.7
Change-Id: Icc806b988830ee715f3d25fef6205401cc006c8d
Steve Kondik [Thu, 18 Jun 2015 09:22:20 +0000 (02:22 -0700)]
stagefright-plugins: Convert tabs to spaces
Change-Id: I32a2bf879c556ab59994bbee9c7cdb15ed702f19
Steve Kondik [Wed, 17 Jun 2015 04:04:19 +0000 (21:04 -0700)]
stagefright-plugins: Refactoring the extractor
* Get rid of all the delays and use proper locking primitives.
* Fix thumbnails in general, tell Android what frame to use.
* Handle all seek modes supported by Android
* Fix the random crashes due to race conditions
* Set thread priority when playing audio
Change-Id: Ic6391100cd8846c3d10db96a327933d9d929f3b7
Steve Kondik [Wed, 17 Jun 2015 21:33:31 +0000 (14:33 -0700)]
stagefright-plugins: Clean up makefiles
Change-Id: Ie0ba15c084307bbf76a277fd72e024df36c116af
Steve Kondik [Wed, 17 Jun 2015 03:39:02 +0000 (20:39 -0700)]
stagefright-plugins: Move and update codec XML
Change-Id: I58dead1b53c6454dd5bb409e276e31d71a790506
Steve Kondik [Fri, 12 Jun 2015 04:15:27 +0000 (21:15 -0700)]
stagefright-plugins: Refactor the decoders
* Switch us over to using SoftVideoDecoderOMXComponent
* Get rid of a truckload of conditionals
* Handle thumbnail generation correctly
* Fix bitwidth in trial decoders
* Handle VC1 properly
* Update copyright headers
* Fix race condition on decoder shutdown and seek
* Clean up all the dead code
Change-Id: I0595a35c15c644d2992e2336a914601173c466c5
Ethan Chen [Fri, 29 May 2015 23:11:44 +0000 (16:11 -0700)]
FFmpegExtractor: mark HEVC as supported
* Software codec for HEVC is provided by Google
Change-Id: Ie997f9f8ffe73e01b5cf34092140b08e0507fee2
Ethan Chen [Thu, 14 May 2015 01:59:51 +0000 (18:59 -0700)]
stagefright-plugins: Add -Wno-psabi for ARM64 builds as well
* Strange things happen to buffers otherwise.
Change-Id: Id5347a0d0a0853df80e72ebeb8c0fbdd7cf2a2ad
Steve Kondik [Wed, 11 Mar 2015 01:31:26 +0000 (01:31 +0000)]
stagefright-plugins: Re-add workarounds for certain audio formats
* Readd workarounds for huge buffers coming from APE and DTS
Change-Id: If42969810b5d43c9441df6b0cdf92b68d8cf9d3f
Steve Kondik [Mon, 19 Jan 2015 23:10:03 +0000 (15:10 -0800)]
stagefright-plugins: Set default target sample format from codec
* Use the codec's default when queried by Stagefright. This allows
us to avoid a multi-stage recheck if the extractor doesn't report
the real bitwidth yet.
Change-Id: I19b79dd1b044b5f7aac4f90b681af42111b8db74
Steve Kondik [Tue, 16 Dec 2014 09:40:42 +0000 (01:40 -0800)]
stagefright-plugins: Enable multithreaded decoding
* Set thread_count to zero in order for FFMPEG to choose an appropriate
number of threads based on available CPUs.
Change-Id: Ifa74195cc07c64f535fad132b5b56db3f611d461
Steve Kondik [Sat, 13 Dec 2014 06:24:13 +0000 (22:24 -0800)]
stagefright-plugins: Updates for FFMPEG 2.5
* Update for API changes in FFMPEG 2.5
* Clean up all the warnings
* Remove homegrown timestamp handling, it's no longer needed
* FFMPEG software video decoders perform quite well-
We now have a formidable media stack that can play nearly
anything!
Change-Id: I910e24a60f29968894b62d13b16c6b5c9b3b42a6
Steve Kondik [Sun, 30 Nov 2014 03:33:21 +0000 (19:33 -0800)]
stagefright-plugins: Enable 24-bit output
* Always enable it. Audioflinger has conversions for when the hardware
can't support it.
* Also fix a bunch of state management issues
Change-Id: I2106b34251bd0c9db0655dd97d3e92c7b635a982
Steve Kondik [Tue, 2 Dec 2014 09:53:57 +0000 (01:53 -0800)]
stagefright-plugins: Use the max aggregated buffer size
* NuPlayer has a new feature which aggregates small buffers before
delivering them to the codec. We need to match this size in all
cases or we will have a bad time.
Change-Id: I353cedbe6f864e89214f185bbffa7314d7caf77c
Steve Kondik [Fri, 28 Nov 2014 23:51:26 +0000 (15:51 -0800)]
stagefright-plugins: Fix warning
Change-Id: Iadf3666a3899f6f1071ba9042642dfd29cc3e2ee
Steve Kondik [Fri, 28 Nov 2014 23:25:40 +0000 (15:25 -0800)]
stagefright-plugins: Use new OMX type for AC3
* This is new in Lollipop. Google didn't implement a decoder though,
so we can handle it.
Change-Id: I755e7f02de38053770bb53acae2a9a41549dfbad
Steve Kondik [Fri, 28 Nov 2014 19:36:39 +0000 (11:36 -0800)]
stagefright-plugins: Return target format in PCM params query
* If the framework told us to do something else, we should do it.
Change-Id: Ie7777346012a96392a3baa9cca38c3ac31288b5d
Steve Kondik [Thu, 27 Nov 2014 11:12:07 +0000 (03:12 -0800)]
stagefright-plugins: Implement frame dropping and AV sync
* Keep the video from lagging behind the audio by dropping
frames when we're too far behind.
* Set options to improve video playback performance
* It's still a quite terrible experience without hardware decoding,
but prior to this patch it was possible that the first slow
frame would be droped by Stagefright and the lag would just grow,
resulting in a black screen.
Change-Id: Ib10933d385d593d8e887bca033f22b68a812bc7c
Steve Kondik [Thu, 27 Nov 2014 10:18:04 +0000 (02:18 -0800)]
stagefright-plugins: Rename mpeg2v to mpeg2
Change-Id: Ia9fdd6c733bc138f52b843593a140c66f803f045
Steve Kondik [Tue, 25 Nov 2014 02:34:26 +0000 (18:34 -0800)]
adec: Fix various issues on Stagefright 5.0
* Return proper values in getParameter calls
* Send valid timestamp at EOS
Change-Id: Ia78fa4029870ae32d30678316d8f7000db2b75c8
Steve Kondik [Sun, 23 Nov 2014 15:52:03 +0000 (07:52 -0800)]
stagefright-plugins: Allow multiple getParameter invocations
* Previously we asserted that the component was not yet configured
during getParameter, but SF in Lollipop may need to query the
component multiple times. Add support for this.
Change-Id: I5e1de8a57605e682a543614414d4e1efac43d03f
Steve Kondik [Sat, 22 Nov 2014 06:10:39 +0000 (22:10 -0800)]
Disable 24-bit until framework is updated
Change-Id: If3f347ae0371aad3cb31364f67475d992a1889d1
Steve Kondik [Sat, 22 Nov 2014 06:10:39 +0000 (22:10 -0800)]
Disable 24-bit until framework is updated
Steve Kondik [Tue, 4 Nov 2014 22:53:30 +0000 (14:53 -0800)]
stagefright-plugins: Add a couple of sample format exceptions
* DTS and AC3 need to output 24-bit samples if supported.
Change-Id: I84174994d568645e7c7c593901fff30b998bf92a
Steve Kondik [Sun, 12 Oct 2014 03:32:31 +0000 (20:32 -0700)]
stagefright-plugins: Return real bitwidth in getParameter call
* ..and store the real parameters during setParameter.
Change-Id: I170b283da649303e6c016458a3bfebd3431b5c42
James Sullins [Wed, 15 Oct 2014 19:33:10 +0000 (14:33 -0500)]
ffmpeg_source: add url check to android_open
This check confirms that if a URL is attached to the
android-source in the url string passed to android_open,
that it match the actual URL pointed to by that datasource.
It has been observed that some hls,applehttp sources contain
playlists within the playlist. In these cases, the additional
playlists may be opened by rewriting the original URL. However,
since the "android-source:<%p>" prefix is unmodified, it "opens"
the original URL again. This continues until memory is depleted.
Change-Id: Ieb504393aaa204a641035c982fe4a123a3e61a98
James Sullins [Wed, 15 Oct 2014 18:58:48 +0000 (13:58 -0500)]
ffmpeg_source: do not adjust offset on read error/eof
It has been observed that NuCachedSource2 can return a negative
value on attempts to read at EOS (end of stream). Also, the
url_feof from FFMPEG attempts an additional fill_buffer after
a eof_reached condition has been set. If the offset is adjusted
backwards at EOS, then url_feof will never detect the EOS and
will have an infinite stream of data. This is particularly bad
when memory is allocated on each line of data read (eg. when
an hls,applehttp media type is parsed via hls_read_header).
Change-Id: Ieb992e2e9e2a55adaabc28fb407f519e56b10011
Steve Kondik [Wed, 8 Oct 2014 14:33:29 +0000 (07:33 -0700)]
stagefright-plugins: Allow use of HW codecs for Windows Media
* We will still fall back to FFMPEG if these fail.
Change-Id: I74287268f6782e69e0bee624368a85837d2c7969
Steve Kondik [Wed, 8 Oct 2014 06:20:07 +0000 (23:20 -0700)]
stagefright-plugins: Audio output port reconfiguration support
* Add support for reconfiguring the audio output port (PCM) on the
fly. This enables us to easily control both high resolution
output as well as downsampling.
Change-Id: Ic5ea3efc966b0da2d62041fa0de2e422c1f9f7fc
Steve Kondik [Wed, 1 Oct 2014 02:00:11 +0000 (19:00 -0700)]
stagefright-plugins: Handle 32-bit floating point sample formats
* Convert these to 24-bit PCM if the system is capable of it.
* This also fixes that pesky ADSP crash.
Change-Id: Ia464d62f2b6f17986428f3e45ed61784d4c9006f
Steve Kondik [Thu, 7 Aug 2014 23:47:44 +0000 (16:47 -0700)]
ffmpeg: Add support for high resolution audio
* Output interleaved 24-bit (32-bit packed) PCM at up to 192KHz for
use with PCM offload. Falls back to resampling if disabled.
Change-Id: Ie1bd3066c0459fb99a9d4ff9e28d6a65e234408a
Steve Kondik [Tue, 22 Jul 2014 04:34:34 +0000 (21:34 -0700)]
Fix crash when playing ALAC
* Don't crash when seeing a weird EOS packet.
Change-Id: I29e979ab94daccb9e81264e09f258c10d96373f5
Michael Chen [Tue, 8 Jul 2014 15:30:40 +0000 (23:30 +0800)]
add support for unknown formats.
The FFmpegExtractor support all ffmpeg formats!!!
Unknown format is defined as MEDIA_MIMETYPE_CONTAINER_FFMPEG
Change-Id: I1645591a1c53f5f2d961a0212e351533630b9999
Michael Chen [Mon, 7 Jul 2014 16:50:46 +0000 (00:50 +0800)]
fix release FFmpegExtractor
old: release FFmpegExtractor -> release AV Tracks
now: release AV Tracks -> release FFmpegExtractor
Change-Id: I1fb60a78deb1c2a1cc4f23dff1786337ea24c684
Lucian Cristian [Fri, 23 May 2014 22:42:05 +0000 (01:42 +0300)]
Don't use ffdshow to downmix the audio stream
send multichannel PCM over supported sound output (HDMI)
if no multichannel output is found the android mixer will downmix
Change-Id: Icea5a89e7669f90a0d7266eeec9eddb20723f6ca
Ricardo Cerqueira [Thu, 22 May 2014 15:54:02 +0000 (16:54 +0100)]
extractor: Underp mpeg4 fastpath
Only run this _after_ validating the result of avformat_open_input()
Change-Id: Ib7969a7f723ba58219476ceb541e8dd24c7c922b
Ricardo Cerqueira [Tue, 20 May 2014 15:43:28 +0000 (16:43 +0100)]
extractor: More NULL checks...
This is blowing up if media unrecognized by ffmpeg goes through
Change-Id: Idfb2dcf581e3195f05772d375d315a6aedeab993
Ricardo Cerqueira [Sat, 17 May 2014 21:45:39 +0000 (22:45 +0100)]
Fix resource leak in cached mpeg4 fast exit
And clean up formatting to match the rest of the file
Change-Id: I334640e3ceefbf2b0ff3d91f7493b02dc0c3359b
Ricardo Cerqueira [Fri, 16 May 2014 18:12:09 +0000 (19:12 +0100)]
extractor: Fast-track the stream analysis if we already have a skip condition
The sniffer already has an abort clause if the container is identified
as MPEG4 and the media source is caching (HTTP, typically). If we figure
this out early, there's no need to drill down into the individual streams,
and we can skip the deeper stream analysis, saving somewhere between 5 and
15 seconds in the identification process.
Change-Id: I64d33dc22262dd389e48b5f07047a8a1908f4ff3
Pawit Pornkitprasan [Thu, 15 May 2014 03:32:56 +0000 (10:32 +0700)]
FFmpegExtractor: don't print list of supported formats
It's just log-spam and doesn't aid debugging in any way
(the value is always constant)
Change-Id: I06bd88675c8cd306523227cde8f2744077f3783d
Pawit Pornkitprasan [Wed, 14 May 2014 12:38:00 +0000 (19:38 +0700)]
FFmpegExtractor: set proper mimetype for VP8/9
This allows other stagefright codecs to be used even when the extended
extractor is used. (Right now, if the the extended extractor is forced
to be used with VP8/9, then 'vtrial' mimetype will be used.)
Change-Id: I7af0bf609d07871b8956d7799cc036c0b8d18d37