summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2013-02-21 20:06:04 -0800
committerSteve Kondik <shade@chemlab.org>2013-04-08 23:05:17 -0700
commit203e28ca88001f2a0f4db7a3018977c687333941 (patch)
treea73d73163f143d3a842bef7000f8bc7f909a98d8 /include
parentba8b022736266d6dda1a1cd5986f8f999710db9f (diff)
downloadframeworks_av-203e28ca88001f2a0f4db7a3018977c687333941.zip
frameworks_av-203e28ca88001f2a0f4db7a3018977c687333941.tar.gz
frameworks_av-203e28ca88001f2a0f4db7a3018977c687333941.tar.bz2
libstagefright: Squashed audio fixes from CodeAurora
libstagefright: Return seek position until seek has been processed If it so happens that the client to TunnelPlayer (e.g. AwesomePlayer) queries for the current time before data from the new seek position is given to the compressed driver, we need to return the seek position Change-Id: If709e61f67cc8e81d34c14d19145dc61ecd82c2b CRs-Fixed: 454825 libstagefright: Use 64 bit offsets only when needed. For enabling >2GB recording, 64 bit offsets are needed for file writing. So, this feature was turned on by default. This in turn increased the file size. With this change, by default this feature will be off and turned on only when required. - Use 64 bit offsets for resolutions >= 720p. - Limit maximum file size for recording to 4GB. - Set max file size only if no value is set from the client. - Fix MPEG4Extractor to use 64 bit offsets CRs-Fixed: 273144, 285785, 288319 (cherry picked from commit 04476a3fb89dfbb025f7852dd4d62cae72385f1a) Change-Id: I00af2c7cddbbf86c566fe4bb989fe728ca06dd19 libstagefright: TunnelPlayer sync fix - Allow close on the AudioSink to be called from the extractor thread and the application thread. - This fixes a race condition where an onPauseTimeout event scheduled from the main thread closes the audio sink while the extractor thread was about to issue write() on audio HAL. (note: on HAL, not audio sink) Change-Id: I22a5c655dfcb40f3cbda3765dc23ad8e6f99c9bb CRs-Fixed: 443205 Frameworks/av: Fix to prevent deadlock in AudioEffects -Write is blocked waiting for effect chain lock and this causes decoder thread to wait indefintely. -Sometimes it is observed that effectschain is locked before mLPAEffectChain is initialized and but unlocking is skipped if mLPAEffectChain is initialized in between.Due to this LPA silence and framework reboot issues are observed as applyEffectsOn() cannot acquire lock to progress further. -Use flag to check if all effects have been locked and unlock accordingly to prevent the deadlock scenario. (cherry picked from commit 011db22abf565dfbe7f9d0a5c7af7564587b3b48) Change-Id: I82cfdab045ecf077f0ba0185fc693fc623fa10db CRs-Fixed: 435661, 435664, 435680, 430309 audio: Use tunnel player only for music stream - Check stream type before creating tunnel player to use tunnel player only for STREAM_MUSIC Change-Id: I6e4b58524e61441ad2e09499bd9187c6dd56cd3d framework/av: Fix for audio recording test through CTS - Issue: Failure in stop is observed with the audio recording test through CTS. TestScenario: When the audio record test is initiated in the CTS console, the recording session is force closed with a notification File Size limit exceeded. Further, the stop fails with the same message(notification of the File size exceeded error). - Cause: The calculation of nTotalBytesEstimate for the recording session exceeds the limit 95 percent of mMaxFileSizeLimitBytes. As a result of size deficit, the recording is stopped at the beginning of the recording session notifying MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED. - Fix: The factor size used in the calculation of nTotalBytesEstimate has been updated properly for 64bit file offset setting. The setParam64BitFileOffset in StagefrightRecorder::prepare() is executed based on two additional validations so that the factor size is updated appropriately. Change-Id: I4749ce8f9735ccc9e1d9e49718c36470837ab27f CRs-Fixed: 396057 audioflinger: apply volume on direct track when track is active During back to back tunnel playback, we encounter a race condition where setVolume can be called when the track is not updated to active state. Fix to apply the volume on direct track only when the track is in active state. Change-Id: I70c289fbf8a9266bae0bd01b04be9f43ad32c70d CRs-Fixed: 464148 LPAPlayer: Update condition to ignore seek - Reject seek if the new seek time is greater than the current position and within an empirical limit (default 60ms). - This limit must be measured for each target. Change-Id: I86b44679fb5fe442bb5adb510c62514f6be3d304 CRs-Fixed: 453067 audioflinger: for DirectAudioTrak, call startOutput before stream is active For LPA and Tunnel playback, when resume is done in paused state, before starting actual playback, volume should be set through AudioPolicy command thread. Change-Id: I7ee1098058c01a35a3e7181d3b291304abf3cac1 CRs-Fixed: 464348
Diffstat (limited to 'include')
-rw-r--r--include/media/MediaPlayerInterface.h6
-rwxr-xr-xinclude/media/stagefright/LPAPlayer.h4
-rw-r--r--include/media/stagefright/TunnelPlayer.h15
3 files changed, 22 insertions, 3 deletions
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 00d53af..5f9eb01 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -1,5 +1,8 @@
/*
* Copyright (C) 2007 The Android Open Source Project
+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Not a Contribution, Apache license notifications and license are retained
+ * for attribution purposes only.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,6 +90,9 @@ public:
virtual ssize_t channelCount() const = 0;
virtual ssize_t frameSize() const = 0;
virtual uint32_t latency() const = 0;
+#ifdef QCOM_HARDWARE
+ virtual audio_stream_type_t streamType() const {return AUDIO_STREAM_DEFAULT;}
+#endif
virtual float msecsPerFrame() const = 0;
virtual status_t getPosition(uint32_t *position) const = 0;
virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0;
diff --git a/include/media/stagefright/LPAPlayer.h b/include/media/stagefright/LPAPlayer.h
index 91f9b3a..ceba399 100755
--- a/include/media/stagefright/LPAPlayer.h
+++ b/include/media/stagefright/LPAPlayer.h
@@ -206,6 +206,9 @@ private:
void handleA2DPSwitch();
void onPauseTimeOut();
+ int64_t getMediaTimeUs_l();
+ bool seekTooClose(int64_t);
+
sp<AudioFlingerLPAdecodeClient> AudioFlingerClient;
friend class AudioFlingerLPAdecodeClient;
Mutex AudioFlingerLock;
@@ -260,7 +263,6 @@ private:
MediaPlayerBase::AudioSink *audioSink,
void *buffer, size_t size, void *cookie);
size_t AudioCallback(void *cookie, void *data, size_t size);
- int64_t getMediaTimeUs_l();
void convertMonoToStereo(int16_t *data, size_t size);
diff --git a/include/media/stagefright/TunnelPlayer.h b/include/media/stagefright/TunnelPlayer.h
index 04cc750..0b083b3 100644
--- a/include/media/stagefright/TunnelPlayer.h
+++ b/include/media/stagefright/TunnelPlayer.h
@@ -133,8 +133,7 @@ private:
//Declare the condition Variables and Mutex
- pthread_mutex_t extractor_mutex;
- pthread_cond_t extractor_cv;
+ Condition mExtractorCV;
// make sure Decoder thread has exited
@@ -198,8 +197,18 @@ private:
sp<TimedEventQueue::Event> mPauseEvent;
bool mPauseEventPending;
+ typedef enum {
+ NCREATED = -1,
+ INITIALIZED,
+ RUNNING,
+ SLEEPING,
+ EXITING,
+ } ThreadState;
+
sp<MediaPlayerBase::AudioSink> mAudioSink;
AwesomePlayer *mObserver;
+ ThreadState mThreadState;
+ bool mStopSinkPending;
static size_t AudioSinkCallback(
MediaPlayerBase::AudioSink *audioSink,
@@ -218,6 +227,8 @@ private:
size_t fillBuffer(void *data, size_t size);
void reset();
+ status_t schedPauseTimeOut();
+ status_t stopAudioSink();
TunnelPlayer(const TunnelPlayer &);
TunnelPlayer &operator=(const TunnelPlayer &);