summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AudioSource.cpp
Commit message (Collapse)AuthorAgeFilesLines
* warnings be gone.Andreas Huber2014-04-111-2/+2
| | | | | | | | (cherry picked from commit 84333e0475bc911adc16417f4ca327c975cf6c36) Modified by Mark Salyzyn <salyzyn@google.com> to keep merge conflicts or errors downstream to a minimum. Change-Id: Ic3b272f9cbf3155001aabd2f79728f1bc31de613
* Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-1/+1
| | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
* Fix kAutoRampDurationUs overflow issueVineeta Srivastava2013-10-181-2/+2
| | | | | | | | When kAutoRampDurationUs multiplies with mSampleRate, it overflows to int64. Type cast it to int64 to make sure RampDurationUs properly. BUg: 11162491 Change-Id: I4f93bc9acc8456e25623a9255ca7a5b206425009
* AudioRecord must be used as sp<> onlyGlenn Kasten2013-06-131-7/+2
| | | | | Bug: 9423855 Change-Id: I78ba8228c60dff11fb466156bb632c5dda45cdaf
* Use size_t for frame countsGlenn Kasten2012-11-151-1/+1
| | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* ALooper::GetNowUs() now relies on systemTime instead of gettimeofday.Andreas Huber2012-10-011-14/+3
| | | | | Change-Id: Ia31eb0940b02581327a8bf51af6df135f9ab6de3 related-to-bug: 7266324
* Prepare for transmitting audio through AudioSource.Andreas Huber2012-08-301-5/+18
| | | | | | | | AudioSource can now be configured to output buffers timestamped based on looper time (absolute) instead of based on systemTime() relative to start time. Change-Id: I8eca42648eb50033ac4aafbe5daac64a98a40690
* Use audio_channel_mask_t more consistentlyGlenn Kasten2012-07-031-1/+1
| | | | | | | | | | | | | | | In IAudioFlinger::createTrack() and IAudioFlinger::openRecord(), declare input parameter to use correct type audio_channel_mask_t. In IAudioFlinger::getInputBufferSize(), input parameter is now channel mask instead of channel count. Remove unused IAudioFlinger::channelCount(audio_io_handle_t). In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(), input parameter is channel mask instead of channel count. Change-Id: Ib2f1c29bea70f016b3cfce83942ba292190ac965
* Fixed a media server crash due to unintialized mRecord member variableJames Dong2012-06-291-1/+2
| | | | | | | | | mRecord is not properly initialized if the call to AudioRecord::getMinFrameCount() fails. media server crashes when the unintialized mRecord object is deleted in AudioSource's destructor. Change-Id: Ia89222789d044c11c9957a99725bc89f9c709e17 related-to-bug: 6744014
* Remove AudioRecord record_flagsGlenn Kasten2012-06-221-5/+0
| | | | Change-Id: I021ddcc1bcb63132a4597d13e3d09db2a5f2c628
* stagefright: fix AudioRecord callback buffer sizeEric Laurent2012-06-121-13/+33
| | | | | | | | | | | Make sure that the maximum number of frames passed to AudioSource by the AudioRecord callback always fits within the maximum buffer size defined by kMaxBufferSize. Also make sure that the total AudioRecord buffer size is more than the minimum required. Change-Id: I26a1f998e0cf75ac88b02e67ec9d8db3c0cca193
* audio_channel_in/out_mask_from_countGlenn Kasten2012-03-151-4/+4
| | | | | | | and avoid ambiguous term "channels" where it might be confusing as to whether it is a channel mask or channel count Change-Id: I744fa08ccb6001a98c97bd638d2c9d56836c4234
* Use AudioRecord::record_flags consistentlyGlenn Kasten2012-03-081-2/+3
| | | | Change-Id: I6f369a2b99eb515603bc7d5629a07db2b96783fe
* Limit the amount of audio record data in each bufferJames Dong2012-02-151-19/+38
| | | | | | | o The size of each input buffer should be less than or equal to kMaxBufferSize o related-to-bug: 5977032 Change-Id: I04343169aac3df56694aad4ba7967ec45337ad7e
* Don't call virtual functions in the destructor for audio and camera source ↵James Dong2012-02-021-2/+2
| | | | | | classes Change-Id: Ia74ffc1c0cbd7971697f5e3c476e340ec5c7727a
* Use audio_source_t consistentlyGlenn Kasten2012-01-261-1/+1
| | | | | | | | | | | | | | | | Was a mix of audio_source_t, uint8_t, and int. Related fixes: - fix comments in MediaRecorder.java - AudioPolicyService server side was not checking source parameter at all, so if the client wrapper was bypassed, invalid values could be passed into audio HAL - JNI android_media_AudioRecord_setup was checking source for positive values, but not negative values. This test is redundant, since already checked at Java and now checked by AudioPolicyService also, but might as well make it correct. Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-3/+3
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* 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
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-271-2/+2
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* A/V synchronization at the beginning of a recording sessionJames Dong2011-02-171-1/+14
| | | | | | | | | | | | | o do not use edts/elst boxes since these optional boxes are ignored o manipulate the first video/audio frame duration to make sure that the rest of the audio/video is in sync (ideally, we should only manipulate the vidoe frame duration, not the audio) o reduce the initial audio mute/suppression period, which is used to eliminate the "recording" sound. bug - 3405882 and 3362703 Change-Id: Ib0acfb4f3843b365157288951dc122b006299c18
* Decouple AudioRecord read and audio encodingJames Dong2011-02-161-128/+145
| | | | | | bug - 3313754 Change-Id: I951dd0e21e34aa1412c391f003bc32103d0424b0
* Catch read error from AudioRecord and do not assertJames Dong2011-02-091-4/+3
| | | | | | bug - 3439313 Change-Id: Ie29d6e4945978ef27fc3e5849e467d895c7736d3
* Report errors to applications if AudioRecord->start() failsJames Dong2011-01-251-1/+4
| | | | | | bug - 3385198 Change-Id: I86ac8071eb28a538b333e102192193d1b9eda5eb
* Revert "Allows the authoring engine to skip frame."James Dong2010-12-111-45/+1
| | | | | | | | | | | | | | o Skipping frames could lead to a lot of issues such as I frames is lost etc. It is not being used anyway. This reverts commit 53d4e0d58e2d5c18f6e026c705af833b9bdd7aba. Conflicts: media/libstagefright/AudioSource.cpp media/libstagefright/CameraSource.cpp Change-Id: I3abba1647de48db25bdc369066eb2a7ae4dedec2
* Fix audio input sample timestamp when audio driver loses audio samplesJames Dong2010-09-141-1/+4
| | | | Change-Id: Ic0f1489f710929af50e7714867ae5153b3242dd8
* HW audio encoder expects timestamp via kKeyTime from each input bufferJames Dong2010-09-081-1/+3
| | | | | | - This fixes media server crashes on droid Change-Id: I7191cadc5275107425ec3ee3d437b2c5295858dc
* Calculate audio media drift time from AudioSourceJames Dong2010-09-011-3/+12
| | | | | | | | | | | | | | | | | | | The problem was that the time to receive an output buffer from an audio encoder is different because the encoder does not need to read from the source for all output buffers. This leads to large fluctuation in terms of wall clock duration between two neighboring audio sample outputs from the audio encoder. As a result, the media time for the video track after adjustment using the drifting changes wildly sometimes. This patch addresses this issue by only updating the media drift time when an audio source input buffer is read. the wall clock for the audio track is also calculated at the same time when the input audio buffer is read at AudioSource. bug - 2959800 Change-Id: I3174aa182f744784b540f0a7198524d4eee8bd7b
* Make sure that if initialization fails, AudioSource still behaves well.James Dong2010-09-011-4/+17
| | | | Change-Id: I16dfc90bcb8a324d6ee9a38a5a1a31cc094c820a
* Suppress the video recording start signalJames Dong2010-08-261-0/+46
| | | | | | - bug 2950297 Change-Id: I0044d07178691feb904cf81e87c1b6d4b714dc1a
* Handle large audio lostJames Dong2010-08-101-9/+17
| | | | Change-Id: I2687ad855aac758946954d0b3fe7aff9f7b5ae7c
* Add lost frame handling in AudioSourceJames Dong2010-07-301-45/+92
| | | | | | - Also collect stats on lost audio frames instead of time spent on reading Change-Id: I6380b143e4fbdcd894491aaae523331e90d0f04f
* Allows the authoring engine to skip frame.James Dong2010-07-221-36/+59
| | | | | | | | | | | This is 1st part of the work to allow audio and video resync if we found out that audio and video are out of sync during authoring - also fixed a problem in AACEncoder::read() where the buffer acquired from the buffer group does not release when error out at reading from source. Change-Id: I8a2740097fcfdf85e6178869afeb9f3687a99118
* Track maximum amplitude and fix getMaxAmplitude()James Dong2010-06-241-0/+29
| | | | | | - only start to track the max amplitude after the first call to getMaxAmplitude() Change-Id: I64d3d9ca0542202a8535a211425e8bccceca50fc
* Audio/video sync during recording (second part)James Dong2010-06-211-10/+23
| | | | Change-Id: Iba0b35f57fdeac7ee1da16899406bf4b957a2c8c
* Remove hard-coded number of audio channels in AudioSourceJames Dong2010-06-141-4/+14
| | | | Change-Id: I5f362252c25e2251bbfa9818b711ee23b4975248
* Initial checkin for pause and resume controlJames Dong2010-06-111-4/+6
| | | | Change-Id: Ibdcf7bea5fb66baa81878704ba4091dfcfe382ee
* Initial check-in for collecting stats from authoring engine at runtimeJames Dong2010-06-081-1/+34
| | | | Change-Id: I93a9d8bd260efc5e7fc135b726e3f1307c6df794
* Support AAC recordingJames Dong2010-05-031-0/+4
| | | | | | | | - Extend the audio recording to AAC format - Add support for setting some recording parameters - Add stss box to the meta data in the recorded file Change-Id: I41167bfd9d70ef9cd33906f8437b39c232b6d3b7
* Initial checkin of AudioSource and AMRWriter, a pair of classes supporting ↵Andreas Huber2010-01-251-0/+122
pure-audio recording in stagefright. related-to-bug: 2295449