summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MP3Extractor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't use the bitrate of the xing headerMarco Nelissen2015-04-291-23/+35
| | | | | | | | | Use the one for the mp3 frame that follows instead. Bug: 19622311 Bug: https://code.google.com/p/android/issues/detail?id=158627 Change-Id: I7f1ad702cad06aa29100a66f9796ca920aaa0592
* stagefright: warnings be gone, some are now errors, use clangLajos Molnar2015-04-171-5/+5
| | | | Change-Id: I81f438ae444f04c12ae27ae4ef6d073033de172c
* warnings be gone.Andreas Huber2014-02-111-1/+2
| | | | Change-Id: Ie3bae3f037730e316d7fca12e7a3527973f752ef
* Bug fix for the MediaPlayer::prepare() api.Dylan Powers2012-11-271-2/+4
| | | | | | | | | | | | | | | For an MP3 source, within the prepare command, ID3 tags are checked in search of gapless playback info. This causes problems for streamed sources. If ID3v2 tags aren't present, then a check is done for ID3v1 tags. This results in a read command that asks the cache to jump to the end of the file, and subsequently make an extra http call to request those bytes. For a streamed source, this causes the file to not be downloaded automatically when MediaPlayer::prepare() is called, and causes stuttering and extra buffering time to be needed when start() is finally called. The solution is to ignore the ID3v1 tags as the gapless info would never exist there, and only check for ID3v2 tags. Change-Id: I7d1b94cffbfe7c38ca094834dedbc92a58855e20
* Fix calculations for an obscure combo of MPEG audio options.John Grossman2012-09-061-1/+8
| | | | | | | | | | | | | | | MPEGv2 and MPEGv2.5 Layer 2 audio payloads should 1152 samples per access unit, not 576. Adjust the frame size and samples out calculations accordingly. Also, adjust the max frame size in the MP3Extractor's MediaSource to be closer to the theoretical worst case max frame size. The theoretical worst case for MPEG audio is 2881 bytes per frame, but the max frame size being used was 32kB. It has been changed to be 4kB in order to remain a power of 2 allocation, but to be the power of 2 closest to the worst case. Change-Id: If11f5a843b06e70151bbe8298cc54f954938d9d7
* Move COM tag parsing to constructorMarco Nelissen2012-03-201-27/+31
| | | | Change-Id: Icfcf05655ca98ccccad4f94834770c2f4098a764
* Parse mp3 encoder padding/delayMarco Nelissen2012-03-201-2/+37
| | | | | | Get the mp3 encoder padding and delay from a XING frame or iTunSMPB tag. Change-Id: Icde598c8857d7e7c187a718f478ee9799d6a1b8a
* Skip XING/VBRI frame when decodingMarco Nelissen2012-03-161-0/+7
| | | | | | | Don't send the XING/VBRI frame to the decoder, as it will result in extra data being output. Also clean up the XING seeker code a bit. Change-Id: I714a94180edae9bedc1bc0c96bf382fe6f928ac6
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-1/+1
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-041-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-7/+7
| | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* Support for an MPEG2 Program Stream extractor.Andreas Huber2011-09-301-2/+17
| | | | Change-Id: I606d87c278f72b22a5b6d7ee57bce6b02e280d41
* Revert "To make SniffMP3() more concrete so that we can remove false-positve ↵James Dong2011-09-061-16/+15
| | | | | | | | responses from MPEG-PS streams." This reverts commit 983ab88e117fcbda9370b8f4ba94271d37149672. related-to-bug: 5231309
* To make SniffMP3() more concrete so that we can remove false-positve ↵Dongwon Kang2011-08-181-15/+16
| | | | | | | | | | | | | | | | responses from MPEG-PS streams. Note: current resync logic keeps searching mp3 frames until it meets a valid one. This resync logic works well with seek() operation, but in SniffMP3(), this may cause false-positive classification for the following MPEG-PS file format. A possible MPEG-PS video file: [PS header]...[mp3 frame][mp3 frame] ... MP3 files: [ID3 tag][mp3 frame][mp3 frame] ... BUG: 5104562 Change-Id: Idd5020723f7bdb2fefc2a63fc8651580fd644399
* Re-calculate mCurrentTimeUs for MP3 CBR seek because we might haveGloria Wang2011-07-271-0/+10
| | | | | | | called Resync() which changes mCurrentPos. For bug 4869063. Change-Id: I5c5876ad81adf0ced1a6e6c18cda6905bf38f731
* Support mpeg1,2 audio and mpeg1,2,4 video content extraction from .ts streams.Andreas Huber2011-05-251-157/+7
| | | | Change-Id: I9d2ee63495f161e30daba7c3aab16cb9d8ced6a5
* In the MP3 extractor, compute timestamps based on sample count instead of ↵Jason Simmons2011-04-071-4/+34
| | | | | | | | byte count. This fixes timestamp accuracy on VBR streams. Change-Id: I73a30309536919cbeb5e5163f2f1340e2b9fa4b1
* Do not enforce the rule in MP3Extractor that all audio frames in an mp3 file ↵James Dong2011-03-041-2/+2
| | | | | | | | | | | must have the same mode For some mp3 files, the mode can be changed from one audio frame to another. Without the capability to switch modes, the decoded audio may have lots of artifacts. bug - 3253310 Change-Id: Id57bb1f204642d15e38a800c72214f6794cfaa37
* Fix MP3ExtractorJames Dong2011-02-241-5/+13
| | | | | | | | | | | | When the temp buffer wraps around, the next read position should start from what have been read to avoid reading the same remaining bytes in the buffer again. o also fix some of the formatting string for logging bug - 3482444 Change-Id: Ie0b56f4691ff9e80a48a57f1b7d0d28c78cfb313
* Speed up MP3Extractor using cached readsJames Dong2011-01-121-4/+33
| | | | Change-Id: I53a5ed76bc2f76f0c184f3800b5448f677117ae3
* Add support for the "compilation" tag in mp3, mp4 and ogg, and also addMarco Nelissen2011-01-071-0/+1
| | | | | | | | | support for two common ways of specifying album artist in ogg files. b/3311831 (cherry-picked from GB because of weird automerger failure) Change-Id: Ibf12a3d6bc8bbc2ac5ea815de6b33414b8f53f0f
* 64-bit file size/offset support for media frameworkJames Dong2010-11-181-15/+15
| | | | Change-Id: I3452bc2c0f1d990cc67285df2fce1f9f86ff8e10
* Some refactoring and added support for another form of vbr headers.Andreas Huber2010-11-091-194/+67
| | | | | | related-to-bug: 3172324 Change-Id: Ic364da09eac7f0a815f9ceb719b6baa8a76e3730
* Instead of asserting, publish no tracks if an MP3Extractor is used on ↵Andreas Huber2010-09-091-37/+39
| | | | | | | non-mp3 content. Change-Id: I26db4524c5306bf2346438d2bd359c5cfb95cead related-to-bug: 2900419
* Allow sniffers to return a packet of opaque data that the corresponding ↵Andreas Huber2010-08-251-5/+27
| | | | | | | extractor can take advantage of to not duplicate work already done sniffing. The mp3 extractor takes advantage of this now. Change-Id: Icb77ae3ee95a69c7da25b4d3b8696c0a2d33028a related-to-bug: 2948754
* Support for communicating if a buffer read from the _extractor_ is a sync ↵Andreas Huber2010-08-061-0/+1
| | | | | | | sample or not. Change-Id: Ie71506224d937cfff1fa1273bfac31c47db8845f related-to-bug: 2900534
* Support finer seek control on MediaSources.Andreas Huber2010-07-211-1/+2
| | | | | | related-to-bug: 2858448 Change-Id: Ifb4b13b990fd5889113e47e2c62249ac43391fa1
* Fix a number of timestamp mismatches in the mp3 extractor and decoder that ↵Andreas Huber2010-06-231-2/+3
| | | | | | | would lead to invalid reporting of the current playback time for mono and/or non-44100 kHz mp3s. Change-Id: I11abc05b62a958ffbc99ca997cd184a2f2199352 related-to-bug: 2667479
* Skip any number of leading ID3v2 tags (instead of just the first), also ↵Andreas Huber2010-03-311-51/+31
| | | | | | | simplify/fix the find-consecutive-mp3-frames functionality. Change-Id: I30b93b21de9bd5509b617cca21f46331562c30ac related-to-bug: 2553445
* NPR's audio streams start with a 30sec segment whose mp3 headers are subtly ↵Andreas Huber2010-03-041-3/+5
| | | | | | different from those following. Allow certain bits to vary that were thought to be fixed before. related-to-bug: 2490385
* Add support for "album artist" tag.Marco Nelissen2010-02-111-0/+1
|
* Add support for the TPOS/TPA (disc number) id3 tag.Marco Nelissen2010-02-081-0/+1
|
* Support for determining the mime type of media via metadata extraction.Andreas Huber2010-01-131-0/+4
|
* More metadata support.Andreas Huber2010-01-131-1/+3
|
* Squashed commit of the following:Andreas Huber2010-01-121-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit f81bb1dac5ef107bb0d7d5d756fb1ffa532ba2cc Author: Andreas Huber <andih@google.com> Date: Mon Jan 11 14:55:56 2010 -0800 Support for duration metadata, midi and ogg-vorbis files (in mediascanner) commit 0b1385a0dc156ce27985a1ff757c4c142fd7ec39 Author: Andreas Huber <andih@google.com> Date: Mon Jan 11 14:20:45 2010 -0800 Refactor meta data logic. Container specific metadata is now also returned by the MediaExtractor. commit f9818dfac39c96e5fefe8c8295e60580692d5990 Author: Andreas Huber <andih@google.com> Date: Fri Jan 8 14:26:09 2010 -0800 A first pass at supporting metadata through ID3 tags. commit 476e9e253633336ab790f943e2d6c0cd8991d76a Author: Andreas Huber <andih@google.com> Date: Thu Jan 7 15:48:44 2010 -0800 Initial checkin of ID3 (V2.2 and V2.3) parser for use in stagefright. related-to-bug: 2295456
* Fix an uninitialized read detected by valgrind. The array to be copied is ↵Andreas Huber2010-01-111-1/+1
| | | | | | statically sized and not a c-string. related-to-bug: 2366619
* Add support for XING headerGloria Wang2009-12-171-11/+182
|
* Initial checkin of software AMR NB encoder based on PV source code.Andreas Huber2009-12-111-3/+3
|
* Fix the mp3 audio extractor that would occasionally return an invalid frame ↵Andreas Huber2009-12-071-9/+10
| | | | directly after a seek.
* Fix MP3Extractor duration overflows...Andreas Huber2009-11-031-1/+1
|
* New API to instantiate a MediaExtractor given a URI and optional MIME type.Andreas Huber2009-10-231-5/+5
| | | | | | Also DataSources now must provide a method initCheck() and DataSource::reat_at has been renamed to readAt to conform to standard API naming guidelines.
* Moving the individual extractor headers files to the private include directory.Andreas Huber2009-10-231-1/+2
|
* Extract video thumbnails from the largest sync sample among the first 20.Andreas Huber2009-10-221-1/+1
| | | | Also fixes OMXCodec seek behaviour on the very first call to OMXCodec::read()
* Proper chunk size computation for Layer II/III V2 and V2.5, skip optional ↵Andreas Huber2009-10-121-1/+33
| | | | | | ID3 tag. related-to-bug: 1986192
* Change to a int64_t usecs representation for timestamps and duration ↵Andreas Huber2009-10-121-5/+3
| | | | throughout stagefright.
* Media MIME types now have corresponding constants in MediaDefs.h, new codec ↵Andreas Huber2009-09-101-2/+3
| | | | enumeration API.
* assert => CHECK in stagefright.Andreas Huber2009-08-261-7/+5
|
* Squashed commit of the following:Andreas Huber2009-08-171-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5bb012f0065f7ffaaeb4f569d71f0e3a8d6b19c3 Author: Andreas Huber <andih@google.com> Date: Fri Aug 14 10:40:08 2009 -0700 An attempt at fixing export using the qcom encoders. More quirks. commit 0690e76bfa48118a68287ccf1bbfa82febaa620c Author: Andreas Huber <andih@google.com> Date: Fri Aug 14 09:08:28 2009 -0700 Callbacks are now dispatched from a separate thread in OMX. commit c6571a039526df29b6343f9a1971dbc019088c61 Author: Andreas Huber <andih@google.com> Date: Thu Aug 13 15:42:25 2009 -0700 Massive API changes throughout stagefright, smart pointers everywhere. commit 900612af6a0555664d9ba195112cd859491265f4 Author: Andreas Huber <andih@google.com> Date: Thu Aug 13 13:33:12 2009 -0700 OMXCodecs now properly shutdown. commit 96732f05e1b0603dcd1b11f16a23512592eeb4f5 Author: Andreas Huber <andih@google.com> Date: Thu Aug 13 12:04:04 2009 -0700 More work on JPEG decoding using the hardware OMX component. commit 63839a073ac393e3a130434ba467969053b694ad Author: Andreas Huber <andih@google.com> Date: Wed Aug 12 13:13:31 2009 -0700 An attempt to drive the JPEG decoder OMX node. commit 3ac2fe5ab2926eda81b2123610b2434c645294ff Author: Andreas Huber <andih@google.com> Date: Tue Aug 11 16:38:21 2009 -0700 Renamed StateMachine to OMXCodec and put it in its proper place. commit 247da75a96bf8881956413023dd49a84d5b4f5b2 Author: Andreas Huber <andih@google.com> Date: Tue Aug 11 16:06:19 2009 -0700 Statemachine is now a full-fledged MediaSource. commit 045244f6771fa0b9b329495c953afda900a84b71 Author: Andreas Huber <andih@google.com> Date: Fri Aug 7 09:16:54 2009 -0700 Properly setup the input format when exporting to AMR audio. commit 271b984cb32c5cd9e46e3f90ae121f334e4b8da9 Author: Andreas Huber <andih@google.com> Date: Thu Aug 6 09:59:38 2009 -0700 Added some code to test audio encoding to the OMX harness. commit 79af4748e4af33bd66d3fbac606e332a69741cf4 Author: Andreas Huber <andih@google.com> Date: Wed Aug 5 14:36:22 2009 -0700 Merge the old OMXDecoder and the new, shiny, StateMachine code. commit 91cf5dd77a8762bc10a0b2ffce35e3bbeb262231 Author: Andreas Huber <andih@google.com> Date: Tue Aug 4 17:41:43 2009 -0700 A new harness to test OMX node compliance (and quirks).
* Squashed commit of the following:Andreas Huber2009-07-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 374ea382ee3a9e3ce17e4c6357fc40d02e362810 Author: Andreas Huber <andih@google.com> Date: Tue Jul 28 09:54:13 2009 -0700 PV's OMX implementation now uses (spec-compliant) microseconds instead of milliseconds in buffer timestamps. commit 8d02f8ab5d7b022ad4ad34db2a9bdeea6ce2acfe Author: Andreas Huber <andih@google.com> Date: Mon Jul 27 14:24:26 2009 -0700 Support for using an overlay for video playback on TI hardware. Appears to be currently constrained to CbYCrY 16-bit colorspace. commit d17f321cb4b15c1fea378f33a7ef5998f23dd0fc Author: Andreas Huber <andih@google.com> Date: Mon Jul 27 09:45:38 2009 -0700 Added '--audio-only' commandline option to stagefright tool. commit d8beef6be5c668c46451446d87e622933371cd75 Author: Andreas Huber <andih@google.com> Date: Fri Jul 24 13:35:00 2009 -0700 Generalize the various workarounds for OMX nodes with their own unique interpretation of the spec. commit c7dfd53eeadf8ed5a39bf2b19b014dcd62f3324d Author: Andreas Huber <andih@google.com> Date: Thu Jul 23 16:06:36 2009 -0700 Fixed erroneous TI AAC decoder behaviour wrt shutdown. The AAC decoder appears to not return out buffers on an Executing->Idle transition, implemented a workaround that does a flush on all ports followed by the Executing->Idle. Oh, and flush with OMX_ALL doesn't properly work either. Fun. commit d6377282e75060881336578f166f9c7feacf3f8f Author: Andreas Huber <andih@google.com> Date: Thu Jul 23 14:06:50 2009 -0700 Apparently the "channels" parameter in AudioTrack's constructor no longer counts channels but is a bitmask of enabled destinations, update the code accordingly. commit ff698c79e851a2e57d362e9c3a09828af4048087 Author: Andreas Huber <andih@google.com> Date: Wed Jul 22 16:54:44 2009 -0700 Fix MPEG4 decoding using TI's hardware decoder that I broke earlier... commit 2ef78bb87cd856eb7f0b3d7dd68782a8650c12bf Author: Andreas Huber <andih@google.com> Date: Wed Jul 22 15:43:18 2009 -0700 Now that the qcom decoder properly advertises its own custom colorspace, update dependent code to reflect this fact. commit bbaec96910727080fd7c8a6907c04facb9f5220f Author: Andreas Huber <andih@google.com> Date: Wed Jul 22 14:32:03 2009 -0700 Finishing up previous, incomplete change. commit 76f14a1ae816b6f434771f8d12bdad81196f351e Author: Andreas Huber <andih@google.com> Date: Wed Jul 22 14:25:17 2009 -0700 The TI video decoder now properly decoder AVC/H.264 content. commit e106130d8c100d5c94603e43864a7a93cca10252 Author: Andreas Huber <andih@google.com> Date: Wed Jul 22 08:56:04 2009 -0700 Experimental support for the TI H.264 decoder, various modifications to OMXDecoder, non-functional still. commit 241c3062dec3447db1a1ee74558cb4b9098fc404 Author: Andreas Huber <andih@google.com> Date: Tue Jul 21 12:13:09 2009 -0700 Enable TI hardware OMX decoders (except for AVC/H.264 which still has issues). This particular set of OMX nodes does not appear to properly return our buffers when sending the "disable" command on a port. Rather it reqires manually flushing that port and _then_ disabling it instead. commit 1c34506a46e32ce25f2a86f3b4250dcfc037356a Author: Andreas Huber <andih@google.com> Date: Tue Jul 21 08:51:35 2009 -0700 Make it simpler to switch between the stagefright player and PVPlayer. commit 249c6de05671d403f8dd51f095d49bf190430c9c Author: Andreas Huber <andih@google.com> Date: Mon Jul 20 14:38:15 2009 -0700 Prepare to use soon-to-be-available hardware decoders in the OMX decoder.
* Clean up MP3Extractor code and fixes a bug that miscalculated the position ↵Andreas Huber2009-07-171-29/+34
| | | | of the header by a few bytes whenever we read in more data.