Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | //#define LOG_NDEBUG 0 |
| 18 | #define LOG_TAG "CameraSourceTimeLapse" |
| 19 | |
| 20 | #include <binder/IPCThreadState.h> |
| 21 | #include <binder/MemoryBase.h> |
| 22 | #include <binder/MemoryHeapBase.h> |
| 23 | #include <media/stagefright/CameraSource.h> |
| 24 | #include <media/stagefright/CameraSourceTimeLapse.h> |
| 25 | #include <media/stagefright/MediaDebug.h> |
| 26 | #include <media/stagefright/MetaData.h> |
| 27 | #include <camera/Camera.h> |
| 28 | #include <camera/CameraParameters.h> |
| 29 | #include <utils/String8.h> |
Nipun Kwatra | b1fb607 | 2010-07-30 18:30:55 -0700 | [diff] [blame] | 30 | #include <utils/Vector.h> |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 31 | |
| 32 | namespace android { |
| 33 | |
| 34 | // static |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 35 | CameraSourceTimeLapse *CameraSourceTimeLapse::CreateFromCamera( |
| 36 | const sp<ICamera> &camera, |
Wu-cheng Li | 42419ce | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 37 | const sp<ICameraRecordingProxy> &proxy, |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 38 | int32_t cameraId, |
| 39 | Size videoSize, |
| 40 | int32_t videoFrameRate, |
| 41 | const sp<Surface>& surface, |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 42 | int64_t timeBetweenFrameCaptureUs) { |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 43 | |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 44 | CameraSourceTimeLapse *source = new |
Wu-cheng Li | 42419ce | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 45 | CameraSourceTimeLapse(camera, proxy, cameraId, |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 46 | videoSize, videoFrameRate, surface, |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 47 | timeBetweenFrameCaptureUs); |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 48 | |
| 49 | if (source != NULL) { |
| 50 | if (source->initCheck() != OK) { |
| 51 | delete source; |
| 52 | return NULL; |
| 53 | } |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 54 | } |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 55 | return source; |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 56 | } |
| 57 | |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 58 | CameraSourceTimeLapse::CameraSourceTimeLapse( |
| 59 | const sp<ICamera>& camera, |
Wu-cheng Li | 42419ce | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 60 | const sp<ICameraRecordingProxy>& proxy, |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 61 | int32_t cameraId, |
| 62 | Size videoSize, |
| 63 | int32_t videoFrameRate, |
| 64 | const sp<Surface>& surface, |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 65 | int64_t timeBetweenFrameCaptureUs) |
Wu-cheng Li | 42419ce | 2011-06-01 17:22:24 +0800 | [diff] [blame] | 66 | : CameraSource(camera, proxy, cameraId, videoSize, videoFrameRate, surface, true), |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 67 | mTimeBetweenTimeLapseVideoFramesUs(1E6/videoFrameRate), |
| 68 | mLastTimeLapseFrameRealTimestampUs(0), |
| 69 | mSkipCurrentFrame(false) { |
| 70 | |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 71 | mTimeBetweenFrameCaptureUs = timeBetweenFrameCaptureUs; |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 72 | LOGD("starting time lapse mode: %lld us", |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 73 | mTimeBetweenFrameCaptureUs); |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 74 | |
James Dong | 0c128b6 | 2010-10-08 11:59:32 -0700 | [diff] [blame] | 75 | mVideoWidth = videoSize.width; |
| 76 | mVideoHeight = videoSize.height; |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 77 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 78 | if (!trySettingVideoSize(videoSize.width, videoSize.height)) { |
| 79 | mInitCheck = NO_INIT; |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 80 | } |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 81 | |
| 82 | // Initialize quick stop variables. |
| 83 | mQuickStop = false; |
| 84 | mForceRead = false; |
| 85 | mLastReadBufferCopy = NULL; |
| 86 | mStopWaitingForIdleCamera = false; |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | CameraSourceTimeLapse::~CameraSourceTimeLapse() { |
| 90 | } |
| 91 | |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 92 | void CameraSourceTimeLapse::startQuickReadReturns() { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 93 | ALOGV("startQuickReadReturns"); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 94 | Mutex::Autolock autoLock(mQuickStopLock); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 95 | |
| 96 | // Enable quick stop mode. |
| 97 | mQuickStop = true; |
| 98 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 99 | // Force dataCallbackTimestamp() coming from the video camera to |
| 100 | // not skip the next frame as we want read() to get a get a frame |
| 101 | // right away. |
| 102 | mForceRead = true; |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 103 | } |
| 104 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 105 | bool CameraSourceTimeLapse::trySettingVideoSize( |
| 106 | int32_t width, int32_t height) { |
| 107 | |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 108 | ALOGV("trySettingVideoSize"); |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 109 | int64_t token = IPCThreadState::self()->clearCallingIdentity(); |
| 110 | String8 s = mCamera->getParameters(); |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 111 | |
| 112 | CameraParameters params(s); |
| 113 | Vector<Size> supportedSizes; |
James Dong | a1d2d8f | 2011-01-04 16:09:07 -0800 | [diff] [blame] | 114 | params.getSupportedVideoSizes(supportedSizes); |
| 115 | bool videoOutputSupported = false; |
| 116 | if (supportedSizes.size() == 0) { |
| 117 | params.getSupportedPreviewSizes(supportedSizes); |
| 118 | } else { |
| 119 | videoOutputSupported = true; |
| 120 | } |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 121 | |
James Dong | a1d2d8f | 2011-01-04 16:09:07 -0800 | [diff] [blame] | 122 | bool videoSizeSupported = false; |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 123 | for (uint32_t i = 0; i < supportedSizes.size(); ++i) { |
| 124 | int32_t pictureWidth = supportedSizes[i].width; |
| 125 | int32_t pictureHeight = supportedSizes[i].height; |
| 126 | |
| 127 | if ((pictureWidth == width) && (pictureHeight == height)) { |
James Dong | a1d2d8f | 2011-01-04 16:09:07 -0800 | [diff] [blame] | 128 | videoSizeSupported = true; |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 129 | } |
| 130 | } |
| 131 | |
James Dong | 08800f3 | 2010-12-09 15:04:33 -0800 | [diff] [blame] | 132 | bool isSuccessful = false; |
James Dong | a1d2d8f | 2011-01-04 16:09:07 -0800 | [diff] [blame] | 133 | if (videoSizeSupported) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 134 | ALOGV("Video size (%d, %d) is supported", width, height); |
James Dong | a1d2d8f | 2011-01-04 16:09:07 -0800 | [diff] [blame] | 135 | if (videoOutputSupported) { |
| 136 | params.setVideoSize(width, height); |
| 137 | } else { |
| 138 | params.setPreviewSize(width, height); |
| 139 | } |
James Dong | 08800f3 | 2010-12-09 15:04:33 -0800 | [diff] [blame] | 140 | if (mCamera->setParameters(params.flatten()) == OK) { |
| 141 | isSuccessful = true; |
| 142 | } else { |
| 143 | LOGE("Failed to set preview size to %dx%d", width, height); |
| 144 | isSuccessful = false; |
| 145 | } |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 146 | } |
| 147 | |
James Dong | 08800f3 | 2010-12-09 15:04:33 -0800 | [diff] [blame] | 148 | IPCThreadState::self()->restoreCallingIdentity(token); |
| 149 | return isSuccessful; |
Nipun Kwatra | 4a857e6 | 2010-09-02 11:43:15 -0700 | [diff] [blame] | 150 | } |
| 151 | |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 152 | void CameraSourceTimeLapse::signalBufferReturned(MediaBuffer* buffer) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 153 | ALOGV("signalBufferReturned"); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 154 | Mutex::Autolock autoLock(mQuickStopLock); |
| 155 | if (mQuickStop && (buffer == mLastReadBufferCopy)) { |
| 156 | buffer->setObserver(NULL); |
| 157 | buffer->release(); |
| 158 | } else { |
| 159 | return CameraSource::signalBufferReturned(buffer); |
| 160 | } |
| 161 | } |
| 162 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 163 | void createMediaBufferCopy( |
| 164 | const MediaBuffer& sourceBuffer, |
| 165 | int64_t frameTime, |
| 166 | MediaBuffer **newBuffer) { |
| 167 | |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 168 | ALOGV("createMediaBufferCopy"); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 169 | size_t sourceSize = sourceBuffer.size(); |
| 170 | void* sourcePointer = sourceBuffer.data(); |
| 171 | |
| 172 | (*newBuffer) = new MediaBuffer(sourceSize); |
| 173 | memcpy((*newBuffer)->data(), sourcePointer, sourceSize); |
| 174 | |
| 175 | (*newBuffer)->meta_data()->setInt64(kKeyTime, frameTime); |
| 176 | } |
| 177 | |
| 178 | void CameraSourceTimeLapse::fillLastReadBufferCopy(MediaBuffer& sourceBuffer) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 179 | ALOGV("fillLastReadBufferCopy"); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 180 | int64_t frameTime; |
| 181 | CHECK(sourceBuffer.meta_data()->findInt64(kKeyTime, &frameTime)); |
| 182 | createMediaBufferCopy(sourceBuffer, frameTime, &mLastReadBufferCopy); |
| 183 | mLastReadBufferCopy->add_ref(); |
| 184 | mLastReadBufferCopy->setObserver(this); |
| 185 | } |
| 186 | |
| 187 | status_t CameraSourceTimeLapse::read( |
| 188 | MediaBuffer **buffer, const ReadOptions *options) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 189 | ALOGV("read"); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 190 | if (mLastReadBufferCopy == NULL) { |
| 191 | mLastReadStatus = CameraSource::read(buffer, options); |
| 192 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 193 | // mQuickStop may have turned to true while read was blocked. |
| 194 | // Make a copy of the buffer in that case. |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 195 | Mutex::Autolock autoLock(mQuickStopLock); |
| 196 | if (mQuickStop && *buffer) { |
| 197 | fillLastReadBufferCopy(**buffer); |
| 198 | } |
| 199 | return mLastReadStatus; |
| 200 | } else { |
| 201 | (*buffer) = mLastReadBufferCopy; |
| 202 | (*buffer)->add_ref(); |
| 203 | return mLastReadStatus; |
| 204 | } |
| 205 | } |
| 206 | |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 207 | void CameraSourceTimeLapse::stopCameraRecording() { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 208 | ALOGV("stopCameraRecording"); |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 209 | CameraSource::stopCameraRecording(); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 210 | if (mLastReadBufferCopy) { |
| 211 | mLastReadBufferCopy->release(); |
| 212 | mLastReadBufferCopy = NULL; |
| 213 | } |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 214 | } |
| 215 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 216 | sp<IMemory> CameraSourceTimeLapse::createIMemoryCopy( |
| 217 | const sp<IMemory> &source_data) { |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 218 | |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 219 | ALOGV("createIMemoryCopy"); |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 220 | size_t source_size = source_data->size(); |
| 221 | void* source_pointer = source_data->pointer(); |
| 222 | |
| 223 | sp<MemoryHeapBase> newMemoryHeap = new MemoryHeapBase(source_size); |
| 224 | sp<MemoryBase> newMemory = new MemoryBase(newMemoryHeap, 0, source_size); |
| 225 | memcpy(newMemory->pointer(), source_pointer, source_size); |
| 226 | return newMemory; |
| 227 | } |
| 228 | |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 229 | bool CameraSourceTimeLapse::skipCurrentFrame(int64_t timestampUs) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 230 | ALOGV("skipCurrentFrame"); |
Nipun Kwatra | dce4beb | 2010-07-27 22:21:44 -0700 | [diff] [blame] | 231 | if (mSkipCurrentFrame) { |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 232 | mSkipCurrentFrame = false; |
| 233 | return true; |
| 234 | } else { |
| 235 | return false; |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | bool CameraSourceTimeLapse::skipFrameAndModifyTimeStamp(int64_t *timestampUs) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 240 | ALOGV("skipFrameAndModifyTimeStamp"); |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 241 | if (mLastTimeLapseFrameRealTimestampUs == 0) { |
| 242 | // First time lapse frame. Initialize mLastTimeLapseFrameRealTimestampUs |
| 243 | // to current time (timestampUs) and save frame data. |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 244 | ALOGV("dataCallbackTimestamp timelapse: initial frame"); |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 245 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 246 | mLastTimeLapseFrameRealTimestampUs = *timestampUs; |
| 247 | return false; |
| 248 | } |
| 249 | |
| 250 | { |
| 251 | Mutex::Autolock autoLock(mQuickStopLock); |
| 252 | |
| 253 | // mForceRead may be set to true by startQuickReadReturns(). In that |
| 254 | // case don't skip this frame. |
| 255 | if (mForceRead) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 256 | ALOGV("dataCallbackTimestamp timelapse: forced read"); |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 257 | mForceRead = false; |
| 258 | *timestampUs = |
| 259 | mLastFrameTimestampUs + mTimeBetweenTimeLapseVideoFramesUs; |
James Dong | b888fd1 | 2011-10-26 23:47:55 -0700 | [diff] [blame] | 260 | |
| 261 | // Really make sure that this video recording frame will not be dropped. |
| 262 | if (*timestampUs < mStartTimeUs) { |
| 263 | LOGI("set timestampUs to start time stamp %lld us", mStartTimeUs); |
| 264 | *timestampUs = mStartTimeUs; |
| 265 | } |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 266 | return false; |
| 267 | } |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 268 | } |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 269 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 270 | // Workaround to bypass the first 2 input frames for skipping. |
| 271 | // The first 2 output frames from the encoder are: decoder specific info and |
| 272 | // the compressed video frame data for the first input video frame. |
| 273 | if (mNumFramesEncoded >= 1 && *timestampUs < |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 274 | (mLastTimeLapseFrameRealTimestampUs + mTimeBetweenFrameCaptureUs)) { |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 275 | // Skip all frames from last encoded frame until |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 276 | // sufficient time (mTimeBetweenFrameCaptureUs) has passed. |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 277 | // Tell the camera to release its recording frame and return. |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 278 | ALOGV("dataCallbackTimestamp timelapse: skipping intermediate frame"); |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 279 | return true; |
| 280 | } else { |
James Dong | 96af14d | 2011-11-20 09:45:44 -0800 | [diff] [blame] | 281 | // Desired frame has arrived after mTimeBetweenFrameCaptureUs time: |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 282 | // - Reset mLastTimeLapseFrameRealTimestampUs to current time. |
| 283 | // - Artificially modify timestampUs to be one frame time (1/framerate) ahead |
| 284 | // of the last encoded frame's time stamp. |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 285 | ALOGV("dataCallbackTimestamp timelapse: got timelapse frame"); |
Nipun Kwatra | 7553cf7 | 2010-09-15 15:08:49 -0700 | [diff] [blame] | 286 | |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 287 | mLastTimeLapseFrameRealTimestampUs = *timestampUs; |
| 288 | *timestampUs = mLastFrameTimestampUs + mTimeBetweenTimeLapseVideoFramesUs; |
| 289 | return false; |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 290 | } |
| 291 | return false; |
| 292 | } |
| 293 | |
| 294 | void CameraSourceTimeLapse::dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, |
| 295 | const sp<IMemory> &data) { |
Steve Block | 71f2cf1 | 2011-10-20 11:56:00 +0100 | [diff] [blame] | 296 | ALOGV("dataCallbackTimestamp"); |
James Dong | 83dd43f | 2011-06-29 16:56:52 -0700 | [diff] [blame] | 297 | mSkipCurrentFrame = skipFrameAndModifyTimeStamp(×tampUs); |
Nipun Kwatra | f9b8018 | 2010-07-12 09:17:14 -0700 | [diff] [blame] | 298 | CameraSource::dataCallbackTimestamp(timestampUs, msgType, data); |
| 299 | } |
| 300 | |
| 301 | } // namespace android |