summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/camera/CameraParameters.h5
-rw-r--r--include/media/AudioRecord.h16
-rw-r--r--include/media/AudioTrack.h19
-rw-r--r--include/media/IAudioFlinger.h10
-rw-r--r--include/media/stagefright/DataSource.h1
-rw-r--r--include/media/stagefright/openmax/OMX_IVCommon.h1
-rw-r--r--include/private/media/AudioTrackShared.h4
-rw-r--r--include/ui/Input.h86
-rw-r--r--include/utils/ResourceTypes.h64
9 files changed, 133 insertions, 73 deletions
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index dc5fc84..83d4f6d 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -263,7 +263,7 @@ public:
// direction is not affected by the rotation or mirroring of
// CAMERA_CMD_SET_DISPLAY_ORIENTATION. Coordinates range from -1000 to 1000.
// (-1000,-1000) is the upper left point. (1000, 1000) is the lower right
- // point. The length and width of focus areas cannot be 0 or negative.
+ // point. The width and height of focus areas cannot be 0 or negative.
//
// The fifth element is the weight. Values for weight must range from 1 to
// 1000. The weight should be interpreted as a per-pixel weight - all
@@ -373,7 +373,7 @@ public:
// direction is not affected by the rotation or mirroring of
// CAMERA_CMD_SET_DISPLAY_ORIENTATION. Coordinates of the rectangle range
// from -1000 to 1000. (-1000, -1000) is the upper left point. (1000, 1000)
- // is the lower right point. The length and width of metering areas cannot
+ // is the lower right point. The width and height of metering areas cannot
// be 0 or negative.
//
// The fifth element is the weight. Values for weight must range from 1 to
@@ -550,6 +550,7 @@ public:
static const char PIXEL_FORMAT_YUV422I[]; // YUY2
static const char PIXEL_FORMAT_YUV420P[]; // YV12
static const char PIXEL_FORMAT_RGB565[];
+ static const char PIXEL_FORMAT_RGBA8888[];
static const char PIXEL_FORMAT_JPEG[];
// Values for focus mode settings.
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index baab2e8..605680a 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -130,7 +130,7 @@ public:
* sampleRate: Track sampling rate in Hz.
* format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed
* 16 bits per sample).
- * channels: Channel mask: see audio_channels_t.
+ * channelMask: Channel mask: see audio_channels_t.
* frameCount: Total size of track PCM buffer in frames. This defines the
* latency of the track.
* flags: A bitmask of acoustic values from enum record_flags. It enables
@@ -151,7 +151,7 @@ public:
AudioRecord(int inputSource,
uint32_t sampleRate = 0,
int format = 0,
- uint32_t channels = AUDIO_CHANNEL_IN_MONO,
+ uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
int frameCount = 0,
uint32_t flags = 0,
callback_t cbf = 0,
@@ -177,7 +177,7 @@ public:
status_t set(int inputSource = 0,
uint32_t sampleRate = 0,
int format = 0,
- uint32_t channels = AUDIO_CHANNEL_IN_MONO,
+ uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
int frameCount = 0,
uint32_t flags = 0,
callback_t cbf = 0,
@@ -348,8 +348,8 @@ private:
bool processAudioBuffer(const sp<ClientRecordThread>& thread);
status_t openRecord_l(uint32_t sampleRate,
- int format,
- int channelCount,
+ uint32_t format,
+ uint32_t channelMask,
int frameCount,
uint32_t flags,
audio_io_handle_t input);
@@ -364,10 +364,10 @@ private:
uint32_t mFrameCount;
audio_track_cblk_t* mCblk;
- uint8_t mFormat;
+ uint32_t mFormat;
uint8_t mChannelCount;
uint8_t mInputSource;
- uint8_t mReserved;
+ uint8_t mReserved[2];
status_t mStatus;
uint32_t mLatency;
@@ -382,7 +382,7 @@ private:
uint32_t mNewPosition;
uint32_t mUpdatePeriod;
uint32_t mFlags;
- uint32_t mChannels;
+ uint32_t mChannelMask;
audio_io_handle_t mInput;
int mSessionId;
};
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index de928da..df30e8c 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -69,8 +69,8 @@ public:
MUTE = 0x00000001
};
uint32_t flags;
- int channelCount;
int format;
+ int channelCount; // will be removed in the future, do not use
size_t frameCount;
size_t size;
union {
@@ -129,7 +129,7 @@ public:
* sampleRate: Track sampling rate in Hz.
* format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed
* 16 bits per sample).
- * channels: Channel mask: see audio_channels_t.
+ * channelMask: Channel mask: see audio_channels_t.
* frameCount: Total size of track PCM buffer in frames. This defines the
* latency of the track.
* flags: Reserved for future use.
@@ -143,7 +143,7 @@ public:
AudioTrack( int streamType,
uint32_t sampleRate = 0,
int format = 0,
- int channels = 0,
+ int channelMask = 0,
int frameCount = 0,
uint32_t flags = 0,
callback_t cbf = 0,
@@ -163,7 +163,7 @@ public:
AudioTrack( int streamType,
uint32_t sampleRate = 0,
int format = 0,
- int channels = 0,
+ int channelMask = 0,
const sp<IMemory>& sharedBuffer = 0,
uint32_t flags = 0,
callback_t cbf = 0,
@@ -187,7 +187,7 @@ public:
status_t set(int streamType =-1,
uint32_t sampleRate = 0,
int format = 0,
- int channels = 0,
+ int channelMask = 0,
int frameCount = 0,
uint32_t flags = 0,
callback_t cbf = 0,
@@ -438,8 +438,8 @@ private:
bool processAudioBuffer(const sp<AudioTrackThread>& thread);
status_t createTrack_l(int streamType,
uint32_t sampleRate,
- int format,
- int channelCount,
+ uint32_t format,
+ uint32_t channelMask,
int frameCount,
uint32_t flags,
const sp<IMemory>& sharedBuffer,
@@ -459,11 +459,12 @@ private:
uint32_t mFrameCount;
audio_track_cblk_t* mCblk;
+ uint32_t mFormat;
uint8_t mStreamType;
- uint8_t mFormat;
uint8_t mChannelCount;
uint8_t mMuted;
- uint32_t mChannels;
+ uint8_t mReserved;
+ uint32_t mChannelMask;
status_t mStatus;
uint32_t mLatency;
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index d8fdc27..4037c46 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -48,8 +48,8 @@ public:
pid_t pid,
int streamType,
uint32_t sampleRate,
- int format,
- int channelCount,
+ uint32_t format,
+ uint32_t channelMask,
int frameCount,
uint32_t flags,
const sp<IMemory>& sharedBuffer,
@@ -61,8 +61,8 @@ public:
pid_t pid,
int input,
uint32_t sampleRate,
- int format,
- int channelCount,
+ uint32_t format,
+ uint32_t channelMask,
int frameCount,
uint32_t flags,
int *sessionId,
@@ -73,7 +73,7 @@ public:
*/
virtual uint32_t sampleRate(int output) const = 0;
virtual int channelCount(int output) const = 0;
- virtual int format(int output) const = 0;
+ virtual uint32_t format(int output) const = 0;
virtual size_t frameCount(int output) const = 0;
virtual uint32_t latency(int output) const = 0;
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h
index 6b6fcdf..48d1464 100644
--- a/include/media/stagefright/DataSource.h
+++ b/include/media/stagefright/DataSource.h
@@ -38,6 +38,7 @@ public:
kWantsPrefetching = 1,
kStreamedFromLocalHost = 2,
kIsCachingDataSource = 4,
+ kIsHTTPBasedSource = 8,
};
static sp<DataSource> CreateFromURI(
diff --git a/include/media/stagefright/openmax/OMX_IVCommon.h b/include/media/stagefright/openmax/OMX_IVCommon.h
index 4a8be7b..12b4f93 100644
--- a/include/media/stagefright/openmax/OMX_IVCommon.h
+++ b/include/media/stagefright/openmax/OMX_IVCommon.h
@@ -149,6 +149,7 @@ typedef enum OMX_COLOR_FORMATTYPE {
OMX_COLOR_Format24BitABGR6666,
OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
OMX_COLOR_FormatMax = 0x7FFFFFFF
} OMX_COLOR_FORMATTYPE;
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index 1827c3e..20abd51 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -26,7 +26,6 @@ namespace android {
// ----------------------------------------------------------------------------
-#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
@@ -82,7 +81,7 @@ struct audio_track_cblk_t
// 16 bit because data is converted to 16 bit before being stored in buffer
uint8_t frameSize;
- uint8_t channelCount;
+ uint8_t pad1;
uint16_t bufferTimeoutMs; // Maximum cumulated timeout before restarting audioflinger
uint16_t waitTimeMs; // Cumulated wait time
@@ -90,6 +89,7 @@ struct audio_track_cblk_t
volatile int32_t flags;
// Cache line boundary (32 bytes)
+
audio_track_cblk_t();
uint32_t stepUser(uint32_t frameCount);
bool stepServer(uint32_t frameCount);
diff --git a/include/ui/Input.h b/include/ui/Input.h
index ba1c6b4..c9f694a 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -655,11 +655,6 @@ private:
// Oldest sample to consider when calculating the velocity.
static const nsecs_t MAX_AGE = 200 * 1000000; // 200 ms
- // When the total duration of the window of samples being averaged is less
- // than the window size, the resulting velocity is scaled to reduce the impact
- // of overestimation in short traces.
- static const nsecs_t MIN_WINDOW = 100 * 1000000; // 100 ms
-
// The minimum duration between samples when estimating velocity.
static const nsecs_t MIN_DURATION = 10 * 1000000; // 10 ms
@@ -674,6 +669,87 @@ private:
int32_t mActivePointerId;
};
+
+/*
+ * Specifies parameters that govern pointer or wheel acceleration.
+ */
+struct VelocityControlParameters {
+ // A scale factor that is multiplied with the raw velocity deltas
+ // prior to applying any other velocity control factors. The scale
+ // factor should be used to adapt the input device resolution
+ // (eg. counts per inch) to the output device resolution (eg. pixels per inch).
+ //
+ // Must be a positive value.
+ // Default is 1.0 (no scaling).
+ float scale;
+
+ // The scaled speed at which acceleration begins to be applied.
+ // This value establishes the upper bound of a low speed regime for
+ // small precise motions that are performed without any acceleration.
+ //
+ // Must be a non-negative value.
+ // Default is 0.0 (no low threshold).
+ float lowThreshold;
+
+ // The scaled speed at which maximum acceleration is applied.
+ // The difference between highThreshold and lowThreshold controls
+ // the range of speeds over which the acceleration factor is interpolated.
+ // The wider the range, the smoother the acceleration.
+ //
+ // Must be a non-negative value greater than or equal to lowThreshold.
+ // Default is 0.0 (no high threshold).
+ float highThreshold;
+
+ // The acceleration factor.
+ // When the speed is above the low speed threshold, the velocity will scaled
+ // by an interpolated value between 1.0 and this amount.
+ //
+ // Must be a positive greater than or equal to 1.0.
+ // Default is 1.0 (no acceleration).
+ float acceleration;
+
+ VelocityControlParameters() :
+ scale(1.0f), lowThreshold(0.0f), highThreshold(0.0f), acceleration(1.0f) {
+ }
+
+ VelocityControlParameters(float scale, float lowThreshold,
+ float highThreshold, float acceleration) :
+ scale(scale), lowThreshold(lowThreshold),
+ highThreshold(highThreshold), acceleration(acceleration) {
+ }
+};
+
+/*
+ * Implements mouse pointer and wheel speed control and acceleration.
+ */
+class VelocityControl {
+public:
+ VelocityControl();
+
+ /* Sets the various parameters. */
+ void setParameters(const VelocityControlParameters& parameters);
+
+ /* Resets the current movement counters to zero.
+ * This has the effect of nullifying any acceleration. */
+ void reset();
+
+ /* Translates a raw movement delta into an appropriately
+ * scaled / accelerated delta based on the current velocity. */
+ void move(nsecs_t eventTime, float* deltaX, float* deltaY);
+
+private:
+ // If no movements are received within this amount of time,
+ // we assume the movement has stopped and reset the movement counters.
+ static const nsecs_t STOP_TIME = 500 * 1000000; // 500 ms
+
+ VelocityControlParameters mParameters;
+
+ nsecs_t mLastMovementTime;
+ VelocityTracker::Position mRawPosition;
+ VelocityTracker mVelocityTracker;
+};
+
+
/*
* Describes the characteristics and capabilities of an input device.
*/
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 2c7cf75..8a92cd6 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -841,6 +841,7 @@ struct ResTable_config
DENSITY_DEFAULT = ACONFIGURATION_DENSITY_DEFAULT,
DENSITY_LOW = ACONFIGURATION_DENSITY_LOW,
DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
+ DENSITY_TV = ACONFIGURATION_DENSITY_TV,
DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
};
@@ -1452,24 +1453,20 @@ struct ResTable_config
// settings is the requested settings
inline bool match(const ResTable_config& settings) const {
if (imsi != 0) {
- if ((settings.mcc != 0 && mcc != 0
- && mcc != settings.mcc) ||
- (settings.mcc == 0 && mcc != 0)) {
+ if (mcc != 0 && mcc != settings.mcc) {
return false;
}
- if ((settings.mnc != 0 && mnc != 0
- && mnc != settings.mnc) ||
- (settings.mnc == 0 && mnc != 0)) {
+ if (mnc != 0 && mnc != settings.mnc) {
return false;
}
}
if (locale != 0) {
- if (settings.language[0] != 0 && language[0] != 0
+ if (language[0] != 0
&& (language[0] != settings.language[0]
|| language[1] != settings.language[1])) {
return false;
}
- if (settings.country[0] != 0 && country[0] != 0
+ if (country[0] != 0
&& (country[0] != settings.country[0]
|| country[1] != settings.country[1])) {
return false;
@@ -1480,66 +1477,56 @@ struct ResTable_config
const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE;
// Any screen sizes for larger screens than the setting do not
// match.
- if ((setScreenSize != 0 && screenSize != 0
- && screenSize > setScreenSize) ||
- (setScreenSize == 0 && screenSize != 0)) {
+ if (screenSize != 0 && screenSize > setScreenSize) {
return false;
}
const int screenLong = screenLayout&MASK_SCREENLONG;
const int setScreenLong = settings.screenLayout&MASK_SCREENLONG;
- if (setScreenLong != 0 && screenLong != 0
- && screenLong != setScreenLong) {
+ if (screenLong != 0 && screenLong != setScreenLong) {
return false;
}
const int uiModeType = uiMode&MASK_UI_MODE_TYPE;
const int setUiModeType = settings.uiMode&MASK_UI_MODE_TYPE;
- if (setUiModeType != 0 && uiModeType != 0
- && uiModeType != setUiModeType) {
+ if (uiModeType != 0 && uiModeType != setUiModeType) {
return false;
}
const int uiModeNight = uiMode&MASK_UI_MODE_NIGHT;
const int setUiModeNight = settings.uiMode&MASK_UI_MODE_NIGHT;
- if (setUiModeNight != 0 && uiModeNight != 0
- && uiModeNight != setUiModeNight) {
+ if (uiModeNight != 0 && uiModeNight != setUiModeNight) {
return false;
}
- if (settings.smallestScreenWidthDp != 0 && smallestScreenWidthDp != 0
+ if (smallestScreenWidthDp != 0
&& smallestScreenWidthDp > settings.smallestScreenWidthDp) {
return false;
}
}
if (screenSizeDp != 0) {
- if (settings.screenWidthDp != 0 && screenWidthDp != 0
- && screenWidthDp > settings.screenWidthDp) {
+ if (screenWidthDp != 0 && screenWidthDp > settings.screenWidthDp) {
//LOGI("Filtering out width %d in requested %d", screenWidthDp, settings.screenWidthDp);
return false;
}
- if (settings.screenHeightDp != 0 && screenHeightDp != 0
- && screenHeightDp > settings.screenHeightDp) {
+ if (screenHeightDp != 0 && screenHeightDp > settings.screenHeightDp) {
//LOGI("Filtering out height %d in requested %d", screenHeightDp, settings.screenHeightDp);
return false;
}
}
if (screenType != 0) {
- if (settings.orientation != 0 && orientation != 0
- && orientation != settings.orientation) {
+ if (orientation != 0 && orientation != settings.orientation) {
return false;
}
// density always matches - we can scale it. See isBetterThan
- if (settings.touchscreen != 0 && touchscreen != 0
- && touchscreen != settings.touchscreen) {
+ if (touchscreen != 0 && touchscreen != settings.touchscreen) {
return false;
}
}
if (input != 0) {
const int keysHidden = inputFlags&MASK_KEYSHIDDEN;
const int setKeysHidden = settings.inputFlags&MASK_KEYSHIDDEN;
- if (setKeysHidden != 0 && keysHidden != 0
- && keysHidden != setKeysHidden) {
+ if (keysHidden != 0 && keysHidden != setKeysHidden) {
// For compatibility, we count a request for KEYSHIDDEN_NO as also
// matching the more recent KEYSHIDDEN_SOFT. Basically
// KEYSHIDDEN_NO means there is some kind of keyboard available.
@@ -1551,36 +1538,29 @@ struct ResTable_config
}
const int navHidden = inputFlags&MASK_NAVHIDDEN;
const int setNavHidden = settings.inputFlags&MASK_NAVHIDDEN;
- if (setNavHidden != 0 && navHidden != 0
- && navHidden != setNavHidden) {
+ if (navHidden != 0 && navHidden != setNavHidden) {
return false;
}
- if (settings.keyboard != 0 && keyboard != 0
- && keyboard != settings.keyboard) {
+ if (keyboard != 0 && keyboard != settings.keyboard) {
return false;
}
- if (settings.navigation != 0 && navigation != 0
- && navigation != settings.navigation) {
+ if (navigation != 0 && navigation != settings.navigation) {
return false;
}
}
if (screenSize != 0) {
- if (settings.screenWidth != 0 && screenWidth != 0
- && screenWidth > settings.screenWidth) {
+ if (screenWidth != 0 && screenWidth > settings.screenWidth) {
return false;
}
- if (settings.screenHeight != 0 && screenHeight != 0
- && screenHeight > settings.screenHeight) {
+ if (screenHeight != 0 && screenHeight > settings.screenHeight) {
return false;
}
}
if (version != 0) {
- if (settings.sdkVersion != 0 && sdkVersion != 0
- && sdkVersion > settings.sdkVersion) {
+ if (sdkVersion != 0 && sdkVersion > settings.sdkVersion) {
return false;
}
- if (settings.minorVersion != 0 && minorVersion != 0
- && minorVersion != settings.minorVersion) {
+ if (minorVersion != 0 && minorVersion != settings.minorVersion) {
return false;
}
}