diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioRecord.h | 4 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 5 | ||||
-rw-r--r-- | include/media/IAudioFlinger.h | 2 | ||||
-rw-r--r-- | include/media/IAudioRecord.h | 3 | ||||
-rw-r--r-- | include/media/nbaio/AudioStreamInSource.h | 2 | ||||
-rw-r--r-- | include/media/nbaio/Pipe.h | 7 | ||||
-rw-r--r-- | include/media/stagefright/MediaCodec.h | 1 |
7 files changed, 16 insertions, 8 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index b3c44a8..6a68c94 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -490,10 +490,12 @@ private: int mSessionId; transfer_type mTransfer; - // Next 4 fields may be changed if IAudioRecord is re-created, but always != 0 + // Next 5 fields may be changed if IAudioRecord is re-created, but always != 0 + // provided the initial set() was successful sp<IAudioRecord> mAudioRecord; sp<IMemory> mCblkMemory; audio_track_cblk_t* mCblk; // re-load after mLock.unlock() + sp<IMemory> mBufferMemory; audio_io_handle_t mInput; // returned by AudioSystem::getInput() int mPreviousPriority; // before start() diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 2c48bbf..79db323 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -154,8 +154,9 @@ public: * streamType: Select the type of audio stream this track is attached to * (e.g. AUDIO_STREAM_MUSIC). * sampleRate: Data source sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). + * format: Audio format. For mixed tracks, any PCM format supported by server is OK + * or AUDIO_FORMAT_PCM_8_BIT which is handled on client side. For direct + * and offloaded tracks, the possible format(s) depends on the output sink. * channelMask: Channel mask, such that audio_is_output_channel(channelMask) is true. * frameCount: Minimum size of track PCM buffer in frames. This defines the * application's contribution to the diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h index 9101f06..7db6a48 100644 --- a/include/media/IAudioFlinger.h +++ b/include/media/IAudioFlinger.h @@ -88,6 +88,8 @@ public: track_flags_t *flags, pid_t tid, // -1 means unused, otherwise must be valid non-0 int *sessionId, + sp<IMemory>& cblk, + sp<IMemory>& buffers, // return value 0 means it follows cblk status_t *status) = 0; /* query the audio hardware state. This state never changes, diff --git a/include/media/IAudioRecord.h b/include/media/IAudioRecord.h index eccc2ca..2003985 100644 --- a/include/media/IAudioRecord.h +++ b/include/media/IAudioRecord.h @@ -34,9 +34,6 @@ class IAudioRecord : public IInterface public: DECLARE_META_INTERFACE(AudioRecord); - /* get this tracks control block */ - virtual sp<IMemory> getCblk() const = 0; - /* After it's created the track is not active. Call start() to * make it active. */ diff --git a/include/media/nbaio/AudioStreamInSource.h b/include/media/nbaio/AudioStreamInSource.h index eaea63c..5169f1e 100644 --- a/include/media/nbaio/AudioStreamInSource.h +++ b/include/media/nbaio/AudioStreamInSource.h @@ -45,7 +45,7 @@ public: // FIXME Use an audio HAL API to query the buffer filling status when it's available. virtual ssize_t availableToRead() { return mStreamBufferSizeBytes / mFrameSize; } - virtual ssize_t read(void *buffer, size_t count); + virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); // NBAIO_Sink end diff --git a/include/media/nbaio/Pipe.h b/include/media/nbaio/Pipe.h index c784129..eba37bc 100644 --- a/include/media/nbaio/Pipe.h +++ b/include/media/nbaio/Pipe.h @@ -30,7 +30,11 @@ class Pipe : public NBAIO_Sink { public: // maxFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2. - Pipe(size_t maxFrames, const NBAIO_Format& format); + // buffer is an optional parameter specifying the virtual address of the pipe buffer, + // which must be of size roundup(maxFrames) * Format_frameSize(format) bytes. + Pipe(size_t maxFrames, const NBAIO_Format& format, void *buffer = NULL); + + // If a buffer was specified in the constructor, it is not automatically freed by destructor. virtual ~Pipe(); // NBAIO_Port interface @@ -57,6 +61,7 @@ private: void * const mBuffer; volatile int32_t mRear; // written by android_atomic_release_store volatile int32_t mReaders; // number of PipeReader clients currently attached to this Pipe + const bool mFreeBufferInDestructor; }; } // namespace android diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 276543b..39e57de 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -100,6 +100,7 @@ struct MediaCodec : public AHandler { uint32_t *flags, int64_t timeoutUs = 0ll); + status_t renderOutputBufferAndRelease(size_t index, int64_t timestampNs); status_t renderOutputBufferAndRelease(size_t index); status_t releaseOutputBuffer(size_t index); |