diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioSystem.h | 4 | ||||
-rw-r--r-- | include/media/IAudioFlinger.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/MetaData.h | 2 | ||||
-rw-r--r-- | include/private/media/AudioTrackShared.h | 14 | ||||
-rw-r--r-- | include/private/media/StaticAudioTrackState.h | 10 |
5 files changed, 24 insertions, 10 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 225ef76..4c22412 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -127,8 +127,8 @@ public: // NOTE: this feature is not supported on all hardware platforms and it is // necessary to check returned status before using the returned values. static status_t getRenderPosition(audio_io_handle_t output, - size_t *halFrames, - size_t *dspFrames, + uint32_t *halFrames, + uint32_t *dspFrames, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h index 899d79f..282f275 100644 --- a/include/media/IAudioFlinger.h +++ b/include/media/IAudioFlinger.h @@ -167,10 +167,10 @@ public: virtual status_t setVoiceVolume(float volume) = 0; - virtual status_t getRenderPosition(size_t *halFrames, size_t *dspFrames, + virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, audio_io_handle_t output) const = 0; - virtual size_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0; + virtual uint32_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0; virtual int newAudioSessionId() = 0; diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h index 3a87474..db8216b 100644 --- a/include/media/stagefright/MetaData.h +++ b/include/media/stagefright/MetaData.h @@ -215,6 +215,8 @@ public: bool findData(uint32_t key, uint32_t *type, const void **data, size_t *size) const; + bool hasData(uint32_t key) const; + void dumpToLog() const; protected: diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h index 7fd9379..2d033e6 100644 --- a/include/private/media/AudioTrackShared.h +++ b/include/private/media/AudioTrackShared.h @@ -65,7 +65,9 @@ typedef SingleStateQueue<StaticAudioTrackState> StaticAudioTrackSingleStateQueue struct AudioTrackSharedStatic { StaticAudioTrackSingleStateQueue::Shared mSingleStateQueue; - size_t mBufferPosition; // updated asynchronously by server, + // This field should be a size_t, but since it is located in shared memory we + // force to 32-bit. The client and server may have different typedefs for size_t. + uint32_t mBufferPosition; // updated asynchronously by server, // "for entertainment purposes only" }; @@ -108,7 +110,9 @@ struct audio_track_cblk_t private: - size_t mMinimum; // server wakes up client if available >= mMinimum + // This field should be a size_t, but since it is located in shared memory we + // force to 32-bit. The client and server may have different typedefs for size_t. + uint32_t mMinimum; // server wakes up client if available >= mMinimum // Channel volumes are fixed point U4.12, so 0x1000 means 1.0. // Left channel is in [0:15], right channel is in [16:31]. @@ -245,7 +249,11 @@ public: } void setMinimum(size_t minimum) { - mCblk->mMinimum = minimum; + // This can only happen on a 64-bit client + if (minimum > UINT32_MAX) { + minimum = UINT32_MAX; + } + mCblk->mMinimum = (uint32_t) minimum; } // Return the number of frames that would need to be obtained and released diff --git a/include/private/media/StaticAudioTrackState.h b/include/private/media/StaticAudioTrackState.h index 46a5946..d483061 100644 --- a/include/private/media/StaticAudioTrackState.h +++ b/include/private/media/StaticAudioTrackState.h @@ -25,9 +25,13 @@ namespace android { // state is wrapped by a SingleStateQueue. struct StaticAudioTrackState { // do not define constructors, destructors, or virtual methods - size_t mLoopStart; - size_t mLoopEnd; - int mLoopCount; + + // These fields should both be size_t, but since they are located in shared memory we + // force to 32-bit. The client and server may have different typedefs for size_t. + uint32_t mLoopStart; + uint32_t mLoopEnd; + + int mLoopCount; }; } // namespace android |