1 /* 2 * Copyright 2011, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * SHINTA 7 */ 8 #ifndef IMAGE_TRACK_VIDEO_SUPPLIER_H 9 #define IMAGE_TRACK_VIDEO_SUPPLIER_H 10 11 #include <Bitmap.h> 12 #include <MediaFormats.h> 13 14 #include "VideoTrackSupplier.h" 15 16 17 class ImageTrackVideoSupplier : public VideoTrackSupplier { 18 public: 19 ImageTrackVideoSupplier(BBitmap* bitmap, 20 int32 trackIndex, status_t& initStatus); 21 virtual ~ImageTrackVideoSupplier(); 22 23 virtual const media_format& Format() const; 24 virtual status_t GetEncodedFormat(media_format* format) const; 25 virtual status_t GetCodecInfo(media_codec_info* info) const; 26 27 virtual status_t ReadFrame(void* buffer, 28 bigtime_t* performanceTime, 29 const media_raw_video_format& format, 30 bool& wasCached); 31 virtual status_t FindKeyFrameForFrame(int64* frame); 32 virtual status_t SeekToTime(bigtime_t* performanceTime); 33 virtual status_t SeekToFrame(int64* frame); 34 35 virtual bigtime_t Position() const 36 { return fPerformanceTime; } 37 virtual bigtime_t Duration() const 38 { return fDuration; } 39 virtual int64 CurrentFrame() const 40 { return fCurrentFrame; } 41 42 #if 0 43 virtual BRect Bounds() const; 44 virtual color_space ColorSpace() const; 45 virtual uint32 BytesPerRow() const; 46 #endif 47 48 virtual int32 TrackIndex() const 49 { return fTrackIndex; } 50 51 private: 52 media_format fFormat; 53 54 bigtime_t fPerformanceTime; 55 bigtime_t fDuration; 56 int64 fCurrentFrame; 57 58 BBitmap* fBitmap; 59 int32 fTrackIndex; 60 }; 61 62 63 #endif // IMAGE_TRACK_VIDEO_SUPPLIER_H 64