Loading services/oboeservice/AAudioServiceStreamMMAP.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <utils/Log.h> #include <atomic> #include <inttypes.h> #include <iomanip> #include <iostream> #include <stdint.h> Loading Loading @@ -163,7 +164,7 @@ aaudio_result_t AAudioServiceStreamMMAP::getFreeRunningPosition(int64_t *positio } // Get timestamp from presentation position. // If fails, get time stamp that was written by getFreeRunningPosition() // If it fails, get timestamp that was written by getFreeRunningPosition() aaudio_result_t AAudioServiceStreamMMAP::getHardwareTimestamp(int64_t *positionFrames, int64_t *timeNanos) { Loading @@ -175,11 +176,18 @@ aaudio_result_t AAudioServiceStreamMMAP::getHardwareTimestamp(int64_t *positionF sp<AAudioServiceEndpointMMAP> serviceEndpointMMAP = static_cast<AAudioServiceEndpointMMAP *>(endpoint.get()); // Disable this code temporarily because the HAL is not returning // a useful result. #if 0 uint64_t position; if (serviceEndpointMMAP->getExternalPosition(&position, timeNanos) == AAUDIO_OK) { ALOGD("%s() getExternalPosition() says pos = %" PRIi64 ", time = %" PRIi64, __func__, position, *timeNanos); *positionFrames = (int64_t) position; return AAUDIO_OK; } else if (mAtomicStreamTimestamp.isValid()) { } else #endif if (mAtomicStreamTimestamp.isValid()) { Timestamp timestamp = mAtomicStreamTimestamp.read(); *positionFrames = timestamp.getPosition(); *timeNanos = timestamp.getNanoseconds() + serviceEndpointMMAP->getHardwareTimeOffsetNanos(); Loading Loading
services/oboeservice/AAudioServiceStreamMMAP.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <utils/Log.h> #include <atomic> #include <inttypes.h> #include <iomanip> #include <iostream> #include <stdint.h> Loading Loading @@ -163,7 +164,7 @@ aaudio_result_t AAudioServiceStreamMMAP::getFreeRunningPosition(int64_t *positio } // Get timestamp from presentation position. // If fails, get time stamp that was written by getFreeRunningPosition() // If it fails, get timestamp that was written by getFreeRunningPosition() aaudio_result_t AAudioServiceStreamMMAP::getHardwareTimestamp(int64_t *positionFrames, int64_t *timeNanos) { Loading @@ -175,11 +176,18 @@ aaudio_result_t AAudioServiceStreamMMAP::getHardwareTimestamp(int64_t *positionF sp<AAudioServiceEndpointMMAP> serviceEndpointMMAP = static_cast<AAudioServiceEndpointMMAP *>(endpoint.get()); // Disable this code temporarily because the HAL is not returning // a useful result. #if 0 uint64_t position; if (serviceEndpointMMAP->getExternalPosition(&position, timeNanos) == AAUDIO_OK) { ALOGD("%s() getExternalPosition() says pos = %" PRIi64 ", time = %" PRIi64, __func__, position, *timeNanos); *positionFrames = (int64_t) position; return AAUDIO_OK; } else if (mAtomicStreamTimestamp.isValid()) { } else #endif if (mAtomicStreamTimestamp.isValid()) { Timestamp timestamp = mAtomicStreamTimestamp.read(); *positionFrames = timestamp.getPosition(); *timeNanos = timestamp.getNanoseconds() + serviceEndpointMMAP->getHardwareTimeOffsetNanos(); Loading