Loading include/media/nbaio/AudioStreamOutSink.h +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ public: // implementation of GNWT (if any) virtual status_t getNextWriteTimestamp(int64_t *timestamp); virtual status_t getTimestamp(AudioTimestamp& timestamp); // NBAIO_Sink end #if 0 // until necessary Loading include/media/nbaio/MonoPipe.h +3 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,9 @@ public: // Return true if the write side of a pipe is currently shutdown. bool isShutdown(); // Return NO_ERROR if there is a timestamp available status_t getTimestamp(AudioTimestamp& timestamp); private: // A pair of methods and a helper variable which allows the reader and the // writer to update and observe the values of mFront and mNextRdPTS in an Loading include/media/nbaio/NBAIO.h +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <stdlib.h> #include <utils/Errors.h> #include <utils/RefBase.h> #include <media/AudioTimestamp.h> namespace android { Loading Loading @@ -213,6 +214,11 @@ public: // <other> Something unexpected happened internally. Check the logs and start debugging. virtual status_t getNextWriteTimestamp(int64_t *ts) { return INVALID_OPERATION; } // Returns NO_ERROR if a timestamp is available. The timestamp includes the total number // of frames presented to an external observer, together with the value of CLOCK_MONOTONIC // as of this presentation count. virtual status_t getTimestamp(AudioTimestamp& timestamp) { return INVALID_OPERATION; } protected: NBAIO_Sink(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesWritten(0) { } virtual ~NBAIO_Sink() { } Loading media/libnbaio/AudioStreamOutSink.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -79,4 +79,16 @@ status_t AudioStreamOutSink::getNextWriteTimestamp(int64_t *timestamp) { return mStream->get_next_write_timestamp(mStream, timestamp); } status_t AudioStreamOutSink::getTimestamp(AudioTimestamp& timestamp) { // FIXME position64 won't be needed after AudioTimestamp.mPosition is changed to uint64_t uint64_t position64; int ok = mStream->get_presentation_position(mStream, &position64, ×tamp.mTime); if (ok != 0) { return INVALID_OPERATION; } timestamp.mPosition = position64; return OK; } } // namespace android media/libnbaio/MonoPipe.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -310,4 +310,9 @@ bool MonoPipe::isShutdown() return mIsShutdown; } status_t MonoPipe::getTimestamp(AudioTimestamp& timestamp) { return INVALID_OPERATION; } } // namespace android Loading
include/media/nbaio/AudioStreamOutSink.h +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ public: // implementation of GNWT (if any) virtual status_t getNextWriteTimestamp(int64_t *timestamp); virtual status_t getTimestamp(AudioTimestamp& timestamp); // NBAIO_Sink end #if 0 // until necessary Loading
include/media/nbaio/MonoPipe.h +3 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,9 @@ public: // Return true if the write side of a pipe is currently shutdown. bool isShutdown(); // Return NO_ERROR if there is a timestamp available status_t getTimestamp(AudioTimestamp& timestamp); private: // A pair of methods and a helper variable which allows the reader and the // writer to update and observe the values of mFront and mNextRdPTS in an Loading
include/media/nbaio/NBAIO.h +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <stdlib.h> #include <utils/Errors.h> #include <utils/RefBase.h> #include <media/AudioTimestamp.h> namespace android { Loading Loading @@ -213,6 +214,11 @@ public: // <other> Something unexpected happened internally. Check the logs and start debugging. virtual status_t getNextWriteTimestamp(int64_t *ts) { return INVALID_OPERATION; } // Returns NO_ERROR if a timestamp is available. The timestamp includes the total number // of frames presented to an external observer, together with the value of CLOCK_MONOTONIC // as of this presentation count. virtual status_t getTimestamp(AudioTimestamp& timestamp) { return INVALID_OPERATION; } protected: NBAIO_Sink(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesWritten(0) { } virtual ~NBAIO_Sink() { } Loading
media/libnbaio/AudioStreamOutSink.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -79,4 +79,16 @@ status_t AudioStreamOutSink::getNextWriteTimestamp(int64_t *timestamp) { return mStream->get_next_write_timestamp(mStream, timestamp); } status_t AudioStreamOutSink::getTimestamp(AudioTimestamp& timestamp) { // FIXME position64 won't be needed after AudioTimestamp.mPosition is changed to uint64_t uint64_t position64; int ok = mStream->get_presentation_position(mStream, &position64, ×tamp.mTime); if (ok != 0) { return INVALID_OPERATION; } timestamp.mPosition = position64; return OK; } } // namespace android
media/libnbaio/MonoPipe.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -310,4 +310,9 @@ bool MonoPipe::isShutdown() return mIsShutdown; } status_t MonoPipe::getTimestamp(AudioTimestamp& timestamp) { return INVALID_OPERATION; } } // namespace android