From 59c1a935295cb30c2ba2f759855e89c174b42a07 Mon Sep 17 00:00:00 2001 From: Dave Sparks Date: Wed, 8 Jul 2009 15:56:53 -0700 Subject: Add timestamps to video frames to improve A/V sync. Bug 1927069. --- libs/ui/Camera.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libs/ui/Camera.cpp') 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& dataPtr) } } +// callback from camera service when timestamped frame is ready +void Camera::dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp& dataPtr) +{ + sp listener; + { + Mutex::Autolock _l(mLock); + listener = mListener; + } + if (listener != NULL) { + listener->postDataTimestamp(timestamp, msgType, dataPtr); + } +} + void Camera::binderDied(const wp& who) { LOGW("ICamera died"); notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, 0); -- cgit v1.2.3-59-g8ed1b