diff options
Diffstat (limited to 'include/media/AudioTrack.h')
| -rw-r--r-- | include/media/AudioTrack.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index ac7f6cf22c10..9f2bd3a15cf4 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -446,7 +446,7 @@ public: */ status_t dump(int fd, const Vector<String16>& args) const; -private: +protected: /* copying audio tracks is not allowed */ AudioTrack(const AudioTrack& other); AudioTrack& operator = (const AudioTrack& other); @@ -518,10 +518,33 @@ private: int mAuxEffectId; mutable Mutex mLock; status_t mRestoreStatus; + bool mIsTimed; int mPreviousPriority; // before start() int mPreviousSchedulingGroup; }; +class TimedAudioTrack : public AudioTrack +{ +public: + TimedAudioTrack(); + + /* allocate a shared memory buffer that can be passed to queueTimedBuffer */ + status_t allocateTimedBuffer(size_t size, sp<IMemory>* buffer); + + /* queue a buffer obtained via allocateTimedBuffer for playback at the + given timestamp. PTS units a microseconds on the media time timeline. + The media time transform (set with setMediaTimeTransform) set by the + audio producer will handle converting from media time to local time + (perhaps going through the common time timeline in the case of + synchronized multiroom audio case) */ + status_t queueTimedBuffer(const sp<IMemory>& buffer, int64_t pts); + + /* define a transform between media time and either common time or + local time */ + enum TargetTimeline {LOCAL_TIME, COMMON_TIME}; + status_t setMediaTimeTransform(const LinearTransform& xform, + TargetTimeline target); +}; }; // namespace android |