Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 894d6be4 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Add NBAIO_Source::onTimestamp()

with dummy default implementation, and implement in MonoPipeReader.
onTimestamp is meant to be called by the corresponding sink when it has
a new timestamp available.

Change-Id: I8a90d24d1061e4a592ce5bd8ee1c9fce6bdd8a84
parent a07a1c2c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ public:

    virtual ssize_t read(void *buffer, size_t count, int64_t readPTS);

    virtual void    onTimestamp(const AudioTimestamp& timestamp);

    // NBAIO_Source end

#if 0   // until necessary
+4 −0
Original line number Diff line number Diff line
@@ -306,6 +306,10 @@ public:
    virtual ssize_t readVia(readVia_t via, size_t total, void *user,
                            int64_t readPTS, size_t block = 0);

    // Invoked asynchronously by corresponding sink when a new timestamp is available.
    // Default implementation ignores the timestamp.
    virtual void    onTimestamp(const AudioTimestamp& timestamp) { }

protected:
    NBAIO_Source(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesRead(0) { }
    virtual ~NBAIO_Source() { }
+5 −0
Original line number Diff line number Diff line
@@ -86,4 +86,9 @@ ssize_t MonoPipeReader::read(void *buffer, size_t count, int64_t readPTS)
    return red;
}

void MonoPipeReader::onTimestamp(const AudioTimestamp& timestamp)
{
    mPipe->mTimestampMutator.push(timestamp);
}

}   // namespace android