diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/camera/Camera.h | 14 | ||||
-rw-r--r-- | include/camera/CameraHardwareInterface.h | 4 | ||||
-rw-r--r-- | include/camera/CameraParameters.h | 27 | ||||
-rw-r--r-- | include/media/AudioEffect.h | 3 | ||||
-rw-r--r-- | include/media/AudioRecord.h | 2 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/AMRWriter.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/DataSource.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/FileSource.h | 7 | ||||
-rw-r--r-- | include/media/stagefright/JPEGSource.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/MPEG4Writer.h | 19 | ||||
-rw-r--r-- | include/utils/Tokenizer.h | 4 |
12 files changed, 54 insertions, 39 deletions
diff --git a/include/camera/Camera.h b/include/camera/Camera.h index 8d8edd6..c7f0b15 100644 --- a/include/camera/Camera.h +++ b/include/camera/Camera.h @@ -111,8 +111,8 @@ enum { }; enum { - CAMERA_FACING_BACK = 0, - CAMERA_FACING_FRONT = 1 /* The camera faces to the user */ + CAMERA_FACING_BACK = 0, /* The facing of the camera is opposite to that of the screen. */ + CAMERA_FACING_FRONT = 1 /* The facing of the camera is the same as that of the screen. */ }; struct CameraInfo { @@ -128,10 +128,12 @@ struct CameraInfo { * camera image needs to be rotated clockwise so it shows correctly on * the display in its natural orientation. It should be 0, 90, 180, or 270. * - * For example, suppose a device has a naturally tall screen, but the camera - * sensor is mounted in landscape. If the top side of the camera sensor is - * aligned with the right edge of the display in natural orientation, the - * value should be 90. + * For example, suppose a device has a naturally tall screen. The + * back-facing camera sensor is mounted in landscape. You are looking at + * the screen. If the top side of the camera sensor is aligned with the + * right edge of the screen in natural orientation, the value should be + * 90. If the top side of a front-facing camera sensor is aligned with + * the right of the screen, the value should be 270. */ int orientation; }; diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h index 5465441..16f572c 100644 --- a/include/camera/CameraHardwareInterface.h +++ b/include/camera/CameraHardwareInterface.h @@ -269,7 +269,9 @@ public: */ virtual status_t cancelPicture() = 0; - /** Set the camera parameters. */ + /** + * Set the camera parameters. This returns BAD_VALUE if any parameter is + * invalid or not supported. */ virtual status_t setParameters(const CameraParameters& params) = 0; /** Return the camera parameters. */ diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index 60031a4..6364d58 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -163,16 +163,23 @@ public: // the best. // Example value: "90". Read/write. static const char KEY_JPEG_QUALITY[]; - // The orientation of the device in degrees. For example, suppose the - // natural position of the device is landscape. If the user takes a picture - // in landscape mode in 2048x1536 resolution, the rotation will be set to - // "0". If the user rotates the phone 90 degrees clockwise, the rotation - // should be set to "90". - // The camera driver can set orientation in the EXIF header without rotating - // the picture. Or the driver can rotate the picture and the EXIF thumbnail. - // If the Jpeg picture is rotated, the orientation in the EXIF header should - // be missing or 1 (row #0 is top and column #0 is left side). The driver - // should not set default value for this parameter. + // The rotation angle in degrees relative to the orientation of the camera. + // This affects the pictures returned from CAMERA_MSG_COMPRESSED_IMAGE. The + // camera driver may set orientation in the EXIF header without rotating the + // picture. Or the driver may rotate the picture and the EXIF thumbnail. If + // the Jpeg picture is rotated, the orientation in the EXIF header will be + // missing or 1 (row #0 is top and column #0 is left side). + // + // Note that the JPEG pictures of front-facing cameras are not mirrored + // as in preview display. + // + // For example, suppose the natural orientation of the device is portrait. + // The device is rotated 270 degrees clockwise, so the device orientation is + // 270. Suppose a back-facing camera sensor is mounted in landscape and the + // top side of the camera sensor is aligned with the right edge of the + // display in natural orientation. So the camera orientation is 90. The + // rotation should be set to 0 (270 + 90). + // // Example value: "0" or "90" or "180" or "270". Write only. static const char KEY_ROTATION[]; // GPS latitude coordinate. GPSLatitude and GPSLatitudeRef will be stored in diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h index c967efb..cda2be0 100644 --- a/include/media/AudioEffect.h +++ b/include/media/AudioEffect.h @@ -403,7 +403,7 @@ public: static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen); protected: - volatile int32_t mEnabled; // enable state + bool mEnabled; // enable state int32_t mSessionId; // audio session ID int32_t mPriority; // priority for effect control status_t mStatus; // effect status @@ -412,6 +412,7 @@ protected: void* mUserData; // client context for callback function effect_descriptor_t mDescriptor; // effect descriptor int32_t mId; // system wide unique effect engine instance ID + Mutex mLock; // Mutex for mEnabled access private: diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 38e3d44..5f7cd90 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -356,7 +356,7 @@ private: sp<IAudioRecord> mAudioRecord; sp<IMemory> mCblkMemory; sp<ClientRecordThread> mClientRecordThread; - Mutex mRecordThreadLock; + Mutex mLock; uint32_t mFrameCount; diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 4475d4a..813a905 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -480,6 +480,7 @@ private: uint32_t mFlags; int mSessionId; int mAuxEffectId; + Mutex mLock; }; diff --git a/include/media/stagefright/AMRWriter.h b/include/media/stagefright/AMRWriter.h index aa965e1..62d57b4 100644 --- a/include/media/stagefright/AMRWriter.h +++ b/include/media/stagefright/AMRWriter.h @@ -44,7 +44,7 @@ protected: virtual ~AMRWriter(); private: - FILE *mFile; + int mFd; status_t mInitCheck; sp<MediaSource> mSource; bool mStarted; diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 27f33fb..d4f1733 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -48,13 +48,13 @@ public: virtual status_t initCheck() const = 0; - virtual ssize_t readAt(off_t offset, void *data, size_t size) = 0; + virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; // Convenience methods: - bool getUInt16(off_t offset, uint16_t *x); + bool getUInt16(off64_t offset, uint16_t *x); // May return ERROR_UNSUPPORTED. - virtual status_t getSize(off_t *size); + virtual status_t getSize(off64_t *size); virtual uint32_t flags() { return 0; diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h index 4307263..72a0403 100644 --- a/include/media/stagefright/FileSource.h +++ b/include/media/stagefright/FileSource.h @@ -34,9 +34,9 @@ public: virtual status_t initCheck() const; - virtual ssize_t readAt(off_t offset, void *data, size_t size); + virtual ssize_t readAt(off64_t offset, void *data, size_t size); - virtual status_t getSize(off_t *size); + virtual status_t getSize(off64_t *size); virtual DecryptHandle* DrmInitialization(DrmManagerClient *client); @@ -46,7 +46,6 @@ protected: virtual ~FileSource(); private: - FILE *mFile; int mFd; int64_t mOffset; int64_t mLength; @@ -59,7 +58,7 @@ private: int64_t mDrmBufSize; unsigned char *mDrmBuf; - ssize_t readAtDRM(off_t offset, void *data, size_t size); + ssize_t readAtDRM(off64_t offset, void *data, size_t size); FileSource(const FileSource &); FileSource &operator=(const FileSource &); diff --git a/include/media/stagefright/JPEGSource.h b/include/media/stagefright/JPEGSource.h index 9d0a700..1b7e91b 100644 --- a/include/media/stagefright/JPEGSource.h +++ b/include/media/stagefright/JPEGSource.h @@ -42,9 +42,9 @@ private: sp<DataSource> mSource; MediaBufferGroup *mGroup; bool mStarted; - off_t mSize; + off64_t mSize; int32_t mWidth, mHeight; - off_t mOffset; + off64_t mOffset; status_t parseJPEG(); diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h index 7bf07eb..f7618e9 100644 --- a/include/media/stagefright/MPEG4Writer.h +++ b/include/media/stagefright/MPEG4Writer.h @@ -61,20 +61,21 @@ protected: private: class Track; - FILE *mFile; + int mFd; + status_t mInitCheck; bool mUse4ByteNalLength; bool mUse32BitOffset; bool mIsFileSizeLimitExplicitlyRequested; bool mPaused; bool mStarted; - off_t mOffset; + off64_t mOffset; off_t mMdatOffset; uint8_t *mMoovBoxBuffer; - off_t mMoovBoxBufferOffset; + off64_t mMoovBoxBufferOffset; bool mWriteMoovBoxToMemory; - off_t mFreeBoxOffset; + off64_t mFreeBoxOffset; bool mStreamableFile; - off_t mEstimatedMoovBoxSize; + off64_t mEstimatedMoovBoxSize; uint32_t mInterleaveDurationUs; int32_t mTimeScale; int64_t mStartTimestampUs; @@ -83,7 +84,7 @@ private: List<Track *> mTracks; - List<off_t> mBoxes; + List<off64_t> mBoxes; void setStartTimestampUs(int64_t timeUs); int64_t getStartTimestampUs(); // Not const @@ -145,10 +146,10 @@ private: void unlock(); // Acquire lock before calling these methods - off_t addSample_l(MediaBuffer *buffer); - off_t addLengthPrefixedSample_l(MediaBuffer *buffer); + off64_t addSample_l(MediaBuffer *buffer); + off64_t addLengthPrefixedSample_l(MediaBuffer *buffer); - inline size_t write(const void *ptr, size_t size, size_t nmemb, FILE* stream); + inline size_t write(const void *ptr, size_t size, size_t nmemb); bool exceedsFileSizeLimit(); bool use32BitFileOffset() const; bool exceedsFileDurationLimit(); diff --git a/include/utils/Tokenizer.h b/include/utils/Tokenizer.h index bfe8923..21e58e6 100644 --- a/include/utils/Tokenizer.h +++ b/include/utils/Tokenizer.h @@ -19,6 +19,7 @@ #include <assert.h> #include <utils/Errors.h> +#include <utils/FileMap.h> #include <utils/String8.h> namespace android { @@ -27,7 +28,7 @@ namespace android { * A simple tokenizer for loading and parsing ASCII text files line by line. */ class Tokenizer { - Tokenizer(const String8& filename, const char* buffer, size_t length); + Tokenizer(const String8& filename, FileMap* fileMap, const char* buffer, size_t length); public: ~Tokenizer(); @@ -108,6 +109,7 @@ private: Tokenizer(const Tokenizer& other); // not copyable String8 mFilename; + FileMap* mFileMap; const char* mBuffer; size_t mLength; |