diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioRecord.h | 4 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 6 | ||||
-rw-r--r-- | include/private/media/AudioTrackShared.h | 7 | ||||
-rw-r--r-- | include/ui/KeyLayoutMap.h | 34 | ||||
-rwxr-xr-x | include/ui/KeycodeLabels.h | 5 | ||||
-rw-r--r-- | include/utils/Functor.h | 1 |
6 files changed, 53 insertions, 4 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 5f7cd90..293764d 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -346,12 +346,14 @@ private: }; bool processAudioBuffer(const sp<ClientRecordThread>& thread); - status_t openRecord(uint32_t sampleRate, + status_t openRecord_l(uint32_t sampleRate, int format, int channelCount, int frameCount, uint32_t flags, audio_io_handle_t input); + audio_io_handle_t getInput_l(); + status_t restoreRecord_l(audio_track_cblk_t*& cblk); sp<IAudioRecord> mAudioRecord; sp<IMemory> mCblkMemory; diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 813a905..3e346db 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -437,7 +437,7 @@ private: }; bool processAudioBuffer(const sp<AudioTrackThread>& thread); - status_t createTrack(int streamType, + status_t createTrack_l(int streamType, uint32_t sampleRate, int format, int channelCount, @@ -446,6 +446,10 @@ private: const sp<IMemory>& sharedBuffer, audio_io_handle_t output, bool enforceFrameCount); + void flush_l(); + 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); sp<IAudioTrack> mAudioTrack; sp<IMemory> mCblkMemory; diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h index c6990bf..4610135 100644 --- a/include/private/media/AudioTrackShared.h +++ b/include/private/media/AudioTrackShared.h @@ -31,6 +31,7 @@ namespace android { #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 +#define RESTORE_TIMEOUT_MS 5000 // Maximum waiting time for a track to be restored #define CBLK_UNDERRUN_MSK 0x0001 #define CBLK_UNDERRUN_ON 0x0001 // underrun (out) or overrrun (in) indication @@ -47,6 +48,12 @@ namespace android { #define CBLK_DISABLED_MSK 0x0010 #define CBLK_DISABLED_ON 0x0010 // track disabled by AudioFlinger due to underrun: #define CBLK_DISABLED_OFF 0x0000 // must be re-started +#define CBLK_RESTORING_MSK 0x0020 +#define CBLK_RESTORING_ON 0x0020 // track is being restored after invalidation +#define CBLK_RESTORING_OFF 0x0000 // by AudioFlinger +#define CBLK_RESTORED_MSK 0x0040 +#define CBLK_RESTORED_ON 0x0040 // track has been restored after invalidation +#define CBLK_RESTORED_OFF 0x0040 // by AudioFlinger struct audio_track_cblk_t { diff --git a/include/ui/KeyLayoutMap.h b/include/ui/KeyLayoutMap.h index 904c8f3..d82d0c8 100644 --- a/include/ui/KeyLayoutMap.h +++ b/include/ui/KeyLayoutMap.h @@ -24,6 +24,36 @@ namespace android { +struct AxisInfo { + enum Mode { + // Axis value is reported directly. + MODE_NORMAL = 0, + // Axis value should be inverted before reporting. + MODE_INVERT = 1, + // Axis value should be split into two axes + MODE_SPLIT = 2, + }; + + // Axis mode. + Mode mode; + + // Axis id. + // When split, this is the axis used for values smaller than the split position. + int32_t axis; + + // When split, this is the axis used for values after higher than the split position. + int32_t highAxis; + + // The split value, or 0 if not split. + int32_t splitValue; + + // The flat value, or -1 if none. + int32_t flatOverride; + + AxisInfo() : mode(MODE_NORMAL), axis(-1), highAxis(-1), splitValue(0), flatOverride(-1) { + } +}; + /** * Describes a mapping from keyboard scan codes and joystick axes to Android key codes and axes. */ @@ -36,7 +66,7 @@ public: status_t mapKey(int32_t scanCode, int32_t* keyCode, uint32_t* flags) const; status_t findScanCodesForKey(int32_t keyCode, Vector<int32_t>* outScanCodes) const; - status_t mapAxis(int32_t scanCode, int32_t* axis) const; + status_t mapAxis(int32_t scanCode, AxisInfo* outAxisInfo) const; private: struct Key { @@ -45,7 +75,7 @@ private: }; KeyedVector<int32_t, Key> mKeys; - KeyedVector<int32_t, int32_t> mAxes; + KeyedVector<int32_t, AxisInfo> mAxes; KeyLayoutMap(); diff --git a/include/ui/KeycodeLabels.h b/include/ui/KeycodeLabels.h index bdfbf7c..b912e9b 100755 --- a/include/ui/KeycodeLabels.h +++ b/include/ui/KeycodeLabels.h @@ -270,6 +270,11 @@ static const KeycodeLabel AXES[] = { { "HAT_Y", 16 }, { "LTRIGGER", 17 }, { "RTRIGGER", 18 }, + { "THROTTLE", 19 }, + { "RUDDER", 20 }, + { "WHEEL", 21 }, + { "GAS", 22 }, + { "BRAKE", 23 }, { "GENERIC_1", 32 }, { "GENERIC_2", 33 }, { "GENERIC_3", 34 }, diff --git a/include/utils/Functor.h b/include/utils/Functor.h index 3955bc3..565f4a3 100644 --- a/include/utils/Functor.h +++ b/include/utils/Functor.h @@ -26,6 +26,7 @@ public: Functor() {} virtual ~Functor() {} virtual status_t operator ()() { return true; } + virtual status_t operator ()(float* data, uint32_t len) { return true; } }; }; // namespace android |