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

Commit aac817e6 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Use size_t for frame counts"

parents 7fcd06b0 e33054eb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ public:
     *  - BAD_VALUE: unsupported configuration
     */

     static status_t getMinFrameCount(int* frameCount,
     static status_t getMinFrameCount(size_t* frameCount,
                                      uint32_t sampleRate,
                                      audio_format_t format,
                                      audio_channel_mask_t channelMask);
@@ -184,7 +184,7 @@ public:

            audio_format_t format() const;
            int         channelCount() const;
            uint32_t    frameCount() const;
            size_t      frameCount() const;
            size_t      frameSize() const { return mFrameSize; }
            audio_source_t inputSource() const;

@@ -352,7 +352,7 @@ private:
            status_t openRecord_l(uint32_t sampleRate,
                                audio_format_t format,
                                audio_channel_mask_t channelMask,
                                int frameCount,
                                size_t frameCount,
                                audio_io_handle_t input);
            audio_io_handle_t getInput_l();
            status_t restoreRecord_l(audio_track_cblk_t*& cblk);
@@ -375,7 +375,7 @@ private:
    uint32_t                mUpdatePeriod;      // in ms

    // constant after constructor or set()
    uint32_t                mFrameCount;
    size_t                  mFrameCount;
    audio_format_t          mFormat;
    uint8_t                 mChannelCount;
    size_t                  mFrameSize;         // app-level frame size == AudioFlinger frame size
+5 −5
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public:

    static status_t getOutputSamplingRate(uint32_t* samplingRate,
            audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
    static status_t getOutputFrameCount(int* frameCount,
    static status_t getOutputFrameCount(size_t* frameCount,
            audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
    static status_t getOutputLatency(uint32_t* latency,
            audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
@@ -100,7 +100,7 @@ public:
    // audio_stream->get_buffer_size()/audio_stream_frame_size()
    static status_t getFrameCount(audio_io_handle_t output,
                                  audio_stream_type_t stream,
                                  int* frameCount);
                                  size_t* frameCount);
    // returns the audio output stream latency in ms. Corresponds to
    // audio_stream_out->get_latency()
    static status_t getLatency(audio_io_handle_t output,
@@ -123,11 +123,11 @@ public:
    // - BAD_VALUE: invalid parameter
    // NOTE: this feature is not supported on all hardware platforms and it is
    // necessary to check returned status before using the returned values.
    static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames,
    static status_t getRenderPosition(size_t *halFrames, size_t *dspFrames,
            audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);

    // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid
    static unsigned int  getInputFramesLost(audio_io_handle_t ioHandle);
    static size_t getInputFramesLost(audio_io_handle_t ioHandle);

    static int newAudioSessionId();
    static void acquireAudioSessionId(int audioSession);
@@ -238,7 +238,7 @@ public:

    // helpers for android.media.AudioManager.getProperty(), see description there for meaning
    static uint32_t getPrimaryOutputSamplingRate();
    static int32_t getPrimaryOutputFrameCount();
    static size_t getPrimaryOutputFrameCount();

    // ----------------------------------------------------------------------------

+2 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ public:
     *  - NO_INIT: audio server or audio hardware not initialized
     */

     static status_t getMinFrameCount(int* frameCount,
     static status_t getMinFrameCount(size_t* frameCount,
                                      audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT,
                                      uint32_t sampleRate = 0);

@@ -494,7 +494,7 @@ protected:
                                 uint32_t sampleRate,
                                 audio_format_t format,
                                 audio_channel_mask_t channelMask,
                                 int frameCount,
                                 size_t frameCount,
                                 audio_output_flags_t flags,
                                 const sp<IMemory>& sharedBuffer,
                                 audio_io_handle_t output);
+5 −5
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public:
                                uint32_t sampleRate,
                                audio_format_t format,
                                audio_channel_mask_t channelMask,
                                int frameCount,
                                size_t frameCount,
                                track_flags_t *flags,
                                const sp<IMemory>& sharedBuffer,
                                audio_io_handle_t output,
@@ -75,7 +75,7 @@ public:
                                uint32_t sampleRate,
                                audio_format_t format,
                                audio_channel_mask_t channelMask,
                                int frameCount,
                                size_t frameCount,
                                track_flags_t flags,
                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                int *sessionId,
@@ -157,10 +157,10 @@ public:

    virtual status_t setVoiceVolume(float volume) = 0;

    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames,
    virtual status_t getRenderPosition(size_t *halFrames, size_t *dspFrames,
                                    audio_io_handle_t output) const = 0;

    virtual unsigned int getInputFramesLost(audio_io_handle_t ioHandle) const = 0;
    virtual size_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0;

    virtual int newAudioSessionId() = 0;

@@ -193,7 +193,7 @@ public:
    // FIXME move these APIs to AudioPolicy to permit a more accurate implementation
    // that looks on primary device for a stream with fast flag, primary flag, or first one.
    virtual uint32_t getPrimaryOutputSamplingRate() = 0;
    virtual int32_t getPrimaryOutputFrameCount() = 0;
    virtual size_t getPrimaryOutputFrameCount() = 0;

};

+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ status_t VideoEditorPlayer::VeAudioOutput::open(
    ALOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount);
    if (mTrack) close();
    uint32_t afSampleRate;
    int afFrameCount;
    size_t afFrameCount;
    int frameCount;

    if (AudioSystem::getOutputFrameCount(&afFrameCount, mStreamType) !=
Loading