Loading include/media/AudioParameter.h +3 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,9 @@ public: static const char *keyChannels; static const char *keyFrameCount; static const char *keyInputSource; #ifdef STE_HARDWARE static const char *keyLatency; #endif String8 toString(); Loading include/media/AudioSystem.h +19 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ namespace android { typedef void (*audio_error_callback)(status_t err); #ifdef STE_HARDWARE typedef void (*latency_update_callback)(void *cookie, audio_io_handle_t output, uint32_t latency); #endif class IAudioPolicyService; class String8; Loading Loading @@ -110,6 +113,10 @@ public: static int newAudioSessionId(); static void acquireAudioSessionId(int audioSession); static void releaseAudioSessionId(int audioSession); #ifdef STE_HARDWARE static int registerLatencyNotificationClient(latency_update_callback cb, void *cookie); static void unregisterLatencyNotificationClient(int clientId); #endif // types of io configuration change events received with ioConfigChanged() enum io_config_event { Loading Loading @@ -239,6 +246,13 @@ private: virtual void binderDied(const wp<IBinder>& who); }; #ifdef STE_HARDWARE struct NotificationClient : public RefBase { latency_update_callback mCb; void * mCookie; }; #endif static sp<AudioFlingerClient> gAudioFlingerClient; static sp<AudioPolicyServiceClient> gAudioPolicyServiceClient; friend class AudioFlingerClient; Loading @@ -261,6 +275,11 @@ private: // list of output descriptors containing cached parameters // (sampling rate, framecount, channel count...) static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs; #ifdef STE_HARDWARE static Mutex gLatencyLock; static int gNextUniqueLatencyId; static DefaultKeyedVector<int, sp<AudioSystem::NotificationClient> > gLatencyNotificationClients; #endif }; }; // namespace android Loading include/media/AudioTrack.h +12 −0 Original line number Diff line number Diff line Loading @@ -55,7 +55,12 @@ public: EVENT_LOOP_END = 2, // Sample loop end was reached; playback restarted from loop start if loop count was not 0. EVENT_MARKER = 3, // Playback head is at the specified marker position (See setMarkerPosition()). EVENT_NEW_POS = 4, // Playback head is at a new position (See setPositionUpdatePeriod()). #ifdef STE_HARDWARE EVENT_BUFFER_END = 5, // Playback head is at the end of the buffer. EVENT_LATENCY_CHANGED = 6 // Audio output has been reconfigured and latency has changed. #else EVENT_BUFFER_END = 5 // Playback head is at the end of the buffer. #endif }; /* Create Buffer on the stack and pass it to obtainBuffer() Loading Loading @@ -480,6 +485,10 @@ private: status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); audio_io_handle_t getOutput_l(); status_t restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart); #ifdef STE_HARDWARE static void LatencyCallbackWrapper(void *cookie, audio_io_handle_t output, uint32_t latency); void latencyCallback(audio_io_handle_t output, uint32_t latency); #endif sp<IAudioTrack> mAudioTrack; sp<IMemory> mCblkMemory; Loading Loading @@ -521,6 +530,9 @@ private: int mAuxEffectId; Mutex mLock; status_t mRestoreStatus; #ifdef STE_HARDWARE int mLatencyClientId; #endif }; Loading include/media/MediaPlayerInterface.h +8 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ public: // Callback returns the number of bytes actually written to the buffer. typedef size_t (*AudioCallback)( AudioSink *audioSink, void *buffer, size_t size, void *cookie); #ifdef STE_HARDWARE typedef void (*LatencyCallback)(uint32_t latency, void *cookie); #endif virtual ~AudioSink() {} virtual bool ready() const = 0; // audio output is open and ready Loading @@ -88,7 +91,12 @@ public: int format=AUDIO_FORMAT_PCM_16_BIT, int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT, AudioCallback cb = NULL, #ifdef STE_HARDWARE void *cookie = NULL, LatencyCallback latencyCb = NULL) = 0; #else void *cookie = NULL) = 0; #endif #ifdef WITH_QCOM_LPA // API to open a routing session for tunneled audio playback Loading include/media/stagefright/AudioPlayer.h +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ private: MediaPlayerBase::AudioSink *audioSink, void *data, size_t size, void *me); #ifdef STE_HARDWARE static void LatencyCallback(uint32_t latency, void *cookie); #endif size_t fillBuffer(void *data, size_t size); int64_t getRealTimeUsLocked() const; Loading Loading
include/media/AudioParameter.h +3 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,9 @@ public: static const char *keyChannels; static const char *keyFrameCount; static const char *keyInputSource; #ifdef STE_HARDWARE static const char *keyLatency; #endif String8 toString(); Loading
include/media/AudioSystem.h +19 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ namespace android { typedef void (*audio_error_callback)(status_t err); #ifdef STE_HARDWARE typedef void (*latency_update_callback)(void *cookie, audio_io_handle_t output, uint32_t latency); #endif class IAudioPolicyService; class String8; Loading Loading @@ -110,6 +113,10 @@ public: static int newAudioSessionId(); static void acquireAudioSessionId(int audioSession); static void releaseAudioSessionId(int audioSession); #ifdef STE_HARDWARE static int registerLatencyNotificationClient(latency_update_callback cb, void *cookie); static void unregisterLatencyNotificationClient(int clientId); #endif // types of io configuration change events received with ioConfigChanged() enum io_config_event { Loading Loading @@ -239,6 +246,13 @@ private: virtual void binderDied(const wp<IBinder>& who); }; #ifdef STE_HARDWARE struct NotificationClient : public RefBase { latency_update_callback mCb; void * mCookie; }; #endif static sp<AudioFlingerClient> gAudioFlingerClient; static sp<AudioPolicyServiceClient> gAudioPolicyServiceClient; friend class AudioFlingerClient; Loading @@ -261,6 +275,11 @@ private: // list of output descriptors containing cached parameters // (sampling rate, framecount, channel count...) static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs; #ifdef STE_HARDWARE static Mutex gLatencyLock; static int gNextUniqueLatencyId; static DefaultKeyedVector<int, sp<AudioSystem::NotificationClient> > gLatencyNotificationClients; #endif }; }; // namespace android Loading
include/media/AudioTrack.h +12 −0 Original line number Diff line number Diff line Loading @@ -55,7 +55,12 @@ public: EVENT_LOOP_END = 2, // Sample loop end was reached; playback restarted from loop start if loop count was not 0. EVENT_MARKER = 3, // Playback head is at the specified marker position (See setMarkerPosition()). EVENT_NEW_POS = 4, // Playback head is at a new position (See setPositionUpdatePeriod()). #ifdef STE_HARDWARE EVENT_BUFFER_END = 5, // Playback head is at the end of the buffer. EVENT_LATENCY_CHANGED = 6 // Audio output has been reconfigured and latency has changed. #else EVENT_BUFFER_END = 5 // Playback head is at the end of the buffer. #endif }; /* Create Buffer on the stack and pass it to obtainBuffer() Loading Loading @@ -480,6 +485,10 @@ private: status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); audio_io_handle_t getOutput_l(); status_t restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart); #ifdef STE_HARDWARE static void LatencyCallbackWrapper(void *cookie, audio_io_handle_t output, uint32_t latency); void latencyCallback(audio_io_handle_t output, uint32_t latency); #endif sp<IAudioTrack> mAudioTrack; sp<IMemory> mCblkMemory; Loading Loading @@ -521,6 +530,9 @@ private: int mAuxEffectId; Mutex mLock; status_t mRestoreStatus; #ifdef STE_HARDWARE int mLatencyClientId; #endif }; Loading
include/media/MediaPlayerInterface.h +8 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ public: // Callback returns the number of bytes actually written to the buffer. typedef size_t (*AudioCallback)( AudioSink *audioSink, void *buffer, size_t size, void *cookie); #ifdef STE_HARDWARE typedef void (*LatencyCallback)(uint32_t latency, void *cookie); #endif virtual ~AudioSink() {} virtual bool ready() const = 0; // audio output is open and ready Loading @@ -88,7 +91,12 @@ public: int format=AUDIO_FORMAT_PCM_16_BIT, int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT, AudioCallback cb = NULL, #ifdef STE_HARDWARE void *cookie = NULL, LatencyCallback latencyCb = NULL) = 0; #else void *cookie = NULL) = 0; #endif #ifdef WITH_QCOM_LPA // API to open a routing session for tunneled audio playback Loading
include/media/stagefright/AudioPlayer.h +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ private: MediaPlayerBase::AudioSink *audioSink, void *data, size_t size, void *me); #ifdef STE_HARDWARE static void LatencyCallback(uint32_t latency, void *cookie); #endif size_t fillBuffer(void *data, size_t size); int64_t getRealTimeUsLocked() const; Loading