summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-24 18:31:21 -0700
committerMathias Agopian <mathias@google.com>2009-06-24 18:31:21 -0700
commitf31868e59fbf59a8d479587c80b648fb37a166fc (patch)
tree5a0aa67a76d6b0e48041f557eefd764e57eb97cf /include
parentc6603951d45fc9b0d1776fec9444b6f31af92840 (diff)
parentecf2b68d834d334de218dc427615b4ca05c0293a (diff)
downloadframeworks_base-f31868e59fbf59a8d479587c80b648fb37a166fc.zip
frameworks_base-f31868e59fbf59a8d479587c80b648fb37a166fc.tar.gz
frameworks_base-f31868e59fbf59a8d479587c80b648fb37a166fc.tar.bz2
merge master in master_gl
Diffstat (limited to 'include')
-rw-r--r--include/media/IMediaPlayer.h10
-rw-r--r--include/media/IMediaPlayerService.h2
-rw-r--r--include/media/MediaPlayerInterface.h13
-rw-r--r--include/media/PVPlayer.h1
-rw-r--r--include/media/ToneGenerator.h84
-rw-r--r--include/media/mediaplayer.h2
-rw-r--r--include/private/opengles/gl_context.h2
-rw-r--r--include/ui/Camera.h37
-rw-r--r--include/utils/BackupHelpers.h5
-rw-r--r--include/utils/ResourceTypes.h26
10 files changed, 137 insertions, 45 deletions
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index 2c4bc2a..85aeb30 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -23,6 +23,7 @@
namespace android {
+class Parcel;
class ISurface;
class IMediaPlayer: public IInterface
@@ -45,6 +46,14 @@ public:
virtual status_t setAudioStreamType(int type) = 0;
virtual status_t setLooping(int loop) = 0;
virtual status_t setVolume(float leftVolume, float rightVolume) = 0;
+
+ // Invoke a generic method on the player by using opaque parcels
+ // for the request and reply.
+ // @param request Parcel that must start with the media player
+ // interface token.
+ // @param[out] reply Parcel to hold the reply data. Cannot be null.
+ // @return OK if the invocation was made. PERMISSION_DENIED otherwise.
+ virtual status_t invoke(const Parcel& request, Parcel *reply) = 0;
};
// ----------------------------------------------------------------------------
@@ -61,4 +70,3 @@ public:
}; // namespace android
#endif // ANDROID_IMEDIAPLAYER_H
-
diff --git a/include/media/IMediaPlayerService.h b/include/media/IMediaPlayerService.h
index 207e4e7..f6faf14 100644
--- a/include/media/IMediaPlayerService.h
+++ b/include/media/IMediaPlayerService.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_IMEDIAPLAYERSERVICE_H
#define ANDROID_IMEDIAPLAYERSERVICE_H
+#include <utils/Errors.h> // for status_t
#include <utils/RefBase.h>
#include <binder/IInterface.h>
#include <binder/Parcel.h>
@@ -36,7 +37,6 @@ public:
virtual sp<IMediaRecorder> createMediaRecorder(pid_t pid) = 0;
virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid) = 0;
-
virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, const char* url) = 0;
virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t length) = 0;
virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 7bf555a..21600b2 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -27,12 +27,15 @@
namespace android {
+class Parcel;
+
enum player_type {
PV_PLAYER = 1,
SONIVOX_PLAYER = 2,
VORBIS_PLAYER = 3
};
+
#define DEFAULT_AUDIOSINK_BUFFERCOUNT 4
#define DEFAULT_AUDIOSINK_BUFFERSIZE 1200
#define DEFAULT_AUDIOSINK_SAMPLERATE 44100
@@ -45,7 +48,6 @@ typedef void (*notify_callback_f)(void* cookie, int msg, int ext1, int ext2);
class MediaPlayerBase : public RefBase
{
public:
-
// AudioSink: abstraction layer for audio output
class AudioSink : public RefBase {
public:
@@ -88,7 +90,14 @@ public:
virtual player_type playerType() = 0;
virtual void setNotifyCallback(void* cookie, notify_callback_f notifyFunc) {
mCookie = cookie; mNotify = notifyFunc; }
-
+ // Invoke a generic method on the player by using opaque parcels
+ // for the request and reply.
+ // @param request Parcel that is positioned at the start of the
+ // data sent by the java layer.
+ // @param[out] reply Parcel to hold the reply data. Cannot be null.
+ // @return OK if the invocation was made successfully. A player
+ // not supporting the direct API should return INVALID_OPERATION.
+ virtual status_t invoke(const Parcel& request, Parcel *reply) = 0;
protected:
virtual void sendEvent(int msg, int ext1=0, int ext2=0) { if (mNotify) mNotify(mCookie, msg, ext1, ext2); }
diff --git a/include/media/PVPlayer.h b/include/media/PVPlayer.h
index 8122df6..eb4595b 100644
--- a/include/media/PVPlayer.h
+++ b/include/media/PVPlayer.h
@@ -52,6 +52,7 @@ public:
virtual status_t reset();
virtual status_t setLooping(int loop);
virtual player_type playerType() { return PV_PLAYER; }
+ virtual status_t invoke(const Parcel& request, Parcel *reply);
// make available to PlayerDriver
void sendEvent(int msg, int ext1=0, int ext2=0) { MediaPlayerBase::sendEvent(msg, ext1, ext2); }
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h
index 6b0cc8a..eafa661 100644
--- a/include/media/ToneGenerator.h
+++ b/include/media/ToneGenerator.h
@@ -71,6 +71,82 @@ public:
TONE_SUP_CONGESTION_ABBREV, // Abbreviated congestion: congestion tone limited to 4 seconds
TONE_SUP_CONFIRM, // Confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle.
TONE_SUP_PIP, // Pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off).
+
+ // CDMA Tones
+ TONE_CDMA_DIAL_TONE_LITE,
+ TONE_CDMA_NETWORK_USA_RINGBACK,
+ TONE_CDMA_INTERCEPT,
+ TONE_CDMA_ABBR_INTERCEPT,
+ TONE_CDMA_REORDER,
+ TONE_CDMA_ABBR_REORDER,
+ TONE_CDMA_NETWORK_BUSY,
+ TONE_CDMA_CONFIRM,
+ TONE_CDMA_ANSWER,
+ TONE_CDMA_NETWORK_CALLWAITING,
+ TONE_CDMA_PIP,
+
+ // ISDN
+ TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, // ISDN Alert Normal
+ TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, // ISDN Intergroup
+ TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, // ISDN SP PRI
+ TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, // ISDN Alert PAT3
+ TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, // ISDN Alert PING RING
+ TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, // ISDN Alert PAT5
+ TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, // ISDN Alert PAT6
+ TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, // ISDN Alert PAT7
+ // ISDN end
+
+ // IS54
+ TONE_CDMA_HIGH_L, // IS54 High Pitch Long
+ TONE_CDMA_MED_L, // IS54 Med Pitch Long
+ TONE_CDMA_LOW_L, // IS54 Low Pitch Long
+ TONE_CDMA_HIGH_SS, // IS54 High Pitch Short Short
+ TONE_CDMA_MED_SS, // IS54 Medium Pitch Short Short
+ TONE_CDMA_LOW_SS, // IS54 Low Pitch Short Short
+ TONE_CDMA_HIGH_SSL, // IS54 High Pitch Short Short Long
+ TONE_CDMA_MED_SSL, // IS54 Medium Pitch Short Short Long
+ TONE_CDMA_LOW_SSL, // IS54 Low Pitch Short Short Long
+ TONE_CDMA_HIGH_SS_2, // IS54 High Pitch Short Short 2
+ TONE_CDMA_MED_SS_2, // IS54 Med Pitch Short Short 2
+ TONE_CDMA_LOW_SS_2, // IS54 Low Pitch Short Short 2
+ TONE_CDMA_HIGH_SLS, // IS54 High Pitch Short Long Short
+ TONE_CDMA_MED_SLS, // IS54 Med Pitch Short Long Short
+ TONE_CDMA_LOW_SLS, // IS54 Low Pitch Short Long Short
+ TONE_CDMA_HIGH_S_X4, // IS54 High Pitch Short Short Short Short
+ TONE_CDMA_MED_S_X4, // IS54 Med Pitch Short Short Short Short
+ TONE_CDMA_LOW_S_X4, // IS54 Low Pitch Short Short Short Short
+ TONE_CDMA_HIGH_PBX_L, // PBX High Pitch Long
+ TONE_CDMA_MED_PBX_L, // PBX Med Pitch Long
+ TONE_CDMA_LOW_PBX_L, // PBX Low Pitch Long
+ TONE_CDMA_HIGH_PBX_SS, // PBX High Short Short
+ TONE_CDMA_MED_PBX_SS, // PBX Med Short Short
+ TONE_CDMA_LOW_PBX_SS, // PBX Low Short Short
+ TONE_CDMA_HIGH_PBX_SSL, // PBX High Short Short Long
+ TONE_CDMA_MED_PBX_SSL, // PBX Med Short Short Long
+ TONE_CDMA_LOW_PBX_SSL, // PBX Low Short Short Long
+ TONE_CDMA_HIGH_PBX_SLS, // PBX High SLS
+ TONE_CDMA_MED_PBX_SLS, // PBX Med SLS
+ TONE_CDMA_LOW_PBX_SLS, // PBX Low SLS
+ TONE_CDMA_HIGH_PBX_S_X4, // PBX High SSSS
+ TONE_CDMA_MED_PBX_S_X4, // PBX Med SSSS
+ TONE_CDMA_LOW_PBX_S_X4, // PBX LOW SSSS
+ //IS54 end
+ // proprietary
+ TONE_CDMA_ALERT_NETWORK_LITE,
+ TONE_CDMA_ALERT_AUTOREDIAL_LITE,
+ TONE_CDMA_ONE_MIN_BEEP,
+ TONE_CDMA_KEYPAD_VOLUME_KEY_LITE,
+ TONE_CDMA_PRESSHOLDKEY_LITE,
+ TONE_CDMA_ALERT_INCALL_LITE,
+ TONE_CDMA_EMERGENCY_RINGBACK,
+ TONE_CDMA_ALERT_CALL_GUARD,
+ TONE_CDMA_SOFT_ERROR_LITE,
+ TONE_CDMA_CALLDROP_LITE,
+ // proprietary end
+ TONE_CDMA_NETWORK_BUSY_ONE_SHOT,
+ TONE_CDMA_ABBR_ALERT,
+ TONE_CDMA_SIGNAL_OFF,
+ //CDMA end
NUM_TONES,
NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1
};
@@ -125,7 +201,7 @@ private:
static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES];
static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment
- static const unsigned int TONEGEN_MAX_SEGMENTS = 5; // Maximun number of segments in a tone descriptor
+ static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor
static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration
static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator().
@@ -140,6 +216,8 @@ private:
// correspond to tone ON state and segments with odd index to OFF state.
// The data stored in segments[] is the duration of the corresponding period in ms.
// The first segment encountered with a 0 duration indicates that no more segment follows.
+ // - loopCnt - Number of times to repeat a sequence of seqments after playing this
+ // - loopIndx - The segment index to go back and play is loopcnt > 0
// - repeatCnt indicates the number of times the sequence described by segments[] array must be repeated.
// When the tone generator encounters the first 0 duration segment, it will compare repeatCnt to mCurCount.
// If mCurCount > repeatCnt, the tone is stopped automatically. Otherwise, tone sequence will be
@@ -150,6 +228,8 @@ private:
public:
unsigned int duration;
unsigned short waveFreq[TONEGEN_MAX_WAVES+1];
+ unsigned short loopCnt;
+ unsigned short loopIndx;
};
class ToneDescriptor {
@@ -174,6 +254,8 @@ private:
const ToneDescriptor *mpToneDesc; // pointer to active tone descriptor
const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor
+ unsigned short mLoopCounter; // Current tone loopback count
+
int mSamplingRate; // AudioFlinger Sampling rate
AudioTrack *mpAudioTrack; // Pointer to audio track used for playback
Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index ffb325d..dd8ea19 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -151,7 +151,7 @@ public:
void notify(int msg, int ext1, int ext2);
static sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat);
static sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat);
-
+ status_t invoke(const Parcel& request, Parcel *reply);
private:
void clear_l();
status_t seekTo_l(int msec);
diff --git a/include/private/opengles/gl_context.h b/include/private/opengles/gl_context.h
index 3b40677..523aed0 100644
--- a/include/private/opengles/gl_context.h
+++ b/include/private/opengles/gl_context.h
@@ -458,7 +458,7 @@ struct matrix_stack_t {
void validate();
matrixf_t& top() { return stack[depth]; }
const matrixf_t& top() const { return stack[depth]; }
- const uint32_t top_ops() const { return ops[depth]; }
+ uint32_t top_ops() const { return ops[depth]; }
inline bool isRigidBody() const {
return !(ops[depth] & ~(OP_TRANSLATE|OP_UNIFORM_SCALE|OP_ROTATE));
}
diff --git a/include/ui/Camera.h b/include/ui/Camera.h
index 048bdd5..bbc21c4 100644
--- a/include/ui/Camera.h
+++ b/include/ui/Camera.h
@@ -86,10 +86,13 @@ class Surface;
class Mutex;
class String8;
-typedef void (*shutter_callback)(void *cookie);
-typedef void (*frame_callback)(const sp<IMemory>& mem, void *cookie);
-typedef void (*autofocus_callback)(bool focused, void *cookie);
-typedef void (*error_callback)(status_t err, void *cookie);
+// ref-counted object for callbacks
+class CameraListener: virtual public RefBase
+{
+public:
+ virtual void notify(int32_t msgType, int32_t ext1, int32_t ext2) = 0;
+ virtual void postData(int32_t msgType, const sp<IMemory>& dataPtr) = 0;
+};
class Camera : public BnCameraClient, public IBinder::DeathRecipient
{
@@ -144,13 +147,8 @@ public:
// get preview/capture parameters - key/value pairs
String8 getParameters() const;
- void setShutterCallback(shutter_callback cb, void *cookie);
- void setRawCallback(frame_callback cb, void *cookie);
- void setJpegCallback(frame_callback cb, void *cookie);
- void setRecordingCallback(frame_callback cb, void *cookie);
- void setPreviewCallback(frame_callback cb, void *cookie, int preview_callback_flag = FRAME_CALLBACK_FLAG_NOOP);
- void setErrorCallback(error_callback cb, void *cookie);
- void setAutoFocusCallback(autofocus_callback cb, void *cookie);
+ void setListener(const sp<CameraListener>& listener);
+ void setPreviewCallbackFlags(int preview_callback_flag);
// ICameraClient interface
virtual void notifyCallback(int32_t msgType, int32_t ext, int32_t ext2);
@@ -160,6 +158,8 @@ public:
private:
Camera();
+ Camera(const Camera&);
+ Camera& operator=(const Camera);
virtual void binderDied(const wp<IBinder>& who);
class DeathNotifier: public IBinder::DeathRecipient
@@ -179,20 +179,7 @@ private:
sp<ICamera> mCamera;
status_t mStatus;
- shutter_callback mShutterCallback;
- void *mShutterCallbackCookie;
- frame_callback mRawCallback;
- void *mRawCallbackCookie;
- frame_callback mJpegCallback;
- void *mJpegCallbackCookie;
- frame_callback mPreviewCallback;
- void *mPreviewCallbackCookie;
- frame_callback mRecordingCallback;
- void *mRecordingCallbackCookie;
- error_callback mErrorCallback;
- void *mErrorCallbackCookie;
- autofocus_callback mAutoFocusCallback;
- void *mAutoFocusCallbackCookie;
+ sp<CameraListener> mListener;
friend class DeathNotifier;
diff --git a/include/utils/BackupHelpers.h b/include/utils/BackupHelpers.h
index c78b99a..b1f5045 100644
--- a/include/utils/BackupHelpers.h
+++ b/include/utils/BackupHelpers.h
@@ -43,6 +43,7 @@ struct SnapshotHeader {
struct FileState {
int modTime_sec;
int modTime_nsec;
+ int mode;
int size;
int crc32;
int nameLen;
@@ -71,6 +72,8 @@ public:
status_t WriteEntityHeader(const String8& key, size_t dataSize);
status_t WriteEntityData(const void* data, size_t size);
+ void SetKeyPrefix(const String8& keyPrefix);
+
private:
explicit BackupDataWriter();
status_t write_padding_for(int n);
@@ -79,6 +82,7 @@ private:
status_t m_status;
ssize_t m_pos;
int m_entityCount;
+ String8 m_keyPrefix;
};
/**
@@ -133,6 +137,7 @@ public:
private:
void* m_buf;
+ bool m_loggedUnknownMetadata;
KeyedVector<String8,FileRec> m_files;
};
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 68f9233..f1029b7 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -71,7 +71,7 @@ namespace android {
* The relative sizes of the stretchy segments indicates the relative
* amount of stretchiness of the regions bordered by the segments. For
* example, regions 3, 7 and 11 above will take up more horizontal space
- * than regions 1, 5 and 9 since the horizonal segment associated with
+ * than regions 1, 5 and 9 since the horizontal segment associated with
* the first set of regions is larger than the other set of regions. The
* ratios of the amount of horizontal (or vertical) space taken by any
* two stretchable slices is exactly the ratio of their corresponding
@@ -87,7 +87,7 @@ namespace android {
* the leftmost slices always start at x=0 and the rightmost slices
* always end at the end of the image. So, for example, the regions 0,
* 4 and 8 (which are fixed along the X axis) start at x value 0 and
- * go to xDiv[0] amd slices 2, 6 and 10 start at xDiv[1] and end at
+ * go to xDiv[0] and slices 2, 6 and 10 start at xDiv[1] and end at
* xDiv[2].
*
* The array pointed to by the colors field lists contains hints for
@@ -626,25 +626,25 @@ public:
event_code_t next();
// These are available for all nodes:
- const int32_t getCommentID() const;
+ int32_t getCommentID() const;
const uint16_t* getComment(size_t* outLen) const;
- const uint32_t getLineNumber() const;
+ uint32_t getLineNumber() const;
// This is available for TEXT:
- const int32_t getTextID() const;
+ int32_t getTextID() const;
const uint16_t* getText(size_t* outLen) const;
ssize_t getTextValue(Res_value* outValue) const;
// These are available for START_NAMESPACE and END_NAMESPACE:
- const int32_t getNamespacePrefixID() const;
+ int32_t getNamespacePrefixID() const;
const uint16_t* getNamespacePrefix(size_t* outLen) const;
- const int32_t getNamespaceUriID() const;
+ int32_t getNamespaceUriID() const;
const uint16_t* getNamespaceUri(size_t* outLen) const;
// These are available for START_TAG and END_TAG:
- const int32_t getElementNamespaceID() const;
+ int32_t getElementNamespaceID() const;
const uint16_t* getElementNamespace(size_t* outLen) const;
- const int32_t getElementNameID() const;
+ int32_t getElementNameID() const;
const uint16_t* getElementName(size_t* outLen) const;
// Remaining methods are for retrieving information about attributes
@@ -653,14 +653,14 @@ public:
size_t getAttributeCount() const;
// Returns -1 if no namespace, -2 if idx out of range.
- const int32_t getAttributeNamespaceID(size_t idx) const;
+ int32_t getAttributeNamespaceID(size_t idx) const;
const uint16_t* getAttributeNamespace(size_t idx, size_t* outLen) const;
- const int32_t getAttributeNameID(size_t idx) const;
+ int32_t getAttributeNameID(size_t idx) const;
const uint16_t* getAttributeName(size_t idx, size_t* outLen) const;
- const uint32_t getAttributeNameResID(size_t idx) const;
+ uint32_t getAttributeNameResID(size_t idx) const;
- const int32_t getAttributeValueStringID(size_t idx) const;
+ int32_t getAttributeValueStringID(size_t idx) const;
const uint16_t* getAttributeStringValue(size_t idx, size_t* outLen) const;
int32_t getAttributeDataType(size_t idx) const;