diff options
author | James Dong <jdong@google.com> | 2010-12-09 11:08:14 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-12-10 07:19:13 -0800 |
commit | 986ef2ad4c96952711d87af481f3afb40aa10775 (patch) | |
tree | d685585e64bfe6a46d7deabd1190fea460ebef3a | |
parent | b41ad26dba96d70f53fff46d10eb589c2b3eb6f8 (diff) | |
download | frameworks_av-986ef2ad4c96952711d87af481f3afb40aa10775.zip frameworks_av-986ef2ad4c96952711d87af481f3afb40aa10775.tar.gz frameworks_av-986ef2ad4c96952711d87af481f3afb40aa10775.tar.bz2 |
We requires camera hal's implementation should not track the ref count of any outstanding video frames and ignore
releaseRecordingFrame() call after it receives disableMsgType(CAMERA_MSG_VIDEO_FRAME).
Change-Id: I2ecb9b3b11dab6bf868ccf8effda1b8df5bcde3c
-rw-r--r-- | include/camera/CameraHardwareInterface.h | 20 | ||||
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 5 |
2 files changed, 20 insertions, 5 deletions
diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h index 3c6c94f..86bd849 100644 --- a/include/camera/CameraHardwareInterface.h +++ b/include/camera/CameraHardwareInterface.h @@ -112,6 +112,13 @@ public: /** * Disable a message, or a set of messages. + * + * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera hal + * should not rely on its client to call releaseRecordingFrame() to release + * video recording frames sent out by the cameral hal before and after the + * disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera hal clients must not + * modify/access any video recording frame after calling + * disableMsgType(CAMERA_MSG_VIDEO_FRAME). */ virtual void disableMsgType(int32_t msgType) = 0; @@ -216,7 +223,11 @@ public: /** * Start record mode. When a record image is available a CAMERA_MSG_VIDEO_FRAME * message is sent with the corresponding frame. Every record frame must be released - * by calling releaseRecordingFrame(). + * by a cameral hal client via releaseRecordingFrame() before the client calls + * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls + * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's responsibility + * to manage the life-cycle of the video recording frames, and the client must + * not modify/access any video recording frames. */ virtual status_t startRecording() = 0; @@ -232,6 +243,13 @@ public: /** * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME. + * + * It is camera hal client's responsibility to release video recording + * frames sent out by the camera hal before the camera hal receives + * a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives + * the call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's + * responsibility of managing the life-cycle of the video recording + * frames. */ virtual void releaseRecordingFrame(const sp<IMemory>& mem) = 0; diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 98b934c..15f6a44 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -933,10 +933,7 @@ void CameraService::Client::dataCallbackTimestamp(nsecs_t timestamp, sp<Client> client = getClientFromCookie(user); if (client == 0) return; - if (!client->lockIfMessageWanted(msgType)) { - client->releaseRecordingFrame(dataPtr); - return; - } + if (!client->lockIfMessageWanted(msgType)) return; if (dataPtr == 0) { LOGE("Null data returned in data with timestamp callback"); |