diff options
author | 2009-07-08 15:56:53 -0700 | |
---|---|---|
committer | 2009-07-08 15:59:25 -0700 | |
commit | 59c1a935295cb30c2ba2f759855e89c174b42a07 (patch) | |
tree | ecb4f9b555dca38af549fa469f97e734d9fcc799 /libs/ui/Camera.cpp | |
parent | a5188a09bd20c376b4f0645b0df4c52f8e114e21 (diff) |
Add timestamps to video frames to improve A/V sync.
Bug 1927069.
Diffstat (limited to 'libs/ui/Camera.cpp')
-rw-r--r-- | libs/ui/Camera.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp index 975594f39e11..5015379d3142 100644 --- a/libs/ui/Camera.cpp +++ b/libs/ui/Camera.cpp @@ -310,6 +310,19 @@ void Camera::dataCallback(int32_t msgType, const sp<IMemory>& dataPtr) } } +// callback from camera service when timestamped frame is ready +void Camera::dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr) +{ + sp<CameraListener> listener; + { + Mutex::Autolock _l(mLock); + listener = mListener; + } + if (listener != NULL) { + listener->postDataTimestamp(timestamp, msgType, dataPtr); + } +} + void Camera::binderDied(const wp<IBinder>& who) { LOGW("ICamera died"); notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, 0); |