107 Commits

Author SHA1 Message Date
Andreas Huber
b482ce8837 Revive support for video encoding in OMXCodec. 2009-10-29 12:02:48 -07:00
Android (Google) Code Review
76a5429407 Merge change I155e2ad0 into eclair-mr2
* changes:
  Re-enable CameraSource.
2009-10-28 13:25:09 -04:00
Andreas Huber
155e2ad04c Re-enable CameraSource. 2009-10-28 10:15:07 -07:00
Eric Laurent
7ed70c9515 am bf96aaad: Merge change Icf10db28 into eclair
Merge commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba' into eclair-mr2

* commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba':
  Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
2009-10-24 01:38:58 -07:00
Andreas Huber
9a12baf929 New API to instantiate a MediaExtractor given a URI and optional MIME type.
Also DataSources now must provide a method initCheck()
and DataSource::reat_at has been renamed to readAt to conform to
standard API naming guidelines.
2009-10-23 10:35:08 -07:00
Andreas Huber
57515f334b Moving the individual extractor headers files to the private include directory. 2009-10-23 09:55:10 -07:00
Andreas Huber
e13526ad92 Prefer software decoders over hardware for thumbnail extraction.
While our hardware decoders clearly outperform the software decoders in terms
of raw throughput, their startup latency makes them less suitable for thumbnail
extraction.
2009-10-23 08:39:00 -07:00
Andreas Huber
e981c33446 Extract video thumbnails from the largest sync sample among the first 20.
Also fixes OMXCodec seek behaviour on the very first call to OMXCodec::read()
2009-10-22 14:22:57 -07:00
Andreas Huber
f68c168d36 Some cleanup of OMXCodec code, make sure to ignore 0-length output buffers in the metadata retriever. 2009-10-21 14:01:30 -07:00
Eric Laurent
415f3e2875 Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Added setVoiceVolume() method to AudioSystem, AudioFlinger, IAudioFlinger, AudioPolicyService.
Removed call to AudioHardwareInterface::setVoiceVolume() from AudioFlinger::setStreamVolume().
2009-10-21 12:29:37 -07:00
Andreas Huber
f16a0b7399 do not merge: The qcom video decoders always output yuv data after adjusting dimensions to be a multiple of 16.
Add a quirk mode to OMXCodec that makes it aware of this fact for proper display. Also integrate back a change from eclair-mr2 that delays releasing an output buffer briefly after posting it to surface flinger, as we don't know how long it'll take it to actually display the buffer's content.
2009-10-20 11:49:01 -07:00
Andreas Huber
784202ea11 Reimplement the OMX backend for stagefright.
Besides a major cleanup and refactoring, OMX is now a singleton living in the media server, it listens for death notifications of node observers/clients that allocated OMX nodes and performs/attempts cleanup.

