1 /* 2 * Copyright 2007, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 #ifndef MEDIA_TRACK_AUDIO_SUPPLIER_H 9 #define MEDIA_TRACK_AUDIO_SUPPLIER_H 10 11 #include "AudioSupplier.h" 12 13 class BMediaTrack; 14 15 class MediaTrackAudioSupplier : public AudioSupplier { 16 public: 17 MediaTrackAudioSupplier(BMediaTrack* track); 18 virtual ~MediaTrackAudioSupplier(); 19 20 virtual media_format Format() const; 21 virtual status_t GetEncodedFormat(media_format* format) const; 22 virtual status_t GetCodecInfo(media_codec_info* info) const; 23 24 virtual status_t ReadFrames(void* buffer, int64* framesRead, 25 bigtime_t* performanceTime); 26 virtual status_t SeekToTime(bigtime_t* performanceTime); 27 28 virtual bigtime_t Position() const 29 { return fPerformanceTime; } 30 virtual bigtime_t Duration() const 31 { return fDuration; } 32 private: 33 BMediaTrack* fMediaTrack; 34 35 media_format fFormat; 36 37 bigtime_t fPerformanceTime; 38 bigtime_t fDuration; 39 }; 40 41 #endif // MEDIA_TRACK_AUDIO_SUPPLIER_H 42