diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-01-20 14:03:58 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-01-20 14:03:58 -0800 |
commit | 22f7dfd23490a3de2f21ff96949ba47003aac8f8 (patch) | |
tree | 41bc290bb2f1f08a0e37cfda4955742a85d42ecf /include | |
parent | 9266c558bf1d21ff647525ff99f7dadbca417309 (diff) | |
download | frameworks_base-22f7dfd23490a3de2f21ff96949ba47003aac8f8.zip frameworks_base-22f7dfd23490a3de2f21ff96949ba47003aac8f8.tar.gz frameworks_base-22f7dfd23490a3de2f21ff96949ba47003aac8f8.tar.bz2 |
auto import from //branches/cupcake/...@127101
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioRecord.h | 2 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 2 | ||||
-rw-r--r-- | include/media/ToneGenerator.h | 2 | ||||
-rw-r--r-- | include/private/media/AudioTrackShared.h | 9 | ||||
-rw-r--r-- | include/ui/Overlay.h | 6 | ||||
-rw-r--r-- | include/utils/Parcel.h | 13 |
6 files changed, 27 insertions, 7 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 71744be..dd585c9 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -275,7 +275,7 @@ public: STOPPED = 1 }; - status_t obtainBuffer(Buffer* audioBuffer, bool blocking); + status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); void releaseBuffer(Buffer* audioBuffer); diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index f382451..fd62daa 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -358,7 +358,7 @@ public: STOPPED = 1 }; - status_t obtainBuffer(Buffer* audioBuffer, bool blocking); + status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); void releaseBuffer(Buffer* audioBuffer); diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h index 0ddfb8e..0cfdeec7 100644 --- a/include/media/ToneGenerator.h +++ b/include/media/ToneGenerator.h @@ -134,7 +134,7 @@ private: Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested float mVolume; // Volume applied to audio track int mStreamType; // Audio stream used for output - int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). + unsigned int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). bool initAudioTrack(); static void audioCallback(int event, void* user, void *info); diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h index 72ed281..1991aa7 100644 --- a/include/private/media/AudioTrackShared.h +++ b/include/private/media/AudioTrackShared.h @@ -28,6 +28,11 @@ namespace android { #define MAX_SAMPLE_RATE 65535 #define THREAD_PRIORITY_AUDIO_CLIENT (ANDROID_PRIORITY_AUDIO) +// Maximum cumulated timeout milliseconds before restarting audioflinger thread +#define MAX_STARTUP_TIMEOUT_MS 3000 // Longer timeout period at startup to cope with A2DP init time +#define MAX_RUN_TIMEOUT_MS 1000 +#define WAIT_PERIOD_MS 10 + struct audio_track_cblk_t { @@ -55,9 +60,11 @@ struct audio_track_cblk_t int16_t flowControlFlag; // underrun (out) or overrrun (in) indication uint8_t out; // out equals 1 for AudioTrack and 0 for AudioRecord uint8_t forceReady; + uint16_t bufferTimeoutMs; // Maximum cumulated timeout before restarting audioflinger + uint16_t waitTimeMs; // Cumulated wait time // Padding ensuring that data buffer starts on a cache line boundary (32 bytes). // See AudioFlinger::TrackBase constructor - int32_t Padding[4]; + int32_t Padding[3]; audio_track_cblk_t(); uint32_t stepUser(uint32_t frameCount); diff --git a/include/ui/Overlay.h b/include/ui/Overlay.h index 9c7bc47..f8454fd 100644 --- a/include/ui/Overlay.h +++ b/include/ui/Overlay.h @@ -40,7 +40,7 @@ class IMemoryHeap; class OverlayRef : public LightRefBase<OverlayRef> { public: - OverlayRef(overlay_handle_t const*, const sp<IOverlay>&, + OverlayRef(overlay_handle_t, const sp<IOverlay>&, uint32_t w, uint32_t h, int32_t f, uint32_t ws, uint32_t hs); static sp<OverlayRef> readFromParcel(const Parcel& data); @@ -53,7 +53,7 @@ private: OverlayRef(); virtual ~OverlayRef(); - overlay_handle_t const *mOverlayHandle; + overlay_handle_t mOverlayHandle; sp<IOverlay> mOverlayChannel; uint32_t mWidth; uint32_t mHeight; @@ -74,7 +74,7 @@ public: void destroy(); /* get the HAL handle for this overlay */ - overlay_handle_t const* getHandleRef() const; + overlay_handle_t getHandleRef() const; /* blocks until an overlay buffer is available and return that buffer. */ status_t dequeueBuffer(overlay_buffer_t* buffer); diff --git a/include/utils/Parcel.h b/include/utils/Parcel.h index 7c451ab..9087c44 100644 --- a/include/utils/Parcel.h +++ b/include/utils/Parcel.h @@ -17,6 +17,7 @@ #ifndef ANDROID_PARCEL_H #define ANDROID_PARCEL_H +#include <cutils/native_handle.h> #include <utils/Errors.h> #include <utils/RefBase.h> #include <utils/String16.h> @@ -78,6 +79,9 @@ public: status_t writeString16(const char16_t* str, size_t len); status_t writeStrongBinder(const sp<IBinder>& val); status_t writeWeakBinder(const wp<IBinder>& val); + + // doesn't take ownership of the native_handle + status_t writeNativeHandle(const native_handle& handle); // Place a file descriptor into the parcel. The given fd must remain // valid for the lifetime of the parcel. @@ -108,6 +112,15 @@ public: const char16_t* readString16Inplace(size_t* outLen) const; sp<IBinder> readStrongBinder() const; wp<IBinder> readWeakBinder() const; + + + // if alloc is NULL, native_handle is allocated with malloc(), otherwise + // alloc is used. If the function fails, the effects of alloc() must be + // reverted by the caller. + native_handle* readNativeHandle( + native_handle* (*alloc)(void* cookie, int numFds, int ints), + void* cookie) const; + // Retrieve a file descriptor from the parcel. This returns the raw fd // in the parcel, which you do not own -- use dup() to get your own copy. |