diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/android_runtime/AndroidRuntime.h | 27 | ||||
-rw-r--r-- | include/camera/CameraParameters.h | 38 | ||||
-rw-r--r-- | include/media/IMediaPlayerClient.h | 2 | ||||
-rw-r--r-- | include/media/MediaPlayerInterface.h | 8 | ||||
-rw-r--r-- | include/media/mediaplayer.h | 5 | ||||
-rw-r--r-- | include/utils/AssetManager.h | 11 | ||||
-rw-r--r-- | include/utils/ResourceTypes.h | 26 |
7 files changed, 95 insertions, 22 deletions
diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h index 22c9b72..b02a057 100644 --- a/include/android_runtime/AndroidRuntime.h +++ b/include/android_runtime/AndroidRuntime.h @@ -46,17 +46,13 @@ public: const char* className, const JNINativeMethod* gMethods, int numMethods); /** - * Call a static Java function that takes no arguments and returns void. - */ - status_t callStatic(const char* className, const char* methodName); - - /** * Call a class's static main method with the given arguments, */ - status_t callMain(const char* className, int argc, const char* const argv[]); + status_t callMain(const char* className, jclass clazz, int argc, + const char* const argv[]); /** - * Find a class, with the input either of the form + * Find a class, with the input either of the form * "package/class" or "package.class". */ static jclass findClass(JNIEnv* env, const char* className); @@ -67,7 +63,14 @@ public: void start(); // start in android.util.RuntimeInit static AndroidRuntime* getRuntime(); - + + /** + * This gets called after the VM has been created, but before we + * run any code. Override it to make any FindClass calls that need + * to use CLASSPATH. + */ + virtual void onVmCreated(JNIEnv* env); + /** * This gets called after the JavaVM has initialized. Override it * with the system's native entry point. @@ -98,6 +101,9 @@ public: /** return a pointer to the JNIEnv pointer for this thread */ static JNIEnv* getJNIEnv(); + /** return a new string corresponding to 'className' with all '.'s replaced by '/'s. */ + static char* toSlashClassName(const char* className); + private: static int startReg(JNIEnv* env); void parseExtraOpts(char* extraOptsBuf); @@ -112,7 +118,7 @@ private: * Thread creation helpers. */ static int javaCreateThreadEtc( - android_thread_func_t entryFunction, + android_thread_func_t entryFunction, void* userData, const char* threadName, int32_t threadPriority, @@ -121,9 +127,6 @@ private: static int javaThreadShell(void* args); }; -// Returns the Unix file descriptor for a ParcelFileDescriptor object -extern int getParcelFileDescriptorFD(JNIEnv* env, jobject object); - extern CursorWindow * get_window_from_object(JNIEnv * env, jobject javaWindow); } diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index 7930f47..e272839 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -308,6 +308,44 @@ public: // 0.3333, EV is -2. // Example value: "0.333333333" or "0.5". Read only. static const char KEY_EXPOSURE_COMPENSATION_STEP[]; + // The maximum number of metering areas supported. This is the maximum + // length of KEY_METERING_AREAS. + // Example value: "0" or "2". Read only. + static const char KEY_MAX_NUM_METERING_AREAS[]; + // Current metering areas. Camera driver uses these areas to decide + // exposure. + // + // Before accessing this parameter, apps should check + // KEY_MAX_NUM_METERING_AREAS first to know the maximum number of metering + // areas first. If the value is 0, metering area is not supported. + // + // Each metering area is a rectangle with specified weight. The direction is + // relative to the sensor orientation, that is, what the sensor sees. The + // 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 + // be 0 or negative. + // + // The weight ranges from 1 to 1000. The sum of the weights of all metering + // areas must be 1000. Metering areas can partially overlap and the driver + // will add the weights in the overlap region. But apps should not set two + // metering areas that have identical coordinates. + // + // A special case of all-zero single metering area means driver to decide + // the metering area. For example, the driver may use more signals to decide + // metering areas and change them dynamically. Apps can set all-zero if they + // want the driver to decide metering areas. + // + // Metering areas are relative to the current field of view (KEY_ZOOM). + // No matter what the zoom level is, (-1000,-1000) represents the top of the + // currently visible camera frame. The metering area cannot be set to be + // outside the current field of view, even when using zoom. + // + // No matter what metering areas are, the final exposure are compensated + // by KEY_EXPOSURE_COMPENSATION. + // Example value: "(-10,-10,0,0,300),(0,0,10,10,700)". Read/write. + static const char KEY_METERING_AREAS[]; // Current zoom value. // Example value: "0" or "6". Read/write. static const char KEY_ZOOM[]; diff --git a/include/media/IMediaPlayerClient.h b/include/media/IMediaPlayerClient.h index eee6c97..daec1c7 100644 --- a/include/media/IMediaPlayerClient.h +++ b/include/media/IMediaPlayerClient.h @@ -28,7 +28,7 @@ class IMediaPlayerClient: public IInterface public: DECLARE_META_INTERFACE(MediaPlayerClient); - virtual void notify(int msg, int ext1, int ext2) = 0; + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 447942b..e1b6dd6 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -55,7 +55,8 @@ enum player_type { // callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, int msg, int ext1, int ext2); +typedef void (*notify_callback_f)(void* cookie, + int msg, int ext1, int ext2, const Parcel *obj); // abstract base class - use MediaPlayerInterface class MediaPlayerBase : public RefBase @@ -159,9 +160,10 @@ public: mCookie = cookie; mNotify = notifyFunc; } - void sendEvent(int msg, int ext1=0, int ext2=0) { + void sendEvent(int msg, int ext1=0, int ext2=0, + const Parcel *obj=NULL) { Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2); + if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); } private: diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 528eeb9..748e489 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -37,6 +37,7 @@ enum media_event_type { MEDIA_BUFFERING_UPDATE = 3, MEDIA_SEEK_COMPLETE = 4, MEDIA_SET_VIDEO_SIZE = 5, + MEDIA_TIMED_TEXT = 99, MEDIA_ERROR = 100, MEDIA_INFO = 200, }; @@ -129,7 +130,7 @@ enum media_player_states { class MediaPlayerListener: virtual public RefBase { public: - virtual void notify(int msg, int ext1, int ext2) = 0; + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; }; class MediaPlayer : public BnMediaPlayerClient, @@ -166,7 +167,7 @@ public: status_t setLooping(int loop); bool isLooping(); status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2); + void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); 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); diff --git a/include/utils/AssetManager.h b/include/utils/AssetManager.h index 9e2bf37..a8c7ddb 100644 --- a/include/utils/AssetManager.h +++ b/include/utils/AssetManager.h @@ -222,6 +222,7 @@ private: { String8 path; FileType type; + String8 idmap; }; Asset* openInPathLocked(const char* fileName, AccessMode mode, @@ -262,6 +263,16 @@ private: void setLocaleLocked(const char* locale); void updateResourceParamsLocked() const; + bool createIdmapFileLocked(const String8& originalPath, const String8& overlayPath, + const String8& idmapPath); + + bool isIdmapStaleLocked(const String8& originalPath, const String8& overlayPath, + const String8& idmapPath); + + Asset* openIdmapLocked(const struct asset_path& ap) const; + + bool getZipEntryCrcLocked(const String8& zipPath, const char* entryFilename, uint32_t* pCrc); + class SharedZip : public RefBase { public: static sp<SharedZip> get(const String8& path); diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h index 35792dc..173412e 100644 --- a/include/utils/ResourceTypes.h +++ b/include/utils/ResourceTypes.h @@ -1798,9 +1798,9 @@ public: ~ResTable(); status_t add(const void* data, size_t size, void* cookie, - bool copyData=false); + bool copyData=false, const void* idmap = NULL); status_t add(Asset* asset, void* cookie, - bool copyData=false); + bool copyData=false, const void* idmap = NULL); status_t add(ResTable* src); status_t getError() const; @@ -2046,6 +2046,24 @@ public: void getLocales(Vector<String8>* locales) const; + // Generate an idmap. + // + // Return value: on success: NO_ERROR; caller is responsible for free-ing + // outData (using free(3)). On failure, any status_t value other than + // NO_ERROR; the caller should not free outData. + status_t createIdmap(const ResTable& overlay, uint32_t originalCrc, uint32_t overlayCrc, + void** outData, size_t* outSize) const; + + enum { + IDMAP_HEADER_SIZE_BYTES = 3 * sizeof(uint32_t), + }; + // Retrieve idmap meta-data. + // + // This function only requires the idmap header (the first + // IDMAP_HEADER_SIZE_BYTES) bytes of an idmap file. + static bool getIdmapInfo(const void* idmap, size_t size, + uint32_t* pOriginalCrc, uint32_t* pOverlayCrc); + #ifndef HAVE_ANDROID_OS void print(bool inclValues) const; static String8 normalizeForOutput(const char* input); @@ -2059,7 +2077,7 @@ private: struct bag_set; status_t add(const void* data, size_t size, void* cookie, - Asset* asset, bool copyData); + Asset* asset, bool copyData, const Asset* idmap); ssize_t getResourcePackageIndex(uint32_t resID) const; ssize_t getEntry( @@ -2068,7 +2086,7 @@ private: const ResTable_type** outType, const ResTable_entry** outEntry, const Type** outTypeClass) const; status_t parsePackage( - const ResTable_package* const pkg, const Header* const header); + const ResTable_package* const pkg, const Header* const header, uint32_t idmap_id); void print_value(const Package* pkg, const Res_value& value) const; |