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

Commit 9f80dd22 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

New control block for AudioTrack and AudioRecord

Main differences between old and new control block:
 - removes the mutex, which was a potential source of priority inversion
 - circular indices into shared buffer, which is now always a power-of-2 size

Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865
parent 9fef8d45
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ class AudioBufferProvider
{
public:

    // FIXME merge with AudioTrackShared::Buffer, AudioTrack::Buffer, and AudioRecord::Buffer
    //       and rename getNextBuffer() to obtainBuffer()
    struct Buffer {
        Buffer() : raw(NULL), frameCount(0) { }
        union {
@@ -44,6 +46,19 @@ public:
    // pts is the local time when the next sample yielded by getNextBuffer
    // will be rendered.
    // Pass kInvalidPTS if the PTS is unknown or not applicable.
    // On entry:
    //  buffer              != NULL
    //  buffer->raw         unused
    //  buffer->frameCount  maximum number of desired frames
    // On successful return:
    //  status              NO_ERROR
    //  buffer->raw         non-NULL pointer to buffer->frameCount contiguous available frames
    //  buffer->frameCount  number of contiguous available frames at buffer->raw,
    //                      0 < buffer->frameCount <= entry value
    // On error return:
    //  status              != NO_ERROR
    //  buffer->raw         NULL
    //  buffer->frameCount  0
    virtual status_t getNextBuffer(Buffer* buffer, int64_t pts = kInvalidPTS) = 0;

    virtual void releaseBuffer(Buffer* buffer) = 0;
+175 −76

File changed.

Preview size limit exceeded, changes collapsed.

+180 −94

File changed.

Preview size limit exceeded, changes collapsed.

+267 −124

File changed.

Preview size limit exceeded, changes collapsed.

+474 −358

File changed.

Preview size limit exceeded, changes collapsed.

Loading