Changed APIs to conform to the rest of the system.
2009-10-16 11:22:43 -07:00
Andreas Huber
bd7b43bb02 Separated private from public header files. 2009-10-13 10:22:55 -07:00
Andreas Huber
8d87cd98a8 Fix various compiler warnings accumulated over time. 2009-10-13 10:06:37 -07:00
Andreas Huber
cfd55579c2 OMXCodec now notifies the reader of changes in the output format by returning a special result/error code. 2009-10-13 09:46:46 -07:00
Andreas Huber
fa8de75250 Change to a int64_t usecs representation for timestamps and duration throughout stagefright. 2009-10-12 16:00:07 -07:00
Andreas Huber
9b8f947790 Fixing the build. 2009-10-09 09:06:06 -07:00
Andreas Huber
53a76bd0c9 Split the ColorConverter off SoftwareRenderer, metadata support in stagefright. 2009-10-08 15:06:09 -07:00
Andreas Huber
3f42707c62 Some decoders will return an error on OMX_EmptyThisBuffer to indicate that they don't support the media format, deal with this. 2009-10-08 14:21:58 -07:00
Andreas Huber
cd74c0d56c The vendor is about to check in a fix for this issue, the workaround is no longer needed 2009-10-08 09:12:11 -07:00
Andreas Huber
8b432b1d85 Workaround for avc decoder misreporting output buffer size requirements if the content is not a multiple-16 width/height. 2009-10-07 13:53:24 -07:00
Eric Laurent
62443f5f45 Fix issue 2139634: DTMF tones on Sholes popping, hissing (audio latency too high).
This change is a complement to the main fix in kernel driver for the same issue (partner change #1250).
It removes clicks sometimes heard after the end of the tones while audio flinger is sending 0s to the audio output stream.
The problem was that the sleep time between two writes was more than the duration of one audio output stream buffer which could cause some underrun.

Also fixed a recent regression in ToneGenerator that made that the end of previous tone was repeated at the beginning of current one under certain timing circumstances when the maximum tone duration was specified.
2009-10-06 18:59:35 -07:00
Marco Nelissen
c39d2e3c01 Music visualizer support hack.
This currently assumes 44k stereo (won't crash on other formats, but won't give the correct results either), and links statically with libspeex to get FFT data, increasing the size of libmedia by about 45kb.
2009-10-06 08:51:16 -07:00
Eric Laurent
af141d529f Fix issue 2142613: ToneGenerator: short tones sometimes don't play on sholes or over A2DP.
When the AudioTrack callback notification size is relatively high (Which is the case on Sholes and over A2DP), it is likely that the end of tone is reached during the first callback. In this case, the AudioTrack is stopped before exiting the callback which causes 2 problems:
- 1: If the AudioFlinger thread is scheduled before we exit the ToneGenerator callback, the track can be stopped and reset before the data is actually marked as present in the buffer by the AudioTrack callback => no audio will be processed by AudioFlinger.
- 2: In this case, the data write index in the AudioTrack buffer is incremented after the track was reset by the AudioFlinger which leaves unplayed data in the buffer. This data will be played the next time the AudioTrack is started if not flushed in between.

The fix consists in adding an intermediate state to ToneGenerator state machine so that we exit the callback function when the stop condition is reached and stop the AudioTrack the next time we execute the callback.
2009-09-24 23:49:40 -07:00
Andreas Huber
4f23457958 Another software color conversion implementation, this time OMX_QCOM_COLOR_FormatYVU420SemiPlanar => rgb565. 2009-09-15 16:19:08 -07:00
Android (Google) Code Review
a4fe2aca52 Merge change 25128 into eclair
* changes:
  Support CbYCrY -> RGB565 color conversion in IOMXRenderer.
2009-09-15 17:48:33 -04:00
Andreas Huber
c966a3c255 Support CbYCrY -> RGB565 color conversion in IOMXRenderer. 2009-09-15 14:32:59 -07:00
Andreas Huber
9f9afef3d5 Added an API IOMX::createRendererFromJavaSurface.
This api allows to instantiate a renderer by specifying the hosting java Surface object. This hides the implementation details of (java-)Surface, (native-)Surface and friends.
2009-09-15 12:49:11 -07:00
Andreas Huber
6026a51424 Move JPEGSource.{cpp,h} into libstagefright. 2009-09-11 07:49:50 -07:00
Andreas Huber
e6c409632f Media MIME types now have corresponding constants in MediaDefs.h, new codec enumeration API. 2009-09-10 14:43:36 -07:00
Andreas Huber
033e6c3a68 Minor API change in MPEG4Writer, support for amr output into MPEG4 containers. 2009-09-09 16:36:12 -07:00
Andreas Huber
5a65a6e220 Added a .amr file extractor (for AMR-NB and AMR-WB content). 2009-09-09 11:05:42 -07:00
Android (Google) Code Review
4e60d7e60b Merge change 24179 into eclair
* changes:
  Support encoding amr-wb content in stagefright.
2009-09-09 13:55:48 -04:00
Eric Laurent
96c08a69ea Fix issue 1992233: DTMF tones on Sholes is really long.
Add a parameter to ToneGenerator.startTone() allowing the caller to specify the tone duration. This is used by the phone application to have a precise control on the DTMF tone duration which was not possible with the use of delayed messaged.
Also modified AudioFlinger output threads so that 0s are written to the audio output stream when no more tracks are ready to mix instead of just sleeping. This avoids an issue where the end of a previous DTMF tone could stay in audio hardware buffers and be played just before the beginning of the next DTMF tone.
2009-09-08 22:56:07 -07:00
Andreas Huber
ee606e66b0 Support encoding amr-wb content in stagefright. 2009-09-08 12:55:50 -07:00
James Dong
392ff3b529 Add basic metadata retrieval support for midi, ogg, etc.
Bug 2050320
2009-09-08 11:04:53 -07:00
Android (Google) Code Review
e1da8be501 Merge change 23835 into eclair
* changes:
  When encountering a .nomedia file, notify the MediaScannerClient, so that it can erase the data column for entries that are in the folder containing the .nomedia file. This prevents us from deleting (via a delete trigger) files when somebody adds a .nomedia file after the fact.
2009-09-03 12:27:26 -07:00
Marco Nelissen
8b04661700 When encountering a .nomedia file, notify the MediaScannerClient,
so that it can erase the data column for entries that are in the
folder containing the .nomedia file. This prevents us from
deleting (via a delete trigger) files when somebody adds a
.nomedia file after the fact.
2009-09-03 11:22:28 -07:00
Andreas Huber
4c48342572 Setting the component role appears to be mandatory now for all mime types.
Also using CODEC_LOGV instead of vanilla LOGV to include the component name the message related to.
2009-09-02 16:05:36 -07:00
Andreas Huber
da050cf206 Some work to make audio encoding work. 2009-09-02 14:01:43 -07:00
Andreas Huber
43ad6eaf77 Squashed commit of the following:
commit c45bfbb97ccd05982008df47181f9c73abaf0497
Author: Andreas Huber <andih@google.com>
Date:   Tue Sep 1 15:58:12 2009 -0700

    This quirk should not be enabled by default in order to make the bug reproducible by the vendor.

commit 21d72e80e795fcae53d9c3bcc8ba6312b081e420
Author: Andreas Huber <andih@google.com>
Date:   Tue Sep 1 15:55:45 2009 -0700

    Undoing the hack to temporarily give up the lock to facilitate reading from the buffer source.

    This simply causes too many issues, there need to be independent threads providing input buffers and dequeuing output buffers.

commit 84d507def8999c146ce124cc8edfe106c9ca70c2
Author: Andreas Huber <andih@google.com>
Date:   Tue Sep 1 15:16:23 2009 -0700

    The AAC components appear to output stereo data even if the input data is mono...
2009-09-01 16:02:43 -07:00
Andreas Huber
329577aa6d Squashed commit of the following:
commit 3fa5f3ce910f34da0cedb8bcce1bd593db7eb740
Author: Andreas Huber <andih@google.com>
Date:   Thu Aug 27 14:48:54 2009 -0700

    Getting rid of more code now obsolete with the departure of OMXDecoder.

commit e0d923ec0c7bb60bec8eb97739036a4c70c0feef
Author: Andreas Huber <andih@google.com>
Date:   Thu Aug 27 14:33:06 2009 -0700

    Remove obsoleted OMXDecoder class. OMXDecoder is dead, long live OMXCodec.
2009-08-27 14:50:58 -07:00
Android (Google) Code Review
bc86bda499 Merge change 22897 into eclair
* changes:
  Fix issue 2045911: Camera Shutter tone does not play correctly while listening to music.
2009-08-27 11:37:35 -07:00
Andreas Huber
42978e55fe An attempt to fix a deadlock between OMXCodec::start and upstream ::read 2009-08-27 10:41:13 -07:00
Eric Laurent
327c27be19 Fix issue 2045911: Camera Shutter tone does not play correctly while listening to music.
Add the possibility to delay routing and volume commands in AudioPolicyClientInterface. The delay is not blocking for the caller.
2009-08-27 05:58:10 -07:00
Andreas Huber
127fcdcd9f Another quirk, some OMX components fail to properly flush before shutdown and we must do it for them... 2009-08-26 16:27:02 -07:00
Andreas Huber
b5ceb9ee21 assert => CHECK in stagefright. 2009-08-26 14:48:20 -07:00
Andreas Huber
446f44f61a Keep up with latest changes to overlay handling on that unnamable platform. 2009-08-26 09:11:13 -07:00
Andreas Huber
404cc418be Make sure not to ask for more buffers when we know that there won't be any, added a quirk for the aac decoder. 2009-08-25 14:26:05 -07:00
Andreas Huber
5c0a9133d2 Dynamically allocate a pair of MemoryHeaps according buffer count/sizes required by the OMX component, respect JPEG compressed size. 2009-08-20 11:16:40 -07:00