diff options
Diffstat (limited to 'include')
26 files changed, 427 insertions, 46 deletions
diff --git a/include/camera/Camera.h b/include/camera/Camera.h index 964700b..75cf5ff 100644 --- a/include/camera/Camera.h +++ b/include/camera/Camera.h @@ -22,8 +22,6 @@ namespace android { -class ISurface; - /* * A set of bit masks for specifying how the received preview frames are * handled before the previewCallback() call. @@ -152,9 +150,8 @@ public: status_t getStatus() { return mStatus; } - // pass the buffered ISurface to the camera service + // pass the buffered Surface to the camera service status_t setPreviewDisplay(const sp<Surface>& surface); - status_t setPreviewDisplay(const sp<ISurface>& surface); // start preview mode, must call setPreviewDisplay first status_t startPreview(); diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h index 1529db7..515d879 100644 --- a/include/camera/CameraHardwareInterface.h +++ b/include/camera/CameraHardwareInterface.h @@ -18,6 +18,7 @@ #define ANDROID_HARDWARE_CAMERA_HARDWARE_INTERFACE_H #include <binder/IMemory.h> +#include <ui/egl/android_natives.h> #include <utils/RefBase.h> #include <surfaceflinger/ISurface.h> #include <camera/Camera.h> @@ -86,8 +87,8 @@ class CameraHardwareInterface : public virtual RefBase { public: virtual ~CameraHardwareInterface() { } - /** Return the IMemoryHeap for the preview image heap */ - virtual sp<IMemoryHeap> getPreviewHeap() const = 0; + /** Set the ISurface from which the preview buffers should be dequeued */ + virtual status_t setPreviewWindow(const sp<ANativeWindow>& buf) = 0; /** Return the IMemoryHeap for the raw image heap */ virtual sp<IMemoryHeap> getRawHeap() const = 0; @@ -221,6 +222,7 @@ public: */ extern "C" int HAL_getNumberOfCameras(); extern "C" void HAL_getCameraInfo(int cameraId, struct CameraInfo* cameraInfo); +/* HAL should return NULL if it fails to open camera hardware. */ extern "C" sp<CameraHardwareInterface> HAL_openCameraHardware(int cameraId); }; // namespace android diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index 4bc1799..a5c7874 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -61,6 +61,7 @@ public: void getSupportedPreviewSizes(Vector<Size> &sizes) const; void setPreviewFrameRate(int fps); int getPreviewFrameRate() const; + void getPreviewFpsRange(int *min_fps, int *max_fps) const; void setPreviewFormat(const char *format); const char *getPreviewFormat() const; void setPictureSize(int width, int height); @@ -82,6 +83,20 @@ public: // Supported preview frame sizes in pixels. // Example value: "800x600,480x320". Read only. static const char KEY_SUPPORTED_PREVIEW_SIZES[]; + // The current minimum and maximum preview fps. This controls the rate of + // preview frames received (CAMERA_MSG_PREVIEW_FRAME). The minimum and + // maximum fps must be one of the elements from + // KEY_SUPPORTED_PREVIEW_FPS_RANGE parameter. + // Example value: "10500,26623" + static const char KEY_PREVIEW_FPS_RANGE[]; + // The supported preview fps (frame-per-second) ranges. Each range contains + // a minimum fps and maximum fps. If minimum fps equals to maximum fps, the + // camera outputs frames in fixed frame rate. If not, the camera outputs + // frames in auto frame rate. The actual frame rate fluctuates between the + // minimum and the maximum. The list has at least one element. The list is + // sorted from small to large (first by maximum fps and then minimum fps). + // Example value: "(10500,26623),(15000,26623),(30000,30000)" + static const char KEY_SUPPORTED_PREVIEW_FPS_RANGE[]; // The image format for preview frames. See CAMERA_MSG_PREVIEW_FRAME in // frameworks/base/include/camera/Camera.h. // Example value: "yuv420sp" or PIXEL_FORMAT_XXX constants. Read/write. diff --git a/include/camera/ICamera.h b/include/camera/ICamera.h index 6fcf9e5..8bceea5 100644 --- a/include/camera/ICamera.h +++ b/include/camera/ICamera.h @@ -20,7 +20,7 @@ #include <utils/RefBase.h> #include <binder/IInterface.h> #include <binder/Parcel.h> -#include <surfaceflinger/ISurface.h> +#include <surfaceflinger/Surface.h> #include <binder/IMemory.h> #include <utils/String8.h> #include <camera/Camera.h> @@ -45,8 +45,8 @@ public: // allow other processes to use this ICamera interface virtual status_t unlock() = 0; - // pass the buffered ISurface to the camera service - virtual status_t setPreviewDisplay(const sp<ISurface>& surface) = 0; + // pass the buffered Surface to the camera service + virtual status_t setPreviewDisplay(const sp<Surface>& surface) = 0; // set the preview callback flag to affect how the received frames from // preview are handled. diff --git a/include/media/EffectPresetReverbApi.h b/include/media/EffectPresetReverbApi.h index 53205bb..a3f094c 100644 --- a/include/media/EffectPresetReverbApi.h +++ b/include/media/EffectPresetReverbApi.h @@ -43,7 +43,8 @@ typedef enum REVERB_PRESET_LARGEROOM, REVERB_PRESET_MEDIUMHALL, REVERB_PRESET_LARGEHALL, - REVERB_PRESET_PLATE + REVERB_PRESET_PLATE, + REVERB_PRESET_LAST = REVERB_PRESET_PLATE } t_reverb_presets; #if __cplusplus diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index af9a7ed..a1ce113 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -25,6 +25,7 @@ namespace android { class Parcel; class ISurface; +class Surface; class IMediaPlayer: public IInterface { @@ -33,7 +34,8 @@ public: virtual void disconnect() = 0; - virtual status_t setVideoSurface(const sp<ISurface>& surface) = 0; + virtual status_t setVideoISurface(const sp<ISurface>& surface) = 0; + virtual status_t setVideoSurface(const sp<Surface>& surface) = 0; virtual status_t prepareAsync() = 0; virtual status_t start() = 0; virtual status_t stop() = 0; diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h index 54adca8..54b197c 100644 --- a/include/media/IMediaRecorder.h +++ b/include/media/IMediaRecorder.h @@ -22,7 +22,7 @@ namespace android { -class ISurface; +class Surface; class ICamera; class IMediaRecorderClient; @@ -32,7 +32,7 @@ public: DECLARE_META_INTERFACE(MediaRecorder); virtual status_t setCamera(const sp<ICamera>& camera) = 0; - virtual status_t setPreviewSurface(const sp<ISurface>& surface) = 0; + virtual status_t setPreviewSurface(const sp<Surface>& surface) = 0; virtual status_t setVideoSource(int vs) = 0; virtual status_t setAudioSource(int as) = 0; virtual status_t setOutputFormat(int of) = 0; @@ -68,4 +68,3 @@ public: }; // namespace android #endif // ANDROID_IMEDIARECORDER_H - diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 3662983..13c73ac 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -33,6 +33,7 @@ namespace android { class Parcel; class ISurface; +class Surface; template<typename T> class SortedVector; @@ -104,7 +105,8 @@ public: const KeyedVector<String8, String8> *headers = NULL) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setVideoSurface(const sp<ISurface>& surface) = 0; + virtual status_t setVideoISurface(const sp<ISurface>& surface) = 0; + virtual status_t setVideoSurface(const sp<Surface>& surface) = 0; virtual status_t prepare() = 0; virtual status_t prepareAsync() = 0; virtual status_t start() = 0; diff --git a/include/media/MediaRecorderBase.h b/include/media/MediaRecorderBase.h index 5e9e368..e5edd29 100644 --- a/include/media/MediaRecorderBase.h +++ b/include/media/MediaRecorderBase.h @@ -22,7 +22,7 @@ namespace android { -class ISurface; +class Surface; struct MediaRecorderBase { MediaRecorderBase() {} @@ -37,7 +37,7 @@ struct MediaRecorderBase { virtual status_t setVideoSize(int width, int height) = 0; virtual status_t setVideoFrameRate(int frames_per_second) = 0; virtual status_t setCamera(const sp<ICamera>& camera) = 0; - virtual status_t setPreviewSurface(const sp<ISurface>& surface) = 0; + virtual status_t setPreviewSurface(const sp<Surface>& surface) = 0; virtual status_t setOutputFile(const char *path) = 0; virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; virtual status_t setParameters(const String8& params) = 0; diff --git a/include/media/PVMediaRecorder.h b/include/media/PVMediaRecorder.h index c091c39..4b44ccc 100644 --- a/include/media/PVMediaRecorder.h +++ b/include/media/PVMediaRecorder.h @@ -23,7 +23,7 @@ namespace android { -class ISurface; +class Surface; class ICamera; class AuthorDriverWrapper; @@ -41,7 +41,7 @@ public: virtual status_t setVideoSize(int width, int height); virtual status_t setVideoFrameRate(int frames_per_second); virtual status_t setCamera(const sp<ICamera>& camera); - virtual status_t setPreviewSurface(const sp<ISurface>& surface); + virtual status_t setPreviewSurface(const sp<Surface>& surface); virtual status_t setOutputFile(const char *path); virtual status_t setOutputFile(int fd, int64_t offset, int64_t length); virtual status_t setParameters(const String8& params); @@ -66,4 +66,3 @@ private: }; // namespace android #endif // ANDROID_PVMEDIARECORDER_H - diff --git a/include/media/PVPlayer.h b/include/media/PVPlayer.h index df50981..657e7a6 100644 --- a/include/media/PVPlayer.h +++ b/include/media/PVPlayer.h @@ -43,7 +43,8 @@ public: const char *url, const KeyedVector<String8, String8> *headers); virtual status_t setDataSource(int fd, int64_t offset, int64_t length); - virtual status_t setVideoSurface(const sp<ISurface>& surface); + virtual status_t setVideoISurface(const sp<ISurface>& surface); + virtual status_t setVideoSurface(const sp<Surface>& surface); virtual status_t prepare(); virtual status_t prepareAsync(); virtual status_t start(); diff --git a/include/media/Visualizer.h b/include/media/Visualizer.h index 5d51de8..b8746c2 100644 --- a/include/media/Visualizer.h +++ b/include/media/Visualizer.h @@ -151,7 +151,6 @@ private: void *mCaptureCbkUser; sp<CaptureThread> mCaptureThread; uint32_t mCaptureFlags; - void *mFftTable; }; diff --git a/include/media/stagefright/AMRWriter.h b/include/media/stagefright/AMRWriter.h index 813dd43..aa965e1 100644 --- a/include/media/stagefright/AMRWriter.h +++ b/include/media/stagefright/AMRWriter.h @@ -37,8 +37,8 @@ struct AMRWriter : public MediaWriter { virtual status_t addSource(const sp<MediaSource> &source); virtual bool reachedEOS(); virtual status_t start(MetaData *params = NULL); - virtual void stop(); - virtual void pause(); + virtual status_t stop(); + virtual status_t pause(); protected: virtual ~AMRWriter(); @@ -57,7 +57,7 @@ private: int64_t mEstimatedDurationUs; static void *ThreadWrapper(void *); - void threadFunc(); + status_t threadFunc(); bool exceedsFileSizeLimit(); bool exceedsFileDurationLimit(); diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 6f7dc38..9d2cff6 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -28,6 +28,7 @@ namespace android { +struct AMessage; class String8; class DataSource : public RefBase { @@ -59,10 +60,14 @@ public: //////////////////////////////////////////////////////////////////////////// - bool sniff(String8 *mimeType, float *confidence); + bool sniff(String8 *mimeType, float *confidence, sp<AMessage> *meta); + // The sniffer can optionally fill in "meta" with an AMessage containing + // a dictionary of values that helps the corresponding extractor initialize + // its state without duplicating effort already exerted by the sniffer. typedef bool (*SnifferFunc)( - const sp<DataSource> &source, String8 *mimeType, float *confidence); + const sp<DataSource> &source, String8 *mimeType, + float *confidence, sp<AMessage> *meta); static void RegisterSniffer(SnifferFunc func); static void RegisterDefaultSniffers(); diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h index be96935..2412f6a 100644 --- a/include/media/stagefright/MPEG4Writer.h +++ b/include/media/stagefright/MPEG4Writer.h @@ -37,9 +37,10 @@ public: virtual status_t addSource(const sp<MediaSource> &source); virtual status_t start(MetaData *param = NULL); + virtual status_t stop(); + virtual status_t pause(); virtual bool reachedEOS(); - virtual void stop(); - virtual void pause(); + virtual status_t dump(int fd, const Vector<String16>& args); void beginBox(const char *fourcc); void writeInt8(int8_t x); diff --git a/include/media/stagefright/MediaWriter.h b/include/media/stagefright/MediaWriter.h index 8d3a9df..5cc8dcf 100644 --- a/include/media/stagefright/MediaWriter.h +++ b/include/media/stagefright/MediaWriter.h @@ -35,14 +35,19 @@ struct MediaWriter : public RefBase { virtual status_t addSource(const sp<MediaSource> &source) = 0; virtual bool reachedEOS() = 0; virtual status_t start(MetaData *params = NULL) = 0; - virtual void stop() = 0; - virtual void pause() = 0; + virtual status_t stop() = 0; + virtual status_t pause() = 0; + virtual void setMaxFileSize(int64_t bytes) { mMaxFileSizeLimitBytes = bytes; } virtual void setMaxFileDuration(int64_t durationUs) { mMaxFileDurationLimitUs = durationUs; } virtual void setListener(const sp<IMediaRecorderClient>& listener) { mListener = listener; } + virtual status_t dump(int fd, const Vector<String16>& args) { + return OK; + } + protected: virtual ~MediaWriter() {} int64_t mMaxFileSizeLimitBytes; diff --git a/include/media/stagefright/foundation/ABitReader.h b/include/media/stagefright/foundation/ABitReader.h new file mode 100644 index 0000000..5135211 --- /dev/null +++ b/include/media/stagefright/foundation/ABitReader.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef A_BIT_READER_H_ + +#define A_BIT_READER_H_ + +#include <media/stagefright/foundation/ABase.h> + +#include <sys/types.h> +#include <stdint.h> + +namespace android { + +struct ABitReader { + ABitReader(const uint8_t *data, size_t size); + + uint32_t getBits(size_t n); + void skipBits(size_t n); + + size_t numBitsLeft() const; + + const uint8_t *data() const; + +private: + const uint8_t *mData; + size_t mSize; + + uint32_t mReservoir; // left-aligned bits + size_t mNumBitsLeft; + + void fillReservoir(); + void putBits(uint32_t x, size_t n); + + DISALLOW_EVIL_CONSTRUCTORS(ABitReader); +}; + +} // namespace android + +#endif // A_BIT_READER_H_ diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h index 1eb178e..d016dfa 100644 --- a/include/private/surfaceflinger/SharedBufferStack.h +++ b/include/private/surfaceflinger/SharedBufferStack.h @@ -54,11 +54,6 @@ class SharedClient; // ---------------------------------------------------------------------------- -// 4 * (11 + 7 + (1 + 2*NUM_RECT_MAX) * NUM_BUFFER_MAX) * NUM_LAYERS_MAX -// 4 * (11 + 7 + (1 + 2*7)*16) * 31 -// 1032 * 31 -// = ~27 KiB (31992) - class SharedBufferStack { friend class SharedClient; @@ -85,7 +80,7 @@ public: }; struct FlatRegion { // 52 bytes = 4 * (1 + 2*N) - static const unsigned int NUM_RECT_MAX = 6; + static const unsigned int NUM_RECT_MAX = 5; uint32_t count; SmallRect rects[NUM_RECT_MAX]; }; @@ -93,13 +88,18 @@ public: struct BufferData { FlatRegion dirtyRegion; SmallRect crop; + uint8_t transform; + uint8_t reserved[3]; }; SharedBufferStack(); void init(int32_t identity); status_t setDirtyRegion(int buffer, const Region& reg); status_t setCrop(int buffer, const Rect& reg); + status_t setTransform(int buffer, uint8_t transform); Region getDirtyRegion(int buffer) const; + Rect getCrop(int buffer) const; + uint32_t getTransform(int buffer) const; // these attributes are part of the conditions/updates volatile int32_t head; // server's current front buffer @@ -117,7 +117,7 @@ public: int32_t reserved32[1]; Statistics stats; int32_t reserved; - BufferData buffers[NUM_BUFFER_MAX]; // 960 bytes + BufferData buffers[NUM_BUFFER_MAX]; // 1024 bytes }; // ---------------------------------------------------------------------------- @@ -206,7 +206,7 @@ public: bool needNewBuffer(int buffer) const; status_t setDirtyRegion(int buffer, const Region& reg); status_t setCrop(int buffer, const Rect& reg); - + status_t setTransform(int buffer, uint32_t transform); class SetBufferCountCallback { friend class SharedBufferClient; @@ -275,6 +275,8 @@ public: status_t reallocateAllExcept(int buffer); int32_t getQueuedCount() const; Region getDirtyRegion(int buffer) const; + Rect getCrop(int buffer) const; + uint32_t getTransform(int buffer) const; status_t resize(int newNumBuffers); diff --git a/include/storage/IMountService.h b/include/storage/IMountService.h new file mode 100644 index 0000000..a2735a4 --- /dev/null +++ b/include/storage/IMountService.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IMOUNTSERVICE_H +#define ANDROID_IMOUNTSERVICE_H + +#include <storage/IMountServiceListener.h> +#include <storage/IMountShutdownObserver.h> +#include <storage/IObbActionListener.h> + +#include <binder/IInterface.h> +#include <binder/Parcel.h> + +namespace android { + +class IMountService: public IInterface { +public: + DECLARE_META_INTERFACE(MountService); + + virtual void registerListener(const sp<IMountServiceListener>& listener) = 0; + virtual void + unregisterListener(const sp<IMountServiceListener>& listener) = 0; + virtual bool isUsbMassStorageConnected() = 0; + virtual void setUsbMassStorageEnabled(const bool enable) = 0; + virtual bool isUsbMassStorageEnabled() = 0; + virtual int32_t mountVolume(const String16& mountPoint) = 0; + virtual int32_t + unmountVolume(const String16& mountPoint, const bool force) = 0; + virtual int32_t formatVolume(const String16& mountPoint) = 0; + virtual int32_t + getStorageUsers(const String16& mountPoint, int32_t** users) = 0; + virtual int32_t getVolumeState(const String16& mountPoint) = 0; + virtual int32_t createSecureContainer(const String16& id, + const int32_t sizeMb, const String16& fstype, const String16& key, + const int32_t ownerUid) = 0; + virtual int32_t finalizeSecureContainer(const String16& id) = 0; + virtual int32_t destroySecureContainer(const String16& id) = 0; + virtual int32_t mountSecureContainer(const String16& id, + const String16& key, const int32_t ownerUid) = 0; + virtual int32_t + unmountSecureContainer(const String16& id, const bool force) = 0; + virtual bool isSecureContainerMounted(const String16& id) = 0; + virtual int32_t renameSecureContainer(const String16& oldId, + const String16& newId) = 0; + virtual bool getSecureContainerPath(const String16& id, String16& path) = 0; + virtual int32_t getSecureContainerList(const String16& id, + String16*& containers) = 0; + virtual void shutdown(const sp<IMountShutdownObserver>& observer) = 0; + virtual void finishMediaUpdate() = 0; + virtual void mountObb(const String16& filename, const String16& key, + const sp<IObbActionListener>& token) = 0; + virtual void unmountObb(const String16& filename, const bool force) = 0; + virtual bool isObbMounted(const String16& filename) = 0; + virtual bool getMountedObbPath(const String16& filename, String16& path) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnMountService: public BnInterface<IMountService> { +public: + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +} +; // namespace android + +#endif // ANDROID_IMOUNTSERVICE_H diff --git a/include/storage/IMountServiceListener.h b/include/storage/IMountServiceListener.h new file mode 100644 index 0000000..5b1f21c --- /dev/null +++ b/include/storage/IMountServiceListener.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IMOUNTSERVICELISTENER_H +#define ANDROID_IMOUNTSERVICELISTENER_H + +#include <binder/IInterface.h> +#include <binder/Parcel.h> + +namespace android { + +class IMountServiceListener: public IInterface { +public: + DECLARE_META_INTERFACE(MountServiceListener); + + virtual void onUsbMassStorageConnectionChanged(const bool connected) = 0; + virtual void onStorageStateChanged(const String16& path, + const String16& oldState, const String16& newState) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnMountServiceListener: public BnInterface<IMountServiceListener> { +public: + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +} +; // namespace android + +#endif // ANDROID_IMOUNTSERVICELISTENER_H diff --git a/include/storage/IMountShutdownObserver.h b/include/storage/IMountShutdownObserver.h new file mode 100644 index 0000000..d019e01 --- /dev/null +++ b/include/storage/IMountShutdownObserver.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IMOUNTSHUTDOWNOBSERVER_H +#define ANDROID_IMOUNTSHUTDOWNOBSERVER_H + +#include <binder/IInterface.h> +#include <binder/Parcel.h> + +namespace android { + +class IMountShutdownObserver: public IInterface +{ +public: + DECLARE_META_INTERFACE(MountShutdownObserver); + + virtual void onShutDownComplete(const int32_t statusCode) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnMountShutdownObserver: public BnInterface<IMountShutdownObserver> +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +}; // namespace android + +#endif // ANDROID_IMOUNTSHUTDOWNOBSERVER_H diff --git a/include/storage/IObbActionListener.h b/include/storage/IObbActionListener.h new file mode 100644 index 0000000..1bedcc6 --- /dev/null +++ b/include/storage/IObbActionListener.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IOBBACTIONLISTENER_H +#define ANDROID_IOBBACTIONLISTENER_H + +#include <binder/IInterface.h> +#include <binder/Parcel.h> + +#include <utils/String16.h> + +namespace android { + +class IObbActionListener: public IInterface +{ +public: + DECLARE_META_INTERFACE(ObbActionListener); + + virtual void onObbResult(const String16& filename, const String16& status) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnObbActionListener: public BnInterface<IObbActionListener> +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +}; // namespace android + +#endif // ANDROID_IOBBACTIONLISTENER_H diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 294c867..a210880 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -94,7 +94,7 @@ private: friend class SurfaceComposerClient; // camera and camcorder need access to the ISurface binder interface for preview - friend class Camera; + friend class CameraService; friend class MediaRecorder; // mediaplayer needs access to ISurface for display friend class MediaPlayer; @@ -173,11 +173,12 @@ private: * (eventually this should go away and be replaced by proper APIs) */ // camera and camcorder need access to the ISurface binder interface for preview - friend class Camera; + friend class CameraService; friend class MediaRecorder; // MediaPlayer needs access to ISurface for display friend class MediaPlayer; friend class IOMX; + friend class SoftwareRenderer; // this is just to be able to write some unit tests friend class Test; @@ -216,6 +217,7 @@ private: int dispatch_crop(va_list args); int dispatch_set_buffer_count(va_list args); int dispatch_set_buffers_geometry(va_list args); + int dispatch_set_buffers_transform(va_list args); void setUsage(uint32_t reqUsage); int connect(int api); @@ -223,6 +225,7 @@ private: int crop(Rect const* rect); int setBufferCount(int bufferCount); int setBuffersGeometry(int w, int h, int format); + int setBuffersTransform(int transform); /* * private stuff... @@ -278,6 +281,7 @@ private: Rect mSwapRectangle; int mConnected; Rect mNextBufferCrop; + uint32_t mNextBufferTransform; BufferInfo mBufferInfo; // protected by mSurfaceLock. These are also used from lock/unlock @@ -309,4 +313,3 @@ private: }; // namespace android #endif // ANDROID_SF_SURFACE_H - diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h index 2505cb0..aed4fa1 100644 --- a/include/ui/InputDispatcher.h +++ b/include/ui/InputDispatcher.h @@ -159,6 +159,12 @@ public: virtual int32_t waitForMotionEventTargets(MotionEvent* motionEvent, uint32_t policyFlags, int32_t injectorPid, int32_t injectorUid, Vector<InputTarget>& outTargets) = 0; + + /* Gets the maximum suggested event delivery rate per second. + * This value is used to throttle motion event movement actions on a per-device + * basis. It is not intended to be a hard limit. + */ + virtual int32_t getMaxEventsPerSecond() = 0; }; @@ -332,6 +338,8 @@ private: // Linked list of motion samples associated with this motion event. MotionSample firstSample; MotionSample* lastSample; + + uint32_t countSamples() const; }; // Tracks the progress of dispatching a particular event to a particular connection. @@ -587,6 +595,17 @@ private: Condition mInjectionSyncFinishedCondition; void decrementPendingSyncDispatchesLocked(EventEntry* entry); + // Throttling state. + struct ThrottleState { + nsecs_t minTimeBetweenEvents; + + nsecs_t lastEventTime; + int32_t lastDeviceId; + uint32_t lastSource; + + uint32_t originalSampleCount; // only collected during debugging + } mThrottleState; + // Key repeat tracking. // XXX Move this up to the input reader instead. struct KeyRepeatState { diff --git a/include/ui/egl/android_natives.h b/include/ui/egl/android_natives.h index ca89b06..d59d72b 100644 --- a/include/ui/egl/android_natives.h +++ b/include/ui/egl/android_natives.h @@ -85,6 +85,7 @@ enum { NATIVE_WINDOW_SET_CROP, NATIVE_WINDOW_SET_BUFFER_COUNT, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, + NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, }; /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ @@ -92,6 +93,20 @@ enum { NATIVE_WINDOW_API_EGL = 1 }; +/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */ +enum { + /* flip source image horizontally */ + NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H , + /* flip source image vertically */ + NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, + /* rotate source image 90 degrees clock-wise */ + NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, + /* rotate source image 180 degrees */ + NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, + /* rotate source image 270 degrees clock-wise */ + NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, +}; + struct ANativeWindow { #ifdef __cplusplus @@ -196,6 +211,7 @@ struct ANativeWindow * NATIVE_WINDOW_SET_CROP * NATIVE_WINDOW_SET_BUFFER_COUNT * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY + * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM * */ @@ -298,6 +314,19 @@ static inline int native_window_set_buffers_geometry( w, h, format); } +/* + * native_window_set_buffers_transform(..., int transform) + * All buffers queued after this call will be displayed transformed according + * to the transform parameter specified. + */ +static inline int native_window_set_buffers_transform( + ANativeWindow* window, + int transform) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, + transform); +} + // --------------------------------------------------------------------------- /* FIXME: this is legacy for pixmaps */ diff --git a/include/utils/ObbFile.h b/include/utils/ObbFile.h index d2ca82e..5243f50 100644 --- a/include/utils/ObbFile.h +++ b/include/utils/ObbFile.h @@ -18,12 +18,16 @@ #define OBBFILE_H_ #include <stdint.h> +#include <strings.h> #include <utils/RefBase.h> #include <utils/String8.h> namespace android { +// OBB flags (bit 0) +#define OBB_OVERLAY (1 << 0) + class ObbFile : public RefBase { protected: virtual ~ObbFile(); @@ -46,18 +50,38 @@ public: return mPackageName; } - int32_t getVersion() const { - return mVersion; - } - void setPackageName(String8 packageName) { mPackageName = packageName; } + int32_t getVersion() const { + return mVersion; + } + void setVersion(int32_t version) { mVersion = version; } + int32_t getFlags() const { + return mFlags; + } + + void setFlags(int32_t flags) { + mFlags = flags; + } + + bool isOverlay() { + return (mFlags & OBB_OVERLAY) == OBB_OVERLAY; + } + + void setOverlay(bool overlay) { + if (overlay) { + mFlags |= OBB_OVERLAY; + } else { + mFlags &= ~OBB_OVERLAY; + } + } + static inline uint32_t get4LE(const unsigned char* buf) { return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); } @@ -76,6 +100,9 @@ private: /* Package version this ObbFile is associated with */ int32_t mVersion; + /* Flags for this OBB type. */ + int32_t mFlags; + const char* mFileName; size_t mFileSize; |
