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

Commit c93c7542 authored by Phil Burk's avatar Phil Burk Committed by android-build-merger
Browse files

Merge "AudioTrack and AudioRecord: getNotificationPeriodInFrames()" into oc-dev

am: bc942724

Change-Id: I0f93033c005f8d9fbda4a91a9d10c87b0415755c
parents 42550a68 bc942724
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ int32_t AudioStreamRecord::getXRunCount() const

int32_t AudioStreamRecord::getFramesPerBurst() const
{
    return 192; // TODO add query to AudioRecord.cpp
    return static_cast<int32_t>(mAudioRecord->getNotificationPeriodInFrames());
}

aaudio_result_t AudioStreamRecord::getTimestamp(clockid_t clockId,
+1 −1
Original line number Diff line number Diff line
@@ -344,7 +344,7 @@ int32_t AudioStreamTrack::getXRunCount() const

int32_t AudioStreamTrack::getFramesPerBurst() const
{
    return 192; // TODO add query to AudioTrack.cpp
    return static_cast<int32_t>(mAudioTrack->getNotificationPeriodInFrames());
}

int64_t AudioStreamTrack::getFramesRead() {
+7 −0
Original line number Diff line number Diff line
@@ -243,6 +243,13 @@ public:
            size_t      frameSize() const   { return mFrameSize; }
            audio_source_t inputSource() const  { return mAttributes.source; }

    /*
     * Return the period of the notification callback in frames.
     * This value is set when the AudioRecord is constructed.
     * It can be modified if the AudioRecord is rerouted.
     */
            uint32_t    getNotificationPeriodInFrames() const { return mNotificationFramesAct; }

    /* After it's created the track is not active. Call start() to
     * make it active. If set, the callback will start being called.
     * If event is not AudioSystem::SYNC_EVENT_NONE, the capture start will be delayed until
+6 −1
Original line number Diff line number Diff line
@@ -348,7 +348,12 @@ public:
            uint32_t    channelCount() const { return mChannelCount; }
            size_t      frameCount() const  { return mFrameCount; }

    // TODO consider notificationFrames() if needed
    /*
     * Return the period of the notification callback in frames.
     * This value is set when the AudioTrack is constructed.
     * It can be modified if the AudioTrack is rerouted.
     */
            uint32_t    getNotificationPeriodInFrames() const { return mNotificationFramesAct; }

    /* Return effective size of audio buffer that an application writes to
     * or a negative error if the track is uninitialized